You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Smooths the input path, creating a continuous curve using a cubic spline, using one of two methods.
606
608
// .
607
-
// For `method="edges"`, every segment (edge) of the path is replaced by a cubic curve with `splinesteps` points,
608
-
// and the cubic interpolation passes through every input point on the path, matching the tangents at every
609
-
// point. If you do not specify `tangents`, they are computed using path_tangents with `uniform=false` by
609
+
// For `method="edges"` (default), every segment (edge) of the path is replaced by a cubic curve with `splinesteps`
610
+
//points, and the cubic interpolation passes through every input point on the path, matching the tangents at every
611
+
// point. If you do not specify `tangents`, they are computed using {{path_tangents()}} with `uniform=false` by
610
612
// default. Only the dirction of a tangent vector matters, not the vector length.
611
613
// Setting `uniform=true` with non-uniform sampling may be desirable in some cases but tends to
612
614
// produces curves that overshoot the point on the path.
613
615
// .
614
616
// For `method="corners"`, every corner of the path is replaced by two cubic curves, each with
615
617
// `splinesteps` points. The two curves are joined at the corner bisector, and the cubic interpolations
616
618
// are tangent to the midpoint of every segment. The `tangents` and `uniform` parameters don't apply to the
617
-
// "corners" method. Using `tangents` with "corners" causes an error.
619
+
// "corners" method. Using either one with "corners" causes an error.
618
620
// .
619
621
// The `size` or `relsize` parameters apply to both methods. They determine how far the curve can bend away
620
622
// from the input path. In the case where the path has three non-collinear points, the size specifies the
@@ -629,16 +631,16 @@ function _rounding_offsets(edgespec,z_dir=1) =
629
631
// `relsize` determines where the curve intersects the corner bisector, relative to the maximum deviation
630
632
// possible (which corresponds to a circle rounding from the shortest leg of the corner). For example,
631
633
// `relsize=1` is the maximum deviation from the corner (a circle arc from the shortest leg), and `relsize=0.5`
632
-
// causes the curve to intersect the corner bisector halfway between the maximum and the tip of the corner.
634
+
// causes the curve to intersect the corner bisector halfway between that maximum and the tip of the corner.
633
635
// .
634
636
// At a given segment or corner (depending on the method) there is a maximum size: a size value that is too
635
637
// large is rounded down. See also path_to_bezpath().
636
638
// Arguments:
637
639
// path = path to smooth
638
640
// tangents = tangents constraining curve direction vectors (vector length doesn't matter) at each point for `method="edges"`. Default: computed automatically
639
641
// ---
640
-
// relsize = relative maximum devation between the curve and edge (for method="edges") or corner (for method="corner"), a number or vector, expressed as proportion of edge length or proportion of max distance from corner (typically between 0 and 1). Default: 0.1
641
-
// size = absolute deviation between the curve and edge (for method="edges") or corner (for method="corner"), a number or vector.
642
+
// relsize = relative maximum devation between the curve and edge (for method="edges") or corner (for method="corners"), a number or vector, expressed as proportion of edge length or proportion of max distance from corner (typically between 0 and 1). Default: 0.1 for `method="edges"` or 0.5 for `method="corners"`
643
+
// size = absolute deviation between the curve and edge (for method="edges") or corner (for method="corners"), a number or vector.
642
644
// method = type of curve; "edges" makes a curve that intersects all the path vertices but deviates from the path edges, and "corners" makes a curve that is tangent to all segment midpoints but deviates from the corners. Default: "edges"
643
645
// splinesteps = Number of steps for each bezier curve section. Default: 10
644
646
// uniform = set to true to compute tangents with uniform=true. Applies only to "edges" method. Default: false
@@ -658,11 +660,11 @@ function _rounding_offsets(edgespec,z_dir=1) =
// Example(2D): Turning on uniform tangent calculation also changes the end derivatives for the "edges" curve (it has no effect on the "corners" curve):
663
+
// Example(2D): Turning on uniform tangent calculation also changes the end derivatives for the "edges" curve:
// Example(2D): Here's a wide rectangle. With `method="edges" (yellow), using `size` means all edges bulge the same amount, regardless of their length. With `method="corners"` (red), the curve is `size' distance from the corners (up to a maximum theoretical circular arc).
667
+
// Example(2D): Here's a wide rectangle. With `method="edges"` (yellow), using `size` means all edges bulge the same amount, regardless of their length. With `method="corners"` (red), the curve is `size` distance from the corners (up to a maximum theoretical circular arc).
// Example(2D): For the "corners" curve, with relsize the distance from the corner is proportional to the maximum distance corresponding to a circular arc (shown in red) from the shorter leg of the corner. As `relsize` approaches zero, the curve approaches the corner.
// Example(2D,Med,NoScales): For the "corners" curve, with relsize the distance from the corner is proportional to the maximum distance corresponding to a circular arc (shown in red) from the shorter leg of the corner. As `relsize` approaches zero, the curve approaches the corner.
// Example(2D): Here's the square with a size that's too big to achieve, giving the the maximum possible curve with `method="edges"` (yellow). For `method="corners"` (red), the maximum possible distance from the corners is a circle.
698
+
// Example(2D,NoScales): Here's the square with a size that's too big to achieve, giving the the maximum possible curve with `method="edges"` (yellow). For `method="corners"` (red), the maximum possible distance from the corners is a circle.
// Example(3D,VPD=48,VPR=[40,0,40],NoAxes): Corner differences between the three squircle styles for squareness=0.5. Style "superellipse" is pink, "fg" is gold, "bezier" is blue.
1795
+
// Example(3D,VPD=48,VPR=[40,0,40],VPT=[11,-11,-10],NoAxes): Corner differences between the three squircle styles for squareness=0.5. Style "superellipse" is pink, "fg" is gold, "bezier" is blue.
0 commit comments