axom icon indicating copy to clipboard operation
axom copied to clipboard

Adds functionality for intersecting curved polygons

Open kennyweiss opened this issue 3 years ago • 2 comments

Summary

  • This PR is revamps and supersedes the code from @davidgunderman's PR #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.
    • [x] Make it easier to provide user input meshes
    • [x] Provide a means of outputting the intersection results. E.g. as an svg image
  • [ ] Update RELEASE-NOTES
  • [x] Perform thorough code review on intersect_polygon algorithm

kennyweiss avatar Jun 12 '21 02:06 kennyweiss

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 avatar Jun 14 '21 16:06 kennyweiss

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 avatar Jun 14 '21 17:06 kennyweiss