JointOptions Class
Control parameters for joint construction, used in offset construction methods such as constructPolygonWireXYOffset and constructCurveXYOffset.
- Define a "joint" as the common point between adjacent segments of the input curve.
- Define the "turn angle" at a joint to be the angle in [0,pi] between the first derivatives (tangents) of the segments at the joint.
- When creating offsets, if an offset needs to do an "outside" turn, the first applicable construction is applied:
- If the turn angle is larger than
options.minArcDegrees
, a circular arc is constructed to offset the joint. - If the turn angle is less than or equal to
options.maxChamferTurnDegrees
, extend curves along tangent to single intersection point (to create a sharp corner). - If the turn angle is larger than
options.maxChamferDegrees
, the joint is offset with a line string whose edges:- lie outside the arc that would have been created by the first construction
- have uniform turn angle less than
options.maxChamferDegrees
- touch the arc at their midpoint (except first and last edge).
Methods
Name | Description | |
---|---|---|
constructor(leftOffsetDistance: number, minArcDegrees: number180, maxChamferDegrees: number91, preserveEllipticalArcs: booleanfalse, allowSharpestCorners: booleanfalse): JointOptions | Construct JointOptions. | |
clone(): JointOptions | Return a deep clone. | |
needArc(theta: Angle): boolean | Return true if the options indicate this amount of turn should be handled with an arc. | |
numChamferPoints(theta: Angle): number | Return the number of corners needed to chamfer the given turn angle. | |
setFrom(other: JointOptions): void | Copy values of input options | |
create(leftOffsetDistanceOrOptions: number | JointOptions): JointOptions Static | Parse a number or JointOptions up to JointOptions: |
Properties
Name | Type | Description | |
---|---|---|---|
allowSharpestCorners | boolean | Whether to remove the internal turn angle upper bound for sharp corner construction. | |
leftOffsetDistance | number | Offset distance, positive to left of base curve. | |
maxChamferTurnDegrees | number | Largest turn angle at which to construct a sharp corner, or largest turn angle in a multi-segment chamfer. | |
minArcDegrees | number | Smallest arc to construct. | |
preserveEllipticalArcs | boolean | Whether to offset elliptical arcs as elliptical arcs (true) or as B-spline curves (false, default). |
Defined in
- curve/OffsetOptions.ts Line 28
Last Updated: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.