Skip to main content

Class: FaceSketcher

Defined in: Sketcher2d.ts:535

The FaceSketcher allows you to sketch on a face that is not planar, for instance the sides of a cylinder.

The coordinates passed to the methods corresponds to normalised distances on this surface, between 0 and 1 in both direction.

Note that if you are drawing on a closed surface (typically a revolution surface or a cylinder), the first parameters represents the angle and can be smaller than 0 or bigger than 1.

Extends

Implements

Constructors

Constructor

new FaceSketcher(face, origin): FaceSketcher;

Defined in: Sketcher2d.ts:542

Parameters

face

Face

origin

Point2D = ...

Returns

FaceSketcher

Overrides

BaseSketcher2d.constructor

Arc Segment

bulgeArc()

bulgeArc(
xDist,
yDist,
bulge): this;

Defined in: Sketcher2d.ts:226

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

xDist

number

yDist

number

bulge

number

Returns

this

Implementation of

GenericSketcher.bulgeArc

Inherited from

BaseSketcher2d.bulgeArc


bulgeArcTo()

bulgeArcTo(end, bulge): this;

Defined in: Sketcher2d.ts:218

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

end

Point2D

bulge

number

Returns

this

Implementation of

GenericSketcher.bulgeArcTo

Inherited from

BaseSketcher2d.bulgeArcTo


hBulgeArc()

hBulgeArc(distance, bulge): this;

Defined in: Sketcher2d.ts:237

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

distance

number

bulge

number

Returns

this

Implementation of

GenericSketcher.hBulgeArc

Inherited from

BaseSketcher2d.hBulgeArc


hSagittaArc()

hSagittaArc(distance, sagitta): this;

Defined in: Sketcher2d.ts:214

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

distance

number

sagitta

number

Returns

this

Implementation of

GenericSketcher.hSagittaArc

Inherited from

BaseSketcher2d.hSagittaArc


sagittaArc()

sagittaArc(
xDist,
yDist,
sagitta): this;

Defined in: Sketcher2d.ts:203

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

xDist

number

yDist

number

sagitta

number

Returns

this

Implementation of

GenericSketcher.sagittaArc

Inherited from

BaseSketcher2d.sagittaArc


sagittaArcTo()

sagittaArcTo(end, sagitta): this;

Defined in: Sketcher2d.ts:176

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

end

Point2D

sagitta

number

Returns

this

Implementation of

GenericSketcher.sagittaArcTo

Inherited from

BaseSketcher2d.sagittaArcTo


tangentArc()

tangentArc(xDist, yDist): this;

Defined in: Sketcher2d.ts:261

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

xDist

number

yDist

number

Returns

this

Implementation of

GenericSketcher.tangentArc

Inherited from

BaseSketcher2d.tangentArc


tangentArcTo()

tangentArcTo(end): this;

Defined in: Sketcher2d.ts:241

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

Parameters

end

Point2D

Returns

this

Implementation of

GenericSketcher.tangentArcTo

Inherited from

BaseSketcher2d.tangentArcTo


threePointsArc()

threePointsArc(
xDist,
yDist,
viaXDist,
viaYDist): this;

Defined in: Sketcher2d.ts:163

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

xDist

number

yDist

number

viaXDist

number

viaYDist

number

Returns

this

Implementation of

GenericSketcher.threePointsArc

Inherited from

BaseSketcher2d.threePointsArc


threePointsArcTo()

threePointsArcTo(end, midPoint): this;

Defined in: Sketcher2d.ts:151

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

Parameters

end

Point2D

midPoint

Point2D

Returns

this

Implementation of

GenericSketcher.threePointsArcTo

Inherited from

BaseSketcher2d.threePointsArcTo


vBulgeArc()

vBulgeArc(distance, bulge): this;

Defined in: Sketcher2d.ts:233

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

distance

number

bulge

number

Returns

this

Implementation of

GenericSketcher.vBulgeArc

Inherited from

BaseSketcher2d.vBulgeArc


vSagittaArc()

vSagittaArc(distance, sagitta): this;

Defined in: Sketcher2d.ts:210

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

distance

number

sagitta

number

Returns

this

Implementation of

GenericSketcher.vSagittaArc

Inherited from

BaseSketcher2d.vSagittaArc

Bezier Curve

bezierCurveTo()

bezierCurveTo(end, controlPoints): this;

Defined in: Sketcher2d.ts:378

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

end

Point2D

controlPoints

Point2D | Point2D[]

Returns

this

Implementation of

GenericSketcher.bezierCurveTo

Inherited from

BaseSketcher2d.bezierCurveTo


cubicBezierCurveTo()

cubicBezierCurveTo(
end,
startControlPoint,
endControlPoint): this;

Defined in: Sketcher2d.ts:402

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

end

Point2D

startControlPoint

Point2D

endControlPoint

Point2D

Returns

this

Implementation of

GenericSketcher.cubicBezierCurveTo

Inherited from

BaseSketcher2d.cubicBezierCurveTo


quadraticBezierCurveTo()

quadraticBezierCurveTo(end, controlPoint): this;

Defined in: Sketcher2d.ts:398

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

Parameters

end

Point2D

controlPoint

Point2D

Returns

this

Implementation of

GenericSketcher.quadraticBezierCurveTo

Inherited from

BaseSketcher2d.quadraticBezierCurveTo


smoothSpline()

smoothSpline(
xDist,
yDist,
splineConfig?): this;

Defined in: Sketcher2d.ts:451

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

xDist

number

yDist

number

splineConfig?

SplineConfig

Returns

this

Implementation of

GenericSketcher.smoothSpline

Inherited from

BaseSketcher2d.smoothSpline


smoothSplineTo()

