@buerli.io/react-cad 0.13.1-beta.9 → 1.0.1-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 (44) hide show
  1. package/build/components/UI/CAD/hooks/useObjectDetails.d.ts +2 -2
  2. package/build/components/UI/CAD/hooks/useRollbackBar.d.ts +3 -3
  3. package/build/components/UI/editors/BooleanEditor/BooleanEditor.d.ts +0 -7
  4. package/build/components/UI/editors/BooleanEditor/useBoolParam.d.ts +1 -3
  5. package/build/components/UI/editors/CSysEditor/CSysEditor.d.ts +3 -3
  6. package/build/components/UI/editors/CSysEditor/useCSysParam.d.ts +2 -2
  7. package/build/components/UI/editors/ExpressionEditor/ExpressionEditor.d.ts +4 -2
  8. package/build/components/UI/editors/ExpressionEditor/useExpressionsParam.d.ts +4 -2
  9. package/build/components/UI/editors/NumberEditor/NumberEditor.d.ts +1 -11
  10. package/build/components/UI/editors/NumberEditor/useNumParam.d.ts +1 -5
  11. package/build/components/UI/editors/PointEditor/PointEditor.d.ts +2 -10
  12. package/build/components/UI/editors/PointEditor/usePointParam.d.ts +3 -5
  13. package/build/components/UI/editors/RefsEditors/ChainFinder.d.ts +2 -2
  14. package/build/components/UI/editors/RefsEditors/RefEditor.d.ts +2 -2
  15. package/build/components/UI/editors/RefsEditors/useMateParam.d.ts +3 -3
  16. package/build/components/UI/editors/RefsEditors/useSelectedItems.d.ts +2 -2
  17. package/build/components/UI/editors/TypeEditor/useTypeParam.d.ts +0 -2
  18. package/build/components/graphics/CSysDisplay.d.ts +5 -5
  19. package/build/components/graphics/SelectedMateObj.d.ts +2 -2
  20. package/build/components/graphics/utils/MatePathTransform.d.ts +1 -1
  21. package/build/components/graphics/utils/useCsysMatrix.d.ts +1 -1
  22. package/build/index.cjs.js +2498 -2824
  23. package/build/index.d.ts +2 -1
  24. package/build/index.js +2512 -2839
  25. package/build/plugins/Dimensions/utils.d.ts +4 -4
  26. package/build/plugins/HLConstraints/components/LimitedValue.d.ts +1 -1
  27. package/build/plugins/HLConstraints/components/Limits.d.ts +4 -1
  28. package/build/plugins/HLConstraints/validators.d.ts +1 -1
  29. package/build/plugins/Sketch/Root/Constraints/constraintsHelpers.d.ts +6 -4
  30. package/build/plugins/Sketch/Root/Constraints/utils.d.ts +3 -3
  31. package/build/plugins/Sketch/Root/CopyPatterns.d.ts +0 -5
  32. package/build/plugins/Sketch/View/graphics/hooks.d.ts +2 -2
  33. package/build/plugins/Sketch/View/handlers/filletHelpers.d.ts +18 -36
  34. package/build/plugins/Sketch/View/handlers/splitHelpers.d.ts +2 -2
  35. package/build/plugins/Sketch/types.d.ts +4 -2
  36. package/build/plugins/components/PluginForm.d.ts +1 -13
  37. package/build/utils/conversionUtils.d.ts +16 -0
  38. package/build/utils/helpers.d.ts +6 -6
  39. package/build/utils/selection/scopes/mateSelection.d.ts +10 -10
  40. package/build/utils/selection/scopes/treeObjInteraction.d.ts +3 -3
  41. package/build/utils/sketchUtils.d.ts +8 -8
  42. package/build/utils/useScale.d.ts +3 -1
  43. package/build/utils/validation.d.ts +3 -4
  44. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
- import { DrawingID, ObjectID, IStructureObject } from '@buerli.io/core';
1
+ import { DrawingID, ObjectID, ScgObject } from '@buerli.io/core';
2
2
  export declare function useDimensionSetId(drawingId: DrawingID, ownerId: ObjectID): ObjectID | undefined;
