Skip to content

Enhance ElviraAlgorithm so it can output plane offset and point mesh. #1570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
May 19, 2025

Conversation

BradWhitlock
Copy link
Member

@BradWhitlock BradWhitlock commented May 10, 2025

This PR resolves #1565.

  • Enhanced the axom::mir::ElviraAlgorithm class so it can output plane normal and offset for the planes used to clip zone fragments. These fields are output when the "plane" option is set to values other than zero.
  • Enhanced the axom::mir::ElviraAlgorithm to accept a "pointmesh" option that causes the algorithm to generate a mesh consisting of points located at the zone fragment clipping plane origins instead of making the usual polygonal or polyhedral meshes. This skips more costly work involved in generating the usual geometry when the user only wants the clipping planes.

Base automatically changed from feature/whitlock/mir_elvira3d_speedup to develop May 14, 2025 22:35
Copy link
Member

@kennyweiss kennyweiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @BradWhitlock

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the documentation!

Comment on lines 998 to 1000
// The last fragment's normals are just (1,0,0).
//const double *normalPtr = fragmentVectorsView.data() + (fragmentIndex * numVectorComponents);
// It seems more useful to emit the opposite of the last fragment's normal instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

construction debris? Or need to keep?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reworked that comment so it retains what I wanted without being an old line of code.

output is comprised of shapes that result from several cuts of the input zones, the resulting
topology is not necessarily water-tight and it consists of polygons for 2D and polyhedra for 3D.
output is typically comprised of shapes that result from several cuts of the input zones,
the resulting topology is not necessarily water-tight and it consists of polygons for 2D
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Readability suggestion: break sentence so we have "...is not necessarily water-tight. It consists of polygons..."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it.

Comment on lines 140 to 142
The ELVIRA algorithm also supports a mode where it instead creates a mesh consisting of
points at the centers of the polygonal/polyhedral zone centers and emits the points in
place of the other zones. This output mode is used to save work when the algorithm is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by this sentence: please clarify. I think you mean something like

"The ELVIRA algorithm also supports a mode where it creates points instead of a polygonal/polyhedral mesh. The points are located where the centroids of the zone faces would have been. This output mode is used..."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or does pointmesh produce points only at the centroids of new fragment cut planes/facets?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, I read it more carefully. Do you mean "A point is created at the centroid of each zone." ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried again. pointmesh makes a point at the origin of every clipping plane. A zone with 3 materials would make 3 clipping planes (2 are at the same place with opposite normals). A zone with 1 material does not get clipped so the point goes at the zone centroid. This mode is for when wants the plane origin and normal and is not that interested in the clipped zone fragments - so we make points instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Much clearer.

Comment on lines +155 to +157
+---------------------------------+------------------------------------------------------+
| Option | Description |
+=================================+======================================================+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please state the default behavior. I am guessing that if plane or pointmesh is omitted, the behavior is the same as specifying 0. What is the default for point_tolerance?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added defaults in the table.

Copy link
Contributor

@Arlie-Capps Arlie-Capps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Brad!

@BradWhitlock BradWhitlock merged commit 0354ce5 into develop May 19, 2025
15 checks passed
@BradWhitlock BradWhitlock deleted the feature/whitlock/mir_elvira_plane_info branch May 19, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance ELVIRA MIR so it can return clipping plane offsets.
3 participants