Class representing a Curve.
Implements
Extends
Implements
Curve
Constructors
new Curve()
new Curve(
shape
):Curve
Creates an instance of Geometry.
Parameters
• shape: TopoDS_Shape
The geometric shape.
Returns
Inherited from
Accessors
edges
get
edges():TopoDS_Edge
[]
Gets the edges of the curve.
Returns
TopoDS_Edge
[]
Implementation of
ICurve.edges
shape
get
shape():TopoDS_Shape
Gets the geometric shape.
set
shape(shape
):void
Sets the geometric shape.
Parameters
• shape: TopoDS_Shape
The new geometric shape.
Returns
TopoDS_Shape
Implementation of
ICurve.shape
Inherited from
type
get
type():Type
Gets the type of the curve.
Returns
Type
The type of the curve.
Implementation of
ICurve.type
wires
get
wires():TopoDS_Wire
[]
Gets the wires of the curve.
Returns
TopoDS_Wire
[]
Implementation of
ICurve.wires
Methods
area()
area():
number
Gets the area of the curve.
Returns
number
The area of the curve.
Implementation of
ICurve.area
bBox()
bBox():
object
Gets the bounding box of the curve.
Returns
object
An object containing width, length, height, area, center, and boundingBox.
area
area:
number
boundingBox
boundingBox:
object
boundingBox.max
max:
Vector
=boundingMax
boundingBox.min
min:
Vector
=boundingMin
center
center:
Vector
height
height:
number
length
length:
number
width
width:
number
Implementation of
ICurve.bBox
centerOfMAss()
centerOfMAss():
Vector
Gets the center of mass of the curve.
Returns
The center of mass point vector.
Implementation of
ICurve.centerOfMAss
chamfer()
chamfer(
distance1
,distance2
):Curve
Chamfers the curve.
Parameters
• distance1: number
The first distance for chamfer.
• distance2: number
The second distance for chamfer.
Returns
The chamfered curve.
Implementation of
ICurve.chamfer
changePlane()
changePlane(
source
,target
):Geometry
Changes the plane of the geometric shape.
Parameters
• source: Plane
The source plane.
• target: Plane
The target plane.
Returns
The geometry with the changed plane.
Implementation of
ICurve.changePlane
Inherited from
closestPoint()
closestPoint(
point
):object
Gets the closest point on the curve.
Parameters
• point: Vector
The point vector.
Returns
object
An object containing nearest and pointsArr.
nearest
nearest:
Vector
pointsArr
pointsArr:
Vector
[]
Implementation of
ICurve.closestPoint
contour()
contour(
point
,direction
,distance
):Vector
[]
Gets the contour of the curve.
Parameters
• point: Vector
The point vector.
• direction: Vector
The direction vector.
• distance: number
The distance.
Returns
Vector
[]
An array of points representing the contour.
Implementation of
ICurve.contour
controlPoints()
controlPoints():
object
Gets the control points of the curve.
Returns
object
An object containing points, knots, weights, and multiplicities.
knots
knots:
number
[]
multiplicities
multiplicities:
number
[]
points
points:
Vector
[]
weights
weights:
number
[]
Implementation of
ICurve.controlPoints
cullCurves()
cullCurves(
curves
):object
Culls duplicate curves.
Parameters
• curves: Curve
[]
The curves to cull.
Returns
object
An object containing culledCurves and duplicateIndexes.
culledCurves
culledCurves:
Curve
[]
duplicateIndexes
duplicateIndexes:
number
[]
Implementation of
ICurve.cullCurves
curveArray()
curveArray(
geometry
,count
):Geometry
[]
Creates an array of geometry along a curve.
Parameters
• geometry: Geometry
The geometry to array.
• count: number
The number of elements in the array.
Returns
Geometry
[]
An array of geometries.
Implementation of
ICurve.curveArray
curveLength()
curveLength():
number
Gets the length of the curve.
Returns
number
The length of the curve.
Implementation of
ICurve.curveLength
curvePlane()
curvePlane(
parameter
):Plane
Gets the curve plane at the given parameter.
Parameters
• parameter: number
The parameter value.
Returns
The curve plane.
Implementation of
ICurve.curvePlane
curvePlanes()
curvePlanes(
count
):object
Gets the curve planes.
Parameters
• count: number
The number of planes.
Returns
object
An object containing planes and parameters.
parameters
parameters:
number
[]
planes
planes:
Plane
[]
Implementation of
ICurve.curvePlanes
curveToPolyline()
curveToPolyline(
toleranceDist
,edge
):Curve
Converts the curve to a polyline.
Parameters
• toleranceDist: number
The tolerance distance.
• edge: number
The edge length.
Returns
The polyline curve.
Implementation of
ICurve.curveToPolyline
dashPattern()
dashPattern(
pattern
):object
Creates a dash pattern on the curve.
Parameters
• pattern: number
[]
The dash pattern.
Returns
object
An object containing dashes and gaps.
dashes
dashes:
Curve
[]
gaps
gaps:
Curve
[]
Implementation of
ICurve.dashPattern
deconstructArc()
deconstructArc():
object
Deconstructs the arc.
Returns
object
An object containing plane, radius, startAngle, and endAngle.
endAngle
endAngle:
number
plane
plane:
Plane
radius
radius:
number
startAngle
startAngle:
number
Implementation of
ICurve.deconstructArc
delete()
delete():
void
Deletes the geometric shape.
Returns
void
Inherited from
difference()
difference(...
geometries
):Curve
Gets the difference between the curve and other curves.
Parameters
• ...geometries: Geometry
[]
The curves to subtract.
Returns
The resulting curve.
Implementation of
ICurve.difference
discontinuity()
discontinuity():
Vector
[]
Gets the discontinuities in the curve.
Returns
Vector
[]
An array of points representing the discontinuities.
Implementation of
ICurve.discontinuity
divideByCount()
divideByCount(
count
):object
Divides the curve by count.
Parameters
• count: number
The number of divisions.
Returns
object
An object containing points, tangents, and parameters.
parameters
parameters:
number
[]
points
points:
Vector
[]
tangents
tangents:
Vector
[]
Implementation of
ICurve.divideByCount
divideByDistance()
divideByDistance(
step
):object
Divides the curve by distance.
Parameters
• step: number
The distance to divide by.
Returns
object
An object containing points, tangents, and parameters.
parameters
parameters:
number
[]
points
points:
Vector
[]
tangents
tangents:
Vector
[]
Implementation of
ICurve.divideByDistance
divideByLength()
divideByLength(
length
):object
Divides the curve by length.
Parameters
• length: number
The length to divide by.
Returns
object
An object containing points, tangents, and parameters.
parameters
parameters:
number
[]
points
points:
Vector
[]
tangents
tangents:
Vector
[]
Implementation of
ICurve.divideByLength
dump()
dump():
string
Dumps the details of the curve.
Returns
string
Implementation of
ICurve.dump
endPoint()
endPoint():
Vector
Gets the end point of the curve.
Returns
The end point vector.
Implementation of
ICurve.endPoint
evaluateCurve()
evaluateCurve(
parameter
,byLength
):object
Evaluates the curve.
Parameters
• parameter: number
The parameter value.
• byLength: boolean
Whether to evaluate by length.
Returns
object
An object containing point, vector1(first derivatives), and vector2(second derivatives).
point
point:
Vector
vector1
vector1:
Vector
vector2
vector2:
Vector
Implementation of
ICurve.evaluateCurve
explode()
explode(
recursive
):object
Explodes the curve.
Parameters
• recursive: boolean
Whether to explode recursively.
Returns
object
An object containing segments and points.
points
points:
Vector
[]
segments
segments:
Curve
[]
Implementation of
ICurve.explode
extremes()
extremes(
plane
):object
Gets the extremes of the curve.
Parameters
• plane: Plane
The plane to get extremes on.
Returns
object
An object containing highest and lowest points.
highest
highest:
Vector
lowest
lowest:
Vector
Implementation of
ICurve.extremes
extrude()
extrude(
direction
):Surface
Extrudes the curve in the given direction.
Parameters
• direction: Vector
The direction vector.
Returns
The extruded surface.
Implementation of
ICurve.extrude
faceNormal()
faceNormal():
Vector
Gets the normal of the face.
Returns
The normal vector.
fillet()
fillet(
filletRadius
):Curve
Fillets the curve.
Parameters
• filletRadius: number
The radius of the fillet.
Returns
The filleted curve.
Implementation of
ICurve.fillet
flip()
flip():
Curve
Flips the curve.
Returns
The flipped curve.
Implementation of
ICurve.flip
getDividedSegments()
getDividedSegments(
points
):Curve
[]
Gets the divided segments of the curve.
Parameters
• points: Vector
[]
The points to divide by.
Returns
Curve
[]
An array of segments.
Implementation of
ICurve.getDividedSegments
getEdges()
getEdges():
TopoDS_Edge
[]
Gets the edges of the curve.
Returns
TopoDS_Edge
[]
An array of edges.
Implementation of
ICurve.getEdges
getFace()
getFace():
TopoDS_Face
Gets the face of the curve.
Returns
TopoDS_Face
The face of the curve.
Implementation of
ICurve.getFace
getShape()
getShape():
TopoDS_Shape
Gets a copy of the geometric shape.
Returns
TopoDS_Shape
The copied shape.
Implementation of
ICurve.getShape
Inherited from
getWires()
getWires():
TopoDS_Wire
[]
Gets the wires of the curve.
Returns
TopoDS_Wire
[]
An array of wires.
Implementation of
ICurve.getWires
horizontalPlane()
horizontalPlane(
parameter
):Plane
Gets the horizontal plane at the given parameter.
Parameters
• parameter: number
The parameter value.
Returns
The horizontal plane.
Implementation of
ICurve.horizontalPlane
horizontalPlanes()
horizontalPlanes(
count
,align
):object
Gets the horizontal planes.
Parameters
• count: number
The number of planes.
• align: boolean
Whether to align the planes.
Returns
object
An object containing planes and parameters.
parameters
parameters:
number
[]
planes
planes:
Plane
[]
Implementation of
ICurve.horizontalPlanes
intersectCurve()
intersectCurve(
curve
):Vector
[]
Intersects the curve with another curve.
Parameters
• curve: Curve
The curve to intersect with.
Returns
Vector
[]
An array of intersection points.
Implementation of
ICurve.intersectCurve
intersectSolid()
intersectSolid(
solid
):Vector
[]
Intersects the solid with a curve.
Parameters
• solid: Solid
The solid to intersect with.
Returns
Vector
[]
An array of intersection points.
Implementation of
ICurve.intersectSolid
intersectSurface()
intersectSurface(
surface
):Vector
[]
Intersects the curve with a surface.
Parameters
• surface: Surface
The surface to intersect with.
Returns
Vector
[]
An array of intersection points.
Implementation of
ICurve.intersectSurface
intersection()
intersection(
geometries
):Curve
[]
Intersects the curve with other curves.
Parameters
• geometries: Geometry
[]
The curves to intersect with.
Returns
Curve
[]
An array of intersection curves.
Implementation of
ICurve.intersection
isArc()
isArc():
boolean
Checks if the curve is an arc.
Returns
boolean
True if the curve is an arc, false otherwise.
Implementation of
ICurve.isArc
isCircle()
isCircle():
boolean
Checks if the curve is a circle.
Returns
boolean
True if the curve is a circle, false otherwise.
Implementation of
ICurve.isCircle
isClosed()
isClosed():
boolean
Checks if the curve is closed.
Returns
boolean
True if the curve is closed, false otherwise.
Implementation of
ICurve.isClosed
isLine()
isLine():
boolean
Checks if the curve is a line.
Returns
boolean
True if the curve is a line, false otherwise.
Implementation of
ICurve.isLine
isPlanar()
isPlanar():
object
|object
Checks if the curve is planar.
Returns
object
| object
An object containing isPlaner, plane, and distance.
Implementation of
ICurve.isPlanar
isRectangle()
isRectangle():
boolean
Checks if the curve is a rectangle.
Returns
boolean
True if the curve is a rectangle, false otherwise.
Implementation of
ICurve.isRectangle
lengthParameter()
lengthParameter(
t
):object
Gets the length parameters.
Parameters
• t: number
The parameter value.
Returns
object
An object containing length1(Length from the start to t
) and length2(Length from t
to the end).
length1
length1:
number
length2
length2:
number
Implementation of
ICurve.lengthParameter
mirrorByCurve()
mirrorByCurve(
curve
):Curve
Mirrors the curve by another curve.
Parameters
• curve: Curve
The curve to mirror by.
Returns
The mirrored curve.
Implementation of
ICurve.mirrorByCurve
offset()
offset(
offsetSize
,side
,offsetType
):Curve
Offsets the curve.
Parameters
• offsetSize: number
The size of the offset.
• side: boolean
The side of the offset.
The type of the offset.
Returns
The offset curve.
Implementation of
ICurve.offset
perpPlane()
perpPlane(
parameter
):Plane
Gets the perpendicular plane at the given parameter.
Parameters
• parameter: number
The parameter value.
Returns
The perpendicular plane.
Implementation of
ICurve.perpPlane
perpPlanes()
perpPlanes(
count
,align
):object
Gets the perpendicular planes.
Parameters
• count: number
The number of planes.
• align: boolean
Whether to align the planes.
Returns
object
An object containing planes and parameters.
parameters
parameters:
number
[]
planes
planes:
Plane
[]
Implementation of
ICurve.perpPlanes
pointInCurve()
pointInCurve(
point
):object
Checks if a point is in the curve.
Parameters
• point: Vector
The point vector.
Returns
object
An object containing projectPoint and relationship.
projectPoint
projectPoint:
Vector
relationship
relationship:
number
=0
Implementation of
ICurve.pointInCurve
pointOnCurve()
pointOnCurve(
t
):Vector
Gets the point on the curve.
Parameters
• t: number
The parameter value.
Returns
The point vector.
Implementation of
ICurve.pointOnCurve
projectCurve()
projectCurve(
geometry
,direction
):Curve
[]
Projects the curve onto a geometry.
Parameters
• geometry: Geometry
The geometry to project onto.
• direction: Vector
The direction vector.
Returns
Curve
[]
An array of projected curves.
Implementation of
ICurve.projectCurve
proximity()
proximity(
curve
):object
Checks the proximity between the curve and another curve.
Parameters
• curve: Curve
The curve to check proximity with.
Returns
object
An object containing pointA, pointB, and distance.
distance
distance:
number
pointA
pointA:
Vector
pointB
pointB:
Vector
Implementation of
ICurve.proximity
rebuildCurve()
rebuildCurve(
degree
):Curve
Rebuilds the curve with the given degree.
Parameters
• degree: number
The degree of the curve.
Returns
The rebuilt curve.
Implementation of
ICurve.rebuildCurve
seam()
seam(
t
):Curve
Seams the curve.
Parameters
• t: number
The parameter value.
Returns
The seamed curve.
Implementation of
ICurve.seam
selfIntersect()
selfIntersect():
Vector
[]
Checks for self-intersections in the curve.
Returns
Vector
[]
An array of self-intersection points.
Implementation of
ICurve.selfIntersect
setPlane()
setPlane(
plane
?):Curve
Sets the plane for the geometric shape.
Parameters
• plane?: Plane
The plane to set.
Returns
The updated geometry.
Implementation of
ICurve.setPlane
Inherited from
startPoint()
startPoint():
Vector
Gets the start point of the curve.
Returns
The start point vector.
Implementation of
ICurve.startPoint
tween()
tween(
curve
,parameter
):Curve
Tweens the curve with another curve.
Parameters
• curve: Curve
The curve to tween with.
• parameter: number
The parameter value.
Returns
The tweened curve.
Implementation of
ICurve.tween
union()
union(
geometries
):Curve
Unions the curve with other curves.
Parameters
• geometries: Geometry
[]
The curves to union with.
Returns
The unioned curve.
Implementation of
ICurve.union
join()
static
join(curves
):Curve
[]
Joins multiple curves.
Parameters
• curves: Curve
[]
The curves to join.
Returns
Curve
[]
An array of joined curves.
render()
static
render(wire
,tolerance
):object
[][]
Renders the wire with the given tolerance.
Parameters
• wire: TopoDS_Wire
The wire to render.
• tolerance: number
The tolerance value.
Returns
object
[][]
An array of points.