Skip to main content

BlueprintSketcher

Sketchers allow the user to draw a two dimentional shape using segment of curve. You start by defining where you sketch will start (with the method movePointerTo. Each sketching method corresponds to drawing a curve of some type (line, arc, elliptic arc, bezier curve to a new point. The next segment will start from the end point of the previous segment. Once you end your sketch you will receive a Sketch object that allows you to give some three dimentionlity to your finished sketch.

Hierarchy

Implements

Constructors

constructor

new BlueprintSketcher(origin?)

Parameters

NameType
originPoint2D

Overrides

BaseSketcher2d.constructor

Defined in

Sketcher2d.ts:636

Methods

bezierCurveTo

bezierCurveTo(end, controlPoints): BlueprintSketcher

Draws a generic bezier curve to the end point, going using a set of control points.

This is the generic definition of a bézier curve, you might want to use either the quadratic or cubic (most common) version, unless you know exactly what you are aiming at.

Parameters

NameType
endPoint2D
controlPointsPoint2D | Point2D[]

Returns

BlueprintSketcher

Implementation of

GenericSketcher.bezierCurveTo

Inherited from

BaseSketcher2d.bezierCurveTo

Defined in

Sketcher2d.ts:378


bulgeArc

bulgeArc(xDist, yDist, bulge): BlueprintSketcher

Draws an arc of circle by defining its end point and the bulge - the maximum distance between the arc and the straight line going from start to end point in units of half the chord. The end point is defined by its horizontal and vertical distances from the start point.

Parameters

NameType
xDistnumber
yDistnumber
bulgenumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.bulgeArc

Inherited from

BaseSketcher2d.bulgeArc

Defined in

Sketcher2d.ts:226


bulgeArcTo

bulgeArcTo(end, bulge): BlueprintSketcher

Draws an arc of circle by defining its end point and the bulge - the maximum distance between the arc and the straight line going from start to end point.

Parameters

NameType
endPoint2D
bulgenumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.bulgeArcTo

Inherited from

BaseSketcher2d.bulgeArcTo

Defined in

Sketcher2d.ts:218


close

close(): Blueprint

Stop drawing, make sure the sketch is closed (by adding a straight line to from the last point to the first) and returns the sketch.

Returns

Blueprint

Implementation of

GenericSketcher.close

Defined in

Sketcher2d.ts:648


closeWithCustomCorner

closeWithCustomCorner(radius, mode?): Blueprint

Stop drawing, make sure the sketch is closed (by adding a straight line to from the last point to the first), add a fillet between the last and the first segments and returns the sketch.

Parameters

NameTypeDefault value
radiusnumberundefined
mode"fillet" | "chamfer""fillet"

Returns

Blueprint

Defined in

Sketcher2d.ts:664


closeWithMirror

closeWithMirror(): Blueprint

Stop drawing, make sure the sketch is closed (by mirroring the lines between the first and last points drawn) and returns the sketch.

Returns

Blueprint

Implementation of

GenericSketcher.closeWithMirror

Defined in

Sketcher2d.ts:653


cubicBezierCurveTo

cubicBezierCurveTo(end, startControlPoint, endControlPoint): BlueprintSketcher

Draws a cubic bezier curve to the end point, using the start and end control point to define its shape. This corresponds to the most commonly used bezier curve.

If you are struggling setting your control points, the smoothSpline might be better for your needs.

Parameters

NameType
endPoint2D
startControlPointPoint2D
endControlPointPoint2D

Returns

BlueprintSketcher

Implementation of

GenericSketcher.cubicBezierCurveTo

Inherited from

BaseSketcher2d.cubicBezierCurveTo

Defined in

Sketcher2d.ts:402


customCorner

customCorner(radius, mode?): BlueprintSketcher

Changes the corner between the previous and next segments.

Parameters

NameTypeDefault value
radiusnumberundefined
mode"fillet" | "chamfer""fillet"

Returns

BlueprintSketcher

Inherited from

BaseSketcher2d.customCorner

Defined in

Sketcher2d.ts:465


done

done(): Blueprint

Stop drawing and returns the sketch.

Returns

Blueprint

Implementation of

GenericSketcher.done

Defined in

Sketcher2d.ts:644


ellipse

ellipse(xDist, yDist, horizontalRadius, verticalRadius, rotation?, longAxis?, sweep?): BlueprintSketcher

Draws an arc of ellipse by defining its end point and an ellipse. The end point is defined by distances from he start point.

The shape of the ellipse is defined by both its radiuses, its angle relative to the current coordinat system, as well as the long and sweep flags (as defined for SVG paths)

Parameters

NameTypeDefault value
xDistnumberundefined
yDistnumberundefined
horizontalRadiusnumberundefined
verticalRadiusnumberundefined
rotationnumber0
longAxisbooleanfalse
sweepbooleanfalse

Returns

BlueprintSketcher

Implementation of

GenericSketcher.ellipse

Inherited from

BaseSketcher2d.ellipse

Defined in

Sketcher2d.ts:334


ellipseTo

ellipseTo(end, horizontalRadius, verticalRadius, rotation?, longAxis?, sweep?): BlueprintSketcher

Draws an arc of ellipse by defining its end point and an ellipse.

The shape of the ellipse is defined by both its radiuses, its angle relative to the current coordinat system, as well as the long and sweep flags (as defined for SVG paths)

Parameters

NameTypeDefault value
endPoint2Dundefined
horizontalRadiusnumberundefined
verticalRadiusnumberundefined
rotationnumber0
longAxisbooleanfalse
sweepbooleanfalse

Returns

BlueprintSketcher

Implementation of

GenericSketcher.ellipseTo

Inherited from

BaseSketcher2d.ellipseTo

Defined in

Sketcher2d.ts:266


hBulgeArc

hBulgeArc(distance, bulge): BlueprintSketcher

Draws an horizontal arc of circle by defining its end point and the bulge

  • the maximum distance between the arc and the straight line going from start to end point in units of half the chord. The end point is defined by its horizontal distance from the start point.

Parameters

NameType
distancenumber
bulgenumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.hBulgeArc

Inherited from

BaseSketcher2d.hBulgeArc

Defined in

Sketcher2d.ts:237


hLine

hLine(distance): BlueprintSketcher

Draws an horizontal line of length distance from the current point

Parameters

NameType
distancenumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.hLine

Inherited from

BaseSketcher2d.hLine

Defined in

Sketcher2d.ts:113


hLineTo

hLineTo(xPos): BlueprintSketcher

Draws an horizontal line to the x coordinate

Parameters

NameType
xPosnumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.hLineTo

Inherited from

BaseSketcher2d.hLineTo

Defined in

Sketcher2d.ts:121


hSagittaArc

hSagittaArc(distance, sagitta): BlueprintSketcher

Draws an horizontal arc of circle by defining its end point and the sagitta - the maximum distance between the arc and the straight line going from start to end point.The end point is defined by its horizontal distance from the start point.

Parameters

NameType
distancenumber
sagittanumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.hSagittaArc

Inherited from

BaseSketcher2d.hSagittaArc

Defined in

Sketcher2d.ts:214


halfEllipse

halfEllipse(xDist, yDist, minorRadius, sweep?): BlueprintSketcher

Draws an arc as half an ellipse, defined by the sagitta of the ellipse (which corresponds to the radius in the axe orthogonal to the straight line).The end point is defined by distances from he start point.

The sweep flag is to be understood as defined for SVG paths.

Parameters

NameTypeDefault value
xDistnumberundefined
yDistnumberundefined
minorRadiusnumberundefined
sweepbooleanfalse

Returns

BlueprintSketcher

Implementation of

GenericSketcher.halfEllipse

Inherited from

BaseSketcher2d.halfEllipse

Defined in

Sketcher2d.ts:368


halfEllipseTo

halfEllipseTo(end, minorRadius, sweep?): BlueprintSketcher

Draws an arc as half an ellipse, defined by the sagitta of the ellipse (which corresponds to the radius in the axe orthogonal to the straight line).

The sweep flag is to be understood as defined for SVG paths.

Parameters

NameTypeDefault value
endPoint2Dundefined
minorRadiusnumberundefined
sweepbooleanfalse

Returns

BlueprintSketcher

Implementation of

GenericSketcher.halfEllipseTo

Inherited from

BaseSketcher2d.halfEllipseTo

Defined in

Sketcher2d.ts:354


line

line(xDist, yDist): BlueprintSketcher

Draws a line at the horizontal distance xDist and the vertical distance yDist of the current point

Parameters

NameType
xDistnumber
yDistnumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.line

Inherited from

BaseSketcher2d.line

Defined in

Sketcher2d.ts:105


lineTo

lineTo(point): BlueprintSketcher

Draws a line from the current point to the point given in argument

Parameters

NameType
pointPoint2D

Returns

BlueprintSketcher

Implementation of

GenericSketcher.lineTo

Inherited from

BaseSketcher2d.lineTo

Defined in

Sketcher2d.ts:95


movePointerTo

movePointerTo(point): BlueprintSketcher

Changes the point to start your drawing from

Parameters

NameType
pointPoint2D

Returns

BlueprintSketcher

Implementation of

GenericSketcher.movePointerTo

Inherited from

BaseSketcher2d.movePointerTo

Defined in

Sketcher2d.ts:66


polarLine

polarLine(distance, angle): BlueprintSketcher

Draws a line from the current point to the point defined in polar coordiates, of radius r and angle theta (in degrees) from the current point

Parameters

NameType
distancenumber
anglenumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.polarLine

Inherited from

BaseSketcher2d.polarLine

Defined in

Sketcher2d.ts:131


polarLineTo

polarLineTo(«destructured»): BlueprintSketcher

Draws a line from the current point to the point defined in polar coordiates, of radius r and angle theta (in degrees) from the origin

Parameters

NameType
«destructured»Point2D

Returns

BlueprintSketcher

Implementation of

GenericSketcher.polarLineTo

Inherited from

BaseSketcher2d.polarLineTo

Defined in

Sketcher2d.ts:125


quadraticBezierCurveTo

quadraticBezierCurveTo(end, controlPoint): BlueprintSketcher

Draws a quadratic bezier curve to the end point, using the single control point.

Parameters

NameType
endPoint2D
controlPointPoint2D

Returns

BlueprintSketcher

Implementation of

GenericSketcher.quadraticBezierCurveTo

Inherited from

BaseSketcher2d.quadraticBezierCurveTo

Defined in

Sketcher2d.ts:398


sagittaArc

sagittaArc(xDist, yDist, sagitta): BlueprintSketcher

Draws an arc of circle by defining its end point and the sagitta - the maximum distance between the arc and the straight line going from start to end point.The end point is defined by its horizontal and vertical distances from the start point.

Parameters

NameType
xDistnumber
yDistnumber
sagittanumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.sagittaArc

Inherited from

BaseSketcher2d.sagittaArc

Defined in

Sketcher2d.ts:203


sagittaArcTo

sagittaArcTo(end, sagitta): BlueprintSketcher

Draws an arc of circle by defining its end point and the sagitta - the maximum distance between the arc and the straight line going from start to end point.

Parameters

NameType
endPoint2D
sagittanumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.sagittaArcTo

Inherited from

BaseSketcher2d.sagittaArcTo

Defined in

Sketcher2d.ts:176


smoothSpline

smoothSpline(xDist, yDist, splineConfig?): BlueprintSketcher

Draws a cubic bezier curve to the end point, attempting to make the line smooth with the previous segment. The end point is defined by its distance to the first point.

It will base its first control point so that its tangent is the same than the previous segment. You can force another tangent by defining startTangent.

You can configure the tangent of the end point by configuring the endTangent, either as "symmetric" to reproduce the start angle, as an angle from the X axis (in the coordinate system) or a 2d direction (still in the coordinate system.

The start- and end- factors decide on how far the control point is from the start and end point. At a factor of 1, the distance corresponds to a quarter of the straight line distance.

Parameters

NameType
xDistnumber
yDistnumber
splineConfig?SplineConfig

Returns

BlueprintSketcher

Implementation of

GenericSketcher.smoothSpline

Inherited from

BaseSketcher2d.smoothSpline

Defined in

Sketcher2d.ts:451


smoothSplineTo

smoothSplineTo(end, config?): BlueprintSketcher

Draws a cubic bezier curve to the end point, attempting to make the line smooth with the previous segment.

It will base its first control point so that its tangent is the same than the previous segment.

The control point relative to the end is by default set to be in the direction of the straight line between start and end. You can specifiy the endSkew either as an angle (in degrees) to this direction, or as an absolute direction in the coordinate system (a Point).

The start- and end- factors decide on how far the control point is from the start and end point. At a factor of 1, the distance corresponds to a quarter of the straight line distance.

Parameters

NameType
endPoint2D
config?SplineConfig

Returns

BlueprintSketcher

Implementation of

GenericSketcher.smoothSplineTo

Inherited from

BaseSketcher2d.smoothSplineTo

Defined in

Sketcher2d.ts:410


tangentArc

tangentArc(xDist, yDist): BlueprintSketcher

Draws an arc of circle from the current point as a tangent to the previous part of curve drawn.The end point is defined by its horizontal and vertical distances from the start point.

Parameters

NameType
xDistnumber
yDistnumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.tangentArc

Inherited from

BaseSketcher2d.tangentArc

Defined in

Sketcher2d.ts:261


tangentArcTo

tangentArcTo(end): BlueprintSketcher

Draws an arc of circle from the current point as a tangent to the previous part of curve drawn.

Parameters

NameType
endPoint2D

Returns

BlueprintSketcher

Implementation of

GenericSketcher.tangentArcTo

Inherited from

BaseSketcher2d.tangentArcTo

Defined in

Sketcher2d.ts:241


tangentLine

tangentLine(distance): BlueprintSketcher

Draws a line from the current point as a tangent to the previous part of curve drawn. The distance defines how long the line will be.

Parameters

NameType
distancenumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.tangentLine

Inherited from

BaseSketcher2d.tangentLine

Defined in

Sketcher2d.ts:137


threePointsArc

threePointsArc(xDist, yDist, viaXDist, viaYDist): BlueprintSketcher

Draws an arc of circle by defining its end point and a third point through which the arc will pass. Both poinats are defined in horizontal (x) and vertical (y) distances from the start point.

Parameters

NameType
xDistnumber
yDistnumber
viaXDistnumber
viaYDistnumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.threePointsArc

Inherited from

BaseSketcher2d.threePointsArc

Defined in

Sketcher2d.ts:163


threePointsArcTo

threePointsArcTo(end, midPoint): BlueprintSketcher

Draws an arc of circle by defining its end point and a third point through which the arc will pass.

Parameters

NameType
endPoint2D
midPointPoint2D

Returns

BlueprintSketcher

Implementation of

GenericSketcher.threePointsArcTo

Inherited from

BaseSketcher2d.threePointsArcTo

Defined in

Sketcher2d.ts:151


vBulgeArc

vBulgeArc(distance, bulge): BlueprintSketcher

Draws a vertical arc of circle by defining its end point and the bulge

  • the maximum distance between the arc and the straight line going from start to end point in units of half the chord. The end point is defined by its vertical distance from the start point.

Parameters

NameType
distancenumber
bulgenumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.vBulgeArc

Inherited from

BaseSketcher2d.vBulgeArc

Defined in

Sketcher2d.ts:233


vLine

vLine(distance): BlueprintSketcher

Draws a vertical line of length distance from the current point

Parameters

NameType
distancenumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.vLine

Inherited from

BaseSketcher2d.vLine

Defined in

Sketcher2d.ts:109


vLineTo

vLineTo(yPos): BlueprintSketcher

Draws a vertical line to the y coordinate

Parameters

NameType
yPosnumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.vLineTo

Inherited from

BaseSketcher2d.vLineTo

Defined in

Sketcher2d.ts:117


vSagittaArc

vSagittaArc(distance, sagitta): BlueprintSketcher

Draws a vertical arc of circle by defining its end point and the sagitta

  • the maximum distance between the arc and the straight line going from start to end point.The end point is defined by its vertical distance from the start point.

Parameters

NameType
distancenumber
sagittanumber

Returns

BlueprintSketcher

Implementation of

GenericSketcher.vSagittaArc

Inherited from

BaseSketcher2d.vSagittaArc

Defined in

Sketcher2d.ts:210