Boundary edges

Aug 9, 2013 at 6:55 PM

I saw there is already a question about boundary edges, but I couldn't make it to work.

I need to get all boundary edges (since triangulation may add points to the original edges I can't use the original input data)

I'm trying this:
foreach (var t in mesh.Triangles)
    var s = t.GetSegment(0);
    System.Diagnostics.Debug.WriteLine(String.Format("Boundary: {0}", s.Boundary));

    s = t.GetSegment(1);
    System.Diagnostics.Debug.WriteLine(String.Format("Boundary: {0}", s.Boundary));

    s = t.GetSegment(2);
    System.Diagnostics.Debug.WriteLine(String.Format("Boundary: {0}", s.Boundary));
But the GetSegment is always returning null. What am I doing wrong?

Also, what are the possible values for the Boundary property?

Thank you and best regards,
Rodrigo Basniak
Aug 9, 2013 at 7:06 PM
I feel stupid now. Didn't read the topology page carefuly. GetSEgment will only return a value if the segment IS on the boundary.

Thanks for this library, very well done!!
Aug 10, 2013 at 1:50 PM
If you want to get the boundary edges only, I suggest you use the mesh.Segments property.

When building the input geometry, you can add a boundary mark to a segment, geometry.AddSegment(int p0, int p1, int boundary). This mark will be the value of the segments Boundary property, so you can easily distinguish between different boundary parts in your application.