brepjs API Reference
    Preparing search index...

    Class FaceSketcher

    The FaceSketcher allows you to sketch on a face that is not planar, for instance the sides of a cylinder.

    The coordinates passed to the methods corresponds to normalised distances on this surface, between 0 and 1 in both direction.

    Note that if you are drawing on a closed surface (typically a revolution surface or a cylinder), the first parameters represents the angle and can be smaller than 0 or bigger than 1.

    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

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

      Parameters

      • radius: number | ((f: Curve2D, s: Curve2D) => Curve2D[])

        Fillet/chamfer radius, or a custom corner function.

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

        Corner treatment type.

      Returns Sketch

      The closed Sketch.

    • 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