Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
229 views
in Technique[技术] by (71.8m points)

python - Check if a volume (.ply) contains a 3D-point

I'm looking for a solution to define if a given 3D-point is contained in a volume (defined by a polygon .ply file).

I use PyVista to define my volume from a point cloud.

But I do not understand how to manipulate the PLY volume, there is vertices and faces.

I would like to get something like this :

volume.contains(point) which will return true or false

My first idea was to create a sphere for the point to substract/intersect it with the volume, but i'm not sure about that.

Do you have any ideas ?

Thanks in advance !

question from:https://stackoverflow.com/questions/65934477/check-if-a-volume-ply-contains-a-3d-point

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This was eventually solved here: https://github.com/pyvista/pyvista-support/issues/349

Solution was to simply compute the distance between the generated mesh and the original mesh with:

dist = shell.points - point

Please see the issue for more details.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...