brepjs API Reference
    Preparing search index...

    Interface DrawingInterface

    interface DrawingInterface {
        boundingBox: BoundingBox2d;
        clone(): DrawingInterface;
        mirror(
            centerOrDirection: Point2D,
            origin?: Point2D,
            mode?: "center" | "plane",
        ): DrawingInterface;
        rotate(angle: number, center: Point2D): DrawingInterface;
        sketchOnFace(
            face: Face,
            scaleMode: ScaleMode,
        ): SketchData | SketchData[] | (SketchData | SketchData[])[];
        sketchOnPlane(
            inputPlane?: Plane | PlaneName,
            origin?: number | PointInput,
        ): SketchData | SketchData[] | (SketchData | SketchData[])[];
        stretch(
            ratio: number,
            direction: Point2D,
            origin: Point2D,
        ): DrawingInterface;
        toSVG(margin: number): string;
        toSVGPaths(): string[] | string[][];
        toSVGViewBox(margin?: number): string;
        translate(xDist: number, yDist: number): DrawingInterface;
        translate(translationVector: Point2D): DrawingInterface;
    }

    Implemented by

    Index

    Properties

    boundingBox: BoundingBox2d

    Methods

    • Returns the mirror image of this drawing made with a single point (in center mode, the default, or a plane, (plane mode, with both direction and origin of the plane).

      Parameters

      • centerOrDirection: Point2D
      • Optionalorigin: Point2D
      • Optionalmode: "center" | "plane"

      Returns DrawingInterface

    • Returns sketch data for the drawing on a face.

      The scale mode corresponds to the way the coordinates of the drawing are interpreted match with the face:

      • original uses global coordinates (1mm in the drawing is 1mm on the face). This is the default, but currently supported only for planar and circular faces
      • bounds normalises the UV parameters on the face to [0,1] intervals.
      • native uses the default UV parameters of opencascade

      Parameters

      Returns SketchData | SketchData[] | (SketchData | SketchData[])[]

    • Formats the drawing as an SVG image

      Parameters

      • margin: number

      Returns string

    • Formats the drawing as a list of SVG paths

      Returns string[] | string[][]

    • Returns the SVG viewbox that corresponds to this drawing

      Parameters

      • Optionalmargin: number

      Returns string