@buerli.io/react-cad 0.10.0 → 0.12.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.
Files changed (43) hide show
  1. package/build/components/UI/CAD/PluginsWindows.d.ts +11 -0
  2. package/build/components/UI/CAD/common/Img.d.ts +1 -0
  3. package/build/components/UI/editors/ColorEditor/ColorEditor.d.ts +9 -0
  4. package/build/components/UI/editors/ColorEditor/index.d.ts +2 -0
  5. package/build/components/UI/editors/ColorEditor/useColorParam.d.ts +9 -0
  6. package/build/components/UI/editors/ToleranceEditor/ToleranceEditor.d.ts +7 -0
  7. package/build/components/UI/editors/ToleranceEditor/index.d.ts +2 -0
  8. package/build/components/UI/editors/ToleranceEditor/useToleranceParam.d.ts +3 -0
  9. package/build/components/graphics/CompositeCurveObj.d.ts +11 -0
  10. package/build/index.cjs.js +3263 -2239
  11. package/build/index.d.ts +5 -1
  12. package/build/index.js +4122 -3102
  13. package/build/plugins/AppearanceEditor/Root.d.ts +7 -0
  14. package/build/plugins/AppearanceEditor/index.d.ts +7 -0
  15. package/build/plugins/CompositeCurve/Root.d.ts +6 -0
  16. package/build/plugins/CompositeCurve/View.d.ts +6 -0
  17. package/build/plugins/CompositeCurve/index.d.ts +5 -0
  18. package/build/plugins/Dimensions/DimContext.d.ts +5 -3
  19. package/build/plugins/Dimensions/Root.d.ts +1 -1
  20. package/build/plugins/Dimensions/View.d.ts +3 -3
  21. package/build/plugins/Dimensions/graphics/DimensionSet.d.ts +8 -0
  22. package/build/plugins/Dimensions/index.d.ts +5 -4
  23. package/build/plugins/Dimensions/utils.d.ts +2 -0
  24. package/build/plugins/Extrusion/View.d.ts +6 -0
  25. package/build/plugins/Extrusion/index.d.ts +7 -1
  26. package/build/plugins/Sketch/View/graphics/IconGroups.d.ts +7 -0
  27. package/build/plugins/Sketch/View/graphics/Regions.d.ts +5 -0
  28. package/build/plugins/Sketch/View/graphics/hooks.d.ts +1 -5
  29. package/build/plugins/Sketch/View/handlers/HandlersConstructors.d.ts +2 -0
  30. package/build/plugins/Sketch/View/handlers/SSelect.d.ts +3 -0
  31. package/build/plugins/Sketch/description.d.ts +0 -2
  32. package/build/plugins/Sketch/types.d.ts +9 -6
  33. package/build/plugins/Sketch/utils/Interaction.d.ts +4 -3
  34. package/build/plugins/Sketch/utils/getEntities.d.ts +2 -0
  35. package/build/plugins/Sketch/utils/useSketchRegions.d.ts +2 -0
  36. package/build/plugins/Twist/Root.d.ts +6 -0
  37. package/build/plugins/Twist/View.d.ts +6 -0
  38. package/build/plugins/Twist/index.d.ts +10 -0
  39. package/build/plugins/components/PluginForm.d.ts +2 -1
  40. package/build/utils/helpers.d.ts +2 -0
  41. package/build/utils/selection/filters.d.ts +1 -0
  42. package/package.json +8 -8
  43. package/build/components/UI/CAD/Solids/ColorPicker.d.ts +0 -7
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { PluginID, DrawingID } from '@buerli.io/core';
3
+ export declare function Root({ drawingId, pluginId }: {
4
+ drawingId: DrawingID;
5
+ pluginId: PluginID;
6
+ }): JSX.Element;
7
+ export default Root;
@@ -0,0 +1,7 @@
1
+ import { ObjectID, PluginDescription } from '@buerli.io/core';
2
+ import { Root } from './Root';
3
+ declare type InternalState = {
4
+ solidIds: ObjectID[];
5
+ };
6
+ declare const description: PluginDescription<InternalState>;
7
+ export { Root, description };
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { DrawingID, PluginID } from '@buerli.io/core';
3
+ export declare const Root: React.FC<{
4
+ drawingId: DrawingID;
5
+ pluginId: PluginID;
6
+ }>;
@@ -0,0 +1,6 @@
1
+ import { DrawingID, PluginID } from '@buerli.io/core';
2
+ import React from 'react';
3
+ export declare const View: React.FC<{
4
+ drawingId: DrawingID;
5
+ pluginId: PluginID;
6
+ }>;
@@ -0,0 +1,5 @@
1
+ import { PluginDescription } from '@buerli.io/core';
2
+ import { Root } from './Root';
3
+ import { View } from './View';
4
+ declare const description: PluginDescription;
5
+ export { Root, View, description };
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import * as THREE from 'three';
3
- import { DrawingID, PluginID } from '@buerli.io/core';
4
- export declare const DimContext: React.Context<{
3
+ import { DrawingID } from '@buerli.io/core';
4
+ export declare const DimSetContext: React.Context<{
5
5
  globalToLocalM: THREE.Matrix4;
6
- pluginId: PluginID;
7
6
  drawingId: DrawingID;
8
7
  }>;
8
+ export declare const DimContext: React.Context<{
9
+ globalToLocalM: THREE.Matrix4;
10
+ }>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DrawingID, PluginID } from '@buerli.io/core';
2
+ import { PluginID, DrawingID } from '@buerli.io/core';
3
3
  export declare const Root: React.FC<{
4
4
  drawingId: DrawingID;
5
5
  pluginId: PluginID;
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { DrawingID, PluginID } from '@buerli.io/core';
3
- export declare const View: React.FC<{
3
+ export declare function View({ drawingId, pluginId }: {
4
4
  drawingId: DrawingID;
5
5
  pluginId: PluginID;
6
- }>;
6
+ }): JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { DrawingID, ObjectID } from '@buerli.io/core';
3
+ export declare const DimensionSet: React.FC<{
4
+ drawingId: DrawingID;
5
+ objectId: ObjectID;
6
+ applyTransform?: boolean;
7
+ allowDeletion?: boolean;
8
+ }>;
@@ -1,4 +1,5 @@
1
- import { Plugin as PluginT } from '@buerli.io/core';
2
- export { useDimensionSetId } from './utils';
3
- declare const Plugin: PluginT;
4
- export { Plugin };
1
+ import { PluginDescription } from '@buerli.io/core';
2
+ import { View } from './View';
3
+ import { Root } from './Root';
4
+ declare const description: PluginDescription;
5
+ export { Root, View, description };
@@ -1,3 +1,5 @@
1
1
  import { DrawingID, ObjectID, IStructureObject } from '@buerli.io/core';
2
2
  export declare function useDimensionSetId(drawingId: DrawingID, ownerId: ObjectID): ObjectID | undefined;
3
3
  export declare const isAngular: (dim: IStructureObject) => boolean;
4
+ export declare const isRadial: (dim: IStructureObject) => boolean;
5
+ export declare const isDiameter: (dim: IStructureObject) => boolean;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { DrawingID, PluginID } from '@buerli.io/core';
3
+ export declare const View: React.FC<{
4
+ drawingId: DrawingID;
5
+ pluginId: PluginID;
6
+ }>;
@@ -1,4 +1,10 @@
1
1
  import { PluginDescription } from '@buerli.io/core';
2
2
  import { Root } from './Root';
3
+ import { View } from './View';
4
+ export declare type ExtrusionPState = {
5
+ originPos: THREE.Vector3 | undefined;
6
+ xDir: THREE.Vector3 | undefined;
7
+ yDir: THREE.Vector3 | undefined;
8
+ };
3
9
  declare const description: PluginDescription;
4
- export { Root, description };
10
+ export { Root, View, description };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ObjectID } from '@buerli.io/core';
3
+ export declare const IconGroups: React.FC<{
4
+ sketchId: ObjectID;
5
+ ids: ObjectID[];
6
+ showAll?: boolean;
7
+ }>;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { ObjectID } from '@buerli.io/core';
3
+ export declare const Regions: React.FC<{
4
+ sketchId: ObjectID;
5
+ }>;
@@ -30,11 +30,7 @@ export declare const useUserData: (objId: ObjectID) => {
30
30
  onHUD?: undefined;
31
31
  };
