Skip to main content

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

Properties

_guessedOrientation

Private _guessedOrientation: null | "clockwise" | "counterClockwise"

Defined in

blueprints/Blueprint.ts:45


_orientation

Private _orientation: null | "clockwise" | "counterClockwise"

Defined in

blueprints/Blueprint.ts:44


curves

curves: Curve2D[]

Defined in

blueprints/Blueprint.ts:42

Accessors

boundingBox

get boundingBox(): BoundingBox2d

Returns

BoundingBox2d

Implementation of

DrawingInterface.boundingBox

Defined in

blueprints/Blueprint.ts:67


firstPoint

get firstPoint(): Point2D

Returns

Point2D

Defined in

blueprints/Blueprint.ts:231


lastPoint

get lastPoint(): Point2D

Returns

Point2D

Defined in

blueprints/Blueprint.ts:235


orientation

get orientation(): "clockwise" | "counterClockwise"

Returns

"clockwise" | "counterClockwise"

Defined in

blueprints/Blueprint.ts:74


repr

get repr(): string

Returns

string

Defined in

blueprints/Blueprint.ts:63

Methods

clone

clone(): Blueprint

Returns

Blueprint

Implementation of

DrawingInterface.clone

Defined in

blueprints/Blueprint.ts:59


delete

delete(): void

Returns

void

Defined in

blueprints/Blueprint.ts:54


intersects

intersects(other): boolean

Parameters

NameType
otherBlueprint

Returns

boolean

Defined in

blueprints/Blueprint.ts:265


isClosed

isClosed(): boolean

Returns

boolean

Defined in

blueprints/Blueprint.ts:261


isInside

isInside(point): boolean

Parameters

NameType
pointPoint2D

Returns

boolean

Defined in

blueprints/Blueprint.ts:239


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


rotate

rotate(angle, center?): Blueprint

Parameters

NameType
anglenumber
center?Point2D

Returns

Blueprint

Implementation of

DrawingInterface.rotate

Defined in

blueprints/Blueprint.ts:118


scale

scale(scaleFactor, center?): Blueprint

Parameters

NameType
scaleFactornumber
center?Point2D

Returns

Blueprint

Defined in

blueprints/Blueprint.ts:110


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


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


stretch

stretch(ratio, direction, origin?): Blueprint

Parameters

NameType
rationumber
directionPoint2D
originPoint2D

Returns

Blueprint

Implementation of

DrawingInterface.stretch

Defined in

blueprints/Blueprint.ts:99


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


toSVGPath

toSVGPath(): string

Returns

string

Defined in

blueprints/Blueprint.ts:215


toSVGPathD

toSVGPathD(): string

Returns

string

Defined in

blueprints/Blueprint.ts:199


toSVGPaths

toSVGPaths(): string[]

Formats the drawing as a list of SVG paths

Returns

string[]

Implementation of

DrawingInterface.toSVGPaths

Defined in

blueprints/Blueprint.ts:223


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


translate

translate(xDist, yDist): Blueprint

Parameters

NameType
xDistnumber
yDistnumber

Returns

Blueprint

Implementation of

DrawingInterface.translate

Defined in

blueprints/Blueprint.ts:125

translate(translationVector): Blueprint

Parameters

NameType
translationVectorPoint2D

Returns

Blueprint

Implementation of

DrawingInterface.translate

Defined in

blueprints/Blueprint.ts:126