smoothSplineTo(end, config?): this;

Defined in: Sketcher2d.ts:410

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

end

Point2D

config?

SplineConfig

Returns

this

Implementation of

GenericSketcher.smoothSplineTo

Inherited from

BaseSketcher2d.smoothSplineTo

Ellipse Arc Segment

ellipse()

ellipse(
xDist,
yDist,
horizontalRadius,
verticalRadius,
rotation,
longAxis,
sweep): this;

Defined in: Sketcher2d.ts:334

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

xDist

number

yDist

number

horizontalRadius

number

verticalRadius

number

rotation

number = 0

longAxis

boolean = false

sweep

boolean = false

Returns

this

Implementation of

GenericSketcher.ellipse

Inherited from

BaseSketcher2d.ellipse


ellipseTo()

ellipseTo(
end,
horizontalRadius,
verticalRadius,
rotation,
longAxis,
sweep): this;

Defined in: Sketcher2d.ts:266

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

end

Point2D

horizontalRadius

number

verticalRadius

number

rotation

number = 0

longAxis

boolean = false

sweep

boolean = false

Returns

this

Implementation of

GenericSketcher.ellipseTo

Inherited from

BaseSketcher2d.ellipseTo


halfEllipse()

halfEllipse(
xDist,
yDist,
minorRadius,
sweep): this;

Defined in: Sketcher2d.ts:368

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

xDist

number

yDist

number

minorRadius

number

sweep

boolean = false

Returns

this

Implementation of

GenericSketcher.halfEllipse

Inherited from

BaseSketcher2d.halfEllipse


halfEllipseTo()

halfEllipseTo(
end,
minorRadius,
sweep): this;

Defined in: Sketcher2d.ts:354

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

end

Point2D

minorRadius

number

sweep

boolean = false

Returns

this

Implementation of

GenericSketcher.halfEllipseTo

Inherited from

BaseSketcher2d.halfEllipseTo

Line Segment

hLine()

hLine(distance): this;

Defined in: Sketcher2d.ts:113

Draws an horizontal line of length distance from the current point

Parameters

distance

number

Returns

this

Implementation of

GenericSketcher.hLine

Inherited from

BaseSketcher2d.hLine


hLineTo()

hLineTo(xPos): this;

Defined in: Sketcher2d.ts:121

Draws an horizontal line to the x coordinate

Parameters

xPos

number

Returns

this

Implementation of

GenericSketcher.hLineTo

Inherited from

BaseSketcher2d.hLineTo


line()

line(xDist, yDist): this;

Defined in: Sketcher2d.ts:105

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

Parameters

xDist

number

yDist

number

Returns

this

Implementation of

GenericSketcher.line

Inherited from

BaseSketcher2d.line


lineTo()

lineTo(point): this;

Defined in: Sketcher2d.ts:95

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

Parameters

point

Point2D

Returns

this

Implementation of

GenericSketcher.lineTo

Inherited from

BaseSketcher2d.lineTo


polarLine()

polarLine(distance, angle): this;

Defined in: Sketcher2d.ts:131

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

distance

number

angle

number

Returns

this

Implementation of

GenericSketcher.polarLine

Inherited from

BaseSketcher2d.polarLine


polarLineTo()

polarLineTo(__namedParameters): this;

Defined in: Sketcher2d.ts:125

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

__namedParameters

Point2D

Returns

this

Implementation of

GenericSketcher.polarLineTo

Inherited from

BaseSketcher2d.polarLineTo


tangentLine()

tangentLine(distance): this;

Defined in: Sketcher2d.ts:137

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

distance

number

Returns

this

Implementation of

GenericSketcher.tangentLine

Inherited from

BaseSketcher2d.tangentLine


vLine()

vLine(distance): this;

Defined in: Sketcher2d.ts:109

Draws a vertical line of length distance from the current point

Parameters

distance

number

Returns

this

Implementation of

GenericSketcher.vLine

Inherited from

BaseSketcher2d.vLine


vLineTo()

vLineTo(yPos): this;

Defined in: Sketcher2d.ts:117

Draws a vertical line to the y coordinate

Parameters

yPos

number

Returns

this

Implementation of

GenericSketcher.vLineTo

Inherited from

BaseSketcher2d.vLineTo

Other

_adaptSurface()

_adaptSurface(): Handle_Geom_Surface;

Defined in: Sketcher2d.ts:558

Returns

Handle_Geom_Surface


close()

close(): Sketch;

Defined in: Sketcher2d.ts:606

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

Sketch

Implementation of

GenericSketcher.close


closeWithCustomCorner()

closeWithCustomCorner(radius, mode): Sketch;

Defined in: Sketcher2d.ts:621

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

radius

number

mode

"fillet" | "chamfer"

Returns

Sketch


closeWithMirror()

closeWithMirror(): Sketch;

Defined in: Sketcher2d.ts:611

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

Returns

Sketch

Implementation of

GenericSketcher.closeWithMirror


customCorner()

customCorner(radius, mode): FaceSketcher;

Defined in: Sketcher2d.ts:465

Changes the corner between the previous and next segments.

Parameters

radius

number

mode

"fillet" | "chamfer"

Returns

FaceSketcher

Inherited from

BaseSketcher2d.customCorner


done()

done(): Sketch;

Defined in: Sketcher2d.ts:587

Stop drawing and returns the sketch.

Returns

Sketch

Implementation of

GenericSketcher.done


movePointerTo()

movePointerTo(point): this;

Defined in: Sketcher2d.ts:66

Changes the point to start your drawing from

Parameters

point

Point2D

Returns

this

Implementation of

GenericSketcher.movePointerTo

Inherited from

BaseSketcher2d.movePointerTo