brepjs API Reference
    Preparing search index...

    Class Sketch

    Represent a closed or open wire profile with a default extrusion origin and direction.

    A Sketch wraps a single Wire and carries metadata (origin, direction, optional base face) so that downstream operations like Sketch.extrude, Sketch.revolve, Sketch.sweepSketch, and Sketch.loftWith know how to act on it without extra arguments.

    Most operations consume (delete) the sketch after producing a solid.

    Implements

    Index

    Constructors

    Properties

    _baseFace: Face | null | undefined
    wire: Wire

    Accessors

    Methods

    • 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 linearly or with a s-shape).

      Parameters

      • extrusionDistance: number
      • __namedParameters: {
            extrusionDirection?: PointInput;
            extrusionProfile?: ExtrusionProfile;
            origin?: PointInput;
            twistAngle?: number;
        } = {}

      Returns Shape3D

    • 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: LoftOptions = {}
      • returnShell: boolean = false

      Returns Shape3D