Class: Drawing
Defined in: draw.ts:51
Implements
Constructors
Constructor
new Drawing(innerShape): Drawing;
Defined in: draw.ts:54
Parameters
innerShape
Shape2D = null
Returns
Drawing
Drawing Modifications
chamfer()
chamfer(radius, filter?): Drawing;
Defined in: draw.ts:172
Creates a new drawing with some corners filletted, as specified by the radius and the corner finder function
Parameters
radius
number
filter?
(c) => CornerFinder
Returns
Drawing
cut()
cut(other): Drawing;
Defined in: draw.ts:133
Builds a new drawing by cuting another drawing into this one
Parameters
other
Drawing
Returns
Drawing
fillet()
fillet(radius, filter?): Drawing;
Defined in: draw.ts:161
Creates a new drawing with some corners filletted, as specified by the radius and the corner finder function
Parameters
radius
number
filter?
(c) => CornerFinder
Returns
Drawing
fuse()
fuse(other): Drawing;
Defined in: draw.ts:142
Builds a new drawing by merging another drawing into this one
Parameters
other
Drawing
Returns
Drawing
intersect()
intersect(other): Drawing;
Defined in: draw.ts:151
Builds a new drawing by intersection this drawing with another
Parameters
other
Drawing
Returns
Drawing
Other
blueprint
Get Signature
get blueprint(): Blueprint;
Defined in: draw.ts:234
Returns
boundingBox
Get Signature
get boundingBox(): BoundingBox2d;
Defined in: draw.ts:88
Returns
Implementation of
repr
Get Signature
get repr(): string;
Defined in: draw.ts:97
Returns
string
approximate()
approximate(target, options): Drawing;
Defined in: draw.ts:224
Parameters
target
"svg" | "arcs"
options
ApproximationOptions = {}
Returns
Drawing
clone()
clone(): Drawing;
Defined in: draw.ts:58
Returns
Drawing
Implementation of
mirror()
mirror(
centerOrDirection,
origin?,
mode?): Drawing;
Defined in: draw.ts:119
Returns the mirror image of this drawing made with a single point (in center mode, the default, or a plane, (plane mode, with both direction and origin of the plane).
Parameters
centerOrDirection
origin?
mode?
"center" | "plane"
Returns
Drawing
Implementation of
offset()
offset(distance, offsetConfig): Drawing;
Defined in: draw.ts:220
Parameters
distance
number
offsetConfig
Offset2DConfig = {}
Returns
Drawing
punchHole()
punchHole(
shape,
faceFinder,
options): AnyShape;
Defined in: draw.ts:195
Parameters
shape
faceFinder
options
draftAngle?
number
height?
number
origin?
Returns
rotate()
rotate(angle, center?): Drawing;
Defined in: draw.ts:102
Parameters
angle
number
center?
Returns
Drawing
Implementation of
scale()
scale(scaleFactor, center?): Drawing;
Defined in: draw.ts:114
Parameters
scaleFactor
number
center?
Returns
Drawing
serialize()
serialize(): string;
Defined in: draw.ts:62
Returns
string
sketchOnFace()
sketchOnFace(face, scaleMode):
| SketchInterface
| Sketches;
Defined in: draw.ts:190
Returns the sketched version of the drawing, on a face.
The scale mode corresponds to the way the coordinates of the drawing are interpreted match with the face:
originaluses global coordinates (1mm in the drawing is 1mm on the face). This is the default, but currently supported only for planar and circular facesboundsnormalises the UV parameters on the face to [0,1] intervals.nativeuses the default UV parameters of opencascade
Parameters
face
scaleMode
Returns
Implementation of
sketchOnPlane()
Call Signature
sketchOnPlane(inputPlane):
| SketchInterface
| Sketches;
Defined in: draw.ts:177
Returns the sketched version of the drawing, on a plane
Parameters
inputPlane
Returns
Implementation of
DrawingInterface.sketchOnPlane
Call Signature
sketchOnPlane(inputPlane?, origin?):
| SketchInterface
| Sketches;
Defined in: draw.ts:178
Parameters
inputPlane?
origin?
number | Point
Returns
Implementation of
DrawingInterface.sketchOnPlane
stretch()
stretch(
ratio,
direction,
origin): Drawing;
Defined in: draw.ts:92
Parameters
ratio
number
direction
origin
Returns
Drawing
Implementation of
toSVG()
toSVG(margin?): string;
Defined in: draw.ts:208
Formats the drawing as an SVG image
Parameters
margin?
number
Returns
string
Implementation of
toSVGPaths()
toSVGPaths(): string[] | string[][];
Defined in: draw.ts:216
Formats the drawing as a list of SVG paths
Returns
string[] | string[][]
Implementation of
toSVGViewBox()
toSVGViewBox(margin): string;
Defined in: draw.ts:212
Returns the SVG viewbox that corresponds to this drawing
Parameters
margin
number = 1
Returns
string
Implementation of
translate()
Call Signature
translate(xDist, yDist): Drawing;
Defined in: draw.ts:107
Parameters
xDist
number
yDist
number
Returns
Drawing
Implementation of
Call Signature
translate(translationVector): Drawing;
Defined in: draw.ts:108
Parameters
translationVector
Returns
Drawing