Skip to main content
edited title
Link
David
  • 171
  • 1
  • 5

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

added 168 characters in body
Source Link
David
  • 171
  • 1
  • 5

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). From this I want to be able to analyse, colorise and potentially modify the original mesh components the slice was generated from.

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), and to reference the original mesh (which it doesn't). ThusAlso 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 as for the highest resolution I could be looking at wanting 100k slices through a model.

Thanks

enter image description here

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

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). From this I want to be able to analyse, colorise and potentially modify the original mesh components the slice was generated from.

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), and to reference the original mesh (which it doesn't). Also 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 as for the highest resolution I could be looking at wanting 100k slices through a model.

Thanks

enter image description here

Source Link
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