Brep Splitting for 3D Printing

subcomponents.gh (269.7 KB)
Hi everyone,

I am currently working on a project about lattice shell structures. I designed a structure in Grasshopper and morphed my lattice geometries onto it. My final structure is a multipiped structure. Given the dimension and capacity of my printer, I need to divide my structure into smaller components for printing. I think I can divide the double-curved structure into rectangular boxes. I will attach some pictures showing what I want to do. I need your assistance. How can I do this? For the process, I used the Crystallon plug-in.

Thanks in advance,



Ekran görĂŒntĂŒsĂŒ 2024-03-08 155429
subcomponents.gh (269.7 KB)

Bake the geometry and split in Rhino or do you need it done in GH?

I need to make it in Gh. How can I do it?

What you ask for is very challenging.
Please do not upload the whole mesh, but the base surface or mesh. I feel it might crash Rhino.
And you need to tell your printer size.

1 Like

Sure! I internalized the unnecessary parts of my definition. My whole structure has dimensions of 3m-height, 6m length, and 4m-width, and 10 centimeters thickness. I think I had better scale it 1/5 before printing, it will be almost 1.2 x 0.6 x 0.8 meters. My printer is Creality K1 max which has the printing dimensions 30x30x30 centimeters. Therefore, I need to split my structure into smaller components. These components can have the dimensions 10x10x1 centimeters.
shell structure.gh (829.7 KB)

1 Like

I want to do a similar thing to this example.

I have some code that creates cutting surfaces but haven’t tried it yet because when I connected MultiPipe to SplitMul GH “froze up” for a long time, before the cutters were connected!

Will try again after I post this.


split_shell structure_2024Mar8a.gh (838.3 KB)

1 Like

Is there a way to split my model like this?


I also added the base surface to my definition. I think splitting the mesh with an orientation based on the surface direction can be useful.
shell structure.gh (822.8 KB)

Hah! Might be easier that way, if you have a list of indices for each “Production Batch”?

You’re on your own. The model I posted has been running for one hour and twenty minutes so far
 :man_facepalming:

You are right but I don’t have the indices for batch. I tried to run your definition but my computer shot down. I can send you the whole of my definition however, it is so complicated since I work with Karamba, Millipede, Crystallon etc. I believe working with the base surface to split my model into smaller components can facilitate the process. Since I am not an expert on Grasshopper, I couldn’t do it. I need your assistance:)

Don’t bother. Working with so many curves is the problem. If not for MultiPipe, some variation of my code would probably be done by now.

1 Like

I understand. Thank you so much

LoL - see @Alim_Battal1, time to forget about your thesis!

:stuck_out_tongue:

Jk - but as it’s being pointed out by Quan and Joseph, this stuff is a pain in the butt, or can be, espcially via native components and with such amount of items.

I think you can first find a way to divide your surface into those production batches, which appear to vary or incrementally divide along the surface. Good luck with that, there must be some examples on this forum.

Second, without a more powerfully-scripted approach via code, you might want to go through the pain of relying on some native components for this. For example, if you fake unroll this baby onto the ground plane, you might be able to get away with it.

The problem is, again, speed.

For that matter, and just as an example, I am using the SubDPoly component to transform the control mesh of your SubD lattice (multi-piped lines). This makes things go ‘faster’, but very slow in grasshopper world (or for Joseph’s patience :stuck_out_tongue_winking_eye:):
image

NOTE:
What I did here is deconstruct the lattice control mesh to transform its vertices from the 3D surface to the {fake-unrolled} 2D surface using the handy component Sporh.Then you can transform back to 3D after performing solid intersections to get your lattice brep chunks. Again: I didn’t use breps. Lastly, this approach employs a simplified partitioning of the 2D surface - meaning simple subsurface grid, not the staggered pattern you show for production batch examples - that’s a more involved process. But, the goal of this example is to potentially lead us to the same goal of splitting your shape for 3D printing. You could even make your own partitioning by hand, then integrate back into the script to re-map things to 3D. I do not say this is a solution for effective lattice-structure-partitioning-optimization, just a way to get your print.

