Dear wo80,
First I would like to thank you for this great contribution.
I am working on a tool using your libary and having some speed issues using the
insertVertex method and VertexCirculator class.
I am iteratively inserting a new vertex at the time into an exising delaunay ( created with triangle.net) After every vertex inserted I need to find the adjacent triangles
to calculate distances via circumference circle. I am currently using the following workflow below at each iteration and have a few questions:
A: can var circulator ( vertexCirculator) be updated each iteration rather than newly instanciated every iteration.
B: Is there a way to get the boundary triangles already as a result of the insertVertex Method ?
C: To insert a the Vertex I am using a dummytri for the otri .. Sometimes this results in a nullexception at the locationsearch. Therefore I built this workaround (below) and changed some codein the mesh.cs to not precise.locate when a triangle[0] is given
.. Any suggestions how to solve the issue in a cleaner way ?
///////////// INSERT VERTEX IN MESH /////
TriangleNet.Topology.Otri otri3 = default(TriangleNet.Topology.Otri);
TriangleNet.Topology.Osub osub3 = default(TriangleNet.Topology.Osub);
osub3.seg = null;
TriangleNet.Geometry.Vertex myvertex = new TriangleNet.Geometry.Vertex(pN.X, pN.Y);
while (true)
{
try
{
otri3.tri = triangleNetMesh.dummytri;
var res = triangleNetMesh.InsertVertex(myvertex, ref otri3, ref osub3, false, false);
resInt = (int)res;
break;
}
catch
{
List<TriangleNet.Topology.Triangle> netTriangle = new
List<TriangleNet.Topology.Triangle>(triangleNetMesh.Triangles);
otri3.tri = netTriangle[0];
var res = triangleNetMesh.InsertVertex(myvertex, ref otri3, ref osub3, false, false);
resInt = (int)res;
break;
}
}
var vertices = triangleNetMesh.Vertices.ToList();
TriangleNet.Geometry.Vertex insertedVertex = vertices[vertices.Count  1];
var circulator = new TriangleNet.Meshing.Iterators.VertexCirculator(triangleNetMesh);
IEnumerable<TriangleNet.Geometry.ITriangle> EnumAdjacentTriangles;
EnumAdjacentTriangles = circulator.EnumerateTriangles(insertedVertex);
Thanks in advance
Best
Christoph
