How to recovering sharp edges on a triangular mesh - algorithm

I need some suggestions to be able to recover or recreate the edges in my mesh.
The mesh comes from a 3D scanner and the edges are therefore not well defined.
I implemented an edge detection algorithm to find all vertices and or triangles near the edge. (The red triangles are the ones under consideration.)
Now I need to know a way or a strategy to make the edges more marked. Can anyone suggest me some algorithm and or library to use?
Thanks.

Related

Detecting holes in a dirty triangle mesh (algorithm)

Detecting holes in a triangle mesh should be easy: Collect the edges that have only one adjacent triangle (degree-1 edges) and construct closed polylines from it. However, the mesh has been made from a scanned point cloud and it has bubbles. Thus the set of degree-1 edges does not completely describe the hole. The image below shows
Degree-1 edges in red
Degree-2 edges in black
Degree-3 edges in purple
I try already to find a paths to close the polylines. But that's not really a robust solution. Any ideas?

Identification of closed cells in a graph

I have a graph where nodes represent points in 3D space. Each node is connected only to all other nodes within some cutoff radius. I am trying to enumerate all subgraphs such that the nodes represent the vertices of a polyhedron with no interior nodes or edges.
At first I thought this was clique problem, but the requirement that all nodes are adjacent to each other isn't working for me. The opposite corners of a cube aren't going to be connected in my dataset, but I need to be able to pull out the cube.
I don't really have a formal education in CS, so I'm not really sure what to search for, but hopefully someone with a better domain vocabulary than me can point me in the right direction.
One way to attack this problem seem to me to use a 3D triangulation "tetrahedrisation". CGAL can be of service there. Then you can start generating different polyhedrons by sticking together neighboring tetrahedrons from the triangulation (as long as they don't inclose another vertex in their combined interior).

Optimizing Geodesic Distances on a Triangular Mesh

I have a convex triangulated mesh. I am able to numerically calculate geodesics between points on the surface; however, I am having trouble tackling the following problem:
Imagine a net being placed over the mesh. The outside boundary of the net coincides with the boundary of the mesh, but the nodes of the net corresponding to the interior of the net are allowed to move freely. I'm interested in finding the configuration that would have the least stress (I know the distances for the at rest state of the net).
Doing this on a smooth surface is simple enough as I could solve for the stresses in terms of the positions of the nodes of the net; however, I don't see a way of calculating the stresses in terms of the position of the net nodes because I don't know that a formula exists for geodesics on a convex triangulated surface.
I'm hoping there is an alternative method to solving this such as a fixed point argument.
Hint:
If I am right, as long as a node remains inside a face, the equations are linear (just as if the node was on a plane). Assuming some node/face correspondence, you can solve for the equilibrium, as if the nodes did belong to the respective planes of support, unconstrained by the face boundaries.
Then for the nodes which are found to lie outside the face, you can project them on the surface and obtain a better face assignment. Hopefully this process might converge to a stable solution.
The picture shows a solution after a first tentative node/face assignment, then a second one after projection/reassignment.
On second thoughts, the problem is even harder as the computation involves geodesic distances between the nodes, which depend on the faces that are traversed. So the domain in which linearity holds when moving a single node is even smaller than a face, it is also limited by "wedges" emanating from the lined nodes and containing no other vertex.
Then you may have to compute the domains where the geodesic distances to a linked neighbor is a linear function of the coordinates and project onto this partition of the surface. Looks like an endeavor.

What is the best initial shape for 3D Delaunay incremental algorithm?

I'm doing 3D Delaunay, with the incremental method. I've tested it in 2D with an initial triangle for inserting the vertices and it works great, but if I use a triangle for 3D, some vertices do not fall into any circumscribed sphere therefore they don't get inserted.
I've tried with a tetrahedron but if the first node falls into the four of the faces, all vertices create new edges towards this new vertex, and deletes all of the initial triangles.
Whichever shape you take, you will always have to deal with side effects.
The best shape is no shape.
This is what we are doing in the CGAL library
http://www.cgal.org
Look at the manual, chapters "2D triangulations" and "3D triangulations".
See also or the journal paper https://hal.inria.fr/inria-00167199/
You can read my answer for this question (Bowyer-Watson algorithm: how to fill "holes" left by removing triangles with super triangle vertices). If the supertriangle is too small sometimes you end with circumcircle outside of the supertriangle. You can try a point-in-polygon test to avoid it.

Merge overlapping triangles into a polygon

I've got a bunch of overlapping triangles from a 3D model projected into a 2D plane. I need to merge each island of touching triangles into a closed, non-convex polygon.
The resultant polygons shouldn't have any holes in them (since the source data doesn't).
Many of the source triangles share (floating point identical) edges with other triangles in the source data.
What's the easiest way to do this? Performance isn't particularly important, since this will be done at design time.
Try gpc, or the General Polygon Clipper Library.
Imagine the projection onto a plane as a "view" of the model (i.e. the direction of projection is the line of sight, and the projection is what you see). In that case, the borders of the polygons you want to compute correspond to the silhouette of the model.
The silhouette, in turn, is a set of edges in the model. For each edge in the silhouette, the adjacent faces will have normals that either point away from the plane or toward the plane. You can check this be taking the dot product of the face normal with the plane normal -- look for edges whose adjacent face normals have dot products of opposite signs with the projection direction.
Once you have found all the silhouette edges you can join them together into the boundaries of the desired polygons.
Generally, you can find more about silhouette detection and extraction by googling terms like mesh silouette finding detection. Maybe a good place to start is here.
I've also found this[1] approach, which I will be trying next.
[1] 2d outline algorithm for projected 3D mesh

Resources