Skip to content

Instantly share code, notes, and snippets.

@piotoor
Created November 18, 2018 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piotoor/f927143325b8bea21b7e4f8a389daa5d to your computer and use it in GitHub Desktop.
Save piotoor/f927143325b8bea21b7e4f8a389daa5d to your computer and use it in GitHub Desktop.
Leaning buildings
earth_r = 6371000; // Earth's mean radius in meters
diff = 1;
angle = 15;
a = 1200;
b = 1200;
h = 2500;
space = 3000;
translate([0, 0, -earth_r])
{
color("green")
sphere(earth_r, $fn=1000);
translate([0, -50, earth_r])
{
color("blue")
rotate([0, angle, 0])
cube([a, b, h]);
translate([-space, 0, 0])
color("red")
rotate([0, angle, 0])
cube([a, b, h]);
translate([space, 0, 0])
color("yellow")
rotate([0, angle + diff, 0])
cube([a, b, h]);
translate([-space, space, 0])
color("white")
rotate([0, angle, 0])
cube([a, b, h]);
translate([space, -space, 0])
color("orange")
rotate([0, angle, 0])
cube([a, b, h]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment