Baking planar surfaces in different layers

hello guys
am working on slicing some geometrys into many planar surfaces (more than 200 slice) and each slicing plan will select many planar surfaces thene i need to save each plane with its surfaces in diffrent layer so i found a python script that save each surface in a single layer but wht i need is to save each plan with its surfaces in a single layer so is there a way to set layer on plan insted of each surfaces? or a way to combine layer that have the same y axe cordinate?
the pics below will explain wht i really need

sliccing and baking in (20.8 KB)
example fille.3dm (18.5 MB)

Hey @anon36495293,

Try this out:
sliccing and baking in (21.4 KB)

If you connect he section component to the rest of your script then they are already grouped into the sections you want. After that I adjusted your ringLayer_ naming as well to match the data structure of the geometry (you generally have to have a label for every geometry, hence duplicating the layer name).

Hope this helps, :+1:


Hi @Lukxf
I tried ur modification script but it bake all the plans in one layer while i need evry single plan in on layer like for exmaple lets say i sliced my geometry into 50 slice
It means i have 50 plan with evry plan have many surfaces so wht i need is 50 layer
Hope u understand wht am looking for.
The pics bellow shows the result of baking
Ring layer_0 select the three plans while i need to have three layer in this example.
Hope u understand wht am looking for.

Sorry @anon36495293 I’m confused. The updated script puts the plans/planes into three layers (which is what your second picture looks like?) So I’m not sure what the 50 layers are for?

1 Like

Hey @anon36495293, it doesn’t look like your script is matching mine…

Its important that you have the ‘dotted’ connection lines between the components which indicates that the data has a tree-structure. A solid line indicates that the data has been flattened somewhere, and so baking it out will end up putting all of your plans/planes onto a single layer. Let me know if you altered the script anywhere, but it should work by default.

1 Like

Hey @Lukxf
I hope this video will show u wht i did exactly

Hey @anon36495293 - see the video. The key is that you don’t need to bake out the plans and re-reference them. This is causing your issue.

1 Like

Hey @Lukxf
Still have prblm the vidoe will show you

Hey @Lukxf
Thabk you so much it worked and you really helped me thank you so much
The problem was in my geometry i geuss cuz i used another one and ur script worked well.

1 Like

No worries @anon36495293, glad I could help. If you’re interested in doing more things like this it might help to read this post: Grasshopper Data Trees Explained!

1 Like

Hello luke i hope u are doing well and fine
So i am working with ur script but i found a problem whene i increse the slicing frame number the script wont work well. For example i tryed to create 102 slices and i bake it with ur script it supposse to give me 102 layer but insted of that it bakes only 4 layers and whene i dont use the script just bake the surfaces comes out from the slices it bake all the 102 slicies so i dont know where is the problem in the script and i tryed to bake the surfaces than use the surface component to sellect all of theme and after that relate it to the ur script but i didnt workn i geuss this is th e way to do it but i couldnt manage a ways to make it work so any solution or where is the problem exact?
I Hope u help me.
The video will show u the problem.

The script works fine if you use it properly.

@Lukxf explained to you already that this is not the way to use this script

What is the purpose of this?

  1. The surfaces in this script are already grouped by their Y-position into branches of a DataTree.
  2. If you did want to sort them, why do you need a plug-in for this simple task?

I cleaned up your Rhino file (got rid of everything except the breps to be used for slicing and baking) and re-wrote the grasshopper script. I used a different python script to do the baking to and purging from the Rhino document. This python script purges existing layers before baking to prevent baking duplicate objects.

example fille_cleaned.3dm (6.9 MB)
slicing and baking in (12.9 KB)

  1. Open files.
  2. Use “Count” slider to select number of slicing planes (number of layers generated will be 1 less than this number).
  3. Click “Bake” button.
  4. Finished.

“Purge” button can be used to delete layers matching the pattern used to create them when baking.



Thank you so much @kev.r ur modification is working so well
I have one qst how can i clean up any other Rhino file (to got rid of everything except the breps)?