3
- export declare const isAngular: (dim: IStructureObject) => boolean;
4
- export declare const isRadial: (dim: IStructureObject) => boolean;
5
- export declare const isDiameter: (dim: IStructureObject) => boolean;
3
+ export declare const isAngular: (dim: ScgObject) => boolean;
4
+ export declare const isRadial: (dim: ScgObject) => boolean;
5
+ export declare const isDiameter: (dim: ScgObject) => boolean;
@@ -5,7 +5,7 @@ export declare const LimitedValue: React.FC<{
5
5
  objId: ObjectID;
6
6
  memberName: string;
7
7
  limitsName?: string;
8
- onUpdate: (value: number | string) => Promise<void>;
8
+ onUpdate: (value: number | string) => Promise<any>;
9
9
  caption?: string;
10
10
  angle?: boolean;
11
11
  disabled?: boolean;
@@ -1,12 +1,15 @@
1
1
  import React from 'react';
2
2
  import { DrawingID, ObjectID } from '@buerli.io/core';
3
- import { LimitsParam } from '@buerli.io/classcad';
4
3
  import { MemberParam } from '../../../types';
5
4
  export declare enum LimitsDiplayType {
6
5
  MIN = 0,
7
6
  MAX = 1,
8
7
  MINMAX = 2
9
8
  }
9
+ export declare type LimitsParam<T = string | number> = {
10
+ min: T | null;
11
+ max: T | null;
12
+ };
10
13
  export declare function useLimitsParam(drawingId: DrawingID, objId: ObjectID, memberName: string, options?: {
11
14
  angle?: boolean;
12
15
  forceNoLimits?: boolean;
@@ -1,2 +1,2 @@
1
- import { LimitsParam } from '@buerli.io/classcad';
1
+ import { LimitsParam } from "./components/Limits";
2
2
  export declare function validateLimits(limits: LimitsParam, name: string): string[];
@@ -1,16 +1,18 @@
1
- import { IStructureObject, IStructureTree, ObjectID } from '@buerli.io/core';
1
+ import { ScgObject, ScgTree, ObjectID } from '@buerli.io/core';
2
+ import { ScgClassType } from '@buerli.io/classcad';
2
3
  declare type GeometryChecker = {
3
4
  type: string;
4
- check: (object: IStructureObject) => number | number[];
5
+ check: (object: ScgObject) => number | number[];
5
6
  };
6
7
  declare type ConstraintGeometryCombination = {
7
8
  entityAdapter: (entities: ObjectID[]) => ObjectID[][];
8
9
  input: GeometryChecker[];
9
10
  };
10
- declare function createHelper(type: string, name: string, ...constraintGeometryCombinations: ConstraintGeometryCombination[]): {
11
+ declare function createHelper(objClass: ScgClassType, type: string, name: string, ...constraintGeometryCombinations: ConstraintGeometryCombination[]): {
12
+ objClass: ScgClassType;
11
13
  type: string;
12
14
  name: string;
13
- adapt(entities: ObjectID[], tree: IStructureTree): number[][] | undefined;
15
+ adapt(entities: ObjectID[], tree: ScgTree): number[][] | undefined;
14
16
  getTooltip(): string[];
15
17
  };
16
18
  export declare const constraintsHelpers: {
@@ -1,6 +1,6 @@
1
- import { CCClasses } from '@buerli.io/classcad';
1
+ import { ScgClassType } from '@buerli.io/classcad';
2
2
  export declare const classNameMap: {
3
3
  [key: string]: string;
4
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;
5
+ export declare function getKeyCode(constrClass: ScgClassType): "KeyF" | "KeyH" | "KeyV" | "KeyI" | "KeyT" | "KeyP" | "KeyC" | "KeyE" | "KeyO" | "KeyD" | "KeyR" | null | undefined;
6
+ export declare function getHotKey(constrClass: ScgClassType): string;
@@ -1,7 +1,2 @@
1
1
  import React from 'react';
2
- export declare enum Patterns {
3
- RECTANGULAR = "RECTANGULAR",
4
- CIRCULAR = "CIRCULAR",
5
- MIRROR = "MIRROR"
6
- }
7
2
  export declare const CopyPatterns: React.FC;
@@ -1,4 +1,4 @@
1
- import { IStructureObject, DrawingID, ObjectID } from '@buerli.io/core';
1
+ import { ScgObject, DrawingID, ObjectID } from '@buerli.io/core';
2
2
  export declare const useGeomParams: (objId: ObjectID) => {
3
3
  renderOrder: number;
4
4
  polygonOffsetUnits: number;
@@ -16,7 +16,7 @@ declare type ObjState = {
16
16
  isConstrOverdefined: boolean;
17
17
  lgsState: number;
18
18
  };
19
- export declare const getColor: (object: IStructureObject, objState: ObjState) => number;
19
+ export declare const getColor: (object: ScgObject, objState: ObjState) => number;
20
20
  /**
21
21
  * Return pointerHandlers of currently enabled sketch Handler.
22
22
  * @param objId
@@ -1,40 +1,22 @@
1
1
  import * as THREE from 'three';
2
- import { ObjectID, IStructureObject, DrawingID } from '@buerli.io/core';
3
- export declare function findPointsAt(drawingId: DrawingID, sketchId: ObjectID, pos: THREE.Vector3): import("@buerli.io/core").ScgObject[];
4
- declare type FilletInfo = {
5
- lines: Array<IStructureObject>;
6
- lineStarts: Array<IStructureObject>;
7
- lineEnds: Array<IStructureObject>;
8
- control: THREE.Vector3;
9
- };
10
- declare type NewFilletInfo = FilletInfo & {
11
- incidence: ObjectID;
2
+ import { ObjectID, DrawingID } from '@buerli.io/core';
3
+ export declare type FilletablePointInfo = {
4
+ offset: number;
5
+ arcStartPos: THREE.Vector3;
6
+ arcEndPos: THREE.Vector3;
7
+ arcCenterPos: THREE.Vector3;
8
+ clockwise: boolean;
9
+ lineIds: ObjectID[];
12
10
  };
13
- declare type ExistingFilletInfo = FilletInfo & {
14
- object: IStructureObject;
15
- objectEnds: IStructureObject[];
16
- filletPoint: IStructureObject;
11
+ export declare type FilletArcsInfo = {
12
+ controlPos: THREE.Vector3;
13
+ arcStartPos: THREE.Vector3;
14
+ arcEndPos: THREE.Vector3;
17
15
  };
18
- export declare function recognizeFilletableAngle(drawingId: DrawingID, sketchId: ObjectID, pos: THREE.Vector3): NewFilletInfo | null;
19
- export declare function getTouchPoints(info: FilletInfo, distance: number): THREE.Vector3[] | null;
20
- export declare function calculateCenterPoint(start: THREE.Vector3, end: THREE.Vector3, control: THREE.Vector3): THREE.Vector3;
21
16
  export declare function evaluateClockwise(start: THREE.Vector3, end: THREE.Vector3, control: THREE.Vector3): boolean;
22
- export declare function calculateFilletParams(info: FilletInfo, distance: number): {
23
- start: THREE.Vector3;
24
- end: THREE.Vector3;
25
- center: THREE.Vector3;
26
- clockwise: boolean;
27
- control: THREE.Vector3;
28
- } | null;
29
- export declare function calculateNewFilletData(drawingId: DrawingID, sketchId: ObjectID, object: IStructureObject): {
30
- info: NewFilletInfo;
31
- params: {
32
- start: THREE.Vector3;
33
- end: THREE.Vector3;
34
- center: THREE.Vector3;
35
- clockwise: boolean;
36
- control: THREE.Vector3;
37
- };
38
- } | null;
39
- export declare function recognizeFilletByArc(drawingId: DrawingID, sketchId: ObjectID, object: IStructureObject): ExistingFilletInfo | null;
40
- export {};
17
+ export declare const getFilletablePointsMap: (drawingId: DrawingID, sketchId: ObjectID) => {
18
+ [key: number]: FilletablePointInfo;
19
+ };
20
+ export declare const getFilletArcsMap: (drawingId: DrawingID, sketchId: ObjectID) => {
21
+ [key: number]: FilletArcsInfo;
22
+ };
@@ -1,9 +1,9 @@
1
1
  import * as THREE from 'three';
2
2
  import { DrawingID, ObjectID } from '@buerli.io/core';
3
- import { CCClasses } from '@buerli.io/classcad';
3
+ import { ScgClassType } from '@buerli.io/classcad';
4
4
  import { CCArcInfo, CCCircleInfo, CCLineInfo } from '../../../../utils/sketchIntersectionUtils';
5
5
  declare type CommonInfo = {
6
- class: CCClasses.CCLine | CCClasses.CCArc | CCClasses.CCCircle;
6
+ class: ScgClassType.CCLine | ScgClassType.CCArc | ScgClassType.CCCircle;
7
7
  bb: THREE.Box2;
8
8
  isSplittable: boolean;
9
9
  };
@@ -1,5 +1,5 @@
1
1
  import { ThreeEvent, ReactThreeFiber } from '@react-three/fiber';
2
- import { IStructureObject, ObjectID } from '@buerli.io/core';
2
+ import { ScgObject, ObjectID } from '@buerli.io/core';
3
3
  import { InfinityPlane } from '../../components/graphics/InfinityPlane';
4
4
  import { Geometry } from 'three-stdlib';
5
5
  export declare type HighlightedConstraintsT = Array<{
@@ -64,7 +64,7 @@ export declare type PointerEventsT = {
64
64
  };
65
65
  export declare type Handler = {
66
66
  name: HandlersList;
67
- filter: (object: IStructureObject) => boolean;
67
+ filter: (object: ScgObject) => boolean;
68
68
  onActivate?: () => void;
69
69
  onDeactivate?: (() => void) | (() => Promise<void>);
70
70
  pointerHandlers: Record<string, (e: ThreeEvent<PointerEvent> & PointerEventsT) => void>;
@@ -119,6 +119,8 @@ export declare type TmpObject = TmpLineT | TmpPointT | TmpArcT | TmpCircleT | Tm
119
119
  export declare type TmpObjects = {
120
120
  [key: string]: TmpObject;
121
121
  };
122
+ export declare type ConstraintType = 'COINCIDENT' | 'COLINEAR' | 'CONCENTRIC' | 'EQUAL_LENGTH' | 'EQUAL_RADIUS' | 'FIXATION' | 'HORIZONTAL' | 'MIDPOINT' | 'PARALLEL' | 'PERPENDICULAR' | 'SPLINE_FIT_POINT' | 'SYMMETRY' | 'TANGENT' | 'VERTICAL';
123
+ export declare type DimensionType = 'RADIUS' | 'DIAMETER' | 'OFFSET' | 'HORIZONTAL_DISTANCE' | 'VERTICAL_DISTANCE' | 'ANGLE' | 'ANGLEOX';
122
124
  declare global {
123
125
  type InfinityPlaneT = ReactThreeFiber.Object3DNode<InfinityPlane, typeof InfinityPlane>;
124
126
  namespace JSX {
@@ -1,9 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DrawingID, PluginID } from '@buerli.io/core';
3
- import { FacadeReturn } from '@buerli.io/classcad';
4
3
  import { MemberParam } from '../../types';
5
4
  /**
6
- * @deprecated
7
5
  * @param drawingId - id of the drawing.
8
6
  * @param update - a function which will be called when user presses "Update" button.
9
7
  * @param params - all params which should be sent to the server. PluginForm validates each of them.
@@ -17,17 +15,7 @@ import { MemberParam } from '../../types';
17
15
  export declare const PluginForm: React.FC<{
18
16
  drawingId: DrawingID;
19
17
  pluginId: PluginID;
20
- update: () => Promise<void>;
21
- params: Record<string, MemberParam<any>>;
22
- children?: React.ReactNode;
23
- validator?: () => string[];
24
- autoClose?: boolean;
25
- forceUpdateEnabled?: boolean;
26
- }>;
27
- export declare const PluginForm_v1: React.FC<{
28
- drawingId: DrawingID;
29
- pluginId: PluginID;
30
- update: () => Promise<FacadeReturn>;
18
+ update: () => Promise<any>;
31
19
  params: Record<string, MemberParam<any>>;
32
20
  children?: React.ReactNode;
33
21
  validator?: () => string[];
@@ -0,0 +1,16 @@
1
+ import { DrawingID, ObjectID } from "@buerli.io/core";
2
+ import { MateParam } from "../components/UI/editors/RefsEditors";
3
+ export declare const mateV1: (mateV0: MateParam) => {
4
+ flip: "X" | "-X" | "Y" | "-Y" | "Z" | "-Z";
5
+ reorient: "0" | "90" | "180" | "270";
6
+ path: number[] | undefined;
7
+ csys: number | undefined;
8
+ };
9
+ export declare const solidV1: (drawingId: DrawingID, id: ObjectID) => {
10
+ id: string | number;
11
+ indices?: number[] | undefined;
12
+ };
13
+ export declare const solidsV1: (drawingId: DrawingID, ids: ObjectID[]) => {
14
+ id: string | number;
15
+ indices?: number[] | undefined;
16
+ }[];
@@ -1,18 +1,18 @@
1
- import { DrawingID, GeometryElement, GraphicID, IStructureObject, MemberType, ObjectID, PointMem, PointMemValue, ContainerGeometryT } from '@buerli.io/core';
1
+ import { DrawingID, GeometryElement, GraphicID, ScgObject, MemberType, ObjectID, ScgPointMem, ScgPoint, ContainerGeometryT } from '@buerli.io/core';
2
2
  import * as THREE from 'three';
3
3
  export declare function useGlobalToLocalMatrix(drawingId: DrawingID, objId: ObjectID | undefined): THREE.Matrix4;
4
4
  export declare function getGlobalToLocalMatrix(drawingId: DrawingID, objId: ObjectID): THREE.Matrix4;
5
- export declare function convertToVector(point: PointMem | undefined): THREE.Vector3;
6
- export declare function convertToArray(point: PointMem): number[];
5
+ export declare function convertToVector(point: ScgPointMem | undefined): THREE.Vector3;
6
+ export declare function convertToArray(point: ScgPointMem): number[];
7
7
  export declare function linesIntersection(point1: THREE.Vector3, dir1: THREE.Vector3, point2: THREE.Vector3, dir2: THREE.Vector3): THREE.Vector3 | null;
8
8
  export declare const angleVecVec: (a: THREE.Vector3, b: THREE.Vector3) => number;
9
9
  export declare const degreesToRadians: (degrees: number) => number;
10
10
  export declare const radiansToDegrees: (radians: number) => number;
11
11
  export declare const getPointOnPlane: (unprojectedPoint: THREE.Vector3, camera: THREE.Camera, globalToLocalM: THREE.Matrix4) => THREE.Vector3;
12
12
  export declare const closestAngle: (value: number, to: number) => number;
13
- export declare const stringifyValue: (value: string | number | PointMemValue, type: MemberType) => string;
14
- export declare function findObject(drawingId: DrawingID, id: GraphicID | ObjectID, unrollRefs?: boolean): IStructureObject | ContainerGeometryT | GeometryElement | undefined;
13
+ export declare const stringifyValue: (value: string | number | ScgPoint, type: MemberType) => string;
14
+ export declare function findObject(drawingId: DrawingID, id: GraphicID | ObjectID, unrollRefs?: boolean): ScgObject | ContainerGeometryT | GeometryElement | undefined;
15
15
  export declare function fmod(num: number, denom: number): number;
16
16
  export declare const solveQuadratic: (a: number, b: number, c: number) => number[];
17
17
  export declare const solveQuartic: (a: number, b: number, c: number, d: number, e: number) => number[];
18
- export declare function getRegionCoordSys(drawingId: DrawingID, regionObj: IStructureObject): THREE.Vector3[];
18
+ export declare function getRegionCoordSys(drawingId: DrawingID, regionObj: ScgObject): THREE.Vector3[];
@@ -1,28 +1,28 @@
1
- import { DrawingID, ObjectID, IStructureObject } from '@buerli.io/core';
1
+ import { DrawingID, ObjectID, ScgObject } from '@buerli.io/core';
2
2
  import { FlipType, ReorientedType } from '@buerli.io/classcad';
3
3
  /**
4
4
  * Implies the following data structure:
5
5
  * data: {
6
- * matePath: ObjectID[],
7
- * csys: IStructureObject,
6
+ * path: ObjectID[],
7
+ * csys: ScgObject,
8
8
  * flip: FlipType,
9
- * reoriented: ReorientedType,
9
+ * reorient: ReorientedType,
10
10
  * }
11
11
  */
12
12
  export declare const MateScope = "HLConstraintScope";
13
- export declare const createMateItem: (matePath: ObjectID[], csys: IStructureObject, flip: FlipType, reoriented: ReorientedType) => {
13
+ export declare const createMateItem: (path: ObjectID[], csys: ScgObject, flip: FlipType, reorient: ReorientedType) => {
14
14
  id: string;
15
15
  scope: string;
16
16
  data: {
17
- matePath: number[];
18
- csys: import("@buerli.io/core").ScgObject;
17
+ path: number[];
18
+ csys: ScgObject;
19
19
  flip: FlipType;
20
- reoriented: ReorientedType;
20
+ reorient: ReorientedType;
21
21
  };
22
22
  label: string;
23
23
  };
24
- export declare function useIsSelected(drawingId: DrawingID, matePath: ObjectID[], csys: IStructureObject): boolean;
25
- export declare function useMateSelection(drawingId: DrawingID, matePath: ObjectID[], csysId: ObjectID): {
24
+ export declare function useIsSelected(drawingId: DrawingID, path: ObjectID[], csys: ScgObject): boolean;
25
+ export declare function useMateSelection(drawingId: DrawingID, path: ObjectID[], csysId: ObjectID): {
26
26
  isHovered: boolean;
27
27
  isSelected: boolean;
28
28
  handlers: {};
@@ -1,13 +1,13 @@
1
- import { DrawingID, IStructureObject, ObjectID, SelectedItem } from '@buerli.io/core';
1
+ import { DrawingID, ScgObject, ObjectID, SelectedItem } from '@buerli.io/core';
2
2
  import { ThreeEvent } from '@react-three/fiber';
3
3
  /**
4
4
  * Implies the following data structure:
5
5
  * data: {
6
- * object: IStructureObject
6
+ * object: ScgObject
7
7
  * }
8
8
  */
9
9
  export declare const TreeObjScope = "TreeObjScope";
10
- export declare const createTreeObjSelItem: (productId: ObjectID, object: IStructureObject) => SelectedItem;
10
+ export declare const createTreeObjSelItem: (productId: ObjectID, object: ScgObject) => SelectedItem;
11
11
  export declare function useIsGHovered(drawingId: DrawingID, objId: ObjectID): boolean;
12
12
  export declare function useIsGSelected(drawingId: DrawingID, objId: ObjectID): boolean;
13
13
  export declare function useIsSHovered(drawingId: DrawingID, objId: ObjectID): boolean;
@@ -1,6 +1,6 @@
1
1
  import * as THREE from 'three';
2
- import { CCClasses } from '@buerli.io/classcad';
3
- import { ArrayMem, DrawingID, IStructureObject, ObjectID } from '@buerli.io/core';
2
+ import { ScgClassType } from '@buerli.io/classcad';
3
+ import { DrawingID, ScgObject, ObjectID, ScgArrayMem } from '@buerli.io/core';
4
4
  /**
5
5
  * Checks if the currently active plugin is CC_Sketch.
6
6
  *
@@ -23,28 +23,28 @@ export declare const calculateTangent: (drawingId: DrawingID, curveId: ObjectID,
23
23
  * @param arg A structure object or CCClass of a structure object.
24
24
  * @returns True if the object represents a sketch geometry, false otherwise.
25
25
  */
26
- export declare const isSketchGeometry: (arg: IStructureObject | CCClasses) => boolean;
26
+ export declare const isSketchGeometry: (arg: ScgObject | ScgClassType) => boolean;
27
27
  /**
28
28
  * Checks if the object represents a 2d constraint.
29
29
  *
30
30
  * @param arg A structure object or CCClass of a structure object.
31
31
  * @returns True if the object represents a 2d constraint, false otherwise.
32
32
  */
33
- export declare const is2DConstraint: (arg: IStructureObject | CCClasses) => boolean;
33
+ export declare const is2DConstraint: (arg: ScgObject | ScgClassType) => boolean;
34
34
  /**
35
35
  * Checks if the object represents a sketch geometry or 2d constraint or a sketch itself.
36
36
  *
37
37
  * @param arg A structure object or CCClass of a structure object.
38
38
  * @returns True if the object represents a sketch or a sketch geometry or a 2d constraint, false otherwise.
39
39
  */
40
- export declare const isSketchObj: (arg: IStructureObject | CCClasses) => boolean;
40
+ export declare const isSketchObj: (arg: ScgObject | ScgClassType) => boolean;
41
41
  /**
42
42
  * Checks if the object represents a sketch region.
43
43
  *
44
44
  * @param arg A structure object or CCClass of a structure object.
45
45
  * @returns True if the object represents a sketch region, false otherwise.
46
46
  */
47
- export declare const isSketchRegion: (arg: IStructureObject | CCClasses) => boolean;
47
+ export declare const isSketchRegion: (arg: ScgObject | ScgClassType) => boolean;
48
48
  /**
49
49
  * Searches for the sketch which nests the specified object.
50
50
  *
@@ -76,7 +76,7 @@ export declare const getEntities: (drawingId: DrawingID, objectId: ObjectID) =>
76
76
  * @param arg A structure object or CCClass of a structure object.
77
77
  * @returns A number value (1-5) which represents the sketch object's priority, or -1 if arg is not a sketch object.
78
78
  */
79
- export declare const getSketchPriority: (arg: IStructureObject | CCClasses) => 1 | 2 | 4 | 3 | -1 | 5;
79
+ export declare const getSketchPriority: (arg: ScgObject | ScgClassType) => 1 | 2 | 4 | 3 | -1 | 5;
80
80
  /**
81
81
  * Projects a point onto the specified sketch geometry.
82
82
  *
@@ -137,7 +137,7 @@ export declare const getArcPreviewValue: (dir0: THREE.Vector3, dir1: THREE.Vecto
137
137
  * @param boundsMember The sketch.boundingBox member.
138
138
  * @returns An object containing the center, radius and box values.
139
139
  */
140
- export declare const getSketchBounds: (boundsMember: ArrayMem) => {
140
+ export declare const getSketchBounds: (boundsMember: ScgArrayMem) => {
141
141
  center: THREE.Vector3;
142
142
  radius: number;
143
143
  box: THREE.Box3;
@@ -1,2 +1,4 @@
1
1
  import React from 'react';
2
- export declare function useScale<T extends THREE.Object3D>(position: THREE.Vector3, getVector?: (sf: number) => [number, number, number]): React.RefObject<T>;
2
+ import * as THREE from 'three';
3
+ export declare function useUnscale<T extends THREE.Object3D>(getVector?: (sf: number) => [number, number, number]): React.RefObject<T>;
4
+ export declare function useConstantSize<T extends THREE.Object3D>(position: THREE.Vector3, getVector?: (sf: number) => [number, number, number]): React.RefObject<T>;
@@ -1,12 +1,11 @@
1
- import { ObjectID, PointMemValue } from '@buerli.io/core';
2
- import { APIParam } from '../types';
1
+ import { ObjectID, ScgPoint } from '@buerli.io/core';
3
2
  export declare function emptyValidator(x: any): never[];
4
3
  export declare function notEmptyRef(ref: ObjectID | undefined, paramName?: string): string[];
5
- export declare function notZeroLength(vecParam: APIParam<PointMemValue>, paramName?: string): string[];
4
+ export declare function notZeroLength(vecParam: ScgPoint | string, paramName?: string): string[];
6
5
  export declare function acceptableRange(min: {
7
6
  value: number;
8
7
  isInclusive: boolean;
9
8
  } | undefined, max: {
10
9
  value: number;
11
10
  isInclusive: boolean;
12
- } | undefined): (numParam: APIParam<number>, paramName?: string) => string[];
11
+ } | undefined): (numParam: number | string, paramName?: string) => string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerli.io/react-cad",
3
- "version": "0.13.1-beta.9",
3
+ "version": "1.0.1-beta.1",
4
4
  "description": "buerli CAD components",
5
5
  "author": "AWV Informatik AG <info@awv-informatik.ch>",
6
6
  "repository": {},
@@ -87,8 +87,8 @@
87
87
  "three": ">=0.153"
88
88
  },
89
89
  "dependencies": {
90
- "@buerli.io/classcad": "0.13.1-beta.9",
91
- "@buerli.io/react": "0.13.1-beta.9",
90
+ "@buerli.io/classcad": "1.0.0",
91
+ "@buerli.io/react": "1.0.0",
92
92
  "@dnd-kit/core": "^6.0.8",
93
93
  "@dnd-kit/modifiers": "^6.0.1",
94
94
  "@dnd-kit/sortable": "^7.0.2",