32
32
  export declare const useHandlersAndColor: (drawingId: DrawingID, objId: ObjectID) => {
33
- handlers: {
34
- onClick: (e: MouseEvent | import("@react-three/fiber").ThreeEvent<MouseEvent>) => void;
35
- onPointerOut: (e: PointerEvent | import("@react-three/fiber").ThreeEvent<PointerEvent>) => void;
36
- onPointerOver: (e: PointerEvent | import("@react-three/fiber").ThreeEvent<PointerEvent>) => void;
37
- } | Record<string, (e: import("@react-three/fiber/dist/declarations/src/core/events").IntersectionEvent<PointerEvent> & import("@react-three/fiber").Properties<PointerEvent> & import("../../types").PointerEventsT) => void>;
33
+ handlers: Record<string, (e: import("@react-three/fiber/dist/declarations/src/core/events").IntersectionEvent<PointerEvent> & import("@react-three/fiber").Properties<PointerEvent> & import("../../types").PointerEventsT) => void>;
38
34
  color: number;
39
35
  };
40
36
  export {};
@@ -8,9 +8,11 @@ import { Fillet } from './Fillet';
8
8
  import { Trim } from './Trim';
9
9
  import { Split } from './Split';
10
10
  import { UseRef } from './UseRef';
11
+ import { SSelect } from './SSelect';
11
12
  export declare const HandlersConstructors: {
12
13
  createAngle: typeof CreateAngle;
13
14
  drag: typeof Drag;
15
+ sSelect: typeof SSelect;
14
16
  drawPoint: typeof DrawPoint;
15
17
  drawLine: typeof DrawLine;
16
18
  drawCircle: typeof DrawCircle;
@@ -0,0 +1,3 @@
1
+ import { DrawingID, PluginID } from '@buerli.io/core';
2
+ import { Handler } from '../../types';
3
+ export declare function SSelect(drawingId: DrawingID, pluginId: PluginID): Handler;
@@ -1,4 +1,2 @@
1
1
  import { PluginDescription } from '@buerli.io/core';
2
- import { SketchPState } from './types';
3
- export declare const getInitialState: () => SketchPState;
4
2
  export declare const description: PluginDescription;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ThreeEvent, ReactThreeFiber } from '@react-three/fiber';
