replicad-pantograph 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,45 @@
1
- import { Diagram, Figure, Segment, Stroke } from "pantograph2d/models";
1
+ import { Diagram, Figure, Segment, Stroke, BoundingBox } from "pantograph2d/models";
2
2
  import * as drawShape from "pantograph2d/drawShape";
3
3
  import * as pantograph from "pantograph2d";
4
- import { Plane, Sketch, Edge, Sketches, CompoundSketch, Point, PlaneName } from "replicad";
4
+ import { fillet, DrawingPen } from "pantograph2d";
5
+ import { Plane, Sketch, Edge, Sketches, CompoundSketch, Point, PlaneName, type SketchInterface } from "replicad";
6
+ import type { Vector as Point2D } from "pantograph2d";
7
+ type CornerFilter = Parameters<typeof fillet>[2];
5
8
  export declare function sketchSegment(segment: Segment, plane: Plane): Edge;
6
9
  export declare function sketchStroke(stroke: Stroke, plane: Plane): Sketch;
7
10
  export declare function sketchFigure(figure: Figure, plane: Plane): Sketch | CompoundSketch;
8
11
  export declare function sketchDiagram(diagram: Diagram, plane: Plane): Sketch | CompoundSketch | Sketches;
9
12
  declare function sketchOnPlane(pantographObject: any, plane: Plane): Sketch | Sketches | CompoundSketch;
10
- declare function sketchOnPlane(pantographObject: any, plane?: PlaneName, origin?: Point | number): Sketch | Sketches | CompoundSketch;
13
+ declare function sketchOnPlane(pantographObject: any, plane: PlaneName, origin?: Point | number): Sketch | Sketches | CompoundSketch;
11
14
  declare function initStudioIntegration(): void;
12
- export { sketchOnPlane, initStudioIntegration, drawShape, pantograph };
15
+ declare class Drawing {
16
+ readonly diagram: Diagram;
17
+ constructor(diagram?: Diagram);
18
+ clone(): Drawing;
19
+ serialize(): string;
20
+ get boundingBox(): BoundingBox;
21
+ get repr(): string;
22
+ rotate(angle: number, center?: Point2D): Drawing;
23
+ translate(xDist: number, yDist: number): Drawing;
24
+ translateTo(translationVector: Point2D): Drawing;
25
+ scale(scaleFactor: number, center?: Point2D): Drawing;
26
+ mirror(directionOrAxis?: Point2D | "x" | "y", origin?: Point2D): Drawing;
27
+ mirrorCenter(center: Point2D): Drawing;
28
+ cut(other: Drawing): Drawing;
29
+ fuse(other: Drawing): Drawing;
30
+ intersect(other: Drawing): Drawing;
31
+ fillet(radius: number, filter?: CornerFilter): Drawing;
32
+ chamfer(radius: number, filter?: CornerFilter): Drawing;
33
+ sketchOnPlane(inputPlane: Plane): SketchInterface | Sketches;
34
+ sketchOnPlane(inputPlane?: PlaneName, origin?: Point | number): SketchInterface | Sketches;
35
+ toSVG(margin?: number): string;
36
+ toSVGViewBox(margin?: number): string;
37
+ toSVGPaths(): string[] | string[][];
38
+ offset(distance: number): Drawing;
39
+ }
40
+ declare class ReDrawingPen extends DrawingPen {
41
+ close(): Drawing;
42
+ closeWithMirror(): Drawing;
43
+ }
44
+ declare function redraw(p?: Point2D): ReDrawingPen;
45
+ export { sketchOnPlane, initStudioIntegration, drawShape, pantograph, Drawing, ReDrawingPen, redraw, };