[Closed] UVW Seem with GW
Max 2014 SP1 64bit + Win8
TS = 0
mesh >> open edges:3920 time:146 memory:1287872L
TS = 1
mesh >> open edges:7840 time:947 memory:3172896L
TS = 2
mesh >> open edges:15680 time:5321 memory:8825488L
Restart Max and the results are:
TS = 0
mesh >> open edges:3920 time:145 memory:1337816L
TS = 1
mesh >> open edges:7840 time:626 memory:3174336L
TS = 2
mesh >> open edges:15680 time:4850 memory:8840056L
Denis code
TS = 0
mesh >> open edges:3920 time:33 memory:1136120L
TS = 1
mesh >> open edges:7840 time:86 memory:2797608L
TS = 2
mesh >> open edges:15680 time:235 memory:8011672L
if you are still using finditem, and deleteitem the code can’t work so fast. but it’s very interesting for me why your code on your machine makes so good numbers. i’m absolutely sure that 90% people on this forum will get the numbers closer to mine and miauu’s. i can’t understand what makes you code work so different by performance.
And another interesting thing is that your code (the optimization of mine) makes the same numbers on your end and mine. How could that be explained?
Now, your algorithm (not the optimized version of mine), does definitly run faster.
PS: When others see what you dont!
Cant avoid loving the simplicity and logic of this: vv[1] < vv[2]
you are first who showed the best way how to find all open map seam edges. i’ve asked several times on this forum for this challenge. and because no one was really interested i didn’t show the answer. so you are the winner!
there is a little mistake in your code which is corrected in mine. open geo edge is not always open map edge.
Do you think this test can reveal something?
(
local test
fn test = (
seed 3
local st = timeStamp()
local arr = for j = 1 to 10000 collect random 0 j
for j in arr where (found = (findItem arr (random 0 j))) > 0 do deleteItem arr found
format "Time %ms
" (timeStamp() - st)
print arr.count
)
test()
)
-- Time 158ms
i will check. but as i said all array performance numbers are too good for an average machine and a max system
you are definitely have to look at XViewChecker suggested first by PiXeL_MoNKeY
that’s the right solution
If anyone is interested in the xViewChecker version, here is a start.
It works with a single Editable Mesh only so there is a lot of work ahead.
fn geomCheck theTime theNode theResults = (
obj = copy theNode.mesh
uvChannel = 1
numTFaces = meshop.getNumMapFaces obj uvChannel
numTVerts = meshop.getNumMapVerts obj uvChannel
facesTVertsIdx = for j = 1 to numTFaces collect (meshop.getMapFace obj uvChannel j)
setMesh obj numverts:numTVerts
setMesh obj faces:facesTVertsIdx
objOpenEdges = meshop.getOpenEdges obj
for edge in objOpenEdges do append theResults edge
delete obj
gc light:true
2
)
Minor improvement if only uv channel 1 is required, gettvface seems to perform faster than meshop.getmapface.
(
local test1;test2;it=1000000
fn test1 = (
mesh = snapshotasmesh $
st = timeStamp()
getmapface = meshop.getmapface
tfaces = for f = 1 to it collect (getmapface mesh 1 1)
format "%ms
" (timestamp() - st)
delete mesh
gc light:true
)
fn test2 = (
mesh = snapshotasmesh $
st = timeStamp()
tfaces = for f = 1 to it collect (gettvface mesh 1)
format "%ms
" (timestamp() - st)
delete mesh
gc light:true
)
test1() -- 454ms
-- test2() -- 401ms
)