FaceSketcher
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.
Hierarchy
↳
FaceSketcher
Implements
Constructors
constructor
• new FaceSketcher(face
, origin?
)
Parameters
Name | Type |
---|---|
face | Face |
origin | Point2D |
Overrides
Defined in
Methods
_adaptSurface
▸ _adaptSurface(): Handle_Geom_Surface
Returns
Handle_Geom_Surface
Defined in
bezierCurveTo
▸ bezierCurveTo(end
, controlPoints
): FaceSketcher
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
Name | Type |
---|---|
end | Point2D |
controlPoints | Point2D | Point2D [] |
Returns
Implementation of
Inherited from
Defined in
bulgeArc
▸ bulgeArc(xDist
, yDist
, bulge
): FaceSketcher
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
Name | Type |
---|---|
xDist | number |
yDist | number |
bulge | number |
Returns
Implementation of
Inherited from
Defined in
bulgeArcTo
▸ bulgeArcTo(end
, bulge
): FaceSketcher
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
Name | Type |
---|---|
end | Point2D |
bulge | number |
Returns
Implementation of
Inherited from
Defined in
close
▸ close(): Sketch
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
Defined in
closeWithCustomCorner
▸ closeWithCustomCorner(radius
, mode?
): Sketch
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
Name | Type | Default value |
---|---|---|
radius | number | undefined |
mode | "fillet" | "chamfer" | "fillet" |
Returns
Defined in
closeWithMirror
▸ closeWithMirror(): Sketch
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
Defined in
cubicBezierCurveTo
▸ cubicBezierCurveTo(end
, startControlPoint
, endControlPoint
): FaceSketcher
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
Name | Type |
---|---|
end | Point2D |
startControlPoint | Point2D |
endControlPoint | Point2D |
Returns
Implementation of
GenericSketcher.cubicBezierCurveTo
Inherited from
BaseSketcher2d.cubicBezierCurveTo
Defined in
customCorner
▸ customCorner(radius
, mode?
): FaceSketcher
Changes the corner between the previous and next segments.
Parameters
Name | Type | Default value |
---|---|---|
radius | number | undefined |
mode | "fillet" | "chamfer" | "fillet" |
Returns
Inherited from
Defined in
done
▸ done(): Sketch
Stop drawing and returns the sketch.
Returns
Implementation of
Defined in
ellipse
▸ ellipse(xDist
, yDist
, horizontalRadius
, verticalRadius
, rotation?
, longAxis?
, sweep?
): FaceSketcher
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
Name | Type | Default value |
---|---|---|
xDist | number | undefined |
yDist | number | undefined |
horizontalRadius | number | undefined |
verticalRadius | number | undefined |
rotation | number | 0 |
longAxis | boolean | false |
sweep | boolean | false |
Returns
Implementation of
Inherited from
Defined in
ellipseTo
▸ ellipseTo(end
, horizontalRadius
, verticalRadius
, rotation?
, longAxis?
, sweep?
): FaceSketcher
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
Name | Type | Default value |
---|---|---|
end | Point2D | undefined |
horizontalRadius | number | undefined |
verticalRadius | number | undefined |
rotation | number | 0 |
longAxis | boolean | false |
sweep | boolean | false |
Returns
Implementation of
Inherited from
Defined in
hBulgeArc
▸ hBulgeArc(distance
, bulge
): FaceSketcher
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
Name | Type |
---|---|
distance | number |
bulge | number |
Returns
Implementation of
Inherited from
Defined in
hLine
▸ hLine(distance
): FaceSketcher
Draws an horizontal line of length distance from the current point
Parameters
Name | Type |
---|---|
distance | number |
Returns
Implementation of
Inherited from
Defined in
hLineTo
▸ hLineTo(xPos
): FaceSketcher
Draws an horizontal line to the x coordinate
Parameters
Name | Type |
---|---|
xPos | number |
Returns
Implementation of
Inherited from
Defined in
hSagittaArc
▸ hSagittaArc(distance
, sagitta
): FaceSketcher
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
Name | Type |
---|---|
distance | number |
sagitta | number |
Returns
Implementation of
Inherited from
Defined in
halfEllipse
▸ halfEllipse(xDist
, yDist
, minorRadius
, sweep?
): FaceSketcher
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
Name | Type | Default value |
---|---|---|
xDist | number | undefined |
yDist | number | undefined |
minorRadius | number | undefined |
sweep | boolean | false |
Returns
Implementation of
Inherited from
Defined in
halfEllipseTo
▸ halfEllipseTo(end
, minorRadius
, sweep?
): FaceSketcher
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
Name | Type | Default value |
---|---|---|
end | Point2D | undefined |
minorRadius | number | undefined |
sweep | boolean | false |
Returns
Implementation of
Inherited from
Defined in
line
▸ line(xDist
, yDist
): FaceSketcher
Draws a line at the horizontal distance xDist and the vertical distance yDist of the current point
Parameters
Name | Type |
---|---|
xDist | number |
yDist | number |
Returns
Implementation of
Inherited from
Defined in
lineTo
▸ lineTo(point
): FaceSketcher
Draws a line from the current point to the point given in argument
Parameters
Name | Type |
---|---|
point | Point2D |
Returns
Implementation of
Inherited from
Defined in
movePointerTo
▸ movePointerTo(point
): FaceSketcher
Changes the point to start your drawing from
Parameters
Name | Type |
---|---|
point | Point2D |
Returns
Implementation of
Inherited from
Defined in
polarLine
▸ polarLine(distance
, angle
): FaceSketcher
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
Name | Type |
---|---|
distance | number |
angle | number |
Returns
Implementation of
Inherited from
Defined in
polarLineTo
▸ polarLineTo(«destructured»
): FaceSketcher
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
Name | Type |
---|---|
«destructured» | Point2D |
Returns
Implementation of
Inherited from
Defined in
quadraticBezierCurveTo
▸ quadraticBezierCurveTo(end
, controlPoint
): FaceSketcher
Draws a quadratic bezier curve to the end point, using the single control point.
Parameters
Name | Type |
---|---|
end | Point2D |
controlPoint | Point2D |
Returns
Implementation of
GenericSketcher.quadraticBezierCurveTo
Inherited from
BaseSketcher2d.quadraticBezierCurveTo
Defined in
sagittaArc
▸ sagittaArc(xDist
, yDist
, sagitta
): FaceSketcher
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
Name | Type |
---|---|
xDist | number |
yDist | number |
sagitta | number |
Returns
Implementation of
Inherited from
Defined in
sagittaArcTo
▸ sagittaArcTo(end
, sagitta
): FaceSketcher
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
Name | Type |
---|---|
end | Point2D |
sagitta | number |
Returns
Implementation of
Inherited from
Defined in
smoothSpline
▸ smoothSpline(xDist
, yDist
, splineConfig?
): FaceSketcher
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
Name | Type |
---|---|
xDist | number |
yDist | number |
splineConfig? | SplineConfig |
Returns
Implementation of
Inherited from
Defined in
smoothSplineTo
▸ smoothSplineTo(end
, config?
): FaceSketcher
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
Name | Type |
---|---|
end | Point2D |
config? | SplineConfig |
Returns
Implementation of
GenericSketcher.smoothSplineTo
Inherited from
Defined in
tangentArc
▸ tangentArc(xDist
, yDist
): FaceSketcher
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
Name | Type |
---|---|
xDist | number |
yDist | number |
Returns
Implementation of
Inherited from
Defined in
tangentArcTo
▸ tangentArcTo(end
): FaceSketcher
Draws an arc of circle from the current point as a tangent to the previous part of curve drawn.
Parameters
Name | Type |
---|---|
end | Point2D |
Returns
Implementation of
Inherited from
Defined in
tangentLine
▸ tangentLine(distance
): FaceSketcher
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
Name | Type |
---|---|
distance | number |
Returns
Implementation of
Inherited from
Defined in
threePointsArc
▸ threePointsArc(xDist
, yDist
, viaXDist
, viaYDist
): FaceSketcher
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
Name | Type |
---|---|
xDist | number |
yDist | number |
viaXDist | number |
viaYDist | number |
Returns
Implementation of
GenericSketcher.threePointsArc
Inherited from
Defined in
threePointsArcTo
▸ threePointsArcTo(end
, midPoint
): FaceSketcher
Draws an arc of circle by defining its end point and a third point through which the arc will pass.
Parameters
Name | Type |
---|---|
end | Point2D |
midPoint | Point2D |
Returns
Implementation of
GenericSketcher.threePointsArcTo
Inherited from
BaseSketcher2d.threePointsArcTo
Defined in
vBulgeArc
▸ vBulgeArc(distance
, bulge
): FaceSketcher
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
Name | Type |
---|---|
distance | number |
bulge | number |
Returns
Implementation of
Inherited from
Defined in
vLine
▸ vLine(distance
): FaceSketcher
Draws a vertical line of length distance from the current point
Parameters
Name | Type |
---|---|
distance | number |
Returns
Implementation of
Inherited from
Defined in
vLineTo
▸ vLineTo(yPos
): FaceSketcher
Draws a vertical line to the y coordinate
Parameters
Name | Type |
---|---|
yPos | number |
Returns
Implementation of
Inherited from
Defined in
vSagittaArc
▸ vSagittaArc(distance
, sagitta
): FaceSketcher
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
Name | Type |
---|---|
distance | number |
sagitta | number |