ywywdh / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

mergeVertices updates v0, v1, v2 but not the parallel vertice array faces.vertices[] #118

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. When TriangleMesh3D.mergeVertices() finds a duplicate vertice it 
updates faces with the new v0,v1,v2 but not the parallel array vertices[] 
which I assumed should contain the same vertices.  Instead of using 
v0,v1,v2 I looped throught the array and did not get what I expected.

2. Inspect the code, TriangleMesh3D.mergeVertices, line 325 (or close to 
it)

for each( var f:Triangle3D in geometry.faces )
{
    f.v0 = uniqueDic[ f.v0 ];
    f.v1 = uniqueDic[ f.v1 ];
    f.v2 = uniqueDic[ f.v2 ];
}

****should be********

for each( var f:Triangle3D in geometry.faces )
{
    f.v0 = uniqueDic[ f.v0 ];
    f.v1 = uniqueDic[ f.v1 ];
    f.v2 = uniqueDic[ f.v2 ];
        // update vertice array also
        f.vertices[0] = uniqueDic[ f.v0 ];
        f.vertices[1] = uniqueDic[ f.v1 ];
        f.vertices[2] = uniqueDic[ f.v2 ];
}

Should be 
What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by deana...@yahoo.com on 23 Oct 2008 at 5:58

GoogleCodeExporter commented 9 years ago
Thank you for reporting. Fixed.

Original comment by r.hauw...@gmail.com on 17 Nov 2008 at 12:28