Skip to content

Instantly share code, notes, and snippets.

@StudioLE
Last active January 27, 2020 14:52
Show Gist options
  • Save StudioLE/ead3ee485787dbbed1a52ef26f769716 to your computer and use it in GitHub Desktop.
Save StudioLE/ead3ee485787dbbed1a52ef26f769716 to your computer and use it in GitHub Desktop.
b = brick;
footprint = Rectangle.ByWidthLength(b.Width, b.Length);
surface = Surface.ByPatch(footprint);
base = surface.Thicken(6/5, false);
p1 = [Imperative]
{
points = [];
w = b.Width / 2 - 0.5;
l = b.Length / 2 - 0.5;
for(x in (w * -1)..w)
{
for(y in (l * -1)..l)
{
p = Point.ByCoordinates(x, y, 6/5);
points = List.AddItemToEnd(p, points);
}
}
return points;
};
p2 = Autodesk.Geometry.Translate(p1, 0, 0, 1/5);
studs = Cylinder.ByPointsRadius(p1, p2, 1.5/5);
parts = List.Flatten([base, studs], 1);
Autodesk.Solid.ByUnion(parts);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment