How can I extrude a square to a smaller square?

Hello,
I am building a model where I wish to extrude a base polygon (square to start) into a smaller square. I have accomplished this in the past by defining each base curve but thought it would be easier and less steps to start with a 2D grid. How can I ‘cap’ the sides of my extrusion?
Thanks,
-Bob

Extrude square to square.gh (24.2 KB)

Like this?
Canvas%20at%2023%3B33%3B02
Extrude square to square_re.gh (11.3 KB)

Yes! How would I not have the base square be capped? Thank you so much.

Just remove the upper surface param from Brep Joincomponent.

Worked perfect. Thanks again!

Thank you

Here’s a simple “brute force” method I’ve used before:


Extrude square to square-bb1.gh (12.7 KB)

You can use the grid , no need to use polygon and rotation

Extrude square to square new.gh (10.3 KB)

Wow - that’s one of the coolest solutions I’ve seen. Thanks for sharing it.

Edit: I just couldn’t resist tweaking it a bit:


Extrude polygons.gh (11.8 KB)

1 Like

Use Polygon center after merge because the top polygon in your definition scaled based on the bottom polygon center

Seghier,
Thank you. I am new to GH and learned some new things from your code. I want to now allow movement of the ‘tip’ of the smaller end. I tied to add control but it does not look right. Any suggestions would be appreciated.
-BobExtrude square to square-move tip.gh (19.9 KB)

I like this generalized method. Thanks!

Thanks for taking the time to look at my script Seghier. I understand your suggestion, but it fails in the case of a filleted polygon because when a non-zero fillet is specified the PCen component changes the polygon from a Polyline to a Curve, and this causes PCen to fail. I guess this is another of the little quirks (features?) hidden inside GH.

Your suggestion works fine with a zero fillet, but fails with any positive value because of this. The overall scaling seems to work the same in either case however.

PS: I plan on using this approach to create a “waffle” bottom on things I 3D print. What I’ll do is set up an array of (probably) scaled squares and use SDiff to subtract them from the solid flat bottom of my object to be printed.

Thanks again for your attention to this. I wish I knew how the GH experts here figure out stuff like this.

If you mean movement of the top square in x,y directions use vector XYZ

Extrude square to square-move tip2.gh (11.6 KB)

Yes. This is what I was looking for. Thanks.

Use Area to find the center

Birk, great idea for the waffle pattern on 3D printed parts. Sometime a very flat bottom is difficult to remove from the bedplate. You can reduce the surface area, plus it makes for an interesting look!

Yup - I discovered that a while ago. But I was using a much more cumbersome method for making the waffles. http://birkbinnard.com/blog/do-you-like-waffles-you-should/.

I’ll have to think about how to or if I can update that page to reflect Segheir’s method.

If you want something like that you don’t need boolean

Extrude polygons solid.gh (16.1 KB)

1 Like

That’s a nice approach Seghier - thanks. Avoiding SDiff is always desirable because of how slowly it runs. I don’t have the Pufferfish add-on so I’ll have to come up with a workaround for the Bounding Rectangle object, but I should be able to do this using the outside edge of the bottom of the part I want to print.

1 Like