Edge Operations
Use following methods of the cadlib object to create and manipulate edges.
A few methods also appear on the Path object, but difference is, methods on the Path object return current instance of Path, used for chaining.
Use methods below when you don’t want to build a set of edges incrementally.
edge
Creates a new edge.
Syntax
cadlib.edge()
Parameters
Takes no parameters
Returns
arc2p
Creates an edge representing an arc passing thru two points.
Syntax
cadlib.arc2p(center, axis, radius, p1,p2)
Parameters
Name | Type | Description |
---|---|---|
center | ||
axis | ||
radius | ||
p1 | ||
p2 |
Returns
arcEllipse
Creates an edge representing an ellipitcal arc.
Syntax
cadlib.ellipse(center, axis, majorRadius, minorRadius, p1,p2)
Parameters
Name | Type | Description |
---|---|---|
center | ||
axis | ||
majorRadius | ||
minorRadius | ||
p1 | ||
p2 |
Returns
_bezierCurve
Creates an edge representing bezier curve
Syntax
cadlib.bezierCurve(poles, weights)
Parameters
Name | Type | Description |
---|---|---|
poles | Array | array of startpoint, control-points and endpoint |
weights |
Returns
helix
Creates an edge representing helix.
Syntax
cadlib.helix(options)
Parameters
Options object -
Name | Type | Description |
---|---|---|
pitch | Number | Defaults to 1.0 |
height | Number | Defaults to 5.0 |
face | {Face}[./] | |
radius | Number | Defaults to 5 |
leftHanded | Boolean | True, if left handeded helix |
longVersion | Boolean | True, if it is a long version |
Returns
bsplineCurve
Creates an edge from the spline curve.
Syntax
cadlib.helix(poles, weights, knots, multiplicities, degree, rational);
Parameters
Options object -
Name | Type | Description |
---|
Returns
interpolateSplineCurve
Creates an edge from a spline built by interpolating the points.
Syntax
cadlib.helix(points, periodic, tolerance, startTangent, endTangent);
Parameters
Options object -
Name | Type | Description |
---|
Returns
edgesFromSVG
edgeFromSVGPath