Is the Point in a Volume?

Hello

 

i have a smale problem. I am searching for a cheap solution how i can find (in maxscript) out if a point is in a volume or not

 

thx

 

 

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nykster's picture

  Hello, I never tried to

 

Hello,

I never tried to do that, but here's a solution that you could use, if your volume is a simple box, not a complex mesh.

Compare your vertex.pos.x and the volume.min.x and volume.max.x

Do the same for the 3 axis. If your vertex is between the min and max on the 3 axis, it should be in the volume...

Hope this helps...

-Nykster

-Nykster

schaf82's picture

i was looking for a funktion

i was looking for a funktion for random volumes but i've found something.

the problem is called point containment problem and there some ways to solve it.

maeh maeh

schaf

maeh maeh

arketip's picture

If you look for a fast

If you look for a fast method:

1) first, you should search if the point is inside the bounding box.

2) if it is the case, then you search the closest face near your point. You take the normal of this face and if the normal isn't oriented to your point (but at the opposite), you could assume that it is inside the volume...

Of course it is an approximation.
This should work for convex volumes.

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.