Skip to content

Commit

Permalink
BUG: Changes the Face Label value to -1 for boundary triangles in Sur…
Browse files Browse the repository at this point in the history
…faceNets

Also updated documentation with a short section about the face labels.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
  • Loading branch information
imikejackson committed Feb 19, 2025
1 parent c0067c7 commit 1be3a12
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
15 changes: 11 additions & 4 deletions src/Plugins/SimplnxCore/docs/QuickSurfaceMeshFilter.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,20 @@ One of the arrays to come out of the algorithm is the "Node Type" vertex array.
| 13 | Node that is on the exterior of the mesh and is a triple line |
| 14 | Node that is on the exterior of the mesh and is a quadruple point |

### Exterior or Boundary Triangles

Each triangle that is created will have an 2 component attribute called `Face Labels` that represent the Feature ID on either
side of the triangle. If one of the triangles represents the border of the virtual box then one of the FaceLables will
have a value of -1.

## Notes

The Quickmesh algorithm is very crude and naive in its implementation. This filter
The Quick Mesh algorithm is very crude and naive in its implementation. This filter
along with the Laplacian Smoothing filter can give you reasonable results. The
newer filter that should replace both the quick mesh and the Laplacian Smoothing
filter is the "SurfaceNets" surface meshing algorithm. This will create the surface
mesh and smooth in a single filter and give subjectively better results.
newer filter that should replace both the Quick Mesh and the Laplacian Smoothing
filter is the "Surface Nets" surface meshing algorithm. This will create the surface
mesh and smooth in a single filter and give subjectively better results and perform
much faster at both.

% Auto generated parameter table will be inserted here

Expand Down
6 changes: 6 additions & 0 deletions src/Plugins/SimplnxCore/docs/SurfaceNetsFilter.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ Nodes that appear on the exterior of a volume have Node Type values starting at

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

### Exterior or Boundary Triangles

Each triangle that is created will have an 2 component attribute called `Face Labels` that represent the Feature ID on either
side of the triangle. If one of the triangles represents the border of the virtual box then one of the FaceLables will
have a value of -1.

## Notes

This filter should be used in place of the "QuickMesh Surface Filter".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ Result<> SurfaceNets::operator()()
std::array<VertexData, 4> vData{};
for(int idxVtx = 0; idxVtx < nodeCount; idxVtx++)
{

// Back-bottom edge
if(cellMapPtr->getEdgeQuad(idxVtx, MMCellFlag::Edge::BackBottomEdge, vertexIndices.data(), quadLabels.data()))
{
Expand Down Expand Up @@ -420,5 +419,14 @@ Result<> SurfaceNets::operator()()
}
}

// Now run through the FaceLabels to make them consistent with Quick Surface Mesh
for(usize tIdx = 0; tIdx < triangleCount * 2; tIdx++)
{
if(faceLabels[tIdx] == 0)
{
faceLabels[tIdx] = -1;
}
}

return {};
}

0 comments on commit 1be3a12

Please sign in to comment.