brepjs API Reference
    Preparing search index...

    Class DrawingPen

    DrawingPen is a helper class to draw in 2D. It is used to create drawings by exposing a builder interface. It is not a drawing itself, but it can be used to create a drawing.

    Hierarchy (View Summary)

    Implements

    Index

    Drawing State

    • get penAngle(): number

      Returns the current pen angle in degrees

      The angle represents the tangent direction at the current pen position, based on the last drawing operation (line, arc, bezier, etc.). Returns 0 if nothing has been drawn yet.

      Returns number

    Other

    _nextCorner: ((f: Curve2D, s: Curve2D) => Curve2D[]) | null
    firstPoint: Point2D
    pendingCurves: Curve2D[]
    pointer: Point2D
    • Close the path and apply a custom corner treatment between the last and first segments.

      Parameters

      • radius: number

        Fillet/chamfer radius.

      • mode: "fillet" | "chamfer" = 'fillet'

        Corner treatment type.

      Returns Drawing

      The closed Drawing.

    • 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