Skip to main content

Class: Blueprint

A Blueprint is an abstract Sketch, a 2D set of curves that can then be sketched on different surfaces (faces or planes)

You should create them by "sketching" with a BlueprintSketcher

Implements

Constructors

constructor

new Blueprint(curves)

Parameters

NameType
curvesCurve2D[]

Defined in

blueprints/Blueprint.ts:42

Properties

curves

curves: Curve2D[]

Defined in

blueprints/Blueprint.ts:40

Accessors

boundingBox

get boundingBox(): BoundingBox2d

Returns

BoundingBox2d

Implementation of

DrawingInterface.boundingBox

Defined in

blueprints/Blueprint.ts:56


firstPoint

get firstPoint(): Point2D

Returns

Point2D

Defined in

blueprints/Blueprint.ts:185


lastPoint

get lastPoint(): Point2D

Returns

Point2D

Defined in

blueprints/Blueprint.ts:189

Methods

clone

clone(): Blueprint

Returns

Blueprint

Implementation of

DrawingInterface.clone

Defined in

blueprints/Blueprint.ts:52


delete

delete(): void

Returns

void

Defined in

blueprints/Blueprint.ts:47


intersects

intersects(other): boolean

Parameters

NameType
otherBlueprint

Returns

boolean

Defined in

blueprints/Blueprint.ts:213


isClosed

isClosed(): boolean

Returns

boolean

Defined in

blueprints/Blueprint.ts:209


isInside

isInside(point): boolean

Parameters

NameType
pointPoint2D

Returns

boolean

Defined in

blueprints/Blueprint.ts:193


mirror

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

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

NameTypeDefault value
centerOrDirectionPoint2Dundefined
originPoint2Dundefined
mode"center" | "plane""center"

Returns

Blueprint

Implementation of

DrawingInterface.mirror

Defined in

blueprints/Blueprint.ts:96


rotate

rotate(angle, center): Blueprint

Parameters

NameType
anglenumber
centerPoint2D

Returns

Blueprint

Implementation of

DrawingInterface.rotate

Defined in

blueprints/Blueprint.ts:82


scale

scale(scaleFactor, center?): Blueprint

Parameters

NameType
scaleFactornumber
center?Point2D

Returns

Blueprint

Defined in

blueprints/Blueprint.ts:74


sketchOnFace

sketchOnFace(face, scaleMode?): Sketch

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
scaleMode?ScaleMode

Returns

Sketch

Implementation of

DrawingInterface.sketchOnFace

Defined in

blueprints/Blueprint.ts:127


sketchOnPlane

sketchOnPlane(inputPlane?, origin?): Sketch

Returns the sketched version of the drawing, on a plane

Parameters

NameType
inputPlane?Plane | PlaneName
origin?number | Point

Returns

Sketch

Implementation of

DrawingInterface.sketchOnPlane

Defined in

blueprints/Blueprint.ts:109


stretch

stretch(ratio, direction, origin?): Blueprint

Parameters

NameType
rationumber
directionPoint2D
originPoint2D

Returns

Blueprint

Implementation of

DrawingInterface.stretch

Defined in

blueprints/Blueprint.ts:63


toSVG

toSVG(margin?): string

Formats the drawing as an SVG image

Parameters

NameTypeDefault value
marginnumber1

Returns

string

Implementation of

DrawingInterface.toSVG

Defined in

blueprints/Blueprint.ts:181


toSVGPath

toSVGPath(): string

Returns

string

Defined in

blueprints/Blueprint.ts:169


toSVGPathD

toSVGPathD(): string

Returns

string

Defined in

blueprints/Blueprint.ts:155


toSVGPaths

toSVGPaths(): string[]

Formats the drawing as a list of SVG paths

Returns

string[]

Implementation of

DrawingInterface.toSVGPaths

Defined in

blueprints/Blueprint.ts:177


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

blueprints/Blueprint.ts:173


translate

translate(xDist, yDist): Blueprint

Parameters

NameType
xDistnumber
yDistnumber

Returns

Blueprint

Implementation of

DrawingInterface.translate

Defined in

blueprints/Blueprint.ts:89