3
- import { IStructureObject, ObjectID, PluginID } from '@buerli.io/core';
3
+ import { IStructureObject, ObjectID } from '@buerli.io/core';
4
4
  import { InfinityPlane } from '../../components/graphics/InfinityPlane';
5
5
  import { Geometry } from 'three-stdlib';
6
6
  export declare type HighlightedConstraintsT = Array<{
@@ -9,9 +9,7 @@ export declare type HighlightedConstraintsT = Array<{
9
9
  }>;
10
10
  export declare type SketchPState = {
11
11
  alwaysShowConstr: boolean;
12
- constraintsToGeometry: {
13
- [key: number]: ObjectID;
14
- };
12
+ showCoincidence: boolean;
15
13
  showRigidSets: boolean;
16
14
  activeHandler: HandlersList | undefined;
17
15
  handlers: {
@@ -24,11 +22,16 @@ export declare type SketchPState = {
24
22
  interaction: {
25
23
  cycle: number;
26
24
  objects: ObjectID[];
25
+ lastHoveredPos: {
26
+ [key: ObjectID]: THREE.Vector3;
27
+ };
28
+ constraintsToGeometry: {
29
+ [key: ObjectID]: ObjectID;
30
+ };
27
31
  };
28
32
  isDragged: boolean;
29
33
  scale: number;
30
34
  step: number;
31
- dimPluginId: PluginID | undefined;
32
35
  mousePos: THREE.Vector3 | undefined;
33
36
  drawnObjectsRef: React.MutableRefObject<THREE.Group> | undefined;
34
37
  rubberBandRectangle: {
@@ -55,7 +58,7 @@ export declare enum HandlersList {
55
58
  TRIM = "trim",
56
59
  SPLIT = "split",
57
60
  USEREF = "useReference",
58
- GSELECTION = "globalSelection"
61
+ SSELECT = "sSelect"
59
62
  }
60
63
  export declare type PointerEventsT = {
61
64
  target: any;
@@ -1,5 +1,6 @@
1
+ import * as THREE from 'three';
1
2
  import { DrawingID, PluginID, ObjectID } from '@buerli.io/core';
2
- export declare const hover: (drawingId: DrawingID, pluginId: PluginID, hoveredId: ObjectID) => void;
3
- export declare const unhover: (drawingId: DrawingID, pluginId: PluginID, hoveredId: ObjectID) => void;
4
- export declare const select: (drawingId: DrawingID, selectedId: ObjectID) => void;
3
+ export declare const hover: (drawingId: DrawingID, pluginId: PluginID, objIds: ObjectID[], hoverPos?: THREE.Vector3) => void;
4
+ export declare const unhover: (drawingId: DrawingID, pluginId: PluginID, objId: ObjectID) => void;
5
+ export declare const select: (drawingId: DrawingID, pluginId: PluginID, selectedId: ObjectID) => void;
5
6
  export declare const tab: (drawingId: DrawingID, pluginId: PluginID) => void;
@@ -0,0 +1,2 @@
1
+ import { DrawingID, ObjectID } from '@buerli.io/core';
2
+ export declare const getEntities: (drawingId: DrawingID, objectId: ObjectID) => number[];
@@ -0,0 +1,2 @@
1
+ import { DrawingID, ObjectID } from '@buerli.io/core';
2
+ export declare const useSketchRegions: (drawingId: DrawingID, sketchId: ObjectID) => number[];
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { DrawingID, PluginID } from '@buerli.io/core';
3
+ export declare const Root: React.FC<{
4
+ drawingId: DrawingID;
5
+ pluginId: PluginID;
6
+ }>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { DrawingID, PluginID } from '@buerli.io/core';
3
+ export declare const View: React.FC<{
4
+ drawingId: DrawingID;
5
+ pluginId: PluginID;
6
+ }>;
@@ -0,0 +1,10 @@
1
+ import { PluginDescription } from '@buerli.io/core';
2
+ import { Root } from './Root';
3
+ import { View } from './View';
4
+ export declare type TwistPState = {
5
+ originPos: THREE.Vector3 | undefined;
6
+ xDir: THREE.Vector3 | undefined;
7
+ yDir: THREE.Vector3 | undefined;
8
+ };
9
+ declare const description: PluginDescription;
10
+ export { Root, View, description };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DrawingID } from '@buerli.io/core';
2
+ import { DrawingID, PluginID } from '@buerli.io/core';
3
3
  import { MemberParam } from '../../types';
4
4
  /**
5
5
  * @param drawingId - id of the drawing.
@@ -14,6 +14,7 @@ import { MemberParam } from '../../types';
14
14
  */
15
15
  export declare const PluginForm: React.FC<{
16
16
  drawingId: DrawingID;
17
+ pluginId: PluginID;
17
18
  update: () => Promise<void>;
18
19
  params: Record<string, MemberParam<any>>;
19
20
  children?: React.ReactNode;
@@ -19,6 +19,7 @@ export declare function getDescendants(tree: IStructureTree, objectId: ObjectID)
19
19
  export declare function getAncestorIdByClass(drawingId: DrawingID, objectId: ObjectID, parentClass: CCClasses): number | null;
20
20
  export declare const isSketchGeometry: (arg: IStructureObject | CCClasses) => boolean;
21
21
  export declare const is2DConstraint: (arg: IStructureObject | CCClasses) => boolean;
22
+ export declare const isSketchRegion: (arg: IStructureObject | CCClasses) => boolean;
22
23
  export declare const degreesToRadians: (degrees: number) => number;
23
24
  export declare const radiansToDegrees: (radians: number) => number;
24
25
  export declare const getPointOnPlane: (unprojectedPoint: THREE.Vector3, camera: THREE.Camera, globalToLocalM: THREE.Matrix4) => THREE.Vector3;
@@ -35,3 +36,4 @@ export declare function fmod(num: number, denom: number): number;
35
36
  export declare function numberToHexColor(color: number): string;
36
37
  export declare const solveQuadratic: (a: number, b: number, c: number) => number[];
37
38
  export declare const solveQuartic: (a: number, b: number, c: number, d: number, e: number) => number[];
39
+ export declare function getRegionCoordSys(drawingId: DrawingID, regionObj: IStructureObject): THREE.Vector3[];
@@ -8,3 +8,4 @@ export declare const workPlaneFilter: (scope: any, data: any) => boolean;
8
8
  export declare const workAxisFilter: (scope: any, data: any) => boolean;
9
9
  export declare const csysFilter: (scope: any, data: any) => boolean;
10
10
  export declare const mateFilter: (scope: any, data: any) => boolean;
11
+ export declare const curveEntityFilter: (scope: any, data: any) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerli.io/react-cad",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "buerli CAD components",
5
5
  "author": "AWV Informatik AG <info@awv-informatik.ch>",
6
6
  "repository": {},
@@ -37,9 +37,9 @@
37
37
  "@babel/preset-env": "^7.15.0",
38
38
  "@babel/preset-react": "^7.14.5",
39
39
  "@babel/preset-typescript": "^7.10.4",
40
- "@buerli.io/icons": "^1.0.11",
41
- "@react-three/drei": "9.77.1",
42
- "@react-three/fiber": "8.13.0",
40
+ "@buerli.io/icons": "^1.0.13",
41
+ "@react-three/drei": "9.92.3",
42
+ "@react-three/fiber": "8.15.14",
43
43
  "@rollup/plugin-babel": "^5.3.0",
44
44
  "@rollup/plugin-image": "^2.1.0",
45
45
  "@rollup/plugin-node-resolve": "^13.0.4",
@@ -84,14 +84,14 @@
84
84
  "typescript": "4.8.4"
85
85
  },
86
86
  "peerDependencies": {
87
- "@react-three/drei": ">=9.77.1",
88
- "@react-three/fiber": ">=8.13.0",
87
+ "@react-three/drei": ">=9.92.3",
88
+ "@react-three/fiber": ">=8.15.14",
89
89
  "three": ">=0.153",
90
90
  "react": ">=18.0"
91
91
  },
92
92
  "dependencies": {
93
- "@buerli.io/classcad": "0.10.0",
94
- "@buerli.io/react": "0.10.0",
93
+ "@buerli.io/classcad": "0.12.0",
94
+ "@buerli.io/react": "0.12.0",
95
95
  "@dnd-kit/core": "^6.0.8",
96
96
  "@dnd-kit/modifiers": "^6.0.1",
97
97
  "@dnd-kit/sortable": "^7.0.2",
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import './colorPicker.css';
3
- import { DrawingID, ObjectID } from '@buerli.io/core';
4
- export declare const ColorPicker: React.FC<{
5
- drawingId: DrawingID;
6
- solidId: ObjectID;
7
- }>;