When using closestMeshPoint the meshpoint have the faceIndex and T but no edge info
import Rhino
import Rhino.Geometry.Point3f as Point3f
import scriptcontext
mesh = Rhino.Geometry.Mesh()
mesh.Vertices.Add(Point3f(0,0,0))
mesh.Vertices.Add(Point3f(1,0,0))
mesh.Vertices.Add(Point3f(0,1,0))
mesh.Vertices.Add(Point3f(0,0,1))
mesh.Faces.AddFace(0, 1, 2)
mesh.Faces.AddFace(3, 1, 0)
mesh.Faces.AddFace(3, 2, 1)
mesh.Faces.AddFace(3, 0, 2)
mesh.Compact()
p = Point3f(1,1,0)
mp = mesh.ClosestMeshPoint(p, 1000000000.0)
print mp.GetTriangle()
print mp.EdgeIndex
print mp.T
print mp.FaceIndex
print mp.EdgeParameter
scriptcontext.doc.Objects.AddMesh(mesh)
scriptcontext.doc.Views.Redraw()
This gives the result
(False, -1, -1, -1)
-1
Array[float]((0.0, 0.5, 0.5, 0.0))
2
0.5
Which clearly stats that if found the face, and that it is on a edge but not what edge. Am I missing a Compact call?
If any one knows how to get the id of the edge of just the id of the face on the other side of the edge then I would be greadfull.
best kasper