Closed moberweger closed 2 months ago
Awesome thanks for the PR!! It seems like we could probably merge this in with trimesh.exchange.ply
and have the load function return either a Trimesh
or Path3D
? Do we need the separate trimesh.path.exchange.ply
module? I guess since PLY is a container format the choice is between confusing return types or confusing function calls :smile:.
My only other note is we could probably support any entity type pretty easily by using the entity.discrete(path.vertices) -> (n, 2) float64
which for a Line
will do the same thing as the current code:
if isinstance(e, Line):
for pp in range(len(e.points) - 1):
entities.append((e.points[pp], e.points[pp + 1]))
else:
raise NotImplementedError(f"type {type(e)} not supported as entities")
Thanks @mikedh for your feedback.
I was also thinking about the integration in the common trimesh.exchange.ply
, but ended up with having a unique return value being the cleaner way of doing things :sweat_smile: But let me know if you think otherwise.
Thanks for the remark about the entity, I will update the PR :+1:
Thanks for the PR and fixes!
Sorry for the slow release, I'll try to get this out next week. I was testing this and I was wondering are there any existing packages that output or load PLY paths in this format? 3JS maybe?
Thanks for looking into this so thoroughly. The almighty Open3D
library can save the ply
format, it is called LineSet over there. I used it before porting this stuff to trimesh
, but Open3D was too heavy for my usecase.
This PR adds support to export
Path3D
object into thePLY
format. This can be used to visualize thePath3D
objects in common 3D mesh viewers, such as MeshLab. These are shown as line stripes, as shown below. This PR contains:PLY
format that uses theedge
property of thePLY
formatPath3D