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
origin
Point2D
= ...
Returns
FaceSketcher
Overrides
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
Inherited from
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
bulge
number
Returns
this
Implementation of
Inherited from
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
Inherited from
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
Inherited from
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
Inherited from
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
sagitta
number
Returns
this
Implementation of
Inherited from
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
Inherited from
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
Returns
this
Implementation of
Inherited from
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
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
midPoint
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
Inherited from
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
Inherited from
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
controlPoints
Returns
this
Implementation of
Inherited from
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
startControlPoint
endControlPoint
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
controlPoint
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?
Returns
this
Implementation of
Inherited from
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
config?
Returns
this
Implementation of
GenericSketcher
.smoothSplineTo
Inherited from
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
Inherited from
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
horizontalRadius
number
verticalRadius
number
rotation
number
= 0
longAxis
boolean
= false
sweep
boolean
= false
Returns
this
Implementation of
Inherited from
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
Inherited from
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
minorRadius
number
sweep
boolean
= false
Returns
this
Implementation of
Inherited from
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
Inherited from
hLineTo()
hLineTo(xPos): this;
Defined in: Sketcher2d.ts:121
Draws an horizontal line to the x coordinate
Parameters
xPos
number
Returns
this
Implementation of
Inherited from
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
Inherited from
lineTo()
lineTo(point): this;
Defined in: Sketcher2d.ts:95
Draws a line from the current point to the point given in argument
Parameters
point
Returns
this
Implementation of
Inherited from
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
Inherited from
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
Returns
this
Implementation of
Inherited from
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
Inherited from
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
Inherited from
vLineTo()
vLineTo(yPos): this;
Defined in: Sketcher2d.ts:117
Draws a vertical line to the y coordinate
Parameters
yPos
number
Returns
this
Implementation of
Inherited from
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
Implementation of
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
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
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
done()
done(): Sketch;
Defined in: Sketcher2d.ts:587
Stop drawing and returns the sketch.
Returns
Implementation of
movePointerTo()
movePointerTo(point): this;
Defined in: Sketcher2d.ts:66
Changes the point to start your drawing from
Parameters
point
Returns
this