axom
axom copied to clipboard
Adds functionality for intersecting curved polygons
Summary
- This PR is revamps and supersedes the code from @davidgunderman's PR #112, rebasing the
feature/gunderman/bezier-polygon
branch on our currentdevelop
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
CurvedPolygon
s. 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
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):
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:
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
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:
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