Skip to main content

Class: Drawing

Implements​

Constructors​

constructor​

• new Drawing(innerShape?)

Parameters​

NameTypeDefault value
innerShapeShape2Dnull

Defined in​

draw.ts:29

Properties​

innerShape​

• Private innerShape: Shape2D

Defined in​

draw.ts:27

Accessors​

boundingBox​

• get boundingBox(): BoundingBox2d

Returns​

BoundingBox2d

Implementation of​

DrawingInterface.boundingBox

Defined in​

draw.ts:37

Methods​

clone​

▸ clone(): Drawing

Returns​

Drawing

Implementation of​

DrawingInterface.clone

Defined in​

draw.ts:33


cut​

▸ cut(other): Drawing

Parameters​

NameType
otherDrawing

Returns​

Drawing

Defined in​

draw.ts:82


fuse​

▸ fuse(other): Drawing

Parameters​

NameType
otherDrawing

Returns​

Drawing

Defined in​

draw.ts:86


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:55


rotate​

▸ rotate(angle, center): Drawing

Parameters​

NameType
anglenumber
centerPoint2D

Returns​

Drawing

Implementation of​

DrawingInterface.rotate

Defined in​

draw.ts:46


sketchOnFace​

▸ sketchOnFace(face, scaleMode): Sketches | SketchInterface

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​

Sketches | SketchInterface

Implementation of​

DrawingInterface.sketchOnFace

Defined in​

draw.ts:77


sketchOnPlane​

▸ sketchOnPlane(inputPlane): Sketches | SketchInterface

Returns the sketched version of the drawing, on a plane

Parameters​

NameType
inputPlanePlane

Returns​

Sketches | SketchInterface

Implementation of​

DrawingInterface.sketchOnPlane

Defined in​

draw.ts:64

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

Parameters​

NameType
inputPlane?PlaneName
origin?number | Point

Returns​

Sketches | SketchInterface

Implementation of​

DrawingInterface.sketchOnPlane

Defined in​

draw.ts:65


stretch​

▸ stretch(ratio, direction, origin): Drawing

Parameters​

NameType
rationumber
directionPoint2D
originPoint2D

Returns​

Drawing

Implementation of​

DrawingInterface.stretch

Defined in​

draw.ts:41


toSVG​

▸ toSVG(margin): string

Formats the drawing as an SVG image

Parameters​

NameType
marginnumber

Returns​

string

Implementation of​

DrawingInterface.toSVG

Defined in​

draw.ts:90


toSVGPaths​

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

Formats the drawing as a list of SVG paths

Returns​

string[] | string[][]

Implementation of​

DrawingInterface.toSVGPaths

Defined in​

draw.ts:98


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:94


translate​

▸ translate(xDist, yDist): Drawing

Parameters​

NameType
xDistnumber
yDistnumber

Returns​

Drawing

Implementation of​

DrawingInterface.translate

Defined in​

draw.ts:50