Class: Curve
Class representing a Curve.
A Curve is any piece of 1D geometry - lines, arcs, circles, splines, polylines, or complex wire shapes made from multiple segments joined together. Curves are one of the three core geometry types in BeeGraphy (alongside Surface and Solid), and they inherit common operations from Geometry.
In practice, you'll use curves constantly. They're the starting point for most 3D modeling workflows: draw a profile, then extrude, sweep, revolve, or loft it into a solid.
When to use Curve
- Creating profiles - draw the cross-section shape for extrusions and sweeps
- Defining paths - guide sweeps, arrays, and lofts along a curve
- Building boundaries - outline regions for surfaces or trimming operations
- Measuring and dividing - get curve length, divide into equal segments, find points along the path
- Boolean operations - union, intersection, and difference of 2D shapes
- Intersections - find where curves cross other curves, surfaces, or solids
Quick start
Key methods at a glance
| Method | What it does |
|---|---|
curveLength() | Total length of the curve |
startPoint(), endPoint() | First and last points |
isClosed() | Whether the curve forms a loop |
pointOnCurve(t) | Point at parameter t (0 to 1) |
evaluateCurve(t) | Point + derivatives at parameter t |
divideByCount(n) | Split into n equal segments |
divideByDistance(d) | Split by fixed step distance |
closestPoint(v) | Nearest point on curve to a given point |
extrude(dir) | Extrude into a surface |
offset(size, side) | Offset the curve |
union(geoms) | Boolean union with other geometry |
intersection(geoms) | Boolean intersection |
difference(geoms) | Boolean subtraction |
explode(recursive) | Break into individual segments |
flip() | Reverse the curve direction |
bBox() | Bounding box (width, height, area, center) |
perpPlane(t) | Perpendicular plane at parameter t |
Curve.join(curves) | Join multiple curves (static) |
Method: wires
Gets the wires of the curve.
Example
Method: type
Gets the type of the curve.
Returns
The type of the curve.
Example
Method: edges
Gets the edges of the curve.
Example
Method: getWires
Gets the wires of the curve.
Returns
An array of wires.
Example
Method: getFace
Gets the face of the curve.
Returns
The face of the curve.
Example
Method: createFaceFromWire
Creates a face from a wire.
Parameters
wire(TopoDS_Wire): The wire to create the face from.
Returns
The created face.
Example
Method: sortWiresByVolume
Sorts wires by area.
Parameters
wires(TopoDS_Wire[]): The wires to sort.
Returns
An array of sorted wires with their areas.
Example
Method: getEdges
Gets the edges of the curve.
Returns
An array of edges.
Example
Method: curveLength
Gets the length of the curve.
Returns
The length of the curve.
Example
Method: faceNormal
Gets the normal of the face.
Returns
The normal vector.
Example
Method: lengthParameter
Gets the length parameters.
Parameters
t(number): The parameter value.
Returns
An object containing length1(Length from the start to t) and length2(Length from t to the end).
Example
Static Method: render
Renders the wire with the given tolerance.
Parameters
wire(TopoDS_Wire): The wire to render.tolerance(number): The tolerance value.
Returns
An array of points.
Example
Method: offset
Offsets the curve.
Parameters
offsetSize(number): The size of the offset.side(boolean): The side of the offset.offsetType(OffsetType = OffsetType.Arc): The type of the offset.
Returns
The offset curve.
Example
Method: isCircle
Checks if the curve is a circle.
Returns
True if the curve is a circle, false otherwise.
Example
Method: isArc
Checks if the curve is an arc.
Returns
True if the curve is an arc, false otherwise.
Example
Method: isLine
Checks if the curve is a line.
Returns
True if the curve is a line, false otherwise.
Example
Method: isRectangle
Checks if the curve is a rectangle.
Returns
True if the curve is a rectangle, false otherwise.
Example
Method: isPlanar
Checks if the curve is planar.
Returns
An object containing isPlaner, plane, and distance.
Example
Method: chamfer
Chamfers the curve.
Parameters
distance1(number): The first distance for chamfer.distance2(number): The second distance for chamfer.
Returns
The chamfered curve.
Example
Method: discontinuity
Gets the discontinuities in the curve.
Returns
An array of points representing the discontinuities.
Example
Method: extrude
Extrudes the curve in the given direction.
Parameters
direction(IVector): The direction vector.
Returns
The extruded surface.
Example
Static Method: join
Joins multiple curves.
Parameters
curves(ICurve[]): The curves to join.
Returns
An array of joined curves.
Example
Method: explode
Explodes the curve.
Parameters
recursive(boolean): Whether to explode recursively.
Returns
An object containing segments and points.
Example
Method: divideByLength
Divides the curve by length.
Parameters
length(number): The length to divide by.
Returns
An object containing points, tangents, and parameters.
Example
Method: divideByDistance
Divides the curve by distance.
Parameters
step(number): The distance to divide by.
Returns
An object containing points, tangents, and parameters.
Example
Method: divideByCount
Divides the curve by count.
Parameters
count(number): The number of divisions.
Returns
An object containing points, tangents, and parameters.
Example
Method: contour
Gets the contour of the curve.
Parameters
point(IVector): The point vector.direction(IVector): The direction vector.distance(number): The distance.
Returns
An array of points representing the contour.
Example
Method: getDividedSegments
Gets the divided segments of the curve.
Parameters
points(IVector[]): The points to divide by.
Returns
An array of segments.
Example
Method: startPoint
Gets the start point of the curve.
Returns
The start point vector.
Example
Method: endPoint
Gets the end point of the curve.
Returns
The end point vector.
Example
Method: seam
Seams the curve.
Parameters
t(number): The parameter value.
Returns
The seamed curve.
Example
Method: pointOnCurve
Gets the point on the curve.
Parameters
t(number): The parameter value.
Returns
The point vector.
Example
Method: evaluateCurve
Evaluates the curve.
Parameters
parameter(number): The parameter value.byLength(boolean): Whether to evaluate by length.
Returns
An object containing point, vector1(first derivatives), and vector2(second derivatives).
Example
Method: pointInCurve
Checks if a point is in the curve.
Parameters
point(IVector): The point vector.
Returns
An object containing projectPoint and relationship.
Example
Method: controlPoints
Gets the control points of the curve.
Returns
An object containing points, knots, weights, and multiplicities.
Example
Method: closestPoint
Gets the closest point on the curve.
Parameters
point(IVector): The point vector.
Returns
An object containing nearest and pointsArr.
Example
Method: bBox
Gets the bounding box of the curve.
Returns
An object containing width, length, height, area, center, and boundingBox.
Example
Method: flip
Flips the curve.
Returns
The flipped curve.
Example
Method: area
Gets the area of the curve.
Returns
The area of the curve.
Example
Method: isClosed
Checks if the curve is closed.
Returns
True if the curve is closed, false otherwise.
Example
Method: deconstructArc
Deconstructs the arc.
Returns
An object containing plane, radius, startAngle, and endAngle.
Example
Method: union
Unions the curve with other curves.
Parameters
geometries((ICurve | ISurface | ISolid): The curves to union with.
Returns
The unioned curve.
Example
Method: intersection
Intersects the curve with other curves.
Parameters
geometries(IGeometry[]): The curves to intersect with.
Returns
An array of intersection curves.
Example
Method: difference
Gets the difference between the curve and other curves.
Parameters
geometries(IGeometry[]): The curves to subtract.
Returns
The resulting curve.
Example
Method: Unknown
Creates an array of geometry along a curve.
Parameters
geometry(IGeometry[]): The geometry to array.count(number): The number of elements in the array.
Returns
An array of geometries.
Method: intersectCurve
Intersects the curve with another curve.
Parameters
curve(ICurve): The curve to intersect with.
Returns
An array of intersection points.
Example
Method: intersectSurface
Intersects the curve with a surface.
Parameters
surface(ISurface): The surface to intersect with.
Returns
An array of intersection points.
Example
Method: intersectSolid
Intersects the solid with a curve.
Parameters
solid(ISolid): The solid to intersect with.
Returns
An array of intersection points.
Example
Method: solidCurve
Intersects the solid with a curve.
Parameters
solid(ISolid): The solid to intersect with.
Returns
An array of intersection overlap curves.
Example
Method: selfIntersect
Checks for self-intersections in the curve.
Returns
An array of self-intersection points.
Example
Method: rebuildCurve
Rebuilds the curve with the given degree.
Parameters
degree(number): The degree of the curve.
Returns
The rebuilt curve.
Example
Method: mirrorByCurve
Mirrors the curve by another curve.
Parameters
curve(ICurve): The curve to mirror by.
Returns
The mirrored curve.
Example
Method: curveToPolyline
Converts the curve to a polyline.
Parameters
toleranceDist(number): The tolerance distance.edge(number): The edge length.
Returns
The polyline curve.
Example
Method: perpPlane
Gets the perpendicular plane at the given parameter.
Parameters
parameter(number): The parameter value.
Returns
The perpendicular plane.
Example
Method: perpPlanes
Gets the perpendicular planes.
Parameters
count(number): The number of planes.align(boolean): Whether to align the planes.
Returns
An object containing planes and parameters.
Example
Method: horizontalPlane
Gets the horizontal plane at the given parameter.
Parameters
parameter(number): The parameter value.
Returns
The horizontal plane.
Example
Method: horizontalPlanes
Gets the horizontal planes.
Parameters
count(number): The number of planes.align(boolean): Whether to align the planes.
Returns
An object containing planes and parameters.
Example
Method: curvePlane
Gets the curve plane at the given parameter.
Parameters
parameter(number): The parameter value.
Returns
The curve plane.
Example
Method: curvePlanes
Gets the curve planes.
Parameters
count(number): The number of planes.
Returns
An object containing planes and parameters.
Example
Method: dashPattern
Creates a dash pattern on the curve.
Parameters
pattern(number[]): The dash pattern.
Returns
An object containing dashes and gaps.
Example
Method: tween
Tweens the curve with another curve.
Parameters
curve(ICurve): The curve to tween with.parameter(number): The parameter value.
Returns
The tweened curve.
Example
Method: proximity
Checks the proximity between the curve and another curve.
Parameters
curve(ICurve): The curve to check proximity with.
Returns
An object containing pointA, pointB, and distance.
Example
Method: extremes
Gets the extremes of the curve.
Parameters
plane(IPlane): The plane to get extremes on.
Returns
An object containing highest and lowest points.
Example
Method: centerOfMass
Gets the center of mass of the curve.
Returns
The center of mass point vector.
Example
Method: projectCurve
Projects the curve onto a geometry.
Parameters
geometry(IGeometry): The geometry to project onto.direction(IVector): The direction vector.
Returns
An array of projected curves.
Example
Method: cullCurves
Culls duplicate curves.
Parameters
curves(ICurve[]): The curves to cull.
Returns
An object containing culledCurves and duplicateIndexes.
Example
Method: isEquivalentCurve
Checks if two curves are equivalent.
Parameters
curve(ICurve): No description
Returns
True if the curves are equivalent, false otherwise.
Example
Method: dump
Dumps the details of the curve.