@buerli.io/react-cad 0.0.23-beta.4 → 0.0.24-beta.1

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.
Files changed (65) hide show
  1. package/build/components/UI/CAD/{SideBar/Constraints.d.ts → Constraints.d.ts} +6 -0
  2. package/build/components/UI/CAD/Drawing.d.ts +8 -1
  3. package/build/components/UI/CAD/{SideBar/AssemblyTree → ModelTree}/AssemblyNode.d.ts +0 -0
  4. package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/Feature.d.ts +0 -0
  5. package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/FeatureList.d.ts +0 -0
  6. package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/index.d.ts +0 -0
  7. package/build/components/UI/CAD/{SideBar → ModelTree}/FeatureList/utils.d.ts +0 -0
  8. package/build/components/UI/CAD/ModelTree/ModelTree.d.ts +13 -0
  9. package/build/components/UI/CAD/{SideBar/AssemblyTree/AssemblyTreeHeader.d.ts → ModelTree/ModelTreeHeader.d.ts} +2 -2
  10. package/build/components/UI/CAD/ModelTree/index.d.ts +1 -0
  11. package/build/components/UI/CAD/{SideBar/AssemblyTree → ModelTree}/primitives.d.ts +0 -0
  12. package/build/components/UI/CAD/{SideBar/AssemblyTree → ModelTree}/useMenuItems.d.ts +1 -1
  13. package/build/components/UI/CAD/{SideBar/SideBar.d.ts → SideBar.d.ts} +0 -0
  14. package/build/components/UI/CAD/{SideBar/Solids → Solids}/ColorPicker.d.ts +0 -0
  15. package/build/components/UI/CAD/Solids/Solids.d.ts +11 -0
  16. package/build/components/UI/CAD/{SideBar/Solids → Solids}/index.d.ts +0 -0
  17. package/build/components/UI/CAD/{SideBar/Solids → Solids}/useMenuItems.d.ts +1 -1
  18. package/build/components/UI/CAD/ViewOptionsBar/ViewOptionButtons.d.ts +1 -4
  19. package/build/components/UI/CAD/ViewOptionsBar/useOptionCommands.d.ts +1 -8
  20. package/build/components/UI/CAD/common/Menu.d.ts +11 -0
  21. package/build/components/UI/CAD/{SideBar → common}/SectionHeader.d.ts +0 -0
  22. package/build/components/UI/CAD/hooks/index.d.ts +1 -0
  23. package/build/components/UI/CAD/{SideBar/FeatureList → hooks}/useMenuItems.d.ts +1 -1
  24. package/build/components/UI/CAD/index.d.ts +8 -3
  25. package/build/components/UI/CAD/plugins/ProductManagement/index.d.ts +3 -0
  26. package/build/components/UI/CAD/store/CADStore.d.ts +3 -0
  27. package/build/components/UI/Readfile.d.ts +5 -4
  28. package/build/components/UI/editors/useParam.d.ts +14 -1
  29. package/build/components/utils/CompValidation/validators/{AssemblyTreeValidator.d.ts → ModelTreeValidator.d.ts} +2 -2
  30. package/build/index.cjs.js +3365 -2276
  31. package/build/index.d.ts +2 -1
  32. package/build/index.js +3362 -2280
  33. package/build/plugins/Sketch/Root/{Constraints.d.ts → Constraints/Constraints.d.ts} +0 -0
  34. package/build/plugins/Sketch/Root/{constraintsHelpers.d.ts → Constraints/constraintsHelpers.d.ts} +0 -0
  35. package/build/plugins/Sketch/Root/Constraints/index.d.ts +2 -0
  36. package/build/plugins/Sketch/Root/Constraints/utils.d.ts +6 -0
  37. package/build/plugins/Sketch/View/graphics/Merged/Arc.d.ts +2 -0
  38. package/build/plugins/Sketch/View/graphics/Merged/ArcGeometry.d.ts +2 -0
  39. package/build/plugins/Sketch/View/graphics/Merged/ArcMaterial.d.ts +2 -0
  40. package/build/plugins/Sketch/View/graphics/Merged/Circle.d.ts +7 -0
  41. package/build/plugins/Sketch/View/graphics/Merged/MergedWrapper.d.ts +11 -3
  42. package/build/plugins/Sketch/View/graphics/hooks.d.ts +7 -6
  43. package/build/plugins/Sketch/View/graphics/primitives.d.ts +3 -3
  44. package/build/plugins/Sketch/View/graphics/scale.d.ts +4 -3
  45. package/build/plugins/Sketch/View/handlers/{Handlers.d.ts → HandlersConstructors.d.ts} +1 -1
  46. package/build/plugins/Sketch/View/handlers/filletHelpers.d.ts +7 -8
  47. package/build/plugins/Sketch/description.d.ts +2 -0
  48. package/build/plugins/Sketch/types.d.ts +22 -14
  49. package/build/plugins/components/PluginForm.d.ts +11 -0
  50. package/build/types.d.ts +0 -12
  51. package/build/utils/defaultValues.d.ts +3 -0
  52. package/build/utils/drawing/index.d.ts +3 -0
  53. package/build/utils/drawing/useDrawingArr.d.ts +10 -0
  54. package/build/utils/drawing/useDrawingCCId.d.ts +10 -0
  55. package/build/utils/drawing/useDrawingStr.d.ts +10 -0
  56. package/build/utils/helpers.d.ts +2 -2
  57. package/build/utils/selection/useSelectorsOrder.d.ts +5 -0
  58. package/build/utils/useScale.d.ts +1 -1
  59. package/package.json +10 -8
  60. package/build/components/UI/CAD/CAD.d.ts +0 -7
  61. package/build/components/UI/CAD/SideBar/AssemblyTree/AssemblyTree.d.ts +0 -5
  62. package/build/components/UI/CAD/SideBar/AssemblyTree/index.d.ts +0 -1
  63. package/build/components/UI/CAD/SideBar/Solids/Solids.d.ts +0 -5
  64. package/build/components/UI/CAD/SideBar/index.d.ts +0 -1
  65. package/build/utils/zoomToFit.d.ts +0 -2
