IsPointInside of Rhino3dmIO seems to fail completely

We are using Rhino3dmIO in a .net core environment and it seems I have trouble with Mesh.IsPointInside that is failing failing completely. For comparison I implemented similar “unit test” (see below) that passes in GHpython component, but not with the Rhino3dmIO lib.

Any thoughts?
Tnx, Wei

import Rhino.Geometry

s = 10

# Cube from 0,0,0 to s,s,s



pointIsInside = m.IsPointInside(Rhino.Geometry.Point3d(1,1,1),0.001,True)
pointIsNotInside = not m.IsPointInside(Rhino.Geometry.Point3d(-1,1,1),0.001,True)

print "pointShouldBeInside : ", pointIsInside
print "pointShouldBeOutside : ", pointIsNotInside

Hi @wpl,

Mesh.IsPointInside always returns false in Rhino3dmIO, as the code behind this method uses functionality only found in core Rhino.

– Dale

Hi. @dale, is there a reason to keep a method that has no use ? I thought method if not implemented were not present in Rhino3dmIo. For example distance in Quaternion…

There’s no good reason. We should remove functions that are useless. I must have missed this one

1 Like

Agreed -

1 Like

Ok, tnx for the reply. Other function where already stripped. So you can imagine how delighted we were to find the IsPointInside function. Removing it is indeed recommended.

We assuming it to work and are currently at a standstill, is there an alternative for this specific function?
Regards, Wei

Hi @wpl,

A popular way of determining whether or not a point all inside of a closed, manifold mesh, is to shoot a ray from the test point thru the mesh and count the number of ray/triangle intersections. This is basicaly what Mesh.IsPointInside. What makes this function unusable in Rhino3dm is that the mesh intersector is in core Rhino, not openNURBS. Rhino3dm is based on openNURBS.

I have no doubt that if you Google “point inside closed mesh” you’ll find a number of algorithms and/or source you can reference.

– Dale

Tnx for the reply @dale,

I hoped there would be combination of functions in Rhino3dmIO that will lead to the same, but I get the drift. I’ll first look for implementations of others a lib or something, before implementing it myself.

Regards, Wei