Skip to main content

Drawing

Implements

Constructors

constructor

new Drawing(innerShape?)

Parameters

NameTypeDefault value
innerShapeShape2Dnull

Defined in

draw.ts:40

Properties

innerShape

Private innerShape: Shape2D

Defined in

draw.ts:38

Accessors

blueprint

get blueprint(): Blueprint

Returns

Blueprint

Defined in

draw.ts:171


boundingBox

get boundingBox(): BoundingBox2d

Returns

BoundingBox2d

Implementation of

DrawingInterface.boundingBox

Defined in

draw.ts:48


repr

get repr(): string

Returns

string

Defined in

draw.ts:57

Drawing Modifications Methods

chamfer

chamfer(radius, filter?): Drawing

Creates a new drawing with some corners filletted, as specified by the radius and the corner finder function

Parameters

NameType
radiusnumber
filter?(c: CornerFinder) => CornerFinder

Returns

Drawing

Defined in

draw.ts:132


cut

cut(other): Drawing

Builds a new drawing by cuting another drawing into this one

Parameters

NameType
otherDrawing

Returns

Drawing

Defined in

draw.ts:93


fillet

fillet(radius, filter?): Drawing

Creates a new drawing with some corners filletted, as specified by the radius and the corner finder function

Parameters

NameType
radiusnumber
filter?(c: CornerFinder) => CornerFinder

Returns

Drawing

Defined in

draw.ts:121


fuse

fuse(other): Drawing

Builds a new drawing by merging another drawing into this one

Parameters

NameType
otherDrawing

Returns

Drawing

Defined in

draw.ts:102


intersect

intersect(other): Drawing

Builds a new drawing by intersection this drawing with another

Parameters

NameType
otherDrawing

Returns

Drawing

Defined in

draw.ts:111


Other Methods

clone

clone(): Drawing

Returns

Drawing

Implementation of

DrawingInterface.clone

Defined in

draw.ts:44


mirror

mirror(centerOrDirection, origin?, mode?): Drawing

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

NameType
centerOrDirectionPoint2D
origin?Point2D
mode?"center" | "plane"

Returns

Drawing

Implementation of

DrawingInterface.mirror

Defined in

draw.ts:79


offset

offset(distance): Drawing

Parameters

NameType
distancenumber

Returns

Drawing

Defined in

draw.ts:167


rotate

rotate(angle, center?): Drawing

Parameters

NameType
anglenumber
center?Point2D

Returns

Drawing

Implementation of

DrawingInterface.rotate

Defined in

draw.ts:62


scale

scale(scaleFactor, center?): Drawing

Parameters

NameType
scaleFactornumber
center?Point2D

Returns

Drawing

Defined in

draw.ts:74


sketchOnFace

sketchOnFace(face, scaleMode): SketchInterface | Sketches

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:

  • original uses global coordinates (1mm in the drawing is 1mm on the face). This is the default, but currently supported only for planar and circular faces
  • bounds normalises the UV parameters on the face to [0,1] intervals.
  • native uses the default UV parameters of opencascade

Parameters

NameType
faceFace
scaleModeScaleMode

Returns

SketchInterface | Sketches

Implementation of

DrawingInterface.sketchOnFace

Defined in

draw.ts:150


sketchOnPlane

sketchOnPlane(inputPlane): SketchInterface | Sketches

Returns the sketched version of the drawing, on a plane

Parameters

NameType
inputPlanePlane

Returns

SketchInterface | Sketches

Implementation of

DrawingInterface.sketchOnPlane

Defined in

draw.ts:137

sketchOnPlane(inputPlane?, origin?): SketchInterface | Sketches

Parameters

NameType
inputPlane?PlaneName
origin?number | Point

Returns

SketchInterface | Sketches

Implementation of

DrawingInterface.sketchOnPlane

Defined in

draw.ts:138


stretch

stretch(ratio, direction, origin): Drawing

Parameters

NameType
rationumber
directionPoint2D
originPoint2D

Returns

Drawing

Implementation of

DrawingInterface.stretch

Defined in

draw.ts:52


toSVG

toSVG(margin?): string

Formats the drawing as an SVG image

Parameters

NameType
margin?number

Returns

string

Implementation of

DrawingInterface.toSVG

Defined in

draw.ts:155


toSVGPaths

toSVGPaths(): string[] | string[][]

Formats the drawing as a list of SVG paths

Returns

string[] | string[][]

Implementation of

DrawingInterface.toSVGPaths

Defined in

draw.ts:163


toSVGViewBox

toSVGViewBox(margin?): string

Returns the SVG viewbox that corresponds to this drawing

Parameters

NameTypeDefault value
marginnumber1

Returns

string

Implementation of

DrawingInterface.toSVGViewBox

Defined in

draw.ts:159


translate

translate(xDist, yDist): Drawing

Parameters

NameType
xDistnumber
yDistnumber

Returns

Drawing

Implementation of

DrawingInterface.translate

Defined in

draw.ts:67

translate(translationVector): Drawing

Parameters

NameType
translationVectorPoint2D

Returns

Drawing

Implementation of

DrawingInterface.translate

Defined in

draw.ts:68