@huukhanhnguyen/geometry / namespaces/NurbsCurve2d
namespaces/NurbsCurve2d
axesAtParam
constaxesAtParam: (curve_json,t) =>Float64Array=wasm.curve2d_axes_at_param
[originX, originY, tangentX, tangentY, normalX, normalY] — the normal is the LEFT normal, 90 degrees counter-clockwise from the tangent.
Parameters
curve_json
string
t
number
Returns
Float64Array
boundingBox
constboundingBox: (curve_json) =>Float64Array=wasm.curve2d_bounding_box
[minX, minY, maxX, maxY].
Parameters
curve_json
string
Returns
Float64Array
closestPoint
constclosestPoint: (curve_json,x,y) =>Float64Array=wasm.curve2d_closest_point
Parameters
curve_json
string
x
number
y
number
Returns
Float64Array
end
constend: (curve_json) =>Float64Array=wasm.curve2d_end
Parameters
curve_json
string
Returns
Float64Array
intersect
constintersect: (a_json,b_json,tolerance) =>string=wasm.curve2d_intersect
Exact curve-curve intersection of the four 2D kinds.
a_json / b_json are each a tagged curve: public flat { type: "line"|"arc"|"ellipse"|"nurbs", ... } or the nested curve2d_* envelope. Returns { crossings, overlaps } JSON.
Parameters
a_json
string
b_json
string
tolerance
number
Returns
string
isClosed
constisClosed: (curve_json) =>boolean=wasm.curve2d_is_closed
Parameters
curve_json
string
Returns
boolean
length
constlength: (curve_json) =>number=wasm.curve2d_length
Parameters
curve_json
string
Returns
number
lengthAt
constlengthAt: (curve_json,t) =>number=wasm.curve2d_length_at
Parameters
curve_json
string
t
number
Returns
number
paramAtLength
constparamAtLength: (curve_json,s) =>number=wasm.curve2d_param_at_length
Parameters
curve_json
string
s
number
Returns
number
pointAt
constpointAt: (curve_json,t) =>Float64Array=wasm.curve2d_point_at
Parameters
curve_json
string
t
number
Returns
Float64Array
reverse
constreverse: (curve_json) =>string=wasm.curve2d_reverse
Parameters
curve_json
string
Returns
string
signedArea
constsignedArea: (curve_json) =>number=wasm.curve2d_signed_area
Green's-theorem area contribution of one segment kind. Only the four ContourJson segment kinds carry one; a tagged curve of any other kind is an error rather than a silent zero.
Parameters
curve_json
string
Returns
number
spline
constspline: (points,degree) =>string=wasm.curve2d_spline
Fit a NURBS of degree through points (flat [x, y, x, y, …]) and return it as a tagged nurbs curve row.
This is the door that replaces the old spline curve KIND. That kind was never a carrier — every one of its operations already delegated to this same NURBS — it was the only way to hand the kernel a 2D point list. Removing the kind without this factory would have removed the capability, so the construction moved here and the kind went away.
Parameters
points
Float64Array
degree
number
Returns
string
splitAt
constsplitAt: (curve_json,t) =>string=wasm.curve2d_split_at
Both halves, as a JSON array of two Curve2dJSON.
Parameters
curve_json
string
t
number
Returns
string
start
conststart: (curve_json) =>Float64Array=wasm.curve2d_start
Parameters
curve_json
string
Returns
Float64Array
tangentAt
consttangentAt: (curve_json,t) =>Float64Array=wasm.curve2d_tangent_at
Parameters
curve_json
string
t
number
Returns
Float64Array
toNurbsCurve
consttoNurbsCurve: (curve_json) =>string=wasm.curve2d_to_nurbs_curve
The z = 0 NurbsCurve delegate every hard operation runs through.
Parameters
curve_json
string
Returns
string
transform
consttransform: (curve_json,elements) =>string=wasm.curve2d_transform
Parameters
curve_json
string
elements
Float64Array
Returns
string