Drawing
Implements
Constructors
constructor
• new Drawing(innerShape?
)
Parameters
Name | Type | Default value |
---|---|---|
innerShape | Shape2D | null |
Defined in
Properties
innerShape
• Private
innerShape: Shape2D
Defined in
Accessors
blueprint
• get
blueprint(): Blueprint
Returns
Defined in
boundingBox
• get
boundingBox(): BoundingBox2d
Returns
Implementation of
Defined in
repr
• get
repr(): string
Returns
string
Defined in
Drawing Modifications Methods
chamfer
▸ chamfer(radius
, filter?
): Drawing
Creates a new drawing with some corners filletted, as specified by the radius and the corner finder function
Parameters
Name | Type |
---|---|
radius | number |
filter? | (c : CornerFinder ) => CornerFinder |
Returns
Defined in
cut
▸ cut(other
): Drawing
Builds a new drawing by cuting another drawing into this one
Parameters
Name | Type |
---|---|
other | Drawing |
Returns
Defined in
fillet
▸ fillet(radius
, filter?
): Drawing
Creates a new drawing with some corners filletted, as specified by the radius and the corner finder function
Parameters
Name | Type |
---|---|
radius | number |
filter? | (c : CornerFinder ) => CornerFinder |
Returns
Defined in
fuse
▸ fuse(other
): Drawing
Builds a new drawing by merging another drawing into this one
Parameters
Name | Type |
---|---|
other | Drawing |
Returns
Defined in
intersect
▸ intersect(other
): Drawing
Builds a new drawing by intersection this drawing with another
Parameters
Name | Type |
---|---|
other | Drawing |
Returns
Defined in
Other Methods
clone
▸ clone(): Drawing
Returns
Implementation of
Defined in
mirror
▸ mirror(centerOrDirection
, origin?
, mode?
): Drawing
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
Name | Type |
---|---|
centerOrDirection | Point2D |
origin? | Point2D |
mode? | "center" | "plane" |
Returns
Implementation of
Defined in
offset
▸ offset(distance
): Drawing
Parameters
Name | Type |
---|---|
distance | number |
Returns
Defined in
rotate
▸ rotate(angle
, center?
): Drawing
Parameters
Name | Type |
---|---|
angle | number |
center? | Point2D |
Returns
Implementation of
Defined in
scale
▸ scale(scaleFactor
, center?
): Drawing
Parameters
Name | Type |
---|---|
scaleFactor | number |
center? | Point2D |
Returns
Defined in
sketchOnFace
▸ sketchOnFace(face
, scaleMode
): SketchInterface
| Sketches
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 facesbounds
normalises the UV parameters on the face to [0,1] intervals.native
uses the default UV parameters of opencascade
Parameters
Name | Type |
---|---|
face | Face |
scaleMode | ScaleMode |
Returns
Implementation of
Defined in
sketchOnPlane
▸ sketchOnPlane(inputPlane
): SketchInterface
| Sketches
Returns the sketched version of the drawing, on a plane
Parameters
Name | Type |
---|---|
inputPlane | Plane |
Returns
Implementation of
DrawingInterface.sketchOnPlane
Defined in
▸ sketchOnPlane(inputPlane?
, origin?
): SketchInterface
| Sketches
Parameters
Name | Type |
---|---|
inputPlane? | PlaneName |
origin? | number | Point |
Returns
Implementation of
DrawingInterface.sketchOnPlane
Defined in
stretch
▸ stretch(ratio
, direction
, origin
): Drawing
Parameters
Name | Type |
---|---|
ratio | number |
direction | Point2D |
origin | Point2D |
Returns
Implementation of
Defined in
toSVG
▸ toSVG(margin?
): string
Formats the drawing as an SVG image
Parameters
Name | Type |
---|---|
margin? | number |
Returns
string
Implementation of
Defined in
toSVGPaths
▸ toSVGPaths(): string
[] | string
[][]
Formats the drawing as a list of SVG paths
Returns
string
[] | string
[][]
Implementation of
Defined in
toSVGViewBox
▸ toSVGViewBox(margin?
): string
Returns the SVG viewbox that corresponds to this drawing
Parameters
Name | Type | Default value |
---|---|---|
margin | number | 1 |
Returns
string
Implementation of
Defined in
translate
▸ translate(xDist
, yDist
): Drawing
Parameters
Name | Type |
---|---|
xDist | number |
yDist | number |
Returns
Implementation of
Defined in
▸ translate(translationVector
): Drawing
Parameters
Name | Type |
---|---|
translationVector | Point2D |