brepjs API Reference
    Preparing search index...

    Class BaseSketcher2d

    Base class for 2D sketchers that accumulate Curve2D segments.

    Provides the shared pen-drawing API (lines, arcs, ellipses, beziers, splines) used by FaceSketcher, BlueprintSketcher, and DrawingPen. Subclasses implement done() / close() to produce the appropriate output type.

    Hierarchy (View Summary)

    Index

    Drawing State

    Other

    _nextCorner: ((f: Curve2D, s: Curve2D) => Curve2D[]) | null
    firstPoint: Point2D
    pendingCurves: Curve2D[]
    pointer: Point2D
    • 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
      • minorRadius: number
      • sweep: boolean = false

      Returns this

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

      Parameters

      • end: Point2D
      • minorRadius: number
      • sweep: boolean = false

      Returns this

    • Draw a horizontal bulge arc of the given distance and bulge factor.

      Parameters

      • distance: number
      • bulge: number

      Returns this

    • Draw a horizontal sagitta arc of the given distance and bulge.

      Parameters

      • distance: number
      • sagitta: number

      Returns this

    • Draw a straight line by relative horizontal and vertical distances.

      Parameters

      • xDist: number
      • yDist: number

      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 tangent to the previous curve, ending at a relative offset.

      Parameters

      • xDist: number
      • yDist: number

      Returns this

    • Draw a line tangent to the previous curve, extending by the given distance.

      Parameters

      • distance: number

      Returns this

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

      Parameters

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

      Returns this

    • Draw a vertical bulge arc of the given distance and bulge factor.

      Parameters

      • distance: number
      • bulge: number

      Returns this

    • Draw a vertical sagitta arc of the given distance and bulge.

      Parameters

      • distance: number
      • sagitta: number

      Returns this