Skip to main content
1 of 3
David
  • 171
  • 1
  • 5

What is the most efficient way to finely "slice" layers though objects

I'm wondering the most efficient way to programatically "slice" though objects to generate a 2D set of faces, vertex loops and derivatives such as face area, and centrons (for more complex objects I'm assuming there would often be multiple faces in a single slice).

The easiest way would seem to be if I could to access the faces and vertex loops in the same way I had thought the boolean modifier would (such as the top face shown in the image).

However I looked at the Bool Tools code (object_boolean_tools.py) and it doesn't access mesh data, and I can't find any bpy code which actually does this

At the moment therefore, the best option seems to be to copy the object into a bmesh and slice it with bpy.ops.mesh.bisect - the code for doing this could be extracted from https://github.com/Rylangrayston/Dicer but for this purpose I ideally want it to be 2D (which this isn't quite). Thus having seen someone elses code run dramatically faster than mine, I'm after advice before starting on such a modification as this already seems likely to be fairly slow and inefficient approach for thin slicing.

Thanks

enter image description here

David
  • 171
  • 1
  • 5