Tolerance issues with "ProjectPointToMesh" and "PointArrayClosestPoint"

Hi I am finally working on the “Walkabout” script again,
and I am having issues with both “ProjectPointToMesh” and “PointArrayClosestPoint”.

I use “ProjectPointToMesh” to project the new camera position down on the mesh, and the result is not within the file tolerance.

And I use “PointArrayClosestPoint” to find which of the projected points that are closest to the camera position. This I do so I can navigate an overlapping mesh (example: so I can walk from one floor up a staircase to the next floor)
And here also I often end up with the wrong data if the floor thickness is close to the tolerance.

So I have to set the tolerance in the file higher, which seems like an odd thing to do since the results should be floating numbers, aren’t they?

Can you please look into it?

It seems to happen when I cross a “mesh wire”.

Hi Jørgen, small help only, if you look to the function in, you might be able to use a smaller tolerance value. It uses ModelAbsoluteTolerance by default.

tolerance = scriptcontext.doc.ModelAbsoluteTolerance
rc = Rhino.Geometry.Intersect.Intersection.ProjectPointsToMeshes(meshes, pts, direction, tolerance)

btw. i´ve seen those “noise” points too. I´ve wondered if it is a bug or me :wink:

@stevebaer the python chm doc lists ProjectPointToMesh under, i guess it should be

rhinoscript.mesh.ProjectPointToMesh (points, mesh_ids, direction)


Thanks, I’ll try it out.
I wonder if this intersection issue is what makes meshsplit so buggy too. It would be great if they fixed that.