When using the SpaceMorph at R6 the process was faster than the same process at R7
I attach a command test with calls to function ClosestMeshPoint in a simple loop and the same call inside the method from SpaceMorph: MorphPoint
I attach too an example with two meshes. The process calling ato Morph can take above from 15 min.
I’m not seeing a significant difference in the performance in Mesh.ClosestMeshPoint between V6 and V7.
I used this simple Python script on your file to benchmark.
import Rhino
import rhinoscriptsyntax as rs
import System
def test_closest_mesh_point():
red_mesh_id = rs.GetObject("Select the red mesh")
if not red_mesh_id: return
red_mesh = rs.coercemesh(red_mesh_id)
if not red_mesh: return
black_mesh_id = rs.GetObject("Select the black mesh")
if not black_mesh_id: return
black_mesh = rs.coercemesh(black_mesh_id)
if not black_mesh: return
sw = System.Diagnostics.Stopwatch()
sw.Start()
for v in red_mesh.Vertices:
mp = black_mesh.ClosestMeshPoint(v, 0.0)
#if mp: print(mp.Point)
sw.Stop()
ts = sw.Elapsed
et = System.String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10)
print('Elapsed Time: {0}'.format(et))
if __name__ == "__main__":
test_closest_mesh_point()
I am not using R6, my code at R7 is the same because I have not changed it, but… the Framework and RhinoCommon version are uptaded: I am using .NET Framework 4.8 and RhinoCommon 7.15.22039.13001
You are using Framework 4.5 and RhinoCommon 6.35.21222.17000