@buerli.io/react-cad 0.0.23 → 0.1.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/build/components/UI/CAD/{SideBar/Constraints.d.ts → Constraints.d.ts} +6 -0
- package/build/components/UI/CAD/Drawing.d.ts +8 -1
- package/build/components/UI/CAD/{SideBar/AssemblyTree → ModelTree}/AssemblyNode.d.ts +0 -0
- package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/Feature.d.ts +0 -0
- package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/FeatureList.d.ts +0 -0
- package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/index.d.ts +0 -0
- package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/utils.d.ts +0 -0
- package/build/components/UI/CAD/ModelTree/ModelTree.d.ts +13 -0
- package/build/components/UI/CAD/{SideBar/AssemblyTree/AssemblyTreeHeader.d.ts → ModelTree/ModelTreeHeader.d.ts} +2 -2
- package/build/components/UI/CAD/ModelTree/index.d.ts +1 -0
- package/build/components/UI/CAD/{SideBar/AssemblyTree → ModelTree}/primitives.d.ts +0 -0
- package/build/components/UI/CAD/{SideBar/AssemblyTree → ModelTree}/useMenuItems.d.ts +1 -1
- package/build/components/UI/CAD/{SideBar/SideBar.d.ts → SideBar.d.ts} +0 -0
- package/build/components/UI/CAD/{SideBar/Solids → Solids}/ColorPicker.d.ts +0 -0
- package/build/components/UI/CAD/Solids/Solids.d.ts +11 -0
- package/build/components/UI/CAD/{SideBar/Solids → Solids}/index.d.ts +0 -0
- package/build/components/UI/CAD/{SideBar/Solids → Solids}/useMenuItems.d.ts +1 -1
- package/build/components/UI/CAD/ViewOptionsBar/ViewOptionButtons.d.ts +1 -4
- package/build/components/UI/CAD/ViewOptionsBar/useOptionCommands.d.ts +1 -8
- package/build/components/UI/CAD/common/Menu.d.ts +11 -0
- package/build/components/UI/CAD/{SideBar → common}/SectionHeader.d.ts +0 -0
- package/build/components/UI/CAD/hooks/index.d.ts +1 -0
- package/build/components/UI/CAD/{SideBar/FeatureList → hooks}/useMenuItems.d.ts +1 -1
- package/build/components/UI/CAD/index.d.ts +8 -3
- package/build/components/UI/CAD/plugins/ProductManagement/index.d.ts +3 -0
- package/build/components/UI/CAD/store/CADStore.d.ts +3 -0
- package/build/components/UI/Readfile.d.ts +5 -4
- package/build/components/UI/editors/useParam.d.ts +14 -1
- package/build/components/utils/CompValidation/validators/{AssemblyTreeValidator.d.ts → ModelTreeValidator.d.ts} +2 -2
- package/build/index.cjs.js +3091 -2030
- package/build/index.d.ts +2 -1
- package/build/index.js +3081 -2027
- package/build/plugins/Sketch/Root/{Constraints.d.ts → Constraints/Constraints.d.ts} +0 -0
- package/build/plugins/Sketch/Root/{constraintsHelpers.d.ts → Constraints/constraintsHelpers.d.ts} +0 -0
- package/build/plugins/Sketch/Root/Constraints/index.d.ts +2 -0
- package/build/plugins/Sketch/Root/Constraints/utils.d.ts +6 -0
- package/build/plugins/Sketch/View/graphics/Merged/Arc.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/ArcGeometry.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/ArcMaterial.d.ts +2 -0
- package/build/plugins/Sketch/View/graphics/Merged/Circle.d.ts +7 -0
- package/build/plugins/Sketch/View/graphics/Merged/MergedWrapper.d.ts +11 -3
- package/build/plugins/Sketch/View/graphics/hooks.d.ts +7 -6
- package/build/plugins/Sketch/View/graphics/primitives.d.ts +3 -3
- package/build/plugins/Sketch/View/graphics/scale.d.ts +4 -3
- package/build/plugins/Sketch/View/handlers/{Handlers.d.ts → HandlersConstructors.d.ts} +1 -1
- package/build/plugins/Sketch/View/handlers/filletHelpers.d.ts +7 -8
- package/build/plugins/Sketch/description.d.ts +2 -0
- package/build/plugins/Sketch/types.d.ts +22 -13
- package/build/plugins/components/PluginForm.d.ts +11 -0
- package/build/types.d.ts +0 -12
- package/build/utils/drawing/useDrawingArr.d.ts +8 -0
- package/build/utils/drawing/useDrawingCCId.d.ts +8 -0
- package/build/utils/drawing/useDrawingStr.d.ts +8 -0
- package/build/utils/helpers.d.ts +2 -2
- package/build/utils/selection/useSelectorsOrder.d.ts +5 -0
- package/build/utils/useScale.d.ts +1 -1
- package/package.json +10 -8
- package/build/components/UI/CAD/CAD.d.ts +0 -7
- package/build/components/UI/CAD/SideBar/AssemblyTree/AssemblyTree.d.ts +0 -5
- package/build/components/UI/CAD/SideBar/AssemblyTree/index.d.ts +0 -1
- package/build/components/UI/CAD/SideBar/Solids/Solids.d.ts +0 -5
- package/build/components/UI/CAD/SideBar/index.d.ts +0 -1
- package/build/utils/zoomToFit.d.ts +0 -2
|
File without changes
|
package/build/plugins/Sketch/Root/{constraintsHelpers.d.ts → Constraints/constraintsHelpers.d.ts}
RENAMED
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CCClasses } from '@buerli.io/classcad';
|
|
2
|
+
export declare const classNameMap: {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function getKeyCode(constrClass: CCClasses): "KeyF" | "KeyH" | "KeyV" | "KeyI" | "KeyT" | "KeyP" | "KeyC" | "KeyE" | "KeyO" | "KeyD" | "KeyR" | null | undefined;
|
|
6
|
+
export declare function getHotKey(constrClass: CCClasses): string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as THREE from 'three';
|
|
3
|
+
import { DrawingID, PluginID } from '@buerli.io/core';
|
|
3
4
|
import { commonProps } from '../primitives';
|
|
5
|
+
export declare const useTubeRadius: (drawingId: DrawingID, pluginId: PluginID) => number;
|
|
4
6
|
export declare const Arc: React.FC<{
|
|
5
7
|
start: THREE.Vector3;
|
|
6
8
|
end: THREE.Vector3;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as THREE from 'three';
|
|
3
|
+
declare type ArcInstance = THREE.Group & {
|
|
4
|
+
radius: number;
|
|
5
|
+
tubeRadius: number;
|
|
6
|
+
angularLength: number;
|
|
7
|
+
};
|
|
3
8
|
export declare const getCylBB: () => THREE.Box3;
|
|
4
9
|
export declare const getSphereBB: () => THREE.Box3;
|
|
10
|
+
export declare const getArcBB: (mesh: ArcInstance) => THREE.Box3;
|
|
5
11
|
export declare const MeshContext: React.Context<{
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
MockCylinder: any;
|
|
13
|
+
MockSphere: any;
|
|
14
|
+
MockArc: any;
|
|
8
15
|
}>;
|
|
9
16
|
/**
|
|
10
17
|
* Component which implements InstancedMesh from three.js.
|
|
11
|
-
* Merged component from drei takes globaly created meshes and then passes corresponding "mocked" components via function props (
|
|
18
|
+
* Merged component from drei takes globaly created meshes and then passes corresponding "mocked" components via function props (MockCylinder and MockSphere) to children.
|
|
12
19
|
* "mocked" components are used for saying drei where to draw instances.
|
|
13
20
|
*/
|
|
14
21
|
export declare const MergedWrapper: React.FC;
|
|
22
|
+
export {};
|
|
@@ -14,17 +14,18 @@ declare type ObjState = {
|
|
|
14
14
|
lgsState: number;
|
|
15
15
|
};
|
|
16
16
|
export declare const getColor: (object: IStructureObject, objState: ObjState) => number;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Return pointerHandlers of currently enabled sketch Handler.
|
|
19
|
+
* @param objId
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare const useSketchHandlers: (objId: ObjectID) => Record<string, (e: PointerEvent & import("@react-three/fiber/dist/declarations/src/core/events").IntesectionEvent<PointerEvent> & import("../../types").PointerEventsT) => void> | undefined;
|
|
20
23
|
export declare const useColor: (objId: ObjectID, gHovered: boolean) => number;
|
|
21
24
|
export declare const useUserData: (objId: ObjectID) => {
|
|
22
25
|
objId: number;
|
|
23
26
|
};
|
|
24
27
|
export declare const useHandlersAndColor: (drawingId: DrawingID, objId: ObjectID) => {
|
|
25
|
-
handlers:
|
|
26
|
-
[key: string]: (e: PointerEvent & import("@react-three/fiber/dist/declarations/src/core/events").IntesectionEvent<PointerEvent> & import("../../types").PointerEventsT) => void;
|
|
27
|
-
};
|
|
28
|
+
handlers: Record<string, (e: PointerEvent & import("@react-three/fiber/dist/declarations/src/core/events").IntesectionEvent<PointerEvent> & import("../../types").PointerEventsT) => void>;
|
|
28
29
|
color: number;
|
|
29
30
|
};
|
|
30
31
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare const lineWidth = 0.
|
|
4
|
-
export declare const pointSize = 0.
|
|
5
|
-
export declare const arcWidth = 0.
|
|
3
|
+
export declare const lineWidth = 0.25;
|
|
4
|
+
export declare const pointSize = 0.6;
|
|
5
|
+
export declare const arcWidth = 0.25;
|
|
6
6
|
export declare const radSegments = 32;
|
|
7
7
|
export declare const tubeSegments = 6;
|
|
8
8
|
export declare type commonProps = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
2
|
+
import { DrawingID, PluginID } from '@buerli.io/core';
|
|
3
|
+
export declare function setScale(drawingId: DrawingID, pluginId: PluginID, newScale: number): void;
|
|
4
|
+
export declare function getScale(drawingId: DrawingID, pluginId: PluginID): number;
|
|
5
|
+
export declare function useScale(drawingId: DrawingID, pluginId: PluginID, getVector?: (sf: number) => [number, number, number]): React.MutableRefObject<import("three").Object3D<import("three").Event> | undefined>;
|
|
@@ -9,7 +9,7 @@ import { DrawCircle } from './DrawCircle';
|
|
|
9
9
|
import { Fillet } from './Fillet';
|
|
10
10
|
import { Trim } from './Trim';
|
|
11
11
|
import { UseRef } from './UseRef';
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const HandlersConstructors: {
|
|
13
13
|
createAngle: typeof CreateAngle;
|
|
14
14
|
drag: typeof Drag;
|
|
15
15
|
drawPoint: typeof DrawPoint;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { IStructureTree, ObjectID, IStructureObject } from '@buerli.io/core';
|
|
3
|
-
import { WithChildren, WithMembers } from '../../../../types';
|
|
4
3
|
export declare function getSketchDescendants(tree: IStructureTree, sketchId: ObjectID): number[];
|
|
5
4
|
export declare function findPointsAt(pos: THREE.Vector3, tree: IStructureTree, sketchId: ObjectID): IStructureObject[];
|
|
6
5
|
export declare function findConstraints(type: string, objA: IStructureObject, objB: IStructureObject, tree: IStructureTree, sketchId: ObjectID): number[];
|
|
7
6
|
declare type FilletInfo = {
|
|
8
|
-
lines: Array<IStructureObject
|
|
9
|
-
lineStarts: Array<IStructureObject
|
|
10
|
-
lineEnds: Array<IStructureObject
|
|
7
|
+
lines: Array<IStructureObject>;
|
|
8
|
+
lineStarts: Array<IStructureObject>;
|
|
9
|
+
lineEnds: Array<IStructureObject>;
|
|
11
10
|
control: THREE.Vector3;
|
|
12
11
|
};
|
|
13
12
|
declare type NewFilletInfo = FilletInfo & {
|
|
14
13
|
incidence: ObjectID;
|
|
15
14
|
};
|
|
16
15
|
declare type ExistingFilletInfo = FilletInfo & {
|
|
17
|
-
object: IStructureObject
|
|
16
|
+
object: IStructureObject;
|
|
18
17
|
objectEnds: IStructureObject[];
|
|
19
|
-
filletPoint: IStructureObject
|
|
18
|
+
filletPoint: IStructureObject;
|
|
20
19
|
};
|
|
21
20
|
export declare function recognizeFilletableAngle(pos: THREE.Vector3, tree: IStructureTree, sketchId: ObjectID): NewFilletInfo | null;
|
|
22
21
|
export declare function getTouchPoints(info: FilletInfo, distance: number): THREE.Vector3[] | null;
|
|
@@ -29,7 +28,7 @@ export declare function calculateFilletParams(info: FilletInfo, distance: number
|
|
|
29
28
|
clockwise: boolean;
|
|
30
29
|
control: THREE.Vector3;
|
|
31
30
|
} | null;
|
|
32
|
-
export declare function calculateNewFilletData(object: IStructureObject
|
|
31
|
+
export declare function calculateNewFilletData(object: IStructureObject, tree: IStructureTree, sketchId: ObjectID): {
|
|
33
32
|
info: NewFilletInfo;
|
|
34
33
|
params: {
|
|
35
34
|
start: THREE.Vector3;
|
|
@@ -39,5 +38,5 @@ export declare function calculateNewFilletData(object: IStructureObject & WithMe
|
|
|
39
38
|
control: THREE.Vector3;
|
|
40
39
|
};
|
|
41
40
|
} | null;
|
|
42
|
-
export declare function recognizeFilletByArc(object: IStructureObject
|
|
41
|
+
export declare function recognizeFilletByArc(object: IStructureObject, tree: IStructureTree, sketchId: ObjectID): ExistingFilletInfo | null;
|
|
43
42
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ThreeEvent, ReactThreeFiber } from '@react-three/fiber';
|
|
3
3
|
import { IStructureObject, ObjectID, PluginID } from '@buerli.io/core';
|
|
4
|
-
import { CCClasses } from '@buerli.io/classcad';
|
|
5
4
|
import { InfinityPlane } from '../../components/graphics/InfinityPlane';
|
|
6
5
|
import { Geometry } from 'three-stdlib';
|
|
7
6
|
export declare type HighlightedConstraintsT = Array<{
|
|
@@ -24,6 +23,7 @@ export declare type SketchPState = {
|
|
|
24
23
|
selected: ObjectID[];
|
|
25
24
|
hovered: ObjectID;
|
|
26
25
|
highlighted: ObjectID[];
|
|
26
|
+
isDragged: boolean;
|
|
27
27
|
scale: number;
|
|
28
28
|
step: number;
|
|
29
29
|
dimPluginId: PluginID | undefined;
|
|
@@ -33,6 +33,7 @@ export declare type SketchPState = {
|
|
|
33
33
|
min: THREE.Vector2;
|
|
34
34
|
max: THREE.Vector2;
|
|
35
35
|
} | undefined;
|
|
36
|
+
cursor: null | string;
|
|
36
37
|
};
|
|
37
38
|
export declare type TmpObjectID = string;
|
|
38
39
|
export declare enum HandlersList {
|
|
@@ -58,25 +59,33 @@ export declare type PointerEventsT = {
|
|
|
58
59
|
export declare type Handler = {
|
|
59
60
|
name: HandlersList;
|
|
60
61
|
filter: (object: IStructureObject) => boolean;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
pointerHandlers: {
|
|
66
|
-
[key: string]: (e: ThreeEvent<PointerEvent> & PointerEventsT) => void;
|
|
67
|
-
};
|
|
68
|
-
keyHandlers?: {
|
|
69
|
-
[key: string]: (e: KeyboardEvent) => boolean | void;
|
|
70
|
-
};
|
|
62
|
+
onActivate?: () => void;
|
|
63
|
+
onDeactivate?: () => void;
|
|
64
|
+
pointerHandlers: Record<string, (e: ThreeEvent<PointerEvent> & PointerEventsT) => void>;
|
|
65
|
+
keyHandlers?: Record<string, (e: KeyboardEvent) => boolean | void>;
|
|
71
66
|
};
|
|
67
|
+
export declare enum TmpObjClasses {
|
|
68
|
+
Line = "Line",
|
|
69
|
+
Point = "Point",
|
|
70
|
+
Circle = "Cirlce",
|
|
71
|
+
Arc = "Arc",
|
|
72
|
+
AngularDimension = "AngularDimension",
|
|
73
|
+
Rectangle = "Rectangle"
|
|
74
|
+
}
|
|
72
75
|
declare type TmpObjectCommon = {
|
|
73
|
-
class:
|
|
76
|
+
class: TmpObjClasses;
|
|
74
77
|
id: string;
|
|
75
78
|
};
|
|
76
79
|
export declare type TmpLineT = TmpObjectCommon & {
|
|
77
80
|
startPId: TmpObjectID;
|
|
78
81
|
endPId: TmpObjectID;
|
|
79
82
|
};
|
|
83
|
+
export declare type TmpRectT = TmpObjectCommon & {
|
|
84
|
+
start: THREE.Vector3;
|
|
85
|
+
end: THREE.Vector3;
|
|
86
|
+
isSquare: boolean;
|
|
87
|
+
isCentered: boolean;
|
|
88
|
+
};
|
|
80
89
|
export declare type TmpPointT = TmpObjectCommon & {
|
|
81
90
|
position: THREE.Vector3;
|
|
82
91
|
};
|
|
@@ -98,7 +107,7 @@ export declare type TmpAngularDimensionT = TmpObjectCommon & {
|
|
|
98
107
|
dimPos: THREE.Vector3;
|
|
99
108
|
reflex: number;
|
|
100
109
|
};
|
|
101
|
-
export declare type TmpObject = TmpLineT | TmpPointT | TmpArcT | TmpCircleT | TmpAngularDimensionT;
|
|
110
|
+
export declare type TmpObject = TmpLineT | TmpPointT | TmpArcT | TmpCircleT | TmpAngularDimensionT | TmpRectT;
|
|
102
111
|
export declare type TmpObjects = {
|
|
103
112
|
[key: string]: TmpObject;
|
|
104
113
|
};
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DrawingID } from '@buerli.io/core';
|
|
3
3
|
import { MemberParam } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* @param drawingId - id of the drawing.
|
|
6
|
+
* @param update - a function which will be called when user presses "Update" button.
|
|
7
|
+
* @param params - all params which should be sent to the server. PluginForm validates each of them.
|
|
8
|
+
* @param validator - smart validation (check https://awv-informatik.atlassian.net/wiki/spaces/CLAS/pages/2428076033/Validation for mor details)
|
|
9
|
+
* @param autoClose - (optional) if true plugin will closed after update. Default is true.
|
|
10
|
+
* @param forceUpdateEnabled - if plugin is opened for the recently created feature it contains default values.
|
|
11
|
+
* User should be able to click "Update" button (clicking on close will remove the feature). Since there is no params changed by the user validator disables "Update" button.
|
|
12
|
+
* To make "Update" button enabled with default values pass true to forceUpdateEnabled
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
4
15
|
export declare const PluginForm: React.FC<{
|
|
5
16
|
drawingId: DrawingID;
|
|
6
17
|
update: () => Promise<void>;
|
package/build/types.d.ts
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IStructureMember, ObjectID } from '@buerli.io/core';
|
|
3
|
-
export declare type WithMembers = {
|
|
4
|
-
members: {
|
|
5
|
-
[key: string]: IStructureMember;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export declare type WithChildren = {
|
|
9
|
-
children: ObjectID[];
|
|
10
|
-
};
|
|
11
|
-
export declare type WithParent = {
|
|
12
|
-
parent: ObjectID;
|
|
13
|
-
};
|
|
14
2
|
export declare type MemberParam<T> = {
|
|
15
3
|
userValue: T;
|
|
16
4
|
serverValue: T;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { DrawingID, DrawingState } from '@buerli.io/core';
|
|
2
|
+
/**
|
|
3
|
+
* Wrapper around useDrawing which allows to avoid ReferenceErrors.
|
|
4
|
+
* Use useDrawingArr if you want to get an array from store. It returns EMPTYARRAY if requested one is undefined.
|
|
5
|
+
*
|
|
6
|
+
* @param drawingId
|
|
7
|
+
* @param selector
|
|
8
|
+
* @returns requested by selector array or EMPTYARRAY if requested is undefined or null
|
|
9
|
+
*/
|
|
2
10
|
export declare function useDrawingArr<T>(drawingId: DrawingID, selector: (state: DrawingState) => Array<T> | undefined): Array<T>;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { DrawingID, DrawingState, ObjectID } from '@buerli.io/core';
|
|
2
|
+
/**
|
|
3
|
+
* Wrapper around useDrawing which allows to avoid ReferenceErrors.
|
|
4
|
+
* Use useDrawingCCId if you want to get an object id from store. It returns NOCCID if requested one is undefined or null.
|
|
5
|
+
*
|
|
6
|
+
* @param drawingId
|
|
7
|
+
* @param selector
|
|
8
|
+
* @returns requested by selector object id or NOCCID if requested is undefined or null
|
|
9
|
+
*/
|
|
2
10
|
export declare function useDrawingCCId(drawingId: DrawingID, selector: (state: DrawingState) => ObjectID | undefined): ObjectID;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { DrawingID, DrawingState } from '@buerli.io/core';
|
|
2
|
+
/**
|
|
3
|
+
* Wrapper around useDrawing which allows to avoid ReferenceErrors.
|
|
4
|
+
* Use useDrawingStr if you want to get a string from store. It returns EMPTYSTR if requested one is undefined.
|
|
5
|
+
*
|
|
6
|
+
* @param drawingId
|
|
7
|
+
* @param selector
|
|
8
|
+
* @returns requested by selector string or EMPTYSTRING if requested one is undefined or null
|
|
9
|
+
*/
|
|
2
10
|
export declare function useDrawingStr(drawingId: DrawingID, selector: (state: DrawingState) => string | undefined): string;
|
package/build/utils/helpers.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CCClasses } from '@buerli.io/classcad';
|
|
2
2
|
import { DrawingID, GeometryElement, GraphicID, IStructureObject, IStructureTree, MemberType, ObjectID, PointMem, PointMemValue, SelectedItem } from '@buerli.io/core';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
|
-
import { WithChildren, WithMembers } from '../types';
|
|
5
4
|
export declare function membersValues(drawingId: DrawingID, ccObjId: DrawingID): any;
|
|
6
5
|
export declare function addMembers(drawingId: DrawingID, ccObjId: DrawingID): {
|
|
7
6
|
members?: undefined;
|
|
@@ -15,7 +14,7 @@ export declare function convertToVector(point: PointMem): THREE.Vector3;
|
|
|
15
14
|
export declare function convertToArray(point: PointMem): number[];
|
|
16
15
|
export declare function linesIntersection(point1: THREE.Vector3, dir1: THREE.Vector3, point2: THREE.Vector3, dir2: THREE.Vector3): THREE.Vector3 | null;
|
|
17
16
|
export declare const angleVecVec: (a: THREE.Vector3, b: THREE.Vector3) => number;
|
|
18
|
-
export declare const calculateTangent: (tree: IStructureTree, object: IStructureObject
|
|
17
|
+
export declare const calculateTangent: (tree: IStructureTree, object: IStructureObject, point: THREE.Vector3) => THREE.Vector3 | undefined;
|
|
19
18
|
export declare function getDescendants(tree: IStructureTree, objectId: ObjectID): number[];
|
|
20
19
|
export declare function getAncestorIdByClass(drawingId: DrawingID, objectId: ObjectID, parentClass: CCClasses): number | null;
|
|
21
20
|
export declare const isSketchGeometry: (arg: IStructureObject | CCClasses) => boolean;
|
|
@@ -34,3 +33,4 @@ export declare function rgbToHex(color: {
|
|
|
34
33
|
}): string;
|
|
35
34
|
export declare function fmod(num: number, denom: number): number;
|
|
36
35
|
export declare function numberToHexColor(color: number): string;
|
|
36
|
+
export declare const solveQuartic: (a: number, b: number, c: number, d: number, e: number) => number[];
|
|
@@ -4,4 +4,9 @@ export declare type SelectorsOrderT = {
|
|
|
4
4
|
removeSelector: (selId: SelectorID) => void;
|
|
5
5
|
switchToNext: (selId: SelectorID) => void;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Allows to automatically enable all selectors in form one by one.
|
|
9
|
+
* @param drawingId
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
7
12
|
export declare function useSelectorsOrder(drawingId: DrawingID): SelectorsOrderT;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare function useScale(position: THREE.Vector3, getVector?: (sf: number) => [number, number, number]): React.MutableRefObject<import("three").Object3D | undefined>;
|
|
2
|
+
export declare function useScale(position: THREE.Vector3, getVector?: (sf: number) => [number, number, number]): React.MutableRefObject<import("three").Object3D<import("three").Event> | undefined>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buerli.io/react-cad",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "buerli CAD components",
|
|
5
5
|
"author": "AWV Informatik AG <info@awv-informatik.ch>",
|
|
6
6
|
"repository": {},
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@babel/preset-react": "^7.14.5",
|
|
48
48
|
"@babel/preset-typescript": "^7.10.4",
|
|
49
49
|
"@buerli.io/icons": "^1.0.9",
|
|
50
|
-
"@react-three/drei": "^
|
|
50
|
+
"@react-three/drei": "^8.10.6",
|
|
51
51
|
"@react-three/fiber": "^7.0.19",
|
|
52
52
|
"@rollup/plugin-babel": "^5.3.0",
|
|
53
53
|
"@rollup/plugin-image": "^2.1.0",
|
|
@@ -57,9 +57,10 @@
|
|
|
57
57
|
"@testing-library/react-hooks": "^3.4.2",
|
|
58
58
|
"@types/jest": "^26.0.8",
|
|
59
59
|
"@types/node": "^11.13.8",
|
|
60
|
+
"@types/path-browserify": "^1.0.0",
|
|
60
61
|
"@types/react": "^16.9.55",
|
|
61
62
|
"@types/styled-components": "^4.1.16",
|
|
62
|
-
"@types/three": "^0.
|
|
63
|
+
"@types/three": "^0.137",
|
|
63
64
|
"@types/uuid": "^3.4.5",
|
|
64
65
|
"@typescript-eslint/eslint-plugin": "4.13.0",
|
|
65
66
|
"@typescript-eslint/parser": "4.13.0",
|
|
@@ -85,19 +86,20 @@
|
|
|
85
86
|
"rollup-plugin-postcss": "^4.0.1",
|
|
86
87
|
"rollup-plugin-size-snapshot": "^0.12.0",
|
|
87
88
|
"rollup-plugin-terser": "^7.0.2",
|
|
88
|
-
"three": "^0.
|
|
89
|
+
"three": "^0.138",
|
|
89
90
|
"typescript": "4.1.2"
|
|
90
91
|
},
|
|
91
92
|
"peerDependencies": {
|
|
92
|
-
"@react-three/drei": "
|
|
93
|
+
"@react-three/drei": "^8.10.6",
|
|
93
94
|
"@react-three/fiber": ">= 7.0.17",
|
|
94
|
-
"three": ">=0.
|
|
95
|
+
"three": ">=0.138"
|
|
95
96
|
},
|
|
96
97
|
"dependencies": {
|
|
97
98
|
"@ant-design/compatible": "^1.0.8",
|
|
98
|
-
"@buerli.io/classcad": "0.0
|
|
99
|
-
"@buerli.io/react": "0.0
|
|
99
|
+
"@buerli.io/classcad": "0.1.0",
|
|
100
|
+
"@buerli.io/react": "0.1.0",
|
|
100
101
|
"antd": "^4.15.3",
|
|
102
|
+
"path-browserify": "^1.0.1",
|
|
101
103
|
"react": "^17.0.2",
|
|
102
104
|
"react-colorful": "^5.3.0",
|
|
103
105
|
"react-movable": "^2.3.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { AssemblyTree } from './AssemblyTree';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SideBar } from './SideBar';
|