Im trying to slice a stl file using trimesh. In this case, Im trying to get a cross-section of a cube at the center (which should be a simple square)
## ... more code here
mesh = trimesh.load_mesh(stl_file)
sliced_mesh = mesh.section(<plane origin, normal and all that goes in here>) ## this is a trimesh.path.path.Path3D
cross_section = sliced_mesh.to_planar()[0] ## this is a trimesh.path.path.Path2D
cross_section = cross_section.simplify()
## ... more code here
now up until here, everything is fine but when I do this:
print(len(cross_section.entities))
it gives back 1. And this one entity is trimesh.path.entities.Line which is kind of weird because the cross-section is suppose to be a square, not a line.
But when I do this:
cross_section.show()
it shows me a square, which is correct, yet there is only one entity making that square... which is a line. How is this possible? And how can I extract all lines inside the cross_section correctly?