Skip to main content

Class: Sketch

Defined in: packages/replicad/src/sketches/Sketch.ts:27

A line drawing to be acted upon. It defines directions to be acted upon by definition (extrusion direction for instance).

Note that all operations will delete the sketch

Implements​

Constructors​

Constructor​

new Sketch(wire, __namedParameters?): Sketch;

Defined in: packages/replicad/src/sketches/Sketch.ts:40

Parameters​

wire​

Wire

__namedParameters?​
defaultDirection?​

Point = ...

defaultOrigin?​

Point = ...

Returns​

Sketch

Properties​

wire​

wire: Wire;

Defined in: packages/replicad/src/sketches/Sketch.ts:28

Accessors​

baseFace​

Get Signature​

get baseFace(): Face | null | undefined;

Defined in: packages/replicad/src/sketches/Sketch.ts:56

Returns​

Face | null | undefined

Set Signature​

set baseFace(newFace): void;

Defined in: packages/replicad/src/sketches/Sketch.ts:60

Parameters​
newFace​

Face | null | undefined

Returns​

void


defaultDirection​

Get Signature​

get defaultDirection(): Vector;

Defined in: packages/replicad/src/sketches/Sketch.ts:89

Returns​

Vector

Set Signature​

set defaultDirection(newDirection): void;

Defined in: packages/replicad/src/sketches/Sketch.ts:93

Parameters​
newDirection​

Point

Returns​

void


defaultOrigin​

Get Signature​

get defaultOrigin(): Vector;

Defined in: packages/replicad/src/sketches/Sketch.ts:81

Returns​

Vector

Set Signature​

set defaultOrigin(newOrigin): void;

Defined in: packages/replicad/src/sketches/Sketch.ts:85

Parameters​
newOrigin​

Point

Returns​

void

Methods​

clone()​

clone(): Sketch;

Defined in: packages/replicad/src/sketches/Sketch.ts:72

Returns​

Sketch


delete()​

delete(): void;

Defined in: packages/replicad/src/sketches/Sketch.ts:65

Returns​

void


extrude()​

extrude(extrusionDistance, __namedParameters?): Shape3D;

Defined in: packages/replicad/src/sketches/Sketch.ts:174

Extrudes the sketch to a certain distance.(along the default direction and origin of the sketch).

You can define another extrusion direction or origin,

It is also possible to twist extrude with an angle (in degrees), or to give a profile to the extrusion (the endFactor will scale the face, and the profile will define how the scale is applied (either linarly or with a s-shape).

Parameters​

extrusionDistance​

number

__namedParameters?​
extrusionDirection?​

Point

extrusionProfile?​

ExtrusionProfile

origin?​

Point

twistAngle?​

number

Returns​

Shape3D

Implementation of​

SketchInterface.extrude


extrudeUntil()​

extrudeUntil(limitingFace, __namedParameters?): Shape3D;

Defined in: packages/replicad/src/sketches/Sketch.ts:146

Extrudes this sketch up to a limiting face, returning only the new solid. The face is not modified or consumed. The sketch's default direction is used unless overridden; the reverse direction is tried if needed. The finite, trimmed limiting face must fully cap the extrusion once without crossing the profile. Use a trimmed face for closed surfaces. The sketch is consumed on success, like extrude, but retained on failure.

Parameters​

limitingFace​

Face

__namedParameters?​

ExtrudeUntilOptions = {}

Returns​

Shape3D

Implementation of​

SketchInterface.extrudeUntil


face()​

face(): Face;

Defined in: packages/replicad/src/sketches/Sketch.ts:100

Transforms the lines into a face. The lines should be closed.

Returns​

Face

Implementation of​

SketchInterface.face


faces()​

faces(): Face;

Defined in: packages/replicad/src/sketches/Sketch.ts:114

Returns​

Face


loftWith()​

loftWith(
otherSketches,
loftConfig?,
returnShell?): Shape3D;

Defined in: packages/replicad/src/sketches/Sketch.ts:271

Loft between this sketch and another sketch (or an array of them)

You can also define a startPoint for the loft (that will be placed before this sketch) and an endPoint after the last one.

You can also define if you want the loft to result in a ruled surface.

Note that all sketches will be deleted by this operation

Parameters​

otherSketches​

Sketch | Sketch[]

loftConfig?​

LoftConfig = {}

returnShell?​

boolean = false

Returns​

Shape3D

Implementation of​

SketchInterface.loftWith


revolve()​

revolve(revolutionAxis?, __namedParameters?): Shape3D;

Defined in: packages/replicad/src/sketches/Sketch.ts:122

Revolves the drawing on an axis (defined by its direction and an origin (defaults to the sketch origin)

Parameters​

revolutionAxis?​

Point | "X" | "Y" | "Z" | "-X" | "-Y" | "-Z"

__namedParameters?​
angle?​

number

origin?​

Point

Returns​

Shape3D

Implementation of​

SketchInterface.revolve


sweepSketch()​

sweepSketch(sketchOnPlane, sweepConfig?): Shape3D;

Defined in: packages/replicad/src/sketches/Sketch.ts:236

Sweep along this sketch another sketch defined in the function sketchOnPlane.

TODO: clean the interface of the sweep config to make it more understandable.

Parameters​

sketchOnPlane​

(plane, origin) => this

sweepConfig?​

GenericSweepConfig = {}

Returns​

Shape3D


wires()​

wires(): Wire;

Defined in: packages/replicad/src/sketches/Sketch.ts:110

Returns​

Wire