@@ -0,0 +1,2 @@
1
+ export { Constraints } from './Constraints';
2
+ export { constraintsHelpers } from './constraintsHelpers';
@@ -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;
@@ -0,0 +1,2 @@
1
+ import * as THREE from 'three';
2
+ export declare const createArcGeometry: (radialSegments: number, tubularSegments: number, instanceLimit: number) => THREE.BufferGeometry;
@@ -0,0 +1,2 @@
1
+ import * as THREE from 'three';
2
+ export declare const createArcMaterial: () => THREE.ShaderMaterial;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import * as THREE from 'three';
3
+ import { commonProps } from '../primitives';
4
+ export declare const Circle: React.FC<{
5
+ center: THREE.Vector3;
6
+ radius: number;
7
+ } & commonProps>;
@@ -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
- Cylinder: any;
7
- Sphere: any;
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 (Box and Sphere) to children.
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
- export declare const useSketchHandlers: (objId: ObjectID) => {
18
- [key: string]: (e: PointerEvent & import("@react-three/fiber/dist/declarations/src/core/events").IntesectionEvent<PointerEvent> & import("../../types").PointerEventsT) => void;
19
- } | undefined;
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.2;
4
- export declare const pointSize = 0.5;
5
- export declare const arcWidth = 0.2;
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
- export declare function setScale(newScale: number): void;
3
- export declare function getScale(): number;
4
- export declare function useScale(getVector?: (sf: number) => [number, number, number]): React.MutableRefObject<import("three").Object3D | undefined>;
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 Handlers: {
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 & WithMembers & WithChildren>;
9
- lineStarts: Array<IStructureObject & WithMembers>;
10
- lineEnds: Array<IStructureObject & WithMembers>;
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 & WithMembers & WithChildren;
16
+ object: IStructureObject;
18
17
  objectEnds: IStructureObject[];
19
- filletPoint: IStructureObject & WithMembers;
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 & WithMembers, tree: IStructureTree, sketchId: ObjectID): {
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 & WithMembers & WithChildren, tree: IStructureTree, sketchId: ObjectID): ExistingFilletInfo | null;
41
+ export declare function recognizeFilletByArc(object: IStructureObject, tree: IStructureTree, sketchId: ObjectID): ExistingFilletInfo | null;
43
42
  export {};
@@ -1,3 +1,5 @@
1
1
  import { PluginDescription } from '@buerli.io/core';
2
+ import { SketchPState } from './types';
3
+ export declare const initialState: SketchPState;
2
4
  export declare const description: PluginDescription;
3
5
  export declare const tolerance = 0.000001;
