Notifications
Clear all

[Closed] How to faster?

This is my test.(i get from here)
spend time: 45.185
It’s too slow, is there other way to faster?


obj = convertToMesh (teapot segments:16)

fn FindSamePosVert obj tolerance:0.001 = 
(
 vList = #{}
 theMesh = snapshotAsMesh obj
 vCount = theMesh.numVerts
 vList.count = vCount
 t = timestamp()
 progressStart ""
 for v in 1 to vCount-1 do
 (
  if not vList[v] then
  (
   pv = getVert theMesh v
   for n in v+1 to vCount do
   (
	pn = getVert theMesh n
	if distance pv pn < tolerance then
	(
	 vList[n] = true
	 vList[v] = true
	)
   )
  )
  progressUpdate (v*100.0/vCount-1)
 )
 progressEnd()
 print ((timestamp() - t)/1000.0)
 delete theMesh
 vList
)
  
FindSamePosVert obj


1 Reply
 lo1