brepjs API Reference
    Preparing search index...

    Interface CompoundBlueprint

    Represent a 2D profile with holes (an outer boundary minus inner cutouts).

    The first element of blueprints is the outer boundary; all subsequent elements are holes subtracted from it. CompoundBlueprint implements the same DrawingInterface as Blueprint, so it can be transformed, sketched, and serialized to SVG in the same way.

    • Blueprint for simple profiles without holes.
    • Blueprints for collections of disjoint profiles.
    interface CompoundBlueprint {
        _boundingBox: BoundingBox2d | null;
        blueprints: Blueprint[];
        get boundingBox(): BoundingBox2d;
        get repr(): string;
        clone(): CompoundBlueprint;
        mirror(
            centerOrDirection: Point2D,
            origin?: Point2D,
            mode?: "plane" | "center",
        ): CompoundBlueprint;
        punchHole(
            shape: AnyShape<Dimension>,
            face: SingleFace,
            options?: { draftAngle?: number; height?: number; origin?: PointInput },
        ): AnyShape<Dimension>;
        rotate(angle: number, center?: Point2D): CompoundBlueprint;
        scale(scaleFactor: number, center?: Point2D): CompoundBlueprint;
        sketchOnFace(face: Face, scaleMode?: ScaleMode): SketchData[];
        sketchOnPlane(
            plane?: Plane | PlaneName,
            origin?: number | PointInput,
        ): SketchData[];
        stretch(
            ratio: number,
            direction: Point2D,
            origin: Point2D,
        ): CompoundBlueprint;
        toSVG(margin?: number): string;
        toSVGGroup(): string;
        toSVGPaths(): string[];
        toSVGViewBox(margin?: number): string;
        translate(xDist: number, yDist: number): CompoundBlueprint;
        translate(translationVector: Point2D): CompoundBlueprint;
    }

    Implements

    Index

    Properties

    _boundingBox: BoundingBox2d | null
    blueprints: Blueprint[]

    Ordered array where blueprints[0] is the outer boundary and the remaining entries are inner holes.

    Accessors

    Methods

    • Render a complete SVG document string for this compound blueprint.

      Parameters

      • margin: number = 1

      Returns string

    • Compute the SVG viewBox attribute for this compound blueprint.

      Parameters

      • margin: number = 1

      Returns string