@@ -1,10 +1,8 @@
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
- export declare const UNDEFINEDID = -1;
8
6
  export declare type HighlightedConstraintsT = Array<{
9
7
  constraintId: ObjectID;
10
8
  geometryId: ObjectID;
@@ -25,6 +23,7 @@ export declare type SketchPState = {
25
23
  selected: ObjectID[];
26
24
  hovered: ObjectID;
27
25
  highlighted: ObjectID[];
26
+ isDragged: boolean;
28
27
  scale: number;
29
28
  step: number;
30
29
  dimPluginId: PluginID | undefined;
@@ -34,6 +33,7 @@ export declare type SketchPState = {
34
33
  min: THREE.Vector2;
35
34
  max: THREE.Vector2;
36
35
  } | undefined;
36
+ cursor: null | string;
37
37
  };
38
38
  export declare type TmpObjectID = string;
39
39
  export declare enum HandlersList {
@@ -59,25 +59,33 @@ export declare type PointerEventsT = {
59
59
  export declare type Handler = {
60
60
  name: HandlersList;
61
61
  filter: (object: IStructureObject) => boolean;
62
- onConstruct?: () => void;
63
- onDestruct?: () => void;
64
- isSelector?: boolean;
65
- escHandler?: () => void;
66
- pointerHandlers: {
67
- [key: string]: (e: ThreeEvent<PointerEvent> & PointerEventsT) => void;
68
- };
69
- keyHandlers?: {
70
- [key: string]: (e: KeyboardEvent) => boolean | void;
71
- };
62
+ onActivate?: () => void;
63
+ onDeactivate?: () => void;
64
+ pointerHandlers: Record<string, (e: ThreeEvent<PointerEvent> & PointerEventsT) => void>;
65
+ keyHandlers?: Record<string, (e: KeyboardEvent) => boolean | void>;
72
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
+ }
73
75
  declare type TmpObjectCommon = {
74
- class: CCClasses;
76
+ class: TmpObjClasses;
75
77
  id: string;
76
78
  };
77
79
  export declare type TmpLineT = TmpObjectCommon & {
78
80
  startPId: TmpObjectID;
79
81
  endPId: TmpObjectID;
80
82
  };
83
+ export declare type TmpRectT = TmpObjectCommon & {
84
+ start: THREE.Vector3;
85
+ end: THREE.Vector3;
86
+ isSquare: boolean;
87
+ isCentered: boolean;
88
+ };
81
89
  export declare type TmpPointT = TmpObjectCommon & {
82
90
  position: THREE.Vector3;
83
91
  };
@@ -99,7 +107,7 @@ export declare type TmpAngularDimensionT = TmpObjectCommon & {
99
107
  dimPos: THREE.Vector3;
100
108
  reflex: number;
101
109
  };
102
- export declare type TmpObject = TmpLineT | TmpPointT | TmpArcT | TmpCircleT | TmpAngularDimensionT;
110
+ export declare type TmpObject = TmpLineT | TmpPointT | TmpArcT | TmpCircleT | TmpAngularDimensionT | TmpRectT;
103
111
  export declare type TmpObjects = {
104
112
  [key: string]: TmpObject;
105
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;
@@ -0,0 +1,3 @@
1
+ export declare const EMPTYARRAY: never[];
2
+ export declare const NOCCID: number;
3
+ export declare const EMPTYSTR = "";
@@ -0,0 +1,3 @@
1
+ export { useDrawingArr } from './useDrawingArr';
2
+ export { useDrawingCCId } from './useDrawingCCId';
3
+ export { useDrawingStr } from './useDrawingStr';
@@ -0,0 +1,10 @@
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
+ */
10
+ export declare function useDrawingArr<T>(drawingId: DrawingID, selector: (state: DrawingState) => Array<T> | undefined): Array<T>;
@@ -0,0 +1,10 @@
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
+ */
10
+ export declare function useDrawingCCId(drawingId: DrawingID, selector: (state: DrawingState) => ObjectID | undefined): ObjectID;
@@ -0,0 +1,10 @@
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
+ */
10
+ export declare function useDrawingStr(drawingId: DrawingID, selector: (state: DrawingState) => string | undefined): string;
@@ -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 & WithMembers & WithChildren, point: THREE.Vector3) => THREE.Vector3 | undefined;
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.23-beta.4",
3
+ "version": "0.0.24-beta.1",
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": "^7.26.1",
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.130.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.131.3",
89
+ "three": "^0.138",
89
90
  "typescript": "4.1.2"
90
91
  },
91
92
  "peerDependencies": {
92
- "@react-three/drei": ">= 7.26.1",
93
+ "@react-three/drei": "^8.10.6",
93
94
  "@react-three/fiber": ">= 7.0.17",
94
- "three": ">=0.129"
95
+ "three": ">=0.138"
95
96
  },
96
97
  "dependencies": {
97
98
  "@ant-design/compatible": "^1.0.8",
98
- "@buerli.io/classcad": "0.0.35-beta.4",
99
- "@buerli.io/react": "0.0.35-beta.4",
99
+ "@buerli.io/classcad": "0.0.36-beta.2",
100
+ "@buerli.io/react": "0.0.36-beta.2",
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,7 +0,0 @@
1
- import React from 'react';
2
- import 'antd/dist/antd.css';
3
- export declare const CAD: React.FC<{
4
- data: ArrayBuffer;
5
- format: 'of1' | 'stp';
6
- name?: string;
7
- }>;
@@ -1,5 +0,0 @@
1
- import { DrawingID } from '@buerli.io/core';
2
- import React from 'react';
3
- export declare const AssemblyTree: React.FC<{
4
- drawingId: DrawingID;
5
- }>;
@@ -1 +0,0 @@
1
- export { AssemblyTree } from './AssemblyTree';
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { DrawingID } from '@buerli.io/core';
3
- export declare const Solids: React.FC<{
4
- drawingId: DrawingID;
5
- }>;
@@ -1 +0,0 @@
1
- export { SideBar } from './SideBar';
@@ -1,2 +0,0 @@
1
- import { DrawingID } from '@buerli.io/core';
2
- export declare const zoomToFit: (drawingId: DrawingID) => void;