Class: CurveBuilder
CurveBuilder is a factory class that provides static methods for creating curves of all kinds -- lines, arcs, circles, splines, and more. You never instantiate CurveBuilder; instead, you call its static methods directly (e.g., CurveBuilder.line(...), CurveBuilder.circle(...)).
When to use CurveBuilder
Reach for CurveBuilder any time you need to create a curve from scratch. Whether you are drawing a simple line between two points, defining a circular profile for a revolve, or constructing a complex NURBS curve for a freeform shape, CurveBuilder is the starting point. The curves it produces can then be passed to other classes like SurfaceBuilder (for extruding, lofting, or sweeping into surfaces) or used directly for analysis and visualization.
Quick start
Key methods
| Method | Description |
|---|---|
line(start, end) | Straight line between two points |
lineSDL(start, direction, length) | Line from a point in a given direction and length |
circle(origin, radius) | Full circle at origin with given radius |
circleCNR(center, normal, radius) | Circle defined by center, normal vector, and radius |
arc(origin, radius, alpha1, alpha2) | Circular arc defined by angles |
arc3Pnt(pA, pB, pC) | Arc passing through three points |
ellipse(origin, r1, r2) | Full ellipse with two radii |
bSplineCurve(points, degree, closed) | Smooth B-spline through control points |
bezierCurve(points) | Bezier curve from control points |
nurbsCurve(points, degree, closed) | NURBS curve from control points |
polyline(points, closed) | Polyline connecting a list of points |
rectangle(origin, width, length) | Rectangular closed curve |
polygon(radius, sides, origin) | Regular polygon with N sides |
helix() | Helical curve |
blendCurve(curveA, curveB, fA, fB) | Smooth blend between two curves |
Static Method: line
Creates a straight line curve between two points.
Parameters
start(IVector): The starting point of the line.end(IVector): The ending point of the line.
Returns
A Curve object representing the straight line curve.
Example
Static Method: lineSDL
Creates a straight line curve in 3D space.
Parameters
start(IVector): The starting point of the line.direction(IVector): The direction vector of the line.length(number): The length of the line.
Returns
A Curve object representing the straight line curve.
Example
Static Method: line4Pnt
Creates a straight line from four points.
Parameters
line(ICurve): The input curve.pointA(IVector): The first point to project onto the input curve.pointB(IVector): The second point to project onto the input curve.
Returns
A new Curve object representing the straight line passing through the first and second points.
Example
Static Method: line2Pln
Creates a straight line between two planes.
Parameters
line(ICurve): The input curve.planeA(IPlane): The first plane to intersect with the input curve.planeB(IPlane): The second plane to intersect with the input curve.
Returns
A new Curve object representing the straight line between the two planes.
Example
Static Method: tangentLines
Calculates the tangent lines between a given point and a circle.
Parameters
point(IVector): The point to calculate the tangent lines from.circle(ICurve): The circle to calculate the tangent lines to.
Returns
An object containing the tangent lines as tangent1 and tangent2.
Example
Static Method: tangentLinesIn
Calculates the tangent lines between two circles.
Parameters
circle1(ICurve): The first circle.circle2(ICurve): The second circle.
Returns
An object containing the tangent lines as tangent1 and tangent2.
Example
Static Method: tangentLinesEx
Calculates the tangent lines between two circles.
Parameters
circle1(ICurve): The first circle.circle2(ICurve): The second circle.
Returns
An object containing the tangent lines as tangent1 and tangent2.
Example
Static Method: tangentArcs
Calculates the tangent arcs between two circles.
Parameters
circle1(ICurve): The first circle.circle2(ICurve): The second circle.radius(number): The radius of tangent arcs.
Returns
An object containing the tangent lines as tangent1 and tangent2.
Example
Static Method: circle
Creates a circle curve with the given origin and radius.
Parameters
origin(IVector): The origin point of the circle.radius(number): The radius of the circle.
Returns
A Curve object representing the circle curve.
Example
Static Method: circle3Pnt
Constructs a circle from three given points.
Parameters
pointA(IVector): The first point.pointB(IVector): The second point.pointC(IVector): The third point.
Returns
An object containing the constructed circle curve, radius, and plane.
Example
Static Method: circleCNR
Constructs a circular curve in 3D space using the Center-Normal-Radius (CNR) method.
Parameters
center(IVector): The center point of the circle.normal(IVector): The normal vector of the circle's plane.radius(number): The radius of the circle.
Returns
A Curve object representing the constructed circle curve.
Example
Static Method: inCircle
Calculates the incircle of a triangle.
Parameters
pointA(IVector): The first corner of triangle.pointB(IVector): The second corner of triangle.pointC(IVector): The third corner of triangle.
Returns
An object containing the calculated circle curve, plane, and radius of the circle.
Example
Static Method: circleBy2Tan
Constructs a circle by two tangents.
Parameters
curveA(ICurve): The first curve.curveB(ICurve): The second curve.point(IVector): The circle center point.
Returns
A new Curve object representing the constructed circle.
Example
Static Method: circleBy3Tan
Constructs a circle by three tangent curves.
Parameters
curveA(ICurve): The first curve for tangency constraint.curveB(ICurve): The second curve for tangency constraint.curveC(ICurve): The third curve for tangency constraint.point(IVector): The circle center point.
Returns
A new Curve object representing the constructed circle.
Example
Static Method: inEllipse
Calculates the inscribed ellipse of a triangle.
Parameters
pointA(IVector): The first corner of triangle.pointB(IVector): The second corner of triangle.pointC(IVector): The third corner of triangle.
Returns
An object containing the generated ellipse curve and the plane it lies on.
Example
Static Method: ellipse
Creates an ellipse curve.
Parameters
origin(IVector): The origin point of the ellipse.radius1(number): The semi-major radius of the ellipse.radius2(number): The semi-minor radius of the ellipse.
Returns
A Curve object representing the ellipse curve.
Example
Static Method: arc
Creates an arc curve.
Parameters
origin(IVector): The origin point of the arc.radius(number): The radius of the arc.alpha1(number): The starting angle of the arc in radians.alpha2(number): The ending angle of the arc in radians.
Returns
A Curve object representing the arc curve.
Example
Static Method: modifiedArc
Modifies an arc by changing its radius and angle.
Parameters
arc(ICurve): The original arc to be modified.radius(number): The new radius for the arc.
Returns
A new Curve object representing the modified arc.
Example
Static Method: arc3Pnt
Constructs an arc of a circle passing through three given points.
Parameters
pointA(IVector): The first point.pointB(IVector): The second point.pointC(IVector): The third point.
Returns
An object containing the constructed arc shape, radius, and center.
Example
Static Method: ellipseArc
Constructs an Ellipse Arc.
Parameters
origin(IVector): The origin point of the arc.radius1(number): The semi-major radius of the arc.radius2(number): The semi-minor radius of the arc.alpha1(number): The starting angle of the arc in radians.alpha2(number): The ending angle of the arc in radians.
Returns
A Curve object representing the arc curve.
Example
Static Method: arcSED
Constructs an arc of a circle in 3D space.
Parameters
start(IVector): The starting point of the arc.end(IVector): The ending point of the arc.direction(IVector): The direction vector of the arc.
Returns
An object containing the constructed arc curve, radius, and plane.
Example
Static Method: connectWithCurve
Connects two points with a curve.
Parameters
start(IVector): The starting point of the curve.end(IVector): The ending point of the curve.curve(ICurve): The curve to connect the points with.
Returns
The resulting curve after connecting the points.
Example
Static Method: helix
Generates a helix curve.
Returns
A Curve object representing the helix curve.
Example
Static Method: polyline
Creates a polyline curve from a list of points.
Parameters
pointList(IVector[]): The list of points defining the polyline.closed(boolean): Indicates whether the polyline is closed or not.
Returns
A Curve object representing the polyline curve.
Example
Static Method: bSplineCurve
Constructs a B-spline curve based on the given list of points.
Parameters
pointList(IVector[]): The list of points to construct the curve from.degree(number): The degree of the B-spline curve.closed(boolean): Indicates whether the curve should be closed.
Returns
A Curve object representing the constructed B-spline curve.
Example
Static Method: bezierCurve
Creates a Bézier curve based on the given points.
Parameters
pointList(IVector[]): The control points of the curve.
Returns
A Curve object representing the Bézier curve.
Example
Static Method: nurbsCurve
Creates a NURBS curve based on the given points, degree, and closed flag.
Parameters
points(IVector[]): The control points of the curve.degree(number): The degree of the curve.closed(boolean): A flag indicating whether the curve is closed.
Returns
A Curve object representing the NURBS curve.
Example
Static Method: nurbsCurvePWKD
Constructs a NURBS curve using the specified control points, weights, knots, and degree.
Parameters
points(IVector[]): The control points of the curve.weightsList(number[]): The weights associated with each control point.knotsList(number[]): The knot vector of the curve.degree(number): The degree of the curve.
Returns
A Curve object representing the constructed NURBS curve.
Example
Static Method: polygon
Generates a polygon shape with the specified radius and number of sides.
Parameters
radius(number): The radius of the polygon.countOfSides(number): The number of sides of the polygon.origin(IVector): The origin point of the polygon.
Returns
A Curve object representing the generated polygon curve.
Example
Static Method: polygonEdge
Generates a polygon from a single edge.
Parameters
start(IVector): The starting point of the edge.end(IVector): The ending point of the edge.planePoint(IVector): A point on the plane in which the edge lies.countOfSides(number): The number of sides of the polygon.
Returns
An object containing the generated polygon curve, the origin of the circle that circumscribes the polygon, the radius of the circumscribed circle, and the radius of the inscribed circle.
Example
Static Method: rectangle
Creates a rectangle curve.
Parameters
origin(IVector): The origin point of the rectangle.width(number): The width of the rectangle.length(number): The length of the rectangle.
Returns
A Curve object representing the rectangle curve.
Example
Static Method: rectangle2Pnt
Creates a rectangle curve based on two given points.
Parameters
pointA(IVector): The first corner point of the rectangle.pointB(IVector): The second corner point of the rectangle.
Returns
A Curve object representing the rectangle curve.
Example
Static Method: rectangleByCenter
Creates a rectangle by specifying the center point, width, and length.
Parameters
center(IVector): The center point of the rectangle.width(number): The width of the rectangle.length(number): The length of the rectangle.
Returns
A Curve object representing the rectangle.
Example
Static Method: rectangle3Pnt
Creates a rectangle in 3D space using three points.
Parameters
aPnt(IVector): The first corner point of the rectangle.bPnt(IVector): The second corner point of the rectangle.cPnt(IVector): The third point along the rectangle edge is opposite the first and second points.
Returns
A Curve object representing the rectangle.
Example
Static Method: star
Generates a star-shaped curve.
Parameters
origin(IVector): The origin point of the star.radiusIn(number): The radius of the inner points of the star.radiusOut(number): The radius of the outer points of the star.countOfSides(number): The number of sides of the star.
Returns
A Curve object representing the star-shaped curve.
Example
Static Method: blendCurve
Blends two curves together based on the given factors.
Parameters
curveA(ICurve): The first curve to blend.curveB(ICurve): The second curve to blend.factorA(number): The blending factor for curveA (0 to 1).factorB(number): The blending factor for curveB (0 to 1).
Returns
A Curve object representing the blended curve.
Example
Static Method: delaunayEdges
Generates Delaunay edges from a set of points.
Parameters
points(IVector[]): An array of Vector objects representing the points.
Returns
A Curve object representing the generated Delaunay edges.
Example
Static Method: voronoi2D
Computes the Voronoi diagram in 2D for a given set of points.
Parameters
points(IVector[]): An array of Vector objects representing the points.
Returns
An array of Curve objects representing the Voronoi diagram.
Example
Static Method: curveToSurface
Converts a curve to a surface.
Parameters
curve(ICurve): No description
Returns
The converted surface.