Collision check

Hi,

Is there any mechanism, that could tell me if surface is inside closed volume? If not, what would be the best approach for rhinoCommons with .Net?
This is quite important to have correct results for very irregular volumes, so bounding box method will not work.

All the objects, that I will be checking lay exactly on volume walls, or are attached to the geometry, that lays on volume walls, so there isn’t anything like “levitating” object.

I don’t know anything about renderer in Rhinoceros3d (from programing point of view), but is it possible to emit light, and check if it hits “wrong” side of volume?

How is the closed volume described? Can you make a Mesh out of it? If so, you could do an intersection test using the volume Mesh and a reasonably dense mesh of the surface.

Volume would be described as a brep made with multiple surfaces. This would be a typical ship compartment.

Regarding the “volume mesh” you mean the mesh of boundary of compartment, or is it somehow possible to mesh solid across its volume? It would be nice, but can’t find any command in rhino, that could possibly do this.

For now, the best idea is to check intersection of plate with compartment with use of Rhino.Geometry.Intersect.BrepBrep, or BrepSurface.

The intersection test is good, I think, but it is also possible to use Brep.IsInside(Point3d) or Mesh.IsInside(Point3d) [if and only if the volume is a solid brep or mesh!!]

http://4.rhino3d.com/5/rhinocommon/html/M_Rhino_Geometry_Mesh_IsPointInside.htm
http://4.rhino3d.com/5/rhinocommon/html/M_Rhino_Geometry_Brep_IsPointInside.htm

Depending on the speed and accuracy required, you could use more or less points to test.

Haven’t seen this methods. Looks like this is exactly what I need. Again thanks for big help :smile: