Skip to content

Commit 834b922

Browse files
committed
BUG: Changes the Face Label value to -1 for boundary triangles in SurfaceNets
Also updated documentation with a short section about the face labels. Signed-off-by: Michael Jackson <[email protected]>
1 parent 700306f commit 834b922

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

src/Plugins/SimplnxCore/docs/QuickSurfaceMeshFilter.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,20 @@ One of the arrays to come out of the algorithm is the "Node Type" vertex array.
6363
| 13 | Node that is on the exterior of the mesh and is a triple line |
6464
| 14 | Node that is on the exterior of the mesh and is a quadruple point |
6565

66+
### Exterior or Boundary Triangles
67+
68+
Each triangle that is created will have an 2 component attribute called `Face Labels` that represent the Feature ID on either
69+
side of the triangle. If one of the triangles represents the border of the virtual box then one of the FaceLables will
70+
have a value of -1.
71+
6672
## Notes
6773

68-
The Quickmesh algorithm is very crude and naive in its implementation. This filter
74+
The Quick Mesh algorithm is very crude and naive in its implementation. This filter
6975
along with the Laplacian Smoothing filter can give you reasonable results. The
70-
newer filter that should replace both the quick mesh and the Laplacian Smoothing
71-
filter is the "SurfaceNets" surface meshing algorithm. This will create the surface
72-
mesh and smooth in a single filter and give subjectively better results.
76+
newer filter that should replace both the Quick Mesh and the Laplacian Smoothing
77+
filter is the "Surface Nets" surface meshing algorithm. This will create the surface
78+
mesh and smooth in a single filter and give subjectively better results and perform
79+
much faster at both.
7380

7481
% Auto generated parameter table will be inserted here
7582

src/Plugins/SimplnxCore/docs/SurfaceNetsFilter.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ Nodes that appear on the exterior of a volume have Node Type values starting at
5858

5959
![Exterior Node Types](Images/SurfaceNets_NodeType_Exterior.png)
6060

61+
### Exterior or Boundary Triangles
62+
63+
Each triangle that is created will have an 2 component attribute called `Face Labels` that represent the Feature ID on either
64+
side of the triangle. If one of the triangles represents the border of the virtual box then one of the FaceLables will
65+
have a value of -1.
66+
6167
## Notes
6268

6369
This filter should be used in place of the "QuickMesh Surface Filter".

src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/SurfaceNets.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ Result<> SurfaceNets::operator()()
242242
std::array<VertexData, 4> vData{};
243243
for(int idxVtx = 0; idxVtx < nodeCount; idxVtx++)
244244
{
245-
246245
// Back-bottom edge
247246
if(cellMapPtr->getEdgeQuad(idxVtx, MMCellFlag::Edge::BackBottomEdge, vertexIndices.data(), quadLabels.data()))
248247
{
@@ -420,5 +419,14 @@ Result<> SurfaceNets::operator()()
420419
}
421420
}
422421

422+
// Now run through the FaceLabels to make them consistent with Quick Surface Mesh
423+
for(usize tIdx = 0; tIdx < triangleCount * 2; tIdx++)
424+
{
425+
if(faceLabels[tIdx] == 0)
426+
{
427+
faceLabels[tIdx] = -1;
428+
}
429+
}
430+
423431
return {};
424432
}

0 commit comments

Comments
 (0)