Skip to content
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

Adds functionality for intersecting curved polygons #590

Draft
wants to merge 38 commits into
base: develop
Choose a base branch
from

Conversation

kennyweiss
Copy link
Member

@kennyweiss kennyweiss commented Jun 12, 2021

Summary

  • This PR is revamps and supersedes the code from @davidgunderman's PR Feature/gunderman/bezier polygon #112, rebasing the feature/gunderman/bezier-polygon branch on our current develop branch
  • It adds some functionality to primal's BezierCurve class to compute sector areas and centroid, where a sector is the region defined by a curve and the origin
  • It add a CurvedPolygon class to primal. This encapsulates a polygon whose edges are BezierCurves
  • It adds an operator to primal to find the interesection regions of a pair of CurvedPolygons. The intersection regions consists of zero or more CurvedPolygons.
  • It adds comprehensive tests for all the new functionality
  • It adds a preliminary example to quest to compute the overlap area between two high order MFEM meshes.

TODO:

  • Improve high order intersection example.
    • Make it easier to provide user input meshes
    • Provide a means of outputting the intersection results. E.g. as an svg image
  • Update RELEASE-NOTES
  • Perform thorough code review on intersect_polygon algorithm

@kennyweiss kennyweiss added Quest Issues related to Axom's 'quest' component Primal Issues related to Axom's 'primal component labels Jun 12, 2021
@kennyweiss kennyweiss self-assigned this Jun 12, 2021
@kennyweiss
Copy link
Member Author

I added CLI11 support to make it easier to load different meshes and added a function to output the result as an SVG.
Here is the default example (slightly tweaked for interpretability):

overlapping_circles
The source mesh is red; the target mesh is blue; and the intersection regions are green.

Here's another example of the two meshes shifted a bit from each other:
shifted
Generated via:

>./examples/quest_high_order_remap_ex \
        --srcFile ../data/mfem/disc-nurbs.mesh --srcOffset -1.1 0 \
        --tgtFile ../data/mfem/disc-nurbs.mesh --tgtOffset 1.1 0

@kennyweiss
Copy link
Member Author

The current code needs to be fixed for cases where the edges are exactly aligned.
Here's what we get when the edges of the center box overlap:
bug_2_offset

Generated from:

>./examples/quest_high_order_remap_ex \
        --srcFile ../data/mfem/disc-nurbs.mesh --srcOffset -1 0 \
        --tgtFile ../data/mfem/disc-nurbs.mesh --tgtOffset 1 0

@kennyweiss kennyweiss force-pushed the feature/kweiss/bezier-polygon-revamp branch 2 times, most recently from 5fc42b9 to 29d3bce Compare June 21, 2021 16:38
@kennyweiss kennyweiss added this to the FY22 Development milestone Nov 15, 2021
@kennyweiss kennyweiss force-pushed the feature/kweiss/bezier-polygon-revamp branch 3 times, most recently from 633fff0 to 76f08ce Compare November 30, 2021 02:22
@kennyweiss kennyweiss force-pushed the feature/kweiss/bezier-polygon-revamp branch 2 times, most recently from 35252e5 to d579c0c Compare January 14, 2022 19:31
@kennyweiss kennyweiss force-pushed the feature/kweiss/bezier-polygon-revamp branch from d579c0c to 3466936 Compare June 17, 2022 18:45
@kennyweiss kennyweiss force-pushed the feature/kweiss/bezier-polygon-revamp branch 3 times, most recently from c6c1eb7 to da3fd27 Compare June 22, 2022 18:25
davidgunderman and others added 9 commits July 3, 2022 12:58
TODO: precision of curvedpolygon intersection appears to be only 10^-10
The current example generates two mfem meshes and finds the pairs of
possibly intersecting elements.
… high order mesh intersection example.

TODO: deal with case of total inclusion and separation
…e in intersect_bezier, and adds two region test for intersect_polygon
kennyweiss and others added 24 commits July 3, 2022 15:36
Supports loading in source and target mfem meshes from file
as well as some simple mesh transformations.
…t example

Also fixes a bug in loading the input mesh: We need to refine before transforming the mesh.
Breaks out function that inserts all intersection vertices into the polygons.
It now properly handles the cases where the two polygons have different numbers of edges.
* A case where there are multiple intersections along an edge, and the polygons have different numbers of edges
* A regression case over linear quads where the computed intersection was (and is still)  incorrect.
  This case has an intersection between an edge an a vertex.
…air of linear squares

Also outputs some additional test cases as SVG.
…rithm

Uses `PolygonEdge` and `Junction` helper classes to simplify the logic.
To help improve handling of degenerate edge-vertex intersection for primal's CurvedPolygon class.
…metry

Note: currently failing for overlapped vertex.
@kennyweiss kennyweiss force-pushed the feature/kweiss/bezier-polygon-revamp branch from da3fd27 to d1c65b5 Compare July 4, 2022 01:04
@rhornung67 rhornung67 modified the milestones: FY22 Development, FY23 Development Feb 13, 2023
@kennyweiss kennyweiss modified the milestones: FY23 Development, FY24 Development Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primal Issues related to Axom's 'primal component Quest Issues related to Axom's 'quest' component Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants