brepjs API Reference
    Preparing search index...

    Class Sketcher

    Build 2D wire profiles on a 3D plane using a builder-pen API.

    The Sketcher converts relative/absolute 2D drawing commands into 3D edges projected onto the chosen plane, then assembles them into a Sketch.

    const sketch = new Sketcher("XZ", 5)
    .hLine(20)
    .vLine(10)
    .hLine(-20)
    .close();
    const solid = sketch.extrude(8);

    Implements

    Index

    Constructors

    Properties

    _mirrorWire: boolean
    firstPoint: Vec3
    pendingEdges: Edge[]
    plane: Plane
    pointer: Vec3

    Methods

    • Draw an arc to a relative end point using a bulge factor.

      Parameters

      • xDist: number
      • yDist: number
      • bulge: number

      Returns this

    • Draw an elliptical arc to a relative end point (SVG-style parameters).

      Parameters

      • xDist: number
      • yDist: number
      • horizontalRadius: number
      • verticalRadius: number
      • rotation: number = 0
      • longAxis: boolean = false
      • sweep: boolean = false

      Returns this

    • Draw an elliptical arc to an absolute end point (SVG-style parameters).

      Parameters

      • end: Point2D
      • horizontalRadius: number
      • verticalRadius: number
      • rotation: number = 0
      • longAxis: boolean = false
      • sweep: boolean = false

      Returns this

    • Draw a half-ellipse arc to a relative end point with a given minor radius.

      Parameters

      • xDist: number
      • yDist: number
      • verticalRadius: number
      • sweep: boolean = false

      Returns this

    • Draw a line in polar coordinates (distance and angle in degrees) from the current point.

      Parameters

      • distance: number
      • angle: number

      Returns this

    • Draw a circular arc to a relative end point, bulging by the given sagitta.

      Parameters

      • xDist: number
      • yDist: number
      • sagitta: number

      Returns this

    • Draw a circular arc through a via-point to an end point, both given as relative distances.

      Parameters

      • xDist: number
      • yDist: number
      • viaXDist: number
      • viaYDist: number

      Returns this