Skip to main content

Class: Sketch

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

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:39

Parameters​

wire​

Wire

__namedParameters?​
defaultDirection?​

Point = ...

defaultOrigin?​

Point = ...

Returns​

Sketch

Properties​

wire​

wire: Wire;

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

Accessors​

baseFace​

Get Signature​

get baseFace(): Face | null | undefined;

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

Returns​

Face | null | undefined

Set Signature​

set baseFace(newFace): void;

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

Parameters​
newFace​

Face | null | undefined

Returns​

void


defaultDirection​

Get Signature​

get defaultDirection(): Vector;

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

Returns​

Vector

Set Signature​

set defaultDirection(newDirection): void;

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

Parameters​
newDirection​

Point

Returns​

void


defaultOrigin​

Get Signature​

get defaultOrigin(): Vector;

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

Returns​

Vector

Set Signature​

set defaultOrigin(newOrigin): void;

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

Parameters​
newOrigin​

Point

Returns​

void

Methods​

clone()​

clone(): Sketch;

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

Returns​

Sketch


delete()​

delete(): void;

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

Returns​

void


extrude()​

extrude(extrusionDistance, __namedParameters?): Shape3D;

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

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


face()​

face(): Face;

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

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:113

Returns​

Face


loftWith()​

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

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

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:121

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

Parameters​

revolutionAxis?​

Point

__namedParameters?​
angle?​

number

origin?​

Point

Returns​

Shape3D

Implementation of​

SketchInterface.revolve


sweepSketch()​

sweepSketch(sketchOnPlane, sweepConfig?): Shape3D;

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

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:109

Returns​

Wire