opengeometry 2.0.0 → 2.0.2
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.
- package/README.md +77 -14
- package/index.d.ts +15 -7
- package/index.js +5888 -16596
- package/index.js.map +1 -1
- package/opengeometry/pkg/opengeometry.d.ts +1101 -0
- package/opengeometry/pkg/opengeometry.js +5636 -0
- package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
- package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +422 -0
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +287 -119
- package/package.json +22 -33
- package/src/editor/freeform.d.ts +28 -0
- package/src/editor/index.d.ts +3 -0
- package/src/editor/parametric.d.ts +5 -0
- package/src/editor/types.d.ts +151 -0
- package/src/examples/booleans.d.ts +4 -3
- package/src/examples/editor-modes.d.ts +24 -0
- package/src/examples/index.d.ts +7 -6
- package/src/examples/offset.d.ts +7 -7
- package/src/examples/primitives.d.ts +5 -5
- package/src/examples/shapes.d.ts +7 -7
- package/src/examples/sweep.d.ts +3 -3
- package/src/examples/wall-from-offsets.d.ts +4 -4
- package/src/freeform/geometry.d.ts +21 -0
- package/src/freeform/index.d.ts +2 -0
- package/src/freeform/types.d.ts +24 -0
- package/src/operations/boolean.d.ts +7 -0
- package/src/operations/editor/freeform.d.ts +1 -0
- package/src/operations/editor/index.d.ts +1 -0
- package/src/operations/editor/parametric.d.ts +1 -0
- package/src/operations/editor/types.d.ts +1 -0
- package/src/operations/index.d.ts +1 -1
- package/src/primitives/arc.d.ts +22 -2
- package/src/primitives/curve.d.ts +25 -2
- package/src/primitives/index.d.ts +5 -5
- package/src/primitives/line.d.ts +25 -2
- package/src/primitives/polyline.d.ts +25 -2
- package/src/primitives/rectangle.d.ts +22 -2
- package/src/shapes/boolean-subtract.d.ts +1 -1
- package/src/shapes/cuboid.d.ts +22 -8
- package/src/shapes/cylinder.d.ts +24 -3
- package/src/shapes/index.d.ts +7 -7
- package/src/shapes/opening.d.ts +25 -5
- package/src/shapes/polygon.d.ts +26 -3
- package/src/shapes/sphere.d.ts +26 -4
- package/src/shapes/sweep.d.ts +27 -3
- package/src/shapes/wedge.d.ts +25 -4
- package/src/examples/shape-outline-dropdown.d.ts +0 -23
- package/src/shapes/swept-shape.d.ts +0 -63
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
|
+
import type { ObjectTransformation } from "../freeform/types.js";
|
|
3
|
+
export type TopologyId = number;
|
|
4
|
+
export interface FreeformOperationCapabilities {
|
|
5
|
+
canPushPullFace: boolean;
|
|
6
|
+
canMoveFace: boolean;
|
|
7
|
+
canExtrudeFace: boolean;
|
|
8
|
+
canCutFace: boolean;
|
|
9
|
+
canMoveEdge: boolean;
|
|
10
|
+
canMoveVertex: boolean;
|
|
11
|
+
canInsertVertexOnEdge: boolean;
|
|
12
|
+
canRemoveVertex: boolean;
|
|
13
|
+
canSplitEdge: boolean;
|
|
14
|
+
canLoopCut: boolean;
|
|
15
|
+
reasons?: string[];
|
|
16
|
+
}
|
|
17
|
+
export interface FreeformEditCapabilities extends FreeformOperationCapabilities {
|
|
18
|
+
editingMode: "freeform";
|
|
19
|
+
entityType: "freeform";
|
|
20
|
+
editFamily: "freeform";
|
|
21
|
+
canEditConfig: false;
|
|
22
|
+
canEditPlacement: false;
|
|
23
|
+
canConvertToFreeform: false;
|
|
24
|
+
}
|
|
25
|
+
export interface FreeformFeatureEditCapabilities extends FreeformOperationCapabilities {
|
|
26
|
+
domain: "face" | "edge" | "vertex";
|
|
27
|
+
topologyId: TopologyId;
|
|
28
|
+
}
|
|
29
|
+
export type TopologyRemapStatus = "unchanged" | "split" | "merged" | "deleted";
|
|
30
|
+
export interface TopologyRemapEntry {
|
|
31
|
+
old_id: TopologyId;
|
|
32
|
+
new_ids: TopologyId[];
|
|
33
|
+
primary_id: TopologyId | null;
|
|
34
|
+
status: TopologyRemapStatus;
|
|
35
|
+
}
|
|
36
|
+
export interface TopologyCreatedIds {
|
|
37
|
+
faces: TopologyId[];
|
|
38
|
+
edges: TopologyId[];
|
|
39
|
+
vertices: TopologyId[];
|
|
40
|
+
}
|
|
41
|
+
export interface TopologyRemap {
|
|
42
|
+
faces: TopologyRemapEntry[];
|
|
43
|
+
edges: TopologyRemapEntry[];
|
|
44
|
+
vertices: TopologyRemapEntry[];
|
|
45
|
+
created_ids: TopologyCreatedIds;
|
|
46
|
+
}
|
|
47
|
+
export type DiagnosticSeverity = "info" | "warning" | "error";
|
|
48
|
+
export interface FreeformDiagnostic {
|
|
49
|
+
code: string;
|
|
50
|
+
severity: DiagnosticSeverity;
|
|
51
|
+
message: string;
|
|
52
|
+
domain?: string;
|
|
53
|
+
topology_id?: TopologyId;
|
|
54
|
+
}
|
|
55
|
+
export interface FreeformValidity {
|
|
56
|
+
ok: boolean;
|
|
57
|
+
healed?: boolean;
|
|
58
|
+
diagnostics: FreeformDiagnostic[];
|
|
59
|
+
}
|
|
60
|
+
export interface FaceInfo {
|
|
61
|
+
face_id: TopologyId;
|
|
62
|
+
centroid: Vector3;
|
|
63
|
+
normal: Vector3;
|
|
64
|
+
surface_type: string;
|
|
65
|
+
loop_ids: TopologyId[];
|
|
66
|
+
edge_ids: TopologyId[];
|
|
67
|
+
vertex_ids: TopologyId[];
|
|
68
|
+
adjacent_face_ids: TopologyId[];
|
|
69
|
+
}
|
|
70
|
+
export interface EdgeInfo {
|
|
71
|
+
edge_id: TopologyId;
|
|
72
|
+
curve_type: string;
|
|
73
|
+
start_vertex_id: TopologyId;
|
|
74
|
+
end_vertex_id: TopologyId;
|
|
75
|
+
start: Vector3;
|
|
76
|
+
end: Vector3;
|
|
77
|
+
incident_face_ids: TopologyId[];
|
|
78
|
+
}
|
|
79
|
+
export interface VertexInfo {
|
|
80
|
+
vertex_id: TopologyId;
|
|
81
|
+
position: Vector3;
|
|
82
|
+
edge_ids: TopologyId[];
|
|
83
|
+
face_ids: TopologyId[];
|
|
84
|
+
}
|
|
85
|
+
export interface TopologyFaceRenderData {
|
|
86
|
+
face_id: TopologyId;
|
|
87
|
+
positions: number[];
|
|
88
|
+
indices: number[];
|
|
89
|
+
}
|
|
90
|
+
export interface TopologyEdgeRenderData {
|
|
91
|
+
edge_id: TopologyId;
|
|
92
|
+
positions: number[];
|
|
93
|
+
}
|
|
94
|
+
export interface TopologyVertexRenderData {
|
|
95
|
+
vertex_id: TopologyId;
|
|
96
|
+
position: Vector3;
|
|
97
|
+
}
|
|
98
|
+
export interface TopologyRenderData {
|
|
99
|
+
faces: TopologyFaceRenderData[];
|
|
100
|
+
edges: TopologyEdgeRenderData[];
|
|
101
|
+
vertices: TopologyVertexRenderData[];
|
|
102
|
+
}
|
|
103
|
+
export interface FreeformEditResult {
|
|
104
|
+
entity_id: string;
|
|
105
|
+
brep_serialized?: string;
|
|
106
|
+
local_brep_serialized?: string;
|
|
107
|
+
geometry_serialized?: string;
|
|
108
|
+
outline_geometry_serialized?: string;
|
|
109
|
+
topology_changed: boolean;
|
|
110
|
+
topology_remap?: TopologyRemap;
|
|
111
|
+
changed_faces?: TopologyId[];
|
|
112
|
+
changed_edges?: TopologyId[];
|
|
113
|
+
changed_vertices?: TopologyId[];
|
|
114
|
+
validity: FreeformValidity;
|
|
115
|
+
placement: ObjectTransformation;
|
|
116
|
+
}
|
|
117
|
+
export interface EditOperationOptions {
|
|
118
|
+
includeBrepSerialized?: boolean;
|
|
119
|
+
includeLocalBrepSerialized?: boolean;
|
|
120
|
+
includeGeometrySerialized?: boolean;
|
|
121
|
+
includeOutlineGeometrySerialized?: boolean;
|
|
122
|
+
includeTopologyRemap?: boolean;
|
|
123
|
+
includeDeltas?: boolean;
|
|
124
|
+
constraintAxis?: Vector3;
|
|
125
|
+
constraintPlaneNormal?: Vector3;
|
|
126
|
+
preserveCoplanarity?: boolean;
|
|
127
|
+
constraintFrame?: "local" | "world";
|
|
128
|
+
openSurfaceMode?: boolean;
|
|
129
|
+
}
|
|
130
|
+
export type EditingMode = "parametric" | "freeform";
|
|
131
|
+
export type ParametricEntityType = "line" | "polyline" | "arc" | "curve" | "rectangle" | "polygon" | "cuboid" | "cylinder" | "sphere" | "wedge" | "opening" | "sweep";
|
|
132
|
+
export type EntityType = ParametricEntityType | "freeform";
|
|
133
|
+
export type EditFamily = "profile" | "curve" | "box" | "radial" | "wedge" | "sweep" | "freeform";
|
|
134
|
+
export type ParametricEditFamily = Exclude<EditFamily, "freeform">;
|
|
135
|
+
export interface ParametricPlacement {
|
|
136
|
+
translation: Vector3;
|
|
137
|
+
rotation: Vector3;
|
|
138
|
+
scale: Vector3;
|
|
139
|
+
}
|
|
140
|
+
export interface BaseEditCapabilities {
|
|
141
|
+
editingMode: EditingMode;
|
|
142
|
+
entityType: EntityType;
|
|
143
|
+
editFamily: EditFamily;
|
|
144
|
+
canEditConfig: boolean;
|
|
145
|
+
canEditPlacement: boolean;
|
|
146
|
+
canConvertToFreeform: boolean;
|
|
147
|
+
}
|
|
148
|
+
export interface ParametricEditCapabilities extends BaseEditCapabilities {
|
|
149
|
+
editingMode: "parametric";
|
|
150
|
+
entityType: ParametricEntityType;
|
|
151
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
-
import { Vector3 } from "
|
|
3
|
-
import { BooleanExecutionOptions, BooleanResult } from "../operations/boolean";
|
|
2
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
|
+
import { BooleanExecutionOptions, BooleanResult } from "../operations/boolean.js";
|
|
4
4
|
export type BooleanExampleOperation = "union" | "intersection" | "subtraction";
|
|
5
|
-
export type BooleanExampleMode = "solid" | "polygon";
|
|
5
|
+
export type BooleanExampleMode = "solid" | "polygon" | "extruded";
|
|
6
6
|
export interface BooleanExampleBuildOptions extends BooleanExecutionOptions {
|
|
7
7
|
mode: BooleanExampleMode;
|
|
8
8
|
sphereCenter?: Vector3;
|
|
9
9
|
polygonOffset?: Vector3;
|
|
10
|
+
extrudedOffset?: Vector3;
|
|
10
11
|
}
|
|
11
12
|
export interface BooleanExampleBuildResult {
|
|
12
13
|
group: THREE.Group;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { FreeformEditResult, FreeformEditor } from "../editor.js";
|
|
3
|
+
import { Line } from "../primitives/line.js";
|
|
4
|
+
import { Polygon } from "../shapes/polygon.js";
|
|
5
|
+
import { Cuboid } from "../shapes/cuboid.js";
|
|
6
|
+
/**
|
|
7
|
+
* Demonstrates the intended editing flow for editor-controls:
|
|
8
|
+
* parametric config/placement edits first, then explicit freeform conversion,
|
|
9
|
+
* including wire-backed freeform edge insertion on a converted line.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createEditorModesExample(scene: THREE.Scene): {
|
|
12
|
+
polygon: Polygon;
|
|
13
|
+
cuboid: Cuboid;
|
|
14
|
+
guideLine: Line;
|
|
15
|
+
polygonCapabilities: import("../editor.js").ParametricEditCapabilities;
|
|
16
|
+
cuboidCapabilities: import("../editor.js").ParametricEditCapabilities;
|
|
17
|
+
guideLineCapabilities: import("../editor.js").ParametricEditCapabilities;
|
|
18
|
+
guideLineFreeform: import("../freeform.js").FreeformGeometry;
|
|
19
|
+
guideLineEditor: FreeformEditor;
|
|
20
|
+
guideLineSplitResult: FreeformEditResult | null;
|
|
21
|
+
freeform: import("../freeform.js").FreeformGeometry;
|
|
22
|
+
freeformEditor: FreeformEditor;
|
|
23
|
+
freeformResult: FreeformEditResult | null;
|
|
24
|
+
};
|
package/src/examples/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Reusable scene example builders for primitives, shapes, and operations.
|
|
3
3
|
*/
|
|
4
|
-
export * from './primitives';
|
|
5
|
-
export * from './shapes';
|
|
6
|
-
export * from './sweep';
|
|
7
|
-
export * from './offset';
|
|
8
|
-
export * from './wall-from-offsets';
|
|
9
|
-
export * from './booleans';
|
|
4
|
+
export * from './primitives.js';
|
|
5
|
+
export * from './shapes.js';
|
|
6
|
+
export * from './sweep.js';
|
|
7
|
+
export * from './offset.js';
|
|
8
|
+
export * from './wall-from-offsets.js';
|
|
9
|
+
export * from './booleans.js';
|
|
10
|
+
export * from './editor-modes.js';
|
package/src/examples/offset.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
-
import { Line } from "../primitives/line";
|
|
3
|
-
import { Polyline } from "../primitives/polyline";
|
|
4
|
-
import { Rectangle } from "../primitives/rectangle";
|
|
5
|
-
import { Curve } from "../primitives/curve";
|
|
2
|
+
import { Line } from "../primitives/line.js";
|
|
3
|
+
import { Polyline } from "../primitives/polyline.js";
|
|
4
|
+
import { Rectangle } from "../primitives/rectangle.js";
|
|
5
|
+
import { Curve } from "../primitives/curve.js";
|
|
6
6
|
export declare function createOffsetExample(scene: THREE.Scene): {
|
|
7
7
|
baseLine: Line;
|
|
8
8
|
lineOffsetPrimitive: Line;
|
|
@@ -12,7 +12,7 @@ export declare function createOffsetExample(scene: THREE.Scene): {
|
|
|
12
12
|
rectangleOffsetPrimitive: Polyline;
|
|
13
13
|
baseCurve: Curve;
|
|
14
14
|
curveOffsetPrimitive: Polyline;
|
|
15
|
-
polylineOffset: import("../primitives/polyline").IOffsetResult;
|
|
16
|
-
rectangleOffset: import("../primitives/rectangle").IRectangleOffsetResult;
|
|
17
|
-
curveOffset: import("../primitives/curve").ICurveOffsetResult;
|
|
15
|
+
polylineOffset: import("../primitives/polyline.js").IOffsetResult;
|
|
16
|
+
rectangleOffset: import("../primitives/rectangle.js").IRectangleOffsetResult;
|
|
17
|
+
curveOffset: import("../primitives/curve.js").ICurveOffsetResult;
|
|
18
18
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
-
import { Arc } from "../primitives/arc";
|
|
3
|
-
import { Curve } from "../primitives/curve";
|
|
4
|
-
import { Line } from "../primitives/line";
|
|
5
|
-
import { Polyline } from "../primitives/polyline";
|
|
6
|
-
import { Rectangle } from "../primitives/rectangle";
|
|
2
|
+
import { Arc } from "../primitives/arc.js";
|
|
3
|
+
import { Curve } from "../primitives/curve.js";
|
|
4
|
+
import { Line } from "../primitives/line.js";
|
|
5
|
+
import { Polyline } from "../primitives/polyline.js";
|
|
6
|
+
import { Rectangle } from "../primitives/rectangle.js";
|
|
7
7
|
/**
|
|
8
8
|
* Adds a basic primitives showcase to the provided scene.
|
|
9
9
|
*/
|
package/src/examples/shapes.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
-
import { Cuboid } from "../shapes/cuboid";
|
|
3
|
-
import { Cylinder } from "../shapes/cylinder";
|
|
4
|
-
import { Opening } from "../shapes/opening";
|
|
5
|
-
import { Polygon } from "../shapes/polygon";
|
|
6
|
-
import { Sphere } from "../shapes/sphere";
|
|
7
|
-
import { Sweep } from "../shapes/sweep";
|
|
8
|
-
import { Wedge } from "../shapes/wedge";
|
|
2
|
+
import { Cuboid } from "../shapes/cuboid.js";
|
|
3
|
+
import { Cylinder } from "../shapes/cylinder.js";
|
|
4
|
+
import { Opening } from "../shapes/opening.js";
|
|
5
|
+
import { Polygon } from "../shapes/polygon.js";
|
|
6
|
+
import { Sphere } from "../shapes/sphere.js";
|
|
7
|
+
import { Sweep } from "../shapes/sweep.js";
|
|
8
|
+
import { Wedge } from "../shapes/wedge.js";
|
|
9
9
|
/**
|
|
10
10
|
* Adds a basic shapes showcase to the provided scene.
|
|
11
11
|
*/
|
package/src/examples/sweep.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
-
import { Polyline } from "../primitives/polyline";
|
|
3
|
-
import { Rectangle } from "../primitives/rectangle";
|
|
4
|
-
import { Sweep } from "../shapes/sweep";
|
|
2
|
+
import { Polyline } from "../primitives/polyline.js";
|
|
3
|
+
import { Rectangle } from "../primitives/rectangle.js";
|
|
4
|
+
import { Sweep } from "../shapes/sweep.js";
|
|
5
5
|
export declare function createSweepExample(scene: THREE.Scene): {
|
|
6
6
|
pathPrimitive: Polyline;
|
|
7
7
|
profilePrimitive: Rectangle;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
-
import { Polyline } from "../primitives/polyline";
|
|
3
|
-
import { Polygon } from "../shapes/polygon";
|
|
2
|
+
import { Polyline } from "../primitives/polyline.js";
|
|
3
|
+
import { Polygon } from "../shapes/polygon.js";
|
|
4
4
|
export declare function createWallFromOffsetsExample(scene: THREE.Scene): {
|
|
5
5
|
centerline: Polyline;
|
|
6
6
|
leftOffsetPolyline: Polyline;
|
|
7
7
|
rightOffsetPolyline: Polyline;
|
|
8
8
|
wallPolygon: Polygon;
|
|
9
|
-
leftOffset: import("../primitives/polyline").IOffsetResult;
|
|
10
|
-
rightOffset: import("../primitives/polyline").IOffsetResult;
|
|
9
|
+
leftOffset: import("../primitives/polyline.js").IOffsetResult;
|
|
10
|
+
rightOffset: import("../primitives/polyline.js").IOffsetResult;
|
|
11
11
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OGFreeformGeometry, Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
|
+
import type { CreateFreeformGeometryOptions, FreeformSource, ObjectTransformation } from "./types.js";
|
|
3
|
+
export declare class FreeformGeometry {
|
|
4
|
+
private readonly geometry;
|
|
5
|
+
constructor(geometry: OGFreeformGeometry);
|
|
6
|
+
getId(): string;
|
|
7
|
+
getBrepSerialized(): string;
|
|
8
|
+
getLocalBrepSerialized(): string;
|
|
9
|
+
getGeometrySerialized(): string;
|
|
10
|
+
getOutlineGeometrySerialized(): string;
|
|
11
|
+
getPlacement(): ObjectTransformation;
|
|
12
|
+
setPlacement(transform: ObjectTransformation): void;
|
|
13
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
14
|
+
setTranslation(translation: Vector3): void;
|
|
15
|
+
setRotation(rotation: Vector3): void;
|
|
16
|
+
setScale(scale: Vector3): void;
|
|
17
|
+
setAnchor(anchor: Vector3): void;
|
|
18
|
+
/** @internal */
|
|
19
|
+
getKernelGeometry(): OGFreeformGeometry;
|
|
20
|
+
}
|
|
21
|
+
export declare function createFreeformGeometry(source: FreeformSource, options?: CreateFreeformGeometryOptions): FreeformGeometry;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
|
+
export interface FreeformPlacementInput {
|
|
3
|
+
anchor?: Vector3;
|
|
4
|
+
translation: Vector3;
|
|
5
|
+
rotation: Vector3;
|
|
6
|
+
scale: Vector3;
|
|
7
|
+
}
|
|
8
|
+
export interface ObjectTransformation {
|
|
9
|
+
anchor: Vector3;
|
|
10
|
+
translation: Vector3;
|
|
11
|
+
rotation: Vector3;
|
|
12
|
+
scale: Vector3;
|
|
13
|
+
}
|
|
14
|
+
export interface CreateFreeformGeometryOptions {
|
|
15
|
+
id?: string;
|
|
16
|
+
placement?: FreeformPlacementInput | ObjectTransformation;
|
|
17
|
+
}
|
|
18
|
+
export type FreeformSource = string | Record<string, unknown> | {
|
|
19
|
+
getLocalBrepSerialized?: () => string;
|
|
20
|
+
getLocalBrepData?: () => unknown;
|
|
21
|
+
getBrepSerialized?: () => string;
|
|
22
|
+
getBrepData?: () => unknown;
|
|
23
|
+
getBrep?: () => unknown;
|
|
24
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
+
import { type CreateFreeformGeometryOptions, type FreeformGeometry } from "../freeform.js";
|
|
2
3
|
export type BooleanOperand = string | Record<string, unknown> | {
|
|
3
4
|
getBrep?: () => unknown;
|
|
4
5
|
getBrepData?: () => unknown;
|
|
@@ -58,6 +59,12 @@ export declare class BooleanResult extends THREE.Mesh {
|
|
|
58
59
|
* Returns the serialized BRep JSON emitted by the kernel boolean operation.
|
|
59
60
|
*/
|
|
60
61
|
getBrepSerialized(): string;
|
|
62
|
+
canConvertToFreeform(): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Converts the boolean output into a first-class freeform geometry object so
|
|
65
|
+
* it can participate in direct face/edge/vertex editing.
|
|
66
|
+
*/
|
|
67
|
+
toFreeform(options?: CreateFreeformGeometryOptions): FreeformGeometry;
|
|
61
68
|
set outline(enable: boolean);
|
|
62
69
|
get outline(): boolean;
|
|
63
70
|
set fatOutlines(value: boolean);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FreeformEditor, createFreeformEditor } from "../../editor/freeform.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../editor.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { clonePlacement, createParametricEditCapabilities, toObjectTransformation, } from "../../editor/parametric.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../editor/types.js";
|
package/src/primitives/arc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector3 } from "
|
|
1
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
export interface IArcOptions {
|
|
4
4
|
ogid?: string;
|
|
@@ -10,8 +10,17 @@ export interface IArcOptions {
|
|
|
10
10
|
color: number;
|
|
11
11
|
fatLines?: boolean;
|
|
12
12
|
width?: number;
|
|
13
|
+
translation?: Vector3;
|
|
14
|
+
rotation?: Vector3;
|
|
15
|
+
scale?: Vector3;
|
|
13
16
|
}
|
|
14
|
-
export
|
|
17
|
+
export interface ArcPlacementOptions {
|
|
18
|
+
translation?: Vector3;
|
|
19
|
+
rotation?: Vector3;
|
|
20
|
+
scale?: Vector3;
|
|
21
|
+
}
|
|
22
|
+
export type ArcConfigUpdate = Partial<Omit<IArcOptions, "translation" | "rotation" | "scale">>;
|
|
23
|
+
export type ArcPlacementUpdate = ArcPlacementOptions;
|
|
15
24
|
export declare class Arc extends THREE.Line {
|
|
16
25
|
ogid: string;
|
|
17
26
|
options: IArcOptions;
|
|
@@ -21,10 +30,21 @@ export declare class Arc extends THREE.Line {
|
|
|
21
30
|
constructor(options?: IArcOptions);
|
|
22
31
|
validateOptions(): void;
|
|
23
32
|
setConfig(options: ArcConfigUpdate): void;
|
|
33
|
+
getAnchor(): Vector3;
|
|
34
|
+
setPlacement(placement: ArcPlacementUpdate): void;
|
|
35
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
36
|
+
setTranslation(translation: Vector3): void;
|
|
37
|
+
setRotation(rotation: Vector3): void;
|
|
38
|
+
setScale(scale: Vector3): void;
|
|
24
39
|
getConfig(): IArcOptions;
|
|
40
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
41
|
+
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
42
|
+
canConvertToFreeform(): boolean;
|
|
43
|
+
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
25
44
|
private getCurrentPositions;
|
|
26
45
|
private updateRenderStyle;
|
|
27
46
|
private generateGeometry;
|
|
28
47
|
getBrep(): any;
|
|
29
48
|
discardGeometry(): void;
|
|
49
|
+
private writePositionsToGeometry;
|
|
30
50
|
}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
-
import { Vector3 } from "
|
|
2
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
3
3
|
export interface ICurveOptions {
|
|
4
4
|
ogid?: string;
|
|
5
5
|
controlPoints: Vector3[];
|
|
6
6
|
color: number;
|
|
7
|
+
translation?: Vector3;
|
|
8
|
+
rotation?: Vector3;
|
|
9
|
+
scale?: Vector3;
|
|
7
10
|
}
|
|
8
|
-
export
|
|
11
|
+
export interface CurvePlacementOptions {
|
|
12
|
+
translation?: Vector3;
|
|
13
|
+
rotation?: Vector3;
|
|
14
|
+
scale?: Vector3;
|
|
15
|
+
}
|
|
16
|
+
export type CurveConfigUpdate = Partial<Omit<ICurveOptions, "translation" | "rotation" | "scale">>;
|
|
17
|
+
export type CurvePlacementUpdate = CurvePlacementOptions;
|
|
9
18
|
export interface ICurveOffsetResult {
|
|
10
19
|
points: Vector3[];
|
|
11
20
|
beveledVertexIndices: number[];
|
|
@@ -18,6 +27,20 @@ export declare class Curve extends THREE.Line {
|
|
|
18
27
|
set color(color: number);
|
|
19
28
|
constructor(options?: ICurveOptions);
|
|
20
29
|
setConfig(options: CurveConfigUpdate): void;
|
|
30
|
+
getConfig(): ICurveOptions;
|
|
31
|
+
getAnchor(): Vector3;
|
|
32
|
+
setAnchor(anchor: Vector3): void;
|
|
33
|
+
resetAnchor(): void;
|
|
34
|
+
setPlacement(placement: CurvePlacementUpdate): void;
|
|
35
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
36
|
+
setTranslation(translation: Vector3): void;
|
|
37
|
+
setRotation(rotation: Vector3): void;
|
|
38
|
+
setScale(scale: Vector3): void;
|
|
39
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
40
|
+
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
41
|
+
canConvertToFreeform(): boolean;
|
|
42
|
+
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
21
43
|
private generateGeometry;
|
|
22
44
|
getOffset(distance: number, acuteThresholdDegrees?: number, bevel?: boolean): ICurveOffsetResult;
|
|
45
|
+
private writePositionsToGeometry;
|
|
23
46
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 2D and path primitive wrappers backed by the OpenGeometry kernel.
|
|
3
3
|
*/
|
|
4
|
-
export * from './line';
|
|
5
|
-
export * from './polyline';
|
|
6
|
-
export * from './arc';
|
|
7
|
-
export * from './rectangle';
|
|
8
|
-
export * from './curve';
|
|
4
|
+
export * from './line.js';
|
|
5
|
+
export * from './polyline.js';
|
|
6
|
+
export * from './arc.js';
|
|
7
|
+
export * from './rectangle.js';
|
|
8
|
+
export * from './curve.js';
|
package/src/primitives/line.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector3 } from "
|
|
1
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
export interface ILineOptions {
|
|
4
4
|
ogid?: string;
|
|
@@ -7,8 +7,17 @@ export interface ILineOptions {
|
|
|
7
7
|
color: number;
|
|
8
8
|
fatLines?: boolean;
|
|
9
9
|
width?: number;
|
|
10
|
+
translation?: Vector3;
|
|
11
|
+
rotation?: Vector3;
|
|
12
|
+
scale?: Vector3;
|
|
10
13
|
}
|
|
11
|
-
export
|
|
14
|
+
export interface LinePlacementOptions {
|
|
15
|
+
translation?: Vector3;
|
|
16
|
+
rotation?: Vector3;
|
|
17
|
+
scale?: Vector3;
|
|
18
|
+
}
|
|
19
|
+
export type LineConfigUpdate = Partial<Omit<ILineOptions, "translation" | "rotation" | "scale">>;
|
|
20
|
+
export type LinePlacementUpdate = LinePlacementOptions;
|
|
12
21
|
export interface ILineOffsetResult {
|
|
13
22
|
points: Vector3[];
|
|
14
23
|
beveledVertexIndices: number[];
|
|
@@ -26,6 +35,19 @@ export declare class Line extends THREE.Line {
|
|
|
26
35
|
constructor(options?: ILineOptions);
|
|
27
36
|
validateOptions(): void;
|
|
28
37
|
setConfig(options: LineConfigUpdate): void;
|
|
38
|
+
getConfig(): ILineOptions;
|
|
39
|
+
getAnchor(): Vector3;
|
|
40
|
+
setAnchor(anchor: Vector3): void;
|
|
41
|
+
resetAnchor(): void;
|
|
42
|
+
setPlacement(placement: LinePlacementUpdate): void;
|
|
43
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
44
|
+
setTranslation(translation: Vector3): void;
|
|
45
|
+
setRotation(rotation: Vector3): void;
|
|
46
|
+
setScale(scale: Vector3): void;
|
|
47
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
48
|
+
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
49
|
+
canConvertToFreeform(): boolean;
|
|
50
|
+
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
29
51
|
/**
|
|
30
52
|
* Every time there are property changes, geometry needs to be discarded and regenerated.
|
|
31
53
|
* This is to ensure that the geometry is always up-to-date with the current state.
|
|
@@ -36,4 +58,5 @@ export declare class Line extends THREE.Line {
|
|
|
36
58
|
private generateGeometry;
|
|
37
59
|
getDXF(): string;
|
|
38
60
|
getOffset(distance: number, acuteThresholdDegrees?: number, bevel?: boolean): ILineOffsetResult;
|
|
61
|
+
private writePositionsToGeometry;
|
|
39
62
|
}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { Vector3 } from '
|
|
2
|
+
import { Vector3 } from '../../opengeometry/pkg/opengeometry.js';
|
|
3
3
|
export interface IPolylineOptions {
|
|
4
4
|
ogid?: string;
|
|
5
5
|
color: number;
|
|
6
6
|
points: Vector3[];
|
|
7
7
|
fatLines?: boolean;
|
|
8
8
|
width?: number;
|
|
9
|
+
translation?: Vector3;
|
|
10
|
+
rotation?: Vector3;
|
|
11
|
+
scale?: Vector3;
|
|
9
12
|
}
|
|
10
|
-
export
|
|
13
|
+
export interface PolylinePlacementOptions {
|
|
14
|
+
translation?: Vector3;
|
|
15
|
+
rotation?: Vector3;
|
|
16
|
+
scale?: Vector3;
|
|
17
|
+
}
|
|
18
|
+
export type PolylineConfigUpdate = Partial<Omit<IPolylineOptions, "translation" | "rotation" | "scale">>;
|
|
19
|
+
export type PolylinePlacementUpdate = PolylinePlacementOptions;
|
|
11
20
|
export interface IOffsetResult {
|
|
12
21
|
points: Vector3[];
|
|
13
22
|
beveledVertexIndices: number[];
|
|
@@ -24,6 +33,19 @@ export declare class Polyline extends THREE.Line {
|
|
|
24
33
|
constructor(options?: IPolylineOptions);
|
|
25
34
|
validateOptions(): void;
|
|
26
35
|
setConfig(options: PolylineConfigUpdate): void;
|
|
36
|
+
getConfig(): IPolylineOptions;
|
|
37
|
+
getAnchor(): Vector3;
|
|
38
|
+
setAnchor(anchor: Vector3): void;
|
|
39
|
+
resetAnchor(): void;
|
|
40
|
+
setPlacement(placement: PolylinePlacementUpdate): void;
|
|
41
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
42
|
+
setTranslation(translation: Vector3): void;
|
|
43
|
+
setRotation(rotation: Vector3): void;
|
|
44
|
+
setScale(scale: Vector3): void;
|
|
45
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
46
|
+
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
47
|
+
canConvertToFreeform(): boolean;
|
|
48
|
+
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
27
49
|
addPoint(point: Vector3): void;
|
|
28
50
|
/**
|
|
29
51
|
* Every time there are property changes, geometry needs to be discarded and regenerated.
|
|
@@ -34,4 +56,5 @@ export declare class Polyline extends THREE.Line {
|
|
|
34
56
|
private updateRenderStyle;
|
|
35
57
|
private generateGeometry;
|
|
36
58
|
getOffset(distance: number, acuteThresholdDegrees?: number, bevel?: boolean): IOffsetResult;
|
|
59
|
+
private writePositionsToGeometry;
|
|
37
60
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector3 } from "
|
|
1
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
export interface IRectangleOptions {
|
|
4
4
|
ogid?: string;
|
|
@@ -8,8 +8,17 @@ export interface IRectangleOptions {
|
|
|
8
8
|
color: number;
|
|
9
9
|
fatLines?: boolean;
|
|
10
10
|
lineWidth?: number;
|
|
11
|
+
translation?: Vector3;
|
|
12
|
+
rotation?: Vector3;
|
|
13
|
+
scale?: Vector3;
|
|
11
14
|
}
|
|
12
|
-
export
|
|
15
|
+
export interface RectanglePlacementOptions {
|
|
16
|
+
translation?: Vector3;
|
|
17
|
+
rotation?: Vector3;
|
|
18
|
+
scale?: Vector3;
|
|
19
|
+
}
|
|
20
|
+
export type RectangleConfigUpdate = Partial<Omit<IRectangleOptions, "translation" | "rotation" | "scale">>;
|
|
21
|
+
export type RectanglePlacementUpdate = RectanglePlacementOptions;
|
|
13
22
|
export interface IRectangleOffsetResult {
|
|
14
23
|
points: Vector3[];
|
|
15
24
|
beveledVertexIndices: number[];
|
|
@@ -24,11 +33,22 @@ export declare class Rectangle extends THREE.Line {
|
|
|
24
33
|
constructor(options?: IRectangleOptions);
|
|
25
34
|
validateOptions(): void;
|
|
26
35
|
setConfig(options: RectangleConfigUpdate): void;
|
|
36
|
+
getAnchor(): Vector3;
|
|
37
|
+
setPlacement(placement: RectanglePlacementUpdate): void;
|
|
38
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
39
|
+
setTranslation(translation: Vector3): void;
|
|
40
|
+
setRotation(rotation: Vector3): void;
|
|
41
|
+
setScale(scale: Vector3): void;
|
|
27
42
|
getConfig(): IRectangleOptions;
|
|
43
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
44
|
+
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
45
|
+
canConvertToFreeform(): boolean;
|
|
46
|
+
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
28
47
|
private getCurrentPositions;
|
|
29
48
|
private updateRenderStyle;
|
|
30
49
|
private generateGeometry;
|
|
31
50
|
getBrep(): any;
|
|
32
51
|
getOffset(distance: number, acuteThresholdDegrees?: number, bevel?: boolean): IRectangleOffsetResult;
|
|
33
52
|
discardGeometry(): void;
|
|
53
|
+
private writePositionsToGeometry;
|
|
34
54
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BooleanExecutionOptions, BooleanOperand, BooleanResult } from "../operations/boolean";
|
|
1
|
+
import type { BooleanExecutionOptions, BooleanOperand, BooleanResult } from "../operations/boolean.js";
|
|
2
2
|
export type ShapeSubtractOperand = BooleanOperand;
|
|
3
3
|
export type ShapeSubtractOptions = BooleanExecutionOptions;
|
|
4
4
|
export type ShapeSubtractResult = BooleanResult;
|