Voronoi in a pyramid shape?

Hello, I’ve been playing with voronoi and an expand script on different volumes. Until now I have had no issues with the volume I am defining, but when I try to use this pyramid script to define the volume for the voronoi, it comes out a rectangle. You can see the defined pyramid, but the expanding voronoi ends up just being a rectangle next to it instead of the pyramid itself.

I’ve attached my file. There are three different scripts on it. The one in the red box is the one I’m having issues with. The one on top is for a rectangle box and i believe the one on the bottom was the original expand script that I got from this forum.

expand_pyramid voronoi.gh (22.0 KB)

With your Rhino file open please right click on the Point container and Internalize data.

Thank you for your reply. I tried what you suggested, but it did not change the outcome. I’ve uploaded an image of what i get. from this script. The pyramid at the bottom is the shape I get at the “extrude point” command. The rectangle above is what I get when I plug that pyramid shape into the “populate 3D” command “region” port. Both shapes are visible at the same time and in two differeent locations.

Sorry for miscommunicating… What I meant by the instructions in the previous post was for you to internalize the points and reupload the gh file. The one you uploaded in the op cannot be opened by somebody without also having your rh file.

As a general comment: Populate3D always operates inside a box (theoretically in this case the bounding box of the pyramid). You need some culling of the points outside the pyramid or Boolean Intersection between the voronoi cells and the pyramid.

you probably want something like this

expand_pyramid voronoi[fixed].gh (13.8 KB)

Sorry for the misunderstanding. Here you go. I kind of thought that the pyramid shape wasn’t being registered as the boundary. I just don’t know how to establish it as such. Pretty new to GH.

I appreciate you taking a look!

expand_pyramid voronoi.gh (20.9 KB)

instead of populate3d use populateGeometry → pass those to voronoi3d

the voronoi will always create cells in box, so use the bounding box of your pyramid

to get the correct cell shapes, create a solid intersection with the pramid

and you’re done

look at this reply

Is this what you are after?

expand_pyramid voronoi1.gh (20.9 KB)

1 Like

Thank you! I was just looking at it in GH. So, anytime the shape I want to “break apart” isn’t a box, I want to use populate geometry?

in your specific case, pretty much yes. In reality with PopulateGeometry you get points inside the shape.

1 Like

Yes, that solution works as well. Thank you very much!

1 Like

Thank you, I appreciate the explanation