@buerli.io/core 0.13.1-beta.9 → 1.0.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.
- package/README.md +19 -12
- package/build/cjs/geometry/ThreeGeometryCreator.js +320 -320
- package/build/cjs/geometry/index.js +17 -17
- package/build/cjs/graphic/filters.js +25 -25
- package/build/cjs/index.js +26 -26
- package/build/cjs/re-export.js +29 -29
- package/build/cjs/store/index.js +37 -37
- package/build/cjs/store/states/buerli.js +98 -98
- package/build/cjs/store/states/cad.js +47 -47
- package/build/cjs/store/states/drawing.js +49 -49
- package/build/cjs/store/states/geometry.js +157 -157
- package/build/cjs/store/states/graphic.js +115 -115
- package/build/cjs/store/states/interaction.js +55 -55
- package/build/cjs/store/states/message.js +25 -25
- package/build/cjs/store/states/plugin.js +115 -115
- package/build/cjs/store/states/selection.js +267 -267
- package/build/cjs/store/states/structure.js +250 -250
- package/build/cjs/store/store.js +9 -9
- package/build/cjs/store/subscribtion/selection.js +49 -49
- package/build/cjs/store/subscribtion/subscribeToDrawing.js +13 -13
- package/build/cjs/types/InteractionInfo.js +11 -11
- package/build/cjs/types/index.js +34 -34
- package/build/cjs/utils/Math.js +91 -91
- package/build/cjs/utils/Measure.js +576 -576
- package/build/cjs/utils/Timing.js +34 -34
- package/build/esm/geometry/ThreeGeometryCreator.js +291 -291
- package/build/esm/geometry/index.js +1 -1
- package/build/esm/graphic/filters.js +12 -12
- package/build/esm/index.js +10 -10
- package/build/esm/re-export.js +23 -23
- package/build/esm/store/index.js +26 -26
- package/build/esm/store/states/buerli.js +92 -92
- package/build/esm/store/states/cad.js +42 -42
- package/build/esm/store/states/drawing.js +45 -45
- package/build/esm/store/states/geometry.js +129 -129
- package/build/esm/store/states/graphic.js +110 -110
- package/build/esm/store/states/interaction.js +50 -50
- package/build/esm/store/states/message.js +21 -21
- package/build/esm/store/states/plugin.js +109 -109
- package/build/esm/store/states/selection.js +261 -261
- package/build/esm/store/states/structure.js +219 -219
- package/build/esm/store/store.js +3 -3
- package/build/esm/store/subscribtion/selection.js +44 -44
- package/build/esm/store/subscribtion/subscribeToDrawing.js +9 -9
- package/build/esm/types/InteractionInfo.js +6 -6
- package/build/esm/types/index.js +16 -16
- package/build/esm/utils/Math.js +65 -65
- package/build/esm/utils/Measure.js +550 -550
- package/build/esm/utils/Timing.js +31 -31
- package/build/types/geometry/ThreeGeometryCreator.d.ts +256 -256
- package/build/types/geometry/index.d.ts +1 -1
- package/build/types/graphic/filters.d.ts +11 -11
- package/build/types/index.d.ts +38 -38
- package/build/types/re-export.d.ts +70 -70
- package/build/types/store/index.d.ts +16 -16
- package/build/types/store/states/buerli.d.ts +41 -41
- package/build/types/store/states/cad.d.ts +56 -53
- package/build/types/store/states/drawing.d.ts +45 -45
- package/build/types/store/states/geometry.d.ts +64 -64
- package/build/types/store/states/graphic.d.ts +21 -21
- package/build/types/store/states/interaction.d.ts +34 -34
- package/build/types/store/states/message.d.ts +30 -30
- package/build/types/store/states/plugin.d.ts +53 -53
- package/build/types/store/states/selection.d.ts +69 -69
- package/build/types/store/states/structure.d.ts +47 -47
- package/build/types/store/store.d.ts +2 -2
- package/build/types/store/subscribtion/selection.d.ts +7 -7
- package/build/types/store/subscribtion/subscribeToDrawing.d.ts +4 -4
- package/build/types/types/InteractionInfo.d.ts +42 -42
- package/build/types/types/index.d.ts +7 -7
- package/build/types/utils/Math.d.ts +21 -21
- package/build/types/utils/Measure.d.ts +64 -64
- package/build/types/utils/Timing.d.ts +8 -8
- package/package.json +45 -45
- package/CHANGELOG.md +0 -7
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
const cache = {};
|
|
3
|
-
const start = (key = uuidv4()) => {
|
|
4
|
-
cache[key] = { startTime: performance.now(), previousTime: performance.now() };
|
|
5
|
-
return key;
|
|
6
|
-
};
|
|
7
|
-
const measure = (key, mode = 'fromStart') => {
|
|
8
|
-
if (!cache[key])
|
|
9
|
-
return Number.NaN;
|
|
10
|
-
const curr = performance.now();
|
|
11
|
-
const prev = mode === 'fromPrevious' ? cache[key].previousTime : cache[key].startTime;
|
|
12
|
-
cache[key] = Object.assign(Object.assign({}, cache[key]), { previousTime: curr });
|
|
13
|
-
return curr - prev;
|
|
14
|
-
};
|
|
15
|
-
const stop = (key) => {
|
|
16
|
-
if (!cache[key])
|
|
17
|
-
return Number.NaN;
|
|
18
|
-
const curr = performance.now();
|
|
19
|
-
const prev = cache[key].startTime;
|
|
20
|
-
delete cache[key];
|
|
21
|
-
return curr - prev;
|
|
22
|
-
};
|
|
23
|
-
const dump = (key, message = '', mode = 'fromStart') => {
|
|
24
|
-
console.info(`${message ? message : key + ':'} ${measure(key, mode).toFixed(2)}ms`);
|
|
25
|
-
};
|
|
26
|
-
export const Timing = {
|
|
27
|
-
start,
|
|
28
|
-
stop,
|
|
29
|
-
measure,
|
|
30
|
-
dump,
|
|
31
|
-
};
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
+
const cache = {};
|
|
3
|
+
const start = (key = uuidv4()) => {
|
|
4
|
+
cache[key] = { startTime: performance.now(), previousTime: performance.now() };
|
|
5
|
+
return key;
|
|
6
|
+
};
|
|
7
|
+
const measure = (key, mode = 'fromStart') => {
|
|
8
|
+
if (!cache[key])
|
|
9
|
+
return Number.NaN;
|
|
10
|
+
const curr = performance.now();
|
|
11
|
+
const prev = mode === 'fromPrevious' ? cache[key].previousTime : cache[key].startTime;
|
|
12
|
+
cache[key] = Object.assign(Object.assign({}, cache[key]), { previousTime: curr });
|
|
13
|
+
return curr - prev;
|
|
14
|
+
};
|
|
15
|
+
const stop = (key) => {
|
|
16
|
+
if (!cache[key])
|
|
17
|
+
return Number.NaN;
|
|
18
|
+
const curr = performance.now();
|
|
19
|
+
const prev = cache[key].startTime;
|
|
20
|
+
delete cache[key];
|
|
21
|
+
return curr - prev;
|
|
22
|
+
};
|
|
23
|
+
const dump = (key, message = '', mode = 'fromStart') => {
|
|
24
|
+
console.info(`${message ? message : key + ':'} ${measure(key, mode).toFixed(2)}ms`);
|
|
25
|
+
};
|
|
26
|
+
export const Timing = {
|
|
27
|
+
start,
|
|
28
|
+
stop,
|
|
29
|
+
measure,
|
|
30
|
+
dump,
|
|
31
|
+
};
|
|
@@ -1,256 +1,256 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { GraphicID, GraphicType, IGraphicArc, IGraphicContainer, IGraphicEdge, IGraphicElement, IGraphicLine, IGraphicMesh, ObjectID } from '../re-export';
|
|
3
|
-
/**
|
|
4
|
-
* Creates THREE geometry based on the data within a @see IGraphicContainer.
|
|
5
|
-
*/
|
|
6
|
-
export declare class ThreeGeometryCreator {
|
|
7
|
-
private coordHeightTolerance;
|
|
8
|
-
protected getMetadata(geometry: IGraphicElement | null, container: IGraphicContainer, color?: number[], opacity?: number): {
|
|
9
|
-
color: THREE.Color | undefined;
|
|
10
|
-
opacity: number;
|
|
11
|
-
layer: any;
|
|
12
|
-
container: {
|
|
13
|
-
id: number;
|
|
14
|
-
ownerId: number;
|
|
15
|
-
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
16
|
-
};
|
|
17
|
-
operationId: any;
|
|
18
|
-
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
19
|
-
};
|
|
20
|
-
createGeometry(container: IGraphicContainer, color?: number[]): ContainerGeometryT;
|
|
21
|
-
createSurface(mesh: IGraphicMesh, container: IGraphicContainer, color?: number[]): {
|
|
22
|
-
color: THREE.Color | undefined;
|
|
23
|
-
opacity: number;
|
|
24
|
-
layer: any;
|
|
25
|
-
container: {
|
|
26
|
-
id: number;
|
|
27
|
-
ownerId: number;
|
|
28
|
-
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
29
|
-
};
|
|
30
|
-
operationId: any;
|
|
31
|
-
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
32
|
-
isValid: boolean;
|
|
33
|
-
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
34
|
-
graphicId: number;
|
|
35
|
-
type: GraphicType;
|
|
36
|
-
loops: number[][];
|
|
37
|
-
};
|
|
38
|
-
protected createMesh(mesh: IGraphicMesh, container: IGraphicContainer, color?: number[]): {
|
|
39
|
-
color: THREE.Color | undefined;
|
|
40
|
-
opacity: number;
|
|
41
|
-
layer: any;
|
|
42
|
-
container: {
|
|
43
|
-
id: number;
|
|
44
|
-
ownerId: number;
|
|
45
|
-
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
46
|
-
};
|
|
47
|
-
operationId: any;
|
|
48
|
-
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
49
|
-
isValid: boolean;
|
|
50
|
-
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
51
|
-
graphicId: number;
|
|
52
|
-
type: GraphicType;
|
|
53
|
-
loops: number[][];
|
|
54
|
-
};
|
|
55
|
-
createPlane(mesh: IGraphicMesh, meshGeom: MeshGeometry): {
|
|
56
|
-
type: GraphicType;
|
|
57
|
-
pointOnPlane: THREE.Vector3;
|
|
58
|
-
normal: THREE.Vector3;
|
|
59
|
-
graphicId: number;
|
|
60
|
-
color: THREE.Color | undefined;
|
|
61
|
-
opacity: number;
|
|
62
|
-
layer: any;
|
|
63
|
-
container: {
|
|
64
|
-
id: number;
|
|
65
|
-
ownerId: number;
|
|
66
|
-
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
67
|
-
};
|
|
68
|
-
operationId: any;
|
|
69
|
-
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
70
|
-
isValid: boolean;
|
|
71
|
-
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
72
|
-
loops: number[][];
|
|
73
|
-
};
|
|
74
|
-
createCylinder(mesh: IGraphicMesh, meshGeom: MeshGeometry): {
|
|
75
|
-
type: GraphicType;
|
|
76
|
-
origin: THREE.Vector3;
|
|
77
|
-
axis: THREE.Vector3;
|
|
78
|
-
height: number;
|
|
79
|
-
radius: number;
|
|
80
|
-
graphicId: number;
|
|
81
|
-
color: THREE.Color | undefined;
|
|
82
|
-
opacity: number;
|
|
83
|
-
layer: any;
|
|
84
|
-
container: {
|
|
85
|
-
id: number;
|
|
86
|
-
ownerId: number;
|
|
87
|
-
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
88
|
-
};
|
|
89
|
-
operationId: any;
|
|
90
|
-
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
91
|
-
isValid: boolean;
|
|
92
|
-
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
93
|
-
loops: number[][];
|
|
94
|
-
};
|
|
95
|
-
createCone(mesh: IGraphicMesh, meshGeom: MeshGeometry): {
|
|
96
|
-
type: GraphicType;
|
|
97
|
-
origin: THREE.Vector3;
|
|
98
|
-
axis: THREE.Vector3;
|
|
99
|
-
height: number;
|
|
100
|
-
radiusBottom: number;
|
|
101
|
-
radiusTop: number;
|
|
102
|
-
graphicId: number;
|
|
103
|
-
color: THREE.Color | undefined;
|
|
104
|
-
opacity: number;
|
|
105
|
-
layer: any;
|
|
106
|
-
container: {
|
|
107
|
-
id: number;
|
|
108
|
-
ownerId: number;
|
|
109
|
-
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
110
|
-
};
|
|
111
|
-
operationId: any;
|
|
112
|
-
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
113
|
-
isValid: boolean;
|
|
114
|
-
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
115
|
-
loops: number[][];
|
|
116
|
-
};
|
|
117
|
-
createSphere(mesh: IGraphicMesh, meshGeom: MeshGeometry): {
|
|
118
|
-
type: GraphicType;
|
|
119
|
-
radius: number;
|
|
120
|
-
graphicId: number;
|
|
121
|
-
color: THREE.Color | undefined;
|
|
122
|
-
opacity: number;
|
|
123
|
-
layer: any;
|
|
124
|
-
container: {
|
|
125
|
-
id: number;
|
|
126
|
-
ownerId: number;
|
|
127
|
-
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
128
|
-
};
|
|
129
|
-
operationId: any;
|
|
130
|
-
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
131
|
-
isValid: boolean;
|
|
132
|
-
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
133
|
-
loops: number[][];
|
|
134
|
-
};
|
|
135
|
-
createLine(line: IGraphicLine, container: IGraphicContainer, points: PointMap, color?: number[]): {
|
|
136
|
-
start: THREE.Vector3;
|
|
137
|
-
end: THREE.Vector3;
|
|
138
|
-
color: THREE.Color | undefined;
|
|
139
|
-
opacity: number;
|
|
140
|
-
layer: any;
|
|
141
|
-
container: {
|
|
142
|
-
id: number;
|
|
143
|
-
ownerId: number;
|
|
144
|
-
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
145
|
-
};
|
|
146
|
-
operationId: any;
|
|
147
|
-
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
148
|
-
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
149
|
-
graphicId: number;
|
|
150
|
-
type: GraphicType;
|
|
151
|
-
};
|
|
152
|
-
createEdge(edge: IGraphicEdge, container: IGraphicContainer, points: PointMap, color?: number[]): {
|
|
153
|
-
start: THREE.Vector3;
|
|
154
|
-
end: THREE.Vector3;
|
|
155
|
-
color: THREE.Color | undefined;
|
|
156
|
-
opacity: number;
|
|
157
|
-
layer: any;
|
|
158
|
-
container: {
|
|
159
|
-
id: number;
|
|
160
|
-
ownerId: number;
|
|
161
|
-
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
162
|
-
};
|
|
163
|
-
operationId: any;
|
|
164
|
-
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
165
|
-
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
166
|
-
graphicId: number;
|
|
167
|
-
type: GraphicType;
|
|
168
|
-
};
|
|
169
|
-
createArc(arc: IGraphicArc, container: IGraphicContainer, points: PointMap, color?: number[]): {
|
|
170
|
-
normal: THREE.Vector3;
|
|
171
|
-
center: THREE.Vector3;
|
|
172
|
-
start: THREE.Vector3;
|
|
173
|
-
end: THREE.Vector3;
|
|
174
|
-
radius: number;
|
|
175
|
-
angle: number;
|
|
176
|
-
color: THREE.Color | undefined;
|
|
177
|
-
opacity: number;
|
|
178
|
-
layer: any;
|
|
179
|
-
container: {
|
|
180
|
-
id: number;
|
|
181
|
-
ownerId: number;
|
|
182
|
-
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
183
|
-
};
|
|
184
|
-
operationId: any;
|
|
185
|
-
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
186
|
-
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
187
|
-
graphicId: number;
|
|
188
|
-
type: GraphicType;
|
|
189
|
-
};
|
|
190
|
-
createPoint(container: IGraphicContainer, key: PointKey, graphicId: GraphicID, position: THREE.Vector3, ownerId: GraphicID, type: PointType): {
|
|
191
|
-
position: THREE.Vector3;
|
|
192
|
-
geometry: THREE.Vector3;
|
|
193
|
-
owners: {
|
|
194
|
-
ownerId: number;
|
|
195
|
-
type: PointType;
|
|
196
|
-
}[];
|
|
197
|
-
color: THREE.Color | undefined;
|
|
198
|
-
opacity: number;
|
|
199
|
-
layer: any;
|
|
200
|
-
container: {
|
|
201
|
-
id: number;
|
|
202
|
-
ownerId: number;
|
|
203
|
-
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
204
|
-
};
|
|
205
|
-
operationId: any;
|
|
206
|
-
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
207
|
-
key: string;
|
|
208
|
-
graphicId: number;
|
|
209
|
-
type: GraphicType;
|
|
210
|
-
};
|
|
211
|
-
private insertPoint;
|
|
212
|
-
}
|
|
213
|
-
export declare const EMPTY_CONTAINER_GEOMETRY: () => ContainerGeometryT;
|
|
214
|
-
declare type CommonProps = {
|
|
215
|
-
graphicId: GraphicID;
|
|
216
|
-
type: GraphicType;
|
|
217
|
-
};
|
|
218
|
-
export declare type Metadata = ReturnType<ThreeGeometryCreator['getMetadata']>;
|
|
219
|
-
export declare type MeshGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createMesh']>;
|
|
220
|
-
export declare type PlaneGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createPlane']>;
|
|
221
|
-
export declare type CylinderGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createCylinder']>;
|
|
222
|
-
export declare type ConeGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createCone']>;
|
|
223
|
-
export declare type SphereGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createSphere']>;
|
|
224
|
-
export declare type LineGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createLine']>;
|
|
225
|
-
export declare type EdgeGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createEdge']>;
|
|
226
|
-
export declare type ArcGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createArc']>;
|
|
227
|
-
export declare type CircleGeometry = ArcGeometry;
|
|
228
|
-
export declare type PointGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createPoint']> & {
|
|
229
|
-
owners: Array<{
|
|
230
|
-
ownerId: GraphicID;
|
|
231
|
-
type: PointType;
|
|
232
|
-
}>;
|
|
233
|
-
};
|
|
234
|
-
declare type PointMap = Record<string, PointGeometry>;
|
|
235
|
-
declare type PointKey = string;
|
|
236
|
-
declare type PointType = 'start' | 'end' | 'center';
|
|
237
|
-
export declare type ContainerGeometryT = {
|
|
238
|
-
graphicId: GraphicID;
|
|
239
|
-
type: GraphicType;
|
|
240
|
-
map: Record<GraphicID, GeometryElement>;
|
|
241
|
-
meshes: MeshGeometry[];
|
|
242
|
-
lines: LineGeometry[];
|
|
243
|
-
edges: EdgeGeometry[];
|
|
244
|
-
arcs: ArcGeometry[];
|
|
245
|
-
points: PointGeometry[];
|
|
246
|
-
box: {
|
|
247
|
-
min: THREE.Vector3;
|
|
248
|
-
max: THREE.Vector3;
|
|
249
|
-
};
|
|
250
|
-
} & ReturnType<ThreeGeometryCreator['getMetadata']>;
|
|
251
|
-
export declare type GeometryElement = MeshGeometry | PlaneGeometry | CylinderGeometry | ConeGeometry | SphereGeometry | LineGeometry | EdgeGeometry | ArcGeometry | CircleGeometry | PointGeometry;
|
|
252
|
-
export declare type ProductElement = GeometryElement & {
|
|
253
|
-
productId: ObjectID;
|
|
254
|
-
};
|
|
255
|
-
export declare const isEqualGeometry: (a: GeometryElement, b: GeometryElement) => boolean;
|
|
256
|
-
export {};
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { GraphicID, GraphicType, IGraphicArc, IGraphicContainer, IGraphicEdge, IGraphicElement, IGraphicLine, IGraphicMesh, ObjectID } from '../re-export';
|
|
3
|
+
/**
|
|
4
|
+
* Creates THREE geometry based on the data within a @see IGraphicContainer.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ThreeGeometryCreator {
|
|
7
|
+
private coordHeightTolerance;
|
|
8
|
+
protected getMetadata(geometry: IGraphicElement | null, container: IGraphicContainer, color?: number[], opacity?: number): {
|
|
9
|
+
color: THREE.Color | undefined;
|
|
10
|
+
opacity: number;
|
|
11
|
+
layer: any;
|
|
12
|
+
container: {
|
|
13
|
+
id: number;
|
|
14
|
+
ownerId: number;
|
|
15
|
+
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
16
|
+
};
|
|
17
|
+
operationId: any;
|
|
18
|
+
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
19
|
+
};
|
|
20
|
+
createGeometry(container: IGraphicContainer, color?: number[]): ContainerGeometryT;
|
|
21
|
+
createSurface(mesh: IGraphicMesh, container: IGraphicContainer, color?: number[]): {
|
|
22
|
+
color: THREE.Color | undefined;
|
|
23
|
+
opacity: number;
|
|
24
|
+
layer: any;
|
|
25
|
+
container: {
|
|
26
|
+
id: number;
|
|
27
|
+
ownerId: number;
|
|
28
|
+
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
29
|
+
};
|
|
30
|
+
operationId: any;
|
|
31
|
+
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
32
|
+
isValid: boolean;
|
|
33
|
+
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
34
|
+
graphicId: number;
|
|
35
|
+
type: GraphicType;
|
|
36
|
+
loops: number[][];
|
|
37
|
+
};
|
|
38
|
+
protected createMesh(mesh: IGraphicMesh, container: IGraphicContainer, color?: number[]): {
|
|
39
|
+
color: THREE.Color | undefined;
|
|
40
|
+
opacity: number;
|
|
41
|
+
layer: any;
|
|
42
|
+
container: {
|
|
43
|
+
id: number;
|
|
44
|
+
ownerId: number;
|
|
45
|
+
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
46
|
+
};
|
|
47
|
+
operationId: any;
|
|
48
|
+
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
49
|
+
isValid: boolean;
|
|
50
|
+
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
51
|
+
graphicId: number;
|
|
52
|
+
type: GraphicType;
|
|
53
|
+
loops: number[][];
|
|
54
|
+
};
|
|
55
|
+
createPlane(mesh: IGraphicMesh, meshGeom: MeshGeometry): {
|
|
56
|
+
type: GraphicType;
|
|
57
|
+
pointOnPlane: THREE.Vector3;
|
|
58
|
+
normal: THREE.Vector3;
|
|
59
|
+
graphicId: number;
|
|
60
|
+
color: THREE.Color | undefined;
|
|
61
|
+
opacity: number;
|
|
62
|
+
layer: any;
|
|
63
|
+
container: {
|
|
64
|
+
id: number;
|
|
65
|
+
ownerId: number;
|
|
66
|
+
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
67
|
+
};
|
|
68
|
+
operationId: any;
|
|
69
|
+
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
70
|
+
isValid: boolean;
|
|
71
|
+
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
72
|
+
loops: number[][];
|
|
73
|
+
};
|
|
74
|
+
createCylinder(mesh: IGraphicMesh, meshGeom: MeshGeometry): {
|
|
75
|
+
type: GraphicType;
|
|
76
|
+
origin: THREE.Vector3;
|
|
77
|
+
axis: THREE.Vector3;
|
|
78
|
+
height: number;
|
|
79
|
+
radius: number;
|
|
80
|
+
graphicId: number;
|
|
81
|
+
color: THREE.Color | undefined;
|
|
82
|
+
opacity: number;
|
|
83
|
+
layer: any;
|
|
84
|
+
container: {
|
|
85
|
+
id: number;
|
|
86
|
+
ownerId: number;
|
|
87
|
+
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
88
|
+
};
|
|
89
|
+
operationId: any;
|
|
90
|
+
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
91
|
+
isValid: boolean;
|
|
92
|
+
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
93
|
+
loops: number[][];
|
|
94
|
+
};
|
|
95
|
+
createCone(mesh: IGraphicMesh, meshGeom: MeshGeometry): {
|
|
96
|
+
type: GraphicType;
|
|
97
|
+
origin: THREE.Vector3;
|
|
98
|
+
axis: THREE.Vector3;
|
|
99
|
+
height: number;
|
|
100
|
+
radiusBottom: number;
|
|
101
|
+
radiusTop: number;
|
|
102
|
+
graphicId: number;
|
|
103
|
+
color: THREE.Color | undefined;
|
|
104
|
+
opacity: number;
|
|
105
|
+
layer: any;
|
|
106
|
+
container: {
|
|
107
|
+
id: number;
|
|
108
|
+
ownerId: number;
|
|
109
|
+
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
110
|
+
};
|
|
111
|
+
operationId: any;
|
|
112
|
+
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
113
|
+
isValid: boolean;
|
|
114
|
+
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
115
|
+
loops: number[][];
|
|
116
|
+
};
|
|
117
|
+
createSphere(mesh: IGraphicMesh, meshGeom: MeshGeometry): {
|
|
118
|
+
type: GraphicType;
|
|
119
|
+
radius: number;
|
|
120
|
+
graphicId: number;
|
|
121
|
+
color: THREE.Color | undefined;
|
|
122
|
+
opacity: number;
|
|
123
|
+
layer: any;
|
|
124
|
+
container: {
|
|
125
|
+
id: number;
|
|
126
|
+
ownerId: number;
|
|
127
|
+
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
128
|
+
};
|
|
129
|
+
operationId: any;
|
|
130
|
+
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
131
|
+
isValid: boolean;
|
|
132
|
+
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
133
|
+
loops: number[][];
|
|
134
|
+
};
|
|
135
|
+
createLine(line: IGraphicLine, container: IGraphicContainer, points: PointMap, color?: number[]): {
|
|
136
|
+
start: THREE.Vector3;
|
|
137
|
+
end: THREE.Vector3;
|
|
138
|
+
color: THREE.Color | undefined;
|
|
139
|
+
opacity: number;
|
|
140
|
+
layer: any;
|
|
141
|
+
container: {
|
|
142
|
+
id: number;
|
|
143
|
+
ownerId: number;
|
|
144
|
+
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
145
|
+
};
|
|
146
|
+
operationId: any;
|
|
147
|
+
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
148
|
+
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
149
|
+
graphicId: number;
|
|
150
|
+
type: GraphicType;
|
|
151
|
+
};
|
|
152
|
+
createEdge(edge: IGraphicEdge, container: IGraphicContainer, points: PointMap, color?: number[]): {
|
|
153
|
+
start: THREE.Vector3;
|
|
154
|
+
end: THREE.Vector3;
|
|
155
|
+
color: THREE.Color | undefined;
|
|
156
|
+
opacity: number;
|
|
157
|
+
layer: any;
|
|
158
|
+
container: {
|
|
159
|
+
id: number;
|
|
160
|
+
ownerId: number;
|
|
161
|
+
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
162
|
+
};
|
|
163
|
+
operationId: any;
|
|
164
|
+
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
165
|
+
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
166
|
+
graphicId: number;
|
|
167
|
+
type: GraphicType;
|
|
168
|
+
};
|
|
169
|
+
createArc(arc: IGraphicArc, container: IGraphicContainer, points: PointMap, color?: number[]): {
|
|
170
|
+
normal: THREE.Vector3;
|
|
171
|
+
center: THREE.Vector3;
|
|
172
|
+
start: THREE.Vector3;
|
|
173
|
+
end: THREE.Vector3;
|
|
174
|
+
radius: number;
|
|
175
|
+
angle: number;
|
|
176
|
+
color: THREE.Color | undefined;
|
|
177
|
+
opacity: number;
|
|
178
|
+
layer: any;
|
|
179
|
+
container: {
|
|
180
|
+
id: number;
|
|
181
|
+
ownerId: number;
|
|
182
|
+
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
183
|
+
};
|
|
184
|
+
operationId: any;
|
|
185
|
+
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
186
|
+
geometry: THREE.BufferGeometry<THREE.NormalBufferAttributes>;
|
|
187
|
+
graphicId: number;
|
|
188
|
+
type: GraphicType;
|
|
189
|
+
};
|
|
190
|
+
createPoint(container: IGraphicContainer, key: PointKey, graphicId: GraphicID, position: THREE.Vector3, ownerId: GraphicID, type: PointType): {
|
|
191
|
+
position: THREE.Vector3;
|
|
192
|
+
geometry: THREE.Vector3;
|
|
193
|
+
owners: {
|
|
194
|
+
ownerId: number;
|
|
195
|
+
type: PointType;
|
|
196
|
+
}[];
|
|
197
|
+
color: THREE.Color | undefined;
|
|
198
|
+
opacity: number;
|
|
199
|
+
layer: any;
|
|
200
|
+
container: {
|
|
201
|
+
id: number;
|
|
202
|
+
ownerId: number;
|
|
203
|
+
type: GraphicType.NONE | GraphicType.BREP | GraphicType.POLYBREP | GraphicType.CURVEARRAY;
|
|
204
|
+
};
|
|
205
|
+
operationId: any;
|
|
206
|
+
rawGraphic: import("@classcad/api-js/build/types/scg/Scg").ScgGraphicElement | null;
|
|
207
|
+
key: string;
|
|
208
|
+
graphicId: number;
|
|
209
|
+
type: GraphicType;
|
|
210
|
+
};
|
|
211
|
+
private insertPoint;
|
|
212
|
+
}
|
|
213
|
+
export declare const EMPTY_CONTAINER_GEOMETRY: () => ContainerGeometryT;
|
|
214
|
+
declare type CommonProps = {
|
|
215
|
+
graphicId: GraphicID;
|
|
216
|
+
type: GraphicType;
|
|
217
|
+
};
|
|
218
|
+
export declare type Metadata = ReturnType<ThreeGeometryCreator['getMetadata']>;
|
|
219
|
+
export declare type MeshGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createMesh']>;
|
|
220
|
+
export declare type PlaneGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createPlane']>;
|
|
221
|
+
export declare type CylinderGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createCylinder']>;
|
|
222
|
+
export declare type ConeGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createCone']>;
|
|
223
|
+
export declare type SphereGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createSphere']>;
|
|
224
|
+
export declare type LineGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createLine']>;
|
|
225
|
+
export declare type EdgeGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createEdge']>;
|
|
226
|
+
export declare type ArcGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createArc']>;
|
|
227
|
+
export declare type CircleGeometry = ArcGeometry;
|
|
228
|
+
export declare type PointGeometry = CommonProps & ReturnType<ThreeGeometryCreator['createPoint']> & {
|
|
229
|
+
owners: Array<{
|
|
230
|
+
ownerId: GraphicID;
|
|
231
|
+
type: PointType;
|
|
232
|
+
}>;
|
|
233
|
+
};
|
|
234
|
+
declare type PointMap = Record<string, PointGeometry>;
|
|
235
|
+
declare type PointKey = string;
|
|
236
|
+
declare type PointType = 'start' | 'end' | 'center';
|
|
237
|
+
export declare type ContainerGeometryT = {
|
|
238
|
+
graphicId: GraphicID;
|
|
239
|
+
type: GraphicType;
|
|
240
|
+
map: Record<GraphicID, GeometryElement>;
|
|
241
|
+
meshes: MeshGeometry[];
|
|
242
|
+
lines: LineGeometry[];
|
|
243
|
+
edges: EdgeGeometry[];
|
|
244
|
+
arcs: ArcGeometry[];
|
|
245
|
+
points: PointGeometry[];
|
|
246
|
+
box: {
|
|
247
|
+
min: THREE.Vector3;
|
|
248
|
+
max: THREE.Vector3;
|
|
249
|
+
};
|
|
250
|
+
} & ReturnType<ThreeGeometryCreator['getMetadata']>;
|
|
251
|
+
export declare type GeometryElement = MeshGeometry | PlaneGeometry | CylinderGeometry | ConeGeometry | SphereGeometry | LineGeometry | EdgeGeometry | ArcGeometry | CircleGeometry | PointGeometry;
|
|
252
|
+
export declare type ProductElement = GeometryElement & {
|
|
253
|
+
productId: ObjectID;
|
|
254
|
+
};
|
|
255
|
+
export declare const isEqualGeometry: (a: GeometryElement, b: GeometryElement) => boolean;
|
|
256
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './ThreeGeometryCreator';
|
|
1
|
+
export * from './ThreeGeometryCreator';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { GraphicType as GT } from '../re-export';
|
|
2
|
-
export declare const lineFilter: (scope: string, data: GT) => boolean;
|
|
3
|
-
export declare const edgeFilter: (scope: string, data: GT) => boolean;
|
|
4
|
-
export declare const arcFilter: (scope: string, data: GT) => boolean;
|
|
5
|
-
export declare const circleFilter: (scope: string, data: GT) => boolean;
|
|
6
|
-
export declare const arcCircleFilter: (scope: string, data: GT) => boolean;
|
|
7
|
-
export declare const pointFilter: (scope: string, data: GT) => boolean;
|
|
8
|
-
export declare const meshFilter: (scope: string, data: GT) => boolean;
|
|
9
|
-
export declare const planeFilter: (scope: string, data: GT) => boolean;
|
|
10
|
-
export declare const loopFilter: (scope: string, data: GT) => boolean;
|
|
11
|
-
export declare const solidFilter: (scope: string, data: GT) => boolean;
|
|
1
|
+
import { GraphicType as GT } from '../re-export';
|
|
2
|
+
export declare const lineFilter: (scope: string, data: GT) => boolean;
|
|
3
|
+
export declare const edgeFilter: (scope: string, data: GT) => boolean;
|
|
4
|
+
export declare const arcFilter: (scope: string, data: GT) => boolean;
|
|
5
|
+
export declare const circleFilter: (scope: string, data: GT) => boolean;
|
|
6
|
+
export declare const arcCircleFilter: (scope: string, data: GT) => boolean;
|
|
7
|
+
export declare const pointFilter: (scope: string, data: GT) => boolean;
|
|
8
|
+
export declare const meshFilter: (scope: string, data: GT) => boolean;
|
|
9
|
+
export declare const planeFilter: (scope: string, data: GT) => boolean;
|
|
10
|
+
export declare const loopFilter: (scope: string, data: GT) => boolean;
|
|
11
|
+
export declare const solidFilter: (scope: string, data: GT) => boolean;
|