@buerli.io/core 1.0.1 → 1.1.0-beta.7
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 -19
- 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 +41 -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 +32 -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 +29 -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 +28 -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 +17 -16
- package/build/types/store/states/buerli.d.ts +41 -41
- package/build/types/store/states/cad.d.ts +56 -56
- 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 +32 -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 +2 -2
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { StoreApi } from 'zustand';
|
|
3
|
-
import { GraphicID, IStructureObject, IStructurePatch, IStructureProtocol, IStructureTree, ObjectID } from '../../re-export';
|
|
4
|
-
import { BuerliState } from './buerli';
|
|
5
|
-
import { DrawingState } from './drawing';
|
|
6
|
-
export declare type StructureData = IStructureProtocol & {
|
|
7
|
-
products: ObjectID[];
|
|
8
|
-
visibleContainers: GraphicID[];
|
|
9
|
-
};
|
|
10
|
-
export declare type StructureApi = ReturnType<typeof structureApi>;
|
|
11
|
-
export declare const structureData: () => StructureData;
|
|
12
|
-
export declare const structureApi: (set: StoreApi<DrawingState>['setState'], get: StoreApi<DrawingState>['getState'], buerliApi: StoreApi<BuerliState>) => {
|
|
13
|
-
get: () => StructureData;
|
|
14
|
-
set: (structure: IStructureProtocol) => void;
|
|
15
|
-
applyPatches: (patches: IStructurePatch[]) => void;
|
|
16
|
-
filterTree: (tree: IStructureTree, filter: (obj: IStructureObject) => boolean) => IStructureObject[];
|
|
17
|
-
findTree: (tree: IStructureTree, filter: (obj: IStructureObject) => boolean) => IStructureObject | undefined;
|
|
18
|
-
collectUsedSolidIds: () => ObjectID[];
|
|
19
|
-
collectProducts: (root: ObjectID) => IStructureObject[];
|
|
20
|
-
getProductSolidIds: (productId: ObjectID) => number[];
|
|
21
|
-
postProcessStructureUpdate: () => void;
|
|
22
|
-
/**
|
|
23
|
-
* Calculates the global transformation matrix for the given _objectId_.
|
|
24
|
-
*
|
|
25
|
-
* @param objectId The object to calculate the global transformation for.
|
|
26
|
-
* @param matrix The initial matrix (mainly used for recursion). It is an out parameter and in the end, it will contain the same matrix as the return value of this function.
|
|
27
|
-
* @returns The global transformation matrix for the given _objectId_.
|
|
28
|
-
*/
|
|
29
|
-
calculateGlobalTransformation: (objectId: ObjectID, matrix?: THREE.Matrix4) => THREE.Matrix4;
|
|
30
|
-
calculateProductBounds: (productId: ObjectID, base?: {
|
|
31
|
-
min: THREE.Vector3;
|
|
32
|
-
max: THREE.Vector3;
|
|
33
|
-
}) => {
|
|
34
|
-
center: THREE.Vector3;
|
|
35
|
-
radius: number;
|
|
36
|
-
max: THREE.Vector3;
|
|
37
|
-
min: THREE.Vector3;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* This is a workaround to get the corresponding drawing id via API.
|
|
41
|
-
*
|
|
42
|
-
* > !!! Should not be used in user code !!!
|
|
43
|
-
*
|
|
44
|
-
* @returns The drawing id.
|
|
45
|
-
*/
|
|
46
|
-
getDrawingId: () => import("./drawing").DrawingID;
|
|
47
|
-
};
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { StoreApi } from 'zustand';
|
|
3
|
+
import { GraphicID, IStructureObject, IStructurePatch, IStructureProtocol, IStructureTree, ObjectID } from '../../re-export';
|
|
4
|
+
import { BuerliState } from './buerli';
|
|
5
|
+
import { DrawingState } from './drawing';
|
|
6
|
+
export declare type StructureData = IStructureProtocol & {
|
|
7
|
+
products: ObjectID[];
|
|
8
|
+
visibleContainers: GraphicID[];
|
|
9
|
+
};
|
|
10
|
+
export declare type StructureApi = ReturnType<typeof structureApi>;
|
|
11
|
+
export declare const structureData: () => StructureData;
|
|
12
|
+
export declare const structureApi: (set: StoreApi<DrawingState>['setState'], get: StoreApi<DrawingState>['getState'], buerliApi: StoreApi<BuerliState>) => {
|
|
13
|
+
get: () => StructureData;
|
|
14
|
+
set: (structure: IStructureProtocol) => void;
|
|
15
|
+
applyPatches: (patches: IStructurePatch[]) => void;
|
|
16
|
+
filterTree: (tree: IStructureTree, filter: (obj: IStructureObject) => boolean) => IStructureObject[];
|
|
17
|
+
findTree: (tree: IStructureTree, filter: (obj: IStructureObject) => boolean) => IStructureObject | undefined;
|
|
18
|
+
collectUsedSolidIds: () => ObjectID[];
|
|
19
|
+
collectProducts: (root: ObjectID) => IStructureObject[];
|
|
20
|
+
getProductSolidIds: (productId: ObjectID) => number[];
|
|
21
|
+
postProcessStructureUpdate: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Calculates the global transformation matrix for the given _objectId_.
|
|
24
|
+
*
|
|
25
|
+
* @param objectId The object to calculate the global transformation for.
|
|
26
|
+
* @param matrix The initial matrix (mainly used for recursion). It is an out parameter and in the end, it will contain the same matrix as the return value of this function.
|
|
27
|
+
* @returns The global transformation matrix for the given _objectId_.
|
|
28
|
+
*/
|
|
29
|
+
calculateGlobalTransformation: (objectId: ObjectID, matrix?: THREE.Matrix4) => THREE.Matrix4;
|
|
30
|
+
calculateProductBounds: (productId: ObjectID, base?: {
|
|
31
|
+
min: THREE.Vector3;
|
|
32
|
+
max: THREE.Vector3;
|
|
33
|
+
}) => {
|
|
34
|
+
center: THREE.Vector3;
|
|
35
|
+
radius: number;
|
|
36
|
+
max: THREE.Vector3;
|
|
37
|
+
min: THREE.Vector3;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* This is a workaround to get the corresponding drawing id via API.
|
|
41
|
+
*
|
|
42
|
+
* > !!! Should not be used in user code !!!
|
|
43
|
+
*
|
|
44
|
+
* @returns The drawing id.
|
|
45
|
+
*/
|
|
46
|
+
getDrawingId: () => import("./drawing").DrawingID;
|
|
47
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BuerliState } from './states/buerli';
|
|
2
|
-
export declare const api: import("zustand/vanilla").StoreApi<BuerliState>;
|
|
1
|
+
import { BuerliState } from './states/buerli';
|
|
2
|
+
export declare const api: import("zustand/vanilla").StoreApi<BuerliState>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StoreApi } from 'zustand';
|
|
2
|
-
import { DrawingID } from '../states/drawing';
|
|
3
|
-
import { SelectedItem, SelectorID } from '../states/selection';
|
|
4
|
-
import { BuerliState } from '../states/buerli';
|
|
5
|
-
export declare const unsubs: Record<string, () => void>;
|
|
6
|
-
export declare function subscribeItems(buerliApi: StoreApi<BuerliState>, drawingId: DrawingID, selectorId: SelectorID, items?: SelectedItem[]): void;
|
|
7
|
-
export declare function unsubscribeItems(buerliApi: StoreApi<BuerliState>, drawingId: DrawingID, selectorId: SelectorID, items?: SelectedItem[]): void;
|
|
1
|
+
import { StoreApi } from 'zustand';
|
|
2
|
+
import { DrawingID } from '../states/drawing';
|
|
3
|
+
import { SelectedItem, SelectorID } from '../states/selection';
|
|
4
|
+
import { BuerliState } from '../states/buerli';
|
|
5
|
+
export declare const unsubs: Record<string, () => void>;
|
|
6
|
+
export declare function subscribeItems(buerliApi: StoreApi<BuerliState>, drawingId: DrawingID, selectorId: SelectorID, items?: SelectedItem[]): void;
|
|
7
|
+
export declare function unsubscribeItems(buerliApi: StoreApi<BuerliState>, drawingId: DrawingID, selectorId: SelectorID, items?: SelectedItem[]): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StoreApi } from 'zustand';
|
|
2
|
-
import { DrawingID, DrawingState } from '../states/drawing';
|
|
3
|
-
import { BuerliState } from '../states/buerli';
|
|
4
|
-
export declare function subscribeToDrawing<T = any>(buerliApi: StoreApi<BuerliState>, drawingId: DrawingID, sel: (d: DrawingState) => T, callback: (arg: T) => void): () => void;
|
|
1
|
+
import { StoreApi } from 'zustand';
|
|
2
|
+
import { DrawingID, DrawingState } from '../states/drawing';
|
|
3
|
+
import { BuerliState } from '../states/buerli';
|
|
4
|
+
export declare function subscribeToDrawing<T = any>(buerliApi: StoreApi<BuerliState>, drawingId: DrawingID, sel: (d: DrawingState) => T, callback: (arg: T) => void): () => void;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { GraphicID, ObjectID } from '../re-export';
|
|
2
|
-
/**
|
|
3
|
-
* It contains general information that can be used to identify CCObjects as well as Brep Elements.
|
|
4
|
-
*/
|
|
5
|
-
export declare type InteractionInfo<T = any> = {
|
|
6
|
-
/**
|
|
7
|
-
* Unique identifier of the interaction info.
|
|
8
|
-
*/
|
|
9
|
-
uniqueIdent: string;
|
|
10
|
-
/**
|
|
11
|
-
* Identifies the object of the Part (for BaseModeling).
|
|
12
|
-
* Needed to identify the location ot the object in the tree.
|
|
13
|
-
*/
|
|
14
|
-
objectId: ObjectID;
|
|
15
|
-
/**
|
|
16
|
-
* Identifies the instance of the Assembly (for BaseModeling).
|
|
17
|
-
* Needed to identify the location ot the object in the tree.
|
|
18
|
-
*/
|
|
19
|
-
prodRefId?: ObjectID | null;
|
|
20
|
-
/**
|
|
21
|
-
* Indentifies an object in the tree by it's full path, starting at AllObjects.
|
|
22
|
-
* It is optional, but should be filled if possible. It can be used to get the full,
|
|
23
|
-
* proper transformation of the identified object.
|
|
24
|
-
*/
|
|
25
|
-
objectPath?: ObjectID[];
|
|
26
|
-
/**
|
|
27
|
-
* Identifies the cad entity of the graphic/geometry cache.
|
|
28
|
-
* Optional but needed for graphic/geometry element identification.
|
|
29
|
-
*/
|
|
30
|
-
containerId?: ObjectID;
|
|
31
|
-
/**
|
|
32
|
-
* Identifies a single graphic/geometry element of a cad entity.
|
|
33
|
-
* Optional but needed for graphic/geometry element identification.
|
|
34
|
-
*/
|
|
35
|
-
graphicId?: GraphicID;
|
|
36
|
-
/**
|
|
37
|
-
* Arbitrary object that contains user specific information.
|
|
38
|
-
*/
|
|
39
|
-
userData?: T;
|
|
40
|
-
};
|
|
41
|
-
export declare const createInfo: (data: Omit<InteractionInfo, 'uniqueIdent'>) => InteractionInfo;
|
|
42
|
-
export declare const createUniqueIdent: (data: Omit<InteractionInfo, 'uniqueIdent'>) => string;
|
|
1
|
+
import { GraphicID, ObjectID } from '../re-export';
|
|
2
|
+
/**
|
|
3
|
+
* It contains general information that can be used to identify CCObjects as well as Brep Elements.
|
|
4
|
+
*/
|
|
5
|
+
export declare type InteractionInfo<T = any> = {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier of the interaction info.
|
|
8
|
+
*/
|
|
9
|
+
uniqueIdent: string;
|
|
10
|
+
/**
|
|
11
|
+
* Identifies the object of the Part (for BaseModeling).
|
|
12
|
+
* Needed to identify the location ot the object in the tree.
|
|
13
|
+
*/
|
|
14
|
+
objectId: ObjectID;
|
|
15
|
+
/**
|
|
16
|
+
* Identifies the instance of the Assembly (for BaseModeling).
|
|
17
|
+
* Needed to identify the location ot the object in the tree.
|
|
18
|
+
*/
|
|
19
|
+
prodRefId?: ObjectID | null;
|
|
20
|
+
/**
|
|
21
|
+
* Indentifies an object in the tree by it's full path, starting at AllObjects.
|
|
22
|
+
* It is optional, but should be filled if possible. It can be used to get the full,
|
|
23
|
+
* proper transformation of the identified object.
|
|
24
|
+
*/
|
|
25
|
+
objectPath?: ObjectID[];
|
|
26
|
+
/**
|
|
27
|
+
* Identifies the cad entity of the graphic/geometry cache.
|
|
28
|
+
* Optional but needed for graphic/geometry element identification.
|
|
29
|
+
*/
|
|
30
|
+
containerId?: ObjectID;
|
|
31
|
+
/**
|
|
32
|
+
* Identifies a single graphic/geometry element of a cad entity.
|
|
33
|
+
* Optional but needed for graphic/geometry element identification.
|
|
34
|
+
*/
|
|
35
|
+
graphicId?: GraphicID;
|
|
36
|
+
/**
|
|
37
|
+
* Arbitrary object that contains user specific information.
|
|
38
|
+
*/
|
|
39
|
+
userData?: T;
|
|
40
|
+
};
|
|
41
|
+
export declare const createInfo: (data: Omit<InteractionInfo, 'uniqueIdent'>) => InteractionInfo;
|
|
42
|
+
export declare const createUniqueIdent: (data: Omit<InteractionInfo, 'uniqueIdent'>) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ScgStructure } from '../re-export';
|
|
2
|
-
export * from './InteractionInfo';
|
|
3
|
-
/**
|
|
4
|
-
* Defines the default structure tree.
|
|
5
|
-
* Should be used to initialize a new structure tree.
|
|
6
|
-
*/
|
|
7
|
-
export declare const DEFAULT_STRUCTURE_TREE: () => ScgStructure;
|
|
1
|
+
import { ScgStructure } from '../re-export';
|
|
2
|
+
export * from './InteractionInfo';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the default structure tree.
|
|
5
|
+
* Should be used to initialize a new structure tree.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_STRUCTURE_TREE: () => ScgStructure;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
export declare const MathUtils: {
|
|
3
|
-
convertToMatrix4: (coordinateSystem: number[][]) => THREE.Matrix4;
|
|
4
|
-
convertToMatrix3: (coordinateSystem: number[][]) => THREE.Matrix3;
|
|
5
|
-
convertToCoordinateSystem: (matrix: THREE.Matrix4) => number[][];
|
|
6
|
-
round(value: number, digits: number): number;
|
|
7
|
-
/**
|
|
8
|
-
* Calculates a transformation matrix.
|
|
9
|
-
*
|
|
10
|
-
* xDir and yDir are NOT orthogonal in general case, thus the y-axis is calculated as a series of cross products.
|
|
11
|
-
*
|
|
12
|
-
* @param originPos The origin position.
|
|
13
|
-
* @param xDir The x direction.
|
|
14
|
-
* @param yDir The y direction.
|
|
15
|
-
* @param offset The offset vector.
|
|
16
|
-
* @param rotation The rotation vector.
|
|
17
|
-
* @param inverted The inverted flag --- 0: do not invert; 1: do invert.
|
|
18
|
-
* @returns The calculated THREE.Matrix4
|
|
19
|
-
*/
|
|
20
|
-
calcluateTransform: (originPos: THREE.Vector3, xDir: THREE.Vector3, yDir: THREE.Vector3, offset: THREE.Vector3, rotation: THREE.Vector3, inverted: 0 | 1) => THREE.Matrix4;
|
|
21
|
-
};
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export declare const MathUtils: {
|
|
3
|
+
convertToMatrix4: (coordinateSystem: number[][]) => THREE.Matrix4;
|
|
4
|
+
convertToMatrix3: (coordinateSystem: number[][]) => THREE.Matrix3;
|
|
5
|
+
convertToCoordinateSystem: (matrix: THREE.Matrix4) => number[][];
|
|
6
|
+
round(value: number, digits: number): number;
|
|
7
|
+
/**
|
|
8
|
+
* Calculates a transformation matrix.
|
|
9
|
+
*
|
|
10
|
+
* xDir and yDir are NOT orthogonal in general case, thus the y-axis is calculated as a series of cross products.
|
|
11
|
+
*
|
|
12
|
+
* @param originPos The origin position.
|
|
13
|
+
* @param xDir The x direction.
|
|
14
|
+
* @param yDir The y direction.
|
|
15
|
+
* @param offset The offset vector.
|
|
16
|
+
* @param rotation The rotation vector.
|
|
17
|
+
* @param inverted The inverted flag --- 0: do not invert; 1: do invert.
|
|
18
|
+
* @returns The calculated THREE.Matrix4
|
|
19
|
+
*/
|
|
20
|
+
calcluateTransform: (originPos: THREE.Vector3, xDir: THREE.Vector3, yDir: THREE.Vector3, offset: THREE.Vector3, rotation: THREE.Vector3, inverted: 0 | 1) => THREE.Matrix4;
|
|
21
|
+
};
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { ArcGeometry, LineGeometry, PlaneGeometry, PointGeometry, ProductElement } from './../geometry';
|
|
3
|
-
import { DrawingID } from './../store/states/drawing';
|
|
4
|
-
export declare type ValueMeasureData = {
|
|
5
|
-
value: number;
|
|
6
|
-
};
|
|
7
|
-
export declare type LinearMeasureData = {
|
|
8
|
-
value: number;
|
|
9
|
-
start: THREE.Vector3;
|
|
10
|
-
end: THREE.Vector3;
|
|
11
|
-
};
|
|
12
|
-
export declare type AngularMeasureData = {
|
|
13
|
-
value: number;
|
|
14
|
-
center: THREE.Vector3;
|
|
15
|
-
dir1: THREE.Vector3;
|
|
16
|
-
dir2: THREE.Vector3;
|
|
17
|
-
};
|
|
18
|
-
export declare type PositionMeasureData = {
|
|
19
|
-
value: THREE.Vector3;
|
|
20
|
-
};
|
|
21
|
-
export declare type VectorMeasureData = {
|
|
22
|
-
value: THREE.Vector3;
|
|
23
|
-
start: THREE.Vector3;
|
|
24
|
-
end: THREE.Vector3;
|
|
25
|
-
};
|
|
26
|
-
declare type MeasureData = LinearMeasureData | AngularMeasureData | PositionMeasureData | VectorMeasureData | ValueMeasureData;
|
|
27
|
-
export declare enum MeasureResultType {
|
|
28
|
-
NONE = "none",
|
|
29
|
-
VALUE = "value",
|
|
30
|
-
DISTANCE = "linear",
|
|
31
|
-
ANGLE = "angular",
|
|
32
|
-
VECTOR = "vector",
|
|
33
|
-
POSITION = "position"
|
|
34
|
-
}
|
|
35
|
-
export declare type MeasureResult = {
|
|
36
|
-
description: string;
|
|
37
|
-
type: MeasureResultType;
|
|
38
|
-
measureData?: MeasureData;
|
|
39
|
-
};
|
|
40
|
-
declare type Item = ProductElement;
|
|
41
|
-
export declare const Measure: {
|
|
42
|
-
transform(items: Item[], drawingId: DrawingID): Item[];
|
|
43
|
-
getInfo(objects: Item[], drawingId: DrawingID): MeasureResult[];
|
|
44
|
-
calculateMeasures(objects: Item[], drawingId: DrawingID): MeasureResult[];
|
|
45
|
-
calculatePointPoint(point1: THREE.Vector3, point2: THREE.Vector3): MeasureResult[];
|
|
46
|
-
calculatePointLine(point: PointGeometry, line: LineGeometry): MeasureResult[];
|
|
47
|
-
calculatePointPlane(point: PointGeometry, plane: PlaneGeometry): MeasureResult[];
|
|
48
|
-
calculateLineLine(first: LineGeometry, second: LineGeometry): MeasureResult[];
|
|
49
|
-
calculateLinePlane(line: LineGeometry, plane: PlaneGeometry): MeasureResult[];
|
|
50
|
-
calculateArcPlane(arc: ArcGeometry, plane: PlaneGeometry): MeasureResult[];
|
|
51
|
-
calculatePlanePlane(plane1: PlaneGeometry, plane2: PlaneGeometry): MeasureResult[];
|
|
52
|
-
degrees(radians: number): number;
|
|
53
|
-
areParallel(vec1: THREE.Vector3, vec2: THREE.Vector3): boolean;
|
|
54
|
-
arePerpendicular(vec1: THREE.Vector3, vec2: THREE.Vector3): boolean;
|
|
55
|
-
getPointLineMPoints(pointsPos: THREE.Vector3, startPos: THREE.Vector3, endPos: THREE.Vector3): [THREE.Vector3, THREE.Vector3];
|
|
56
|
-
getPointPlaneMPoints(pointPos: THREE.Vector3, pointOnPlane: THREE.Vector3, normal: THREE.Vector3): [THREE.Vector3, THREE.Vector3];
|
|
57
|
-
getLineLineMPoints(start1Pos: THREE.Vector3, end1Pos: THREE.Vector3, start2Pos: THREE.Vector3, end2Pos: THREE.Vector3): [THREE.Vector3, THREE.Vector3] | [undefined, undefined];
|
|
58
|
-
getLinePlaneMPoints(startPos: THREE.Vector3, endPos: THREE.Vector3, pointOnPlane: THREE.Vector3, normal: THREE.Vector3): [THREE.Vector3, THREE.Vector3] | [undefined, undefined];
|
|
59
|
-
getArcPlaneMPoints(arcCenter: THREE.Vector3, arcNormal: THREE.Vector3, pointOnPlane: THREE.Vector3, planeNormal: THREE.Vector3): [THREE.Vector3, THREE.Vector3] | [undefined, undefined];
|
|
60
|
-
getPlanePlaneMPoints(pointOnPlane1: THREE.Vector3, normal1: THREE.Vector3, pointOnPlane2: THREE.Vector3, normal2: THREE.Vector3): [THREE.Vector3, THREE.Vector3] | [undefined, undefined];
|
|
61
|
-
getLineLineMDirs(start1Pos: THREE.Vector3, end1Pos: THREE.Vector3, start2Pos: THREE.Vector3, end2Pos: THREE.Vector3): THREE.Vector3[];
|
|
62
|
-
getPlanePlaneMDirs(normal1: THREE.Vector3, normal2: THREE.Vector3): THREE.Vector3[] | undefined[];
|
|
63
|
-
};
|
|
64
|
-
export {};
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { ArcGeometry, LineGeometry, PlaneGeometry, PointGeometry, ProductElement } from './../geometry';
|
|
3
|
+
import { DrawingID } from './../store/states/drawing';
|
|
4
|
+
export declare type ValueMeasureData = {
|
|
5
|
+
value: number;
|
|
6
|
+
};
|
|
7
|
+
export declare type LinearMeasureData = {
|
|
8
|
+
value: number;
|
|
9
|
+
start: THREE.Vector3;
|
|
10
|
+
end: THREE.Vector3;
|
|
11
|
+
};
|
|
12
|
+
export declare type AngularMeasureData = {
|
|
13
|
+
value: number;
|
|
14
|
+
center: THREE.Vector3;
|
|
15
|
+
dir1: THREE.Vector3;
|
|
16
|
+
dir2: THREE.Vector3;
|
|
17
|
+
};
|
|
18
|
+
export declare type PositionMeasureData = {
|
|
19
|
+
value: THREE.Vector3;
|
|
20
|
+
};
|
|
21
|
+
export declare type VectorMeasureData = {
|
|
22
|
+
value: THREE.Vector3;
|
|
23
|
+
start: THREE.Vector3;
|
|
24
|
+
end: THREE.Vector3;
|
|
25
|
+
};
|
|
26
|
+
declare type MeasureData = LinearMeasureData | AngularMeasureData | PositionMeasureData | VectorMeasureData | ValueMeasureData;
|
|
27
|
+
export declare enum MeasureResultType {
|
|
28
|
+
NONE = "none",
|
|
29
|
+
VALUE = "value",
|
|
30
|
+
DISTANCE = "linear",
|
|
31
|
+
ANGLE = "angular",
|
|
32
|
+
VECTOR = "vector",
|
|
33
|
+
POSITION = "position"
|
|
34
|
+
}
|
|
35
|
+
export declare type MeasureResult = {
|
|
36
|
+
description: string;
|
|
37
|
+
type: MeasureResultType;
|
|
38
|
+
measureData?: MeasureData;
|
|
39
|
+
};
|
|
40
|
+
declare type Item = ProductElement;
|
|
41
|
+
export declare const Measure: {
|
|
42
|
+
transform(items: Item[], drawingId: DrawingID): Item[];
|
|
43
|
+
getInfo(objects: Item[], drawingId: DrawingID): MeasureResult[];
|
|
44
|
+
calculateMeasures(objects: Item[], drawingId: DrawingID): MeasureResult[];
|
|
45
|
+
calculatePointPoint(point1: THREE.Vector3, point2: THREE.Vector3): MeasureResult[];
|
|
46
|
+
calculatePointLine(point: PointGeometry, line: LineGeometry): MeasureResult[];
|
|
47
|
+
calculatePointPlane(point: PointGeometry, plane: PlaneGeometry): MeasureResult[];
|
|
48
|
+
calculateLineLine(first: LineGeometry, second: LineGeometry): MeasureResult[];
|
|
49
|
+
calculateLinePlane(line: LineGeometry, plane: PlaneGeometry): MeasureResult[];
|
|
50
|
+
calculateArcPlane(arc: ArcGeometry, plane: PlaneGeometry): MeasureResult[];
|
|
51
|
+
calculatePlanePlane(plane1: PlaneGeometry, plane2: PlaneGeometry): MeasureResult[];
|
|
52
|
+
degrees(radians: number): number;
|
|
53
|
+
areParallel(vec1: THREE.Vector3, vec2: THREE.Vector3): boolean;
|
|
54
|
+
arePerpendicular(vec1: THREE.Vector3, vec2: THREE.Vector3): boolean;
|
|
55
|
+
getPointLineMPoints(pointsPos: THREE.Vector3, startPos: THREE.Vector3, endPos: THREE.Vector3): [THREE.Vector3, THREE.Vector3];
|
|
56
|
+
getPointPlaneMPoints(pointPos: THREE.Vector3, pointOnPlane: THREE.Vector3, normal: THREE.Vector3): [THREE.Vector3, THREE.Vector3];
|
|
57
|
+
getLineLineMPoints(start1Pos: THREE.Vector3, end1Pos: THREE.Vector3, start2Pos: THREE.Vector3, end2Pos: THREE.Vector3): [THREE.Vector3, THREE.Vector3] | [undefined, undefined];
|
|
58
|
+
getLinePlaneMPoints(startPos: THREE.Vector3, endPos: THREE.Vector3, pointOnPlane: THREE.Vector3, normal: THREE.Vector3): [THREE.Vector3, THREE.Vector3] | [undefined, undefined];
|
|
59
|
+
getArcPlaneMPoints(arcCenter: THREE.Vector3, arcNormal: THREE.Vector3, pointOnPlane: THREE.Vector3, planeNormal: THREE.Vector3): [THREE.Vector3, THREE.Vector3] | [undefined, undefined];
|
|
60
|
+
getPlanePlaneMPoints(pointOnPlane1: THREE.Vector3, normal1: THREE.Vector3, pointOnPlane2: THREE.Vector3, normal2: THREE.Vector3): [THREE.Vector3, THREE.Vector3] | [undefined, undefined];
|
|
61
|
+
getLineLineMDirs(start1Pos: THREE.Vector3, end1Pos: THREE.Vector3, start2Pos: THREE.Vector3, end2Pos: THREE.Vector3): THREE.Vector3[];
|
|
62
|
+
getPlanePlaneMDirs(normal1: THREE.Vector3, normal2: THREE.Vector3): THREE.Vector3[] | undefined[];
|
|
63
|
+
};
|
|
64
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare type TimingMode = 'fromStart' | 'fromPrevious';
|
|
2
|
-
export declare const Timing: {
|
|
3
|
-
start: (key?: string) => string;
|
|
4
|
-
stop: (key: string) => number;
|
|
5
|
-
measure: (key: string, mode?: TimingMode) => number;
|
|
6
|
-
dump: (key: string, message?: string, mode?: TimingMode) => void;
|
|
7
|
-
};
|
|
8
|
-
export {};
|
|
1
|
+
declare type TimingMode = 'fromStart' | 'fromPrevious';
|
|
2
|
+
export declare const Timing: {
|
|
3
|
+
start: (key?: string) => string;
|
|
4
|
+
stop: (key: string) => number;
|
|
5
|
+
measure: (key: string, mode?: TimingMode) => number;
|
|
6
|
+
dump: (key: string, message?: string, mode?: TimingMode) => void;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buerli.io/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-beta.7",
|
|
4
4
|
"description": "buerli state management",
|
|
5
5
|
"author": "AWV Informatik AG <info@awv-informatik.ch>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"typescript": "4.8.4"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@classcad/api-js": "https://awvstatic.com/classcad/download/release/21.
|
|
36
|
+
"@classcad/api-js": "https://awvstatic.com/classcad/download/release/21.2.0/js/classcad-api-js-21.2.0.tgz",
|
|
37
37
|
"fast-json-patch": "^3.1.1",
|
|
38
38
|
"jsonpatch": "^3.1.0",
|
|
39
39
|
"uuid": "^9.0.0",
|