Defining Curve-Bounded Domains
This section discusses how curve-bounded domains, and curves, are defined in this package. A good demonstration of how these domains are worked with is in the curve-bounded tutorial.
Curves
To start, let us discuss curves. All functions that work with curves in this package treat them as being subtypes of the AbstractParametricCurve
type. These curves must:
- Be defined as parametric curves, parametrised over $0 \leq t \leq 1$.
- Not be self-intersecting, with the exception of allowing for closed curves.
- Implement
differentiate
,twice_differentiate
, andthrice_differentiate
. - Be defined as a callable struct.
- Either implement
point_position_relative_to_curve
orget_closest_point
. Alternatively, the struct should have alookup_table
field so thatlookup_table[i]
is the value of the curve att = (i - 1) / (length(lookup_table) - 1)
.
With these specifications, a curve can be fully compatible with the functions in this package, as other functions such as arc_length
, curvature
, and total_variation
are automatically defined for such a curve. The curves that are defined in this package can be found using subtypes
:
using DelaunayTriangulation, InteractiveUtils
subtypes(DelaunayTriangulation.AbstractParametricCurve)
8-element Vector{Any}:
BSpline
BezierCurve
CatmullRomSpline
CircularArc
DelaunayTriangulation.CatmullRomSplineSegment
DelaunayTriangulation.PiecewiseLinear
EllipticalArc
LineSegment
Curve-Bounded Domains
For defining curve-bounded domains, defining them is similar to defining piecewise linear boundaries as described here. You still need to be careful about orientation, and you of course need to make sure that curves belonging to the same boundary connect appropriately. For defining curve-bounded domains that also have a piecewise linear section, the piecewise linear section should be defined as a vector of vertices just like here.