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

Properties

_guessedOrientation

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

Defined in

blueprints/Blueprint.ts:44


_orientation

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

Defined in

blueprints/Blueprint.ts:43


curves

curves: Curve2D[]

Defined in

blueprints/Blueprint.ts:41

Accessors

boundingBox

get boundingBox(): BoundingBox2d

Returns

BoundingBox2d

Implementation of

DrawingInterface.boundingBox

Defined in

blueprints/Blueprint.ts:66


firstPoint

get firstPoint(): Point2D

Returns

Point2D

Defined in

blueprints/Blueprint.ts:238


lastPoint

get lastPoint(): Point2D

Returns

Point2D

Defined in

blueprints/Blueprint.ts:242


orientation

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

Returns

"clockwise" | "counterClockwise"

Defined in

blueprints/Blueprint.ts:73


repr

get repr(): string

Returns

string

Defined in

blueprints/Blueprint.ts:62

Methods

clone

clone(): Blueprint

Returns

Blueprint

Implementation of

DrawingInterface.clone

Defined in

blueprints/Blueprint.ts:58


delete

delete(): void

Returns

void

Defined in

blueprints/Blueprint.ts:53


intersects

intersects(other): boolean

Parameters

NameType
otherBlueprint

Returns

boolean

Defined in

blueprints/Blueprint.ts:272


isClosed

isClosed(): boolean

Returns

boolean

Defined in

blueprints/Blueprint.ts:268


isInside

isInside(point): boolean

Parameters

NameType
pointPoint2D

Returns

boolean

Defined in

blueprints/Blueprint.ts:246


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


rotate

rotate(angle, center?): Blueprint

Parameters

NameType
anglenumber
center?Point2D

Returns

Blueprint

Implementation of

DrawingInterface.rotate

Defined in

blueprints/Blueprint.ts:117


scale

scale(scaleFactor, center?): Blueprint

Parameters

NameType
scaleFactornumber
center?Point2D

Returns

Blueprint

Defined in

blueprints/Blueprint.ts:109


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


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


stretch

stretch(ratio, direction, origin?): Blueprint

Parameters

NameType
rationumber
directionPoint2D
originPoint2D

Returns

Blueprint

Implementation of

DrawingInterface.stretch

Defined in

blueprints/Blueprint.ts:98


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


toSVGPath

toSVGPath(): string

Returns

string

Defined in

blueprints/Blueprint.ts:222


toSVGPathD

toSVGPathD(): string

Returns

string

Defined in

blueprints/Blueprint.ts:198


toSVGPaths

toSVGPaths(): string[]

Formats the drawing as a list of SVG paths

Returns

string[]

Implementation of

DrawingInterface.toSVGPaths

Defined in

blueprints/Blueprint.ts:230


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


translate

translate(xDist, yDist): Blueprint

Parameters

NameType
xDistnumber
yDistnumber

Returns

Blueprint

Implementation of

DrawingInterface.translate

Defined in

blueprints/Blueprint.ts:124

translate(translationVector): Blueprint

Parameters

NameType
translationVectorPoint2D

Returns

Blueprint

Implementation of

DrawingInterface.translate

Defined in

blueprints/Blueprint.ts:125