algorithmic modeling for Rhino
I don't have the plugin you are using so can't read your code. In general, though, it looks like you want to use 'Solid Difference (SDiff)' to subtract the inner volume from the cube, then find plane intersections with what remains.
Thank you so much for your definition. I think it is what I want, however I had a few questions about the script. (I am new to grasshopper, if I made mistakes, pls do point it out XD)
1. How to understand your script? In my view, you start with two brep sets, one is the cube of the grid, and the other one is the random shape. And then you use the logic of solid difference to cut the random shape out of the cube, so that we get the inner volume from the cube.
2. How to manipulate the inner volume in your script? I tried to give the curve a new value, but the cube turns into a solid cube without any inner volume.
3. Is there any way to form a grid wireframe instead of just the framework of the cube. Because for now, it is like the contours of that cubic grid in two directions but if I want to make it into structural use, it would be better to get the inner grids like the photos show
The shape to be subtracted from the cube is totally arbitrary, so long as it's a "Closed Brep" (required for 'SDiff' to work).
To demonstrate the idea, I created a 'RevSrf' (surface of revolution) with 'Cap Holes (Cap)' to close the ends. The cube is arbitrary too; I used 'BBox (Bounding Box)' for the capped, revSrf (might be a good idea to scale that a bit larger?). Then I rotated the revSrf 45 degrees just to make it more interesting, before 'SDiff'.
There is still no "grid" at that point. To create the grid, I used three edges of the 'BBox' corresponding to X, Y and Z directions and divided them using 'PFrames (Perpendicular Frames)'. The frames are planes used by 'Brep | Plane (Sec)' to intersect the 'SDiff' result.
You can hide the 'Preview' of 'SDiff' to leave only the intersection curves.
You can feed those intersection curves to 'Boundary' to get surfaces from many of them (the ones that are "Closed Planar"). Add 'Shift Paths', then 'Shift List' twice (1 and -1) with 'Wrap=False' to ignore the six outer surfaces.
A few simple tips for understanding GH code:
P.S. I just realized I haven't really matched your desired result, which is a 3D grid of pipes... Will have to give that a little more thought.
That exactly what I want to achieve. Thank you so much Joseph!
My pleasure. It's close but the ragged edges indicate to me that there is a data mismatch somewhere... Aha, I found it but haven't got it fixed yet.
So, with some "engineering" that basically works, the artistic part remains. Creating and positioning the interior volume to be removed and the size, shape and relative position of the enveloping box. For example, there is more "scaffolding" than necessary behind and above the interior shell. How do you reduce that?
What if you want all the scaffolding bits to be spaced at a fixed interval? It may appear that way now, but that's only because all the 'BBox' faces are nearly the same size. If you use 'Scale NU' instead of 'Scale' and apply different factors to X, Y and Z, strange things happen!
So for practical use, this isn't done yet.
Later... I was about to post the above and leave it to you but couldn't resist puttering further. This may look a little kludgy with separate components for X, Y and Z - but it's far more flexible. The scaffolding grid has separate controls for spacing and extent in X, Y and Z, independent of the clipping box.
Er... that's the intent anyway. Playing with it, I can see there is more work to do! So I'll hold off posting the new code for now. So far, it looks like this:
Interesting project Joseph! I was replacing your initial curve with one of my own. When I set the curve and plug it into the surface of revolution, the curve just sits there and does nothing?
In addition, it looks to me like the 2nd picture (grey 1 point perspective)
the shape looks more like a math type gyroid mesh with was subtracted from the 3d grid
I can't see your code so don't know what you did? The 'RevSrf' is an arbitrary shape; as long as it's a "Closed Brep", it doesn't matter what shape it is. Standby, posting new code.