Here’s the example:
shell structure.gh (848.3 KB)

I’ve left the heavy stuff disabled in case you want to delve into it gradually re-enabling in the suggested order:

*late edit:
I guess if all you want is to 3D print the model we can skip some things

2D-to-3D:
you can map the lines instead of the mesh, multi-pipe them on the 2D surface, do the splitting, and then transform to 3D as breps.

3D only:
Pending - I want to see how long it takes. I’ll give it a try when I get a chance tonight or tomorrow.

Best of luck on your thesis!

2 Likes

After six hours and 20 minutes, my model finally finished :exclamation: But the results are not good. Profiler time shows only 22 minutes, which is silly, and a text panel shows ~14 “Invalid Brep”, one “Open Brep” and ~21 “Trimmed Surface”. Attempt to internalize the results have resulted in a long freeze. Very disappointing for a new computer with 64 GB of ram. Waste of time, I won’t wait any longer.

1 Like

Mr. RenĂ©, first of all, thank you so much for your great effort. If you weren’t, I couldn’t do anything. I will open your definition as you listed. I hope it will be useful for me.

2 Likes

Mr. Joseph, thank you for your assistance and patience. I think the way Mr.Rene proposed will help me a lot. Best regards

I am waiting for you for the final results.

1 Like

On a hunch at the suspicious (short) Profiler results I tried this file again in R8 and see that it finished in 20 minutes, with many “Invalid Brep” results but not as many as I saw in the six+ hour R7 run yesterday.

Seems to me that this code is worthy of study by McNeel to explain the peculiar results?

P.S. In R7, I reduced the number of ‘Cutters’ (SplitMul ‘C’ input) to two and the Profiler time drops to eight minutes, but the results are still messed up. Definitely worth more study, eh? Comparing R7 and R8 with reduced number of cutter surfaces.

P.P.S. With only one horizontal cutting surface I get R7 results in 5.3 minutes, three ‘Open Brep’ which sounds correct but I can’t see any geometry results yet, long after the text panel and Profiler indicate it’s done :interrobang: Still waiting
 :frowning:

FINALLY :bangbang: I can see R7 results using only one horizontal cutter surface and they look correct. Attempted to save the file and the endless spinner starts again. No idea what it’s doing?

P.S. There is a persistent message saying “Save the current document” that appears on all my apps, left by trying to save the R7 document. See image below:

save_msg

More
 The document finally saved and the message disappeared. So I disconnected the SplitMul ‘B’ input and tried to save the file again
 But once again, endless spinner :interrobang: This is very boring. Will add the file here when it finishes.

Here it is:
split_shell structure_2024Mar9c.gh (865.0 KB)

2 Likes

Don’t! Ha!

Apologies.

I did some - not worth it - result is fine without pursuing the same thing in 3D just for the sake of it.

The bottlenecks here are (1) the conversion from SubD to Brep - which is inevitable if you’re going to require the smooth appearance of your lattice for the 3D print; and (2) the brep solid intersections that must be performed to split the brep lattice into the chunks. On my laptop this conversion (via GH) takes close to 4 minutes, and the solid intersections (on the 2D surface version) take a prohibitively expensive amount of time to crank out.

Alternatively, to reduce some of this waiting, you could convert to polysurface manually in Rhino (SubD to NURBS - I think with packed faces + G0 option) then reinsert this ‘brep’ back into grasshopper. Rhino should take less time with all horsepower compared to GH I believe.

It’s best to do this. Or a happy in-between, why go through the above hassle.

What @ftzuk proposes isn’t bad at all.

If GH:

summary

Sporph lattice linework 3D surface to 2D surface
SubD :Multi-pipe the sporphed linework
Brep the SubD Multi-pipe (wait in Rhino, or wait in GH; your choice)
Mesh the Brep
Get chunks: perform solid mesh intersections.
Sporph chunks 2D to 3D (printable objects)

I’m sure you can tweak the file.
Let us know if you have trouble.