Page 1 of 1

[solved] SplitAlongPlane ??

PostPosted: Wednesday, 20.June 2012, 12:26
by ikam
Hi

There is something strange with SplitAlongPlane. It crash randomly or it break the mesh.

Behavior is different between several wz4 executions (memory space allocating). Sometime it works fine, sometimes it crash or sometime it break the mesh. In addition it seems to be different depending on the machine where it was compiled...

For example :
- with the original wz4 exe (fr_public\altona_wz4\wz4\bin) - The mesh is always correct but sometimes wz crash (splitalongplane don't deform the mesh)
- with my compiled version - Mesh is always broken and sometimes it crash. (I used the original lastest gihub version)
- with the erbsen compiled version (on this forum) - Mesh is correct but it crash sometimes. (same code source version of mine)

For example, I 've made a simple example with only a cube and splitalongplane, here the screenshot of the result with my compiled version : (we can see an incorrect vertex position which deform the cube).

there seems to be a problem with SplitEdgeAlongPlane function at line 6427.

I would like to have the result of your debug test and your config, to help me please.

Code: Select all
6427  Wz4MeshVertex *v = Vertices.AddMany(1);  <= set a breakpoint on this line
6428  v->Pos.Fade(t,a.Pos,b.Pos);


at breakpoint if you examine a.Pos and b.Pos values you will see correct data like (0.5, 0.5, 0.5), press F10 to run the line and examine again a and b. (normally values should not change)
For me values become incorrect => a.Pos {x=-1.5883997e+038 y=-1.5883997e+038 z=-1.5883997e+038 }

My config is :

- windows xp sp3
- visual studio 2010

Thanks.

Re: SplitAlongPlane ??

PostPosted: Wednesday, 20.June 2012, 18:17
by Skinnytorus
hi. ikam.
It looks like your example starts to crash wz4 with tesselation along y axis set to any odd value starting from 27.
My config:
Win7 64
VS 2010 Express
I tried to track this issue in VS using your break points but I can not find such values as a.Pos and b.Pos.
I'm totally new to VS and I think I will need a step by step instruction to get these values for you :))

Re: SplitAlongPlane ??

PostPosted: Wednesday, 20.June 2012, 18:31
by Skinnytorus
No, that's not it... It crashes also when changing x or z tesselation. Wrong thesis.
I'm going to experiment more... There must be some dependency anyway...

Re: SplitAlongPlane ??

PostPosted: Wednesday, 20.June 2012, 18:48
by Skinnytorus
total mess here. unperdictable results. by the way, the first example in the test file works OK for me (latest version compiled on my config)... it's really strange...

Re: SplitAlongPlane ??

PostPosted: Thursday, 21.June 2012, 07:53
by erbsen
Hi ikam,

Mesh broken? No.
The first and third example crashes.
The second example works and the last example crashes at tesselaation 19-19-19. But when i increase the tesselation seperate for every axis i can get over 19-19-19.

Skinnytorus wrote:I'm totally new to VS and I think I will need a step by step instruction to get these values for you :))
Me too.

My config:
Win 7 64 bit
VS 2010 Express


erbsen

Re: SplitAlongPlane ??

PostPosted: Thursday, 21.June 2012, 11:50
by ikam
ok thanks, it's confirm my fix. I thought the problem was only on my compilation.

Re: SplitAlongPlane ??

PostPosted: Saturday, 23.June 2012, 13:32
by Skinnytorus
ikam,
Many thanks for the pull request. It works like a charm now! :)