mercredi 19 décembre 2018

Find all 3D points inside a cube(3D Box)

I'm trying to find out the 3D points of a point cloud which are inside a 3D Box. I'm able to get the points inside 3D box by the below logic, only when the 3d box is align with the axis, but on rotating the 3d box, the logic fails.

(This only applies if the box's edges are aligned with the coordinate axes.)

If the vertices are (x1,y1,z1),(x2,y1,z1),(x1,y2,z1),⋯,(x2,y2,z2), then any point (x,y,z) is inside the box if and only if

x1<x<x2
and
y1<y<y2
and
z1<z<z2

In other words, the point's coordinates are between the vertices' coordinates.

Now I got algo from https://math.stackexchange.com/questions/2909812/points-inside-a-3d-rectangle?noredirect=1&lq=1 but not able to figure out how to take the "position vectors".

Any suggestions!!

Another issue: Is there any fast way to find out all the points inside a 3D box, rather than iterating over the whole point cloud.

Any suggestion is appreciated!!!

Aucun commentaire:

Enregistrer un commentaire