meshmash / Plankton

A C# half-edge mesh data structure, and components for using this in Grasshopper/Rhino
http://meshmash.github.io/Plankton
GNU Lesser General Public License v3.0
216 stars 66 forks source link

Incorrect handling of overlapping edges? #33

Closed NMO13 closed 8 years ago

NMO13 commented 8 years ago

I'm not 100% sure but I think the following case is not correctly handled:

        PlanktonMesh pMesh = new PlanktonMesh();

        pMesh.Vertices.Add(0, 0, 0);
        pMesh.Vertices.Add(5, 0, 0);
        pMesh.Vertices.Add(5, 5, 0);
        pMesh.Vertices.Add(3, -5, 0);
        pMesh.Vertices.Add(7, 0, 0);

        pMesh.Faces.AddFace(0, 1, 2);
        pMesh.Faces.AddFace(0, 3, 4);

This looks something like this:

zeichnung1

But shouldn't it look like this?

zeichnung2

pearswj commented 8 years ago

Not quite. You need to explicitly specify the fourth vertex if you want it to be included, i.e. pMesh.Faces.AddFace(0, 3, 4, 1);

untitled

NMO13 commented 8 years ago

Ok, yes makes sense. Thanks.

pearswj commented 8 years ago

No problem. Thanks for getting in touch all the same!