@buerli.io/react-cad 0.13.0 → 0.13.1-beta.10
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/PluginsWindows.d.ts +5 -2
- package/build/components/UI/CAD/ToolBar/AssemblyModeCmds.d.ts +2 -2
- package/build/components/UI/CAD/ToolBar/PartModeCmds.d.ts +2 -2
- package/build/components/UI/CAD/ToolBar/useCommands.d.ts +5 -2
- package/build/components/UI/CAD/common/MultiSelect.d.ts +12 -0
- package/build/components/UI/CAD/common/NameEdit.d.ts +1 -3
- package/build/components/UI/CAD/hooks/useContextMenuItems.d.ts +1 -1
- package/build/components/UI/CAD/hooks/useCurrentInstance.d.ts +1 -1
- package/build/components/UI/CAD/hooks/useCurrentProduct.d.ts +1 -1
- package/build/components/UI/CAD/hooks/useObjectDetails.d.ts +2 -2
- package/build/components/UI/CAD/hooks/useRollbackBar.d.ts +3 -3
- package/build/components/UI/CAD/hooks/useRoot.d.ts +1 -1
- package/build/components/UI/CAD/index.d.ts +1 -0
- package/build/components/UI/CAD/plugins/ProductManagement/types.d.ts +0 -1
- package/build/components/UI/editors/BooleanEditor/BooleanEditor.d.ts +1 -1
- package/build/components/UI/editors/BooleanEditor/useBoolParam.d.ts +1 -1
- package/build/components/UI/editors/CSysEditor/CSysEditor.d.ts +4 -3
- package/build/components/UI/editors/CSysEditor/useCSysParam.d.ts +2 -2
- package/build/components/UI/editors/ExpressionEditor/ExpressionEditor.d.ts +9 -3
- package/build/components/UI/editors/ExpressionEditor/useExpressionsParam.d.ts +4 -3
- package/build/components/UI/editors/NumberEditor/Mentions.d.ts +11 -0
- package/build/components/UI/editors/NumberEditor/NumberEditor.d.ts +4 -3
- package/build/components/UI/editors/NumberEditor/useNumParam.d.ts +2 -2
- package/build/components/UI/editors/PointEditor/PointEditor.d.ts +5 -4
- package/build/components/UI/editors/PointEditor/usePointParam.d.ts +3 -3
- package/build/components/UI/editors/RefsEditors/ChainFinder.d.ts +2 -2
- package/build/components/UI/editors/RefsEditors/MateEditor.d.ts +1 -0
- package/build/components/UI/editors/RefsEditors/MateOrientationEditor.d.ts +9 -0
- package/build/components/UI/editors/RefsEditors/RefEditor.d.ts +3 -2
- package/build/components/UI/editors/RefsEditors/RefsEditor.d.ts +1 -0
- package/build/components/UI/editors/RefsEditors/useMateParam.d.ts +3 -3
- package/build/components/UI/editors/RefsEditors/useModes.d.ts +6 -2
- package/build/components/UI/editors/RefsEditors/useSelectedItems.d.ts +2 -2
- package/build/components/UI/editors/TypeWrapper.d.ts +5 -0
- package/build/components/UI/editors/Wrapper.d.ts +2 -1
- package/build/components/graphics/CSysDisplay.d.ts +5 -5
- package/build/components/graphics/SelectedMateObj.d.ts +2 -2
- package/build/components/graphics/utils/MatePathTransform.d.ts +1 -1
- package/build/components/graphics/utils/useCsysMatrix.d.ts +1 -1
- package/build/index.cjs.js +21824 -19891
- package/build/index.d.ts +5 -1
- package/build/index.js +17493 -15564
- package/build/plugins/Dimensions/utils.d.ts +4 -4
- package/build/plugins/Expressions/useContextMenuItems.d.ts +5 -0
- package/build/plugins/HLConstraints/components/LimitedValue.d.ts +1 -1
- package/build/plugins/HLConstraints/components/Limits.d.ts +6 -1
- package/build/plugins/HLConstraints/validators.d.ts +1 -1
- package/build/plugins/Sketch/Root/Constraints/constraintsHelpers.d.ts +6 -4
- package/build/plugins/Sketch/Root/Constraints/utils.d.ts +3 -3
- package/build/plugins/Sketch/Root/CopyPatterns.d.ts +0 -5
- package/build/plugins/Sketch/Root/SketchGroup.d.ts +1 -0
- package/build/plugins/Sketch/View/graphics/TmpAngularDimension.d.ts +0 -2
- package/build/plugins/Sketch/View/graphics/hooks.d.ts +4 -2
- package/build/plugins/Sketch/View/graphics/primitives.d.ts +0 -14
- package/build/plugins/Sketch/View/handlers/HandlersConstructors.d.ts +2 -2
- package/build/plugins/Sketch/View/handlers/Use.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/filletHelpers.d.ts +18 -38
- package/build/plugins/Sketch/View/handlers/hoverHelpers.d.ts +3 -0
- package/build/plugins/Sketch/View/handlers/splitHelpers.d.ts +14 -29
- package/build/plugins/Sketch/types.d.ts +8 -8
- package/build/plugins/Sketch/utils/Interaction.d.ts +2 -1
- package/build/plugins/Sketch/utils/OverdefinedStateManager.d.ts +6 -0
- package/build/plugins/components/PluginForm.d.ts +1 -1
- package/build/utils/conversionUtils.d.ts +16 -0
- package/build/utils/getHighlightedColor.d.ts +1 -1
- package/build/utils/helpers.d.ts +6 -27
- package/build/utils/mateUtils.d.ts +1 -3
- package/build/utils/selection/scopes/mateSelection.d.ts +10 -10
- package/build/utils/selection/scopes/treeObjInteraction.d.ts +3 -3
- package/build/utils/sketchIntersectionUtils.d.ts +29 -0
- package/build/utils/sketchUtils.d.ts +173 -0
- package/build/utils/useScale.d.ts +3 -1
- package/build/utils/validation.d.ts +3 -4
- package/package.json +9 -11
- package/build/plugins/Sketch/View/graphics/RubberBandSelection.d.ts +0 -2
- package/build/plugins/Sketch/View/handlers/UseRef.d.ts +0 -3
- package/build/plugins/Sketch/utils/getEntities.d.ts +0 -2
- package/build/plugins/Sketch/utils/getGeometryPriority.d.ts +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DrawingID, ObjectID,
|
|
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:
|
|
4
|
-
export declare const isRadial: (dim:
|
|
5
|
-
export declare const isDiameter: (dim:
|
|
3
|
+
export declare const isAngular: (dim: ScgObject) => boolean;
|
|
4
|
+
export declare const isRadial: (dim: ScgObject) => boolean;
|
|
5
|
+
export declare const isDiameter: (dim: ScgObject) => boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'antd/dist/antd.css';
|
|
3
|
+
import { DrawingID, ObjectID } from '@buerli.io/core';
|
|
4
|
+
import { MenuElement } from '../../components/UI/CAD/common/ContextMenu';
|
|
5
|
+
export declare function useContextMenuItems(drawingId: DrawingID, productId: ObjectID, setEditName: React.Dispatch<React.SetStateAction<boolean>>): MenuElement[];
|
|
@@ -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<
|
|
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;
|
|
@@ -15,6 +18,8 @@ export declare const Limits: React.FC<{
|
|
|
15
18
|
param: MemberParam<LimitsParam>;
|
|
16
19
|
displayType?: LimitsDiplayType;
|
|
17
20
|
onUpdate?: any;
|
|
21
|
+
iconMinURL?: string;
|
|
22
|
+
iconMaxURL?: string;
|
|
18
23
|
caption?: string;
|
|
19
24
|
validator?: (numParam: LimitsParam, pName?: string) => string[];
|
|
20
25
|
}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LimitsParam } from
|
|
1
|
+
import { LimitsParam } from "./components/Limits";
|
|
2
2
|
export declare function validateLimits(limits: LimitsParam, name: string): string[];
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
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:
|
|
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 {
|
|
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:
|
|
6
|
-
export declare function getHotKey(constrClass:
|
|
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,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare const calcSector: (dimPos: THREE.Vector3, dir0: THREE.Vector3, dir1: THREE.Vector3, center: THREE.Vector3) => 0 | 1 | 2 | 3;
|
|
4
|
-
export declare const calcPreviewValue: (dir0: THREE.Vector3, dir1: THREE.Vector3, sector: number, reflex: number) => number;
|
|
5
3
|
export declare const TmpPositionHandler: React.FC<{
|
|
6
4
|
position: THREE.Vector3;
|
|
7
5
|
}>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
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;
|
|
5
5
|
isHovered: boolean;
|
|
6
6
|
isSelected: boolean;
|
|
7
7
|
isHighlighted: boolean;
|
|
8
|
+
isConstrOverdefined: boolean;
|
|
8
9
|
};
|
|
9
10
|
declare type ObjState = {
|
|
10
11
|
isSketchActive: boolean;
|
|
@@ -12,9 +13,10 @@ declare type ObjState = {
|
|
|
12
13
|
isGHovered: boolean;
|
|
13
14
|
isSHovered: boolean;
|
|
14
15
|
isSelected: boolean;
|
|
16
|
+
isConstrOverdefined: boolean;
|
|
15
17
|
lgsState: number;
|
|
16
18
|
};
|
|
17
|
-
export declare const getColor: (object:
|
|
19
|
+
export declare const getColor: (object: ScgObject, objState: ObjState) => number;
|
|
18
20
|
/**
|
|
19
21
|
* Return pointerHandlers of currently enabled sketch Handler.
|
|
20
22
|
* @param objId
|
|
@@ -18,20 +18,6 @@ export declare const Point: React.FC<{
|
|
|
18
18
|
position: THREE.Vector3;
|
|
19
19
|
size?: number;
|
|
20
20
|
} & commonProps>;
|
|
21
|
-
export declare function getArcAngles(params: {
|
|
22
|
-
start: THREE.Vector3;
|
|
23
|
-
end: THREE.Vector3;
|
|
24
|
-
center: THREE.Vector3;
|
|
25
|
-
clockwise: boolean;
|
|
26
|
-
radius: number;
|
|
27
|
-
}): {
|
|
28
|
-
center: THREE.Vector3;
|
|
29
|
-
mid: THREE.Vector3;
|
|
30
|
-
radius: number;
|
|
31
|
-
startAngle: number;
|
|
32
|
-
endAngle: number;
|
|
33
|
-
bulge: number;
|
|
34
|
-
};
|
|
35
21
|
export declare const Arc: React.FC<{
|
|
36
22
|
start: THREE.Vector3;
|
|
37
23
|
end: THREE.Vector3;
|
|
@@ -7,7 +7,6 @@ import { DrawCircle } from './DrawCircle';
|
|
|
7
7
|
import { Fillet } from './Fillet';
|
|
8
8
|
import { Trim } from './Trim';
|
|
9
9
|
import { Split } from './Split';
|
|
10
|
-
import { UseRef } from './UseRef';
|
|
11
10
|
import { SSelect } from './SSelect';
|
|
12
11
|
export declare const HandlersConstructors: {
|
|
13
12
|
createAngle: typeof CreateAngle;
|
|
@@ -19,7 +18,8 @@ export declare const HandlersConstructors: {
|
|
|
19
18
|
fillet: typeof Fillet;
|
|
20
19
|
trim: typeof Trim;
|
|
21
20
|
split: typeof Split;
|
|
22
|
-
|
|
21
|
+
useGeometry: (drawingId: DrawingID, pluginId: PluginID) => import("../../types").Handler;
|
|
22
|
+
useReference: (drawingId: DrawingID, pluginId: PluginID) => import("../../types").Handler;
|
|
23
23
|
drawRect2Points: (drawingId: DrawingID, pluginId: PluginID) => import("../../types").Handler;
|
|
24
24
|
drawRectCenter: (drawingId: DrawingID, pluginId: PluginID) => import("../../types").Handler;
|
|
25
25
|
drawArcCenter: (drawingId: DrawingID, pluginId: PluginID) => import("../../types").Handler;
|
|
@@ -1,42 +1,22 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import {
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
control: THREE.Vector3;
|
|
11
|
-
};
|
|
12
|
-
declare type NewFilletInfo = FilletInfo & {
|
|
13
|
-
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[];
|
|
14
10
|
};
|
|
15
|
-
declare type
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
export declare type FilletArcsInfo = {
|
|
12
|
+
controlPos: THREE.Vector3;
|
|
13
|
+
arcStartPos: THREE.Vector3;
|
|
14
|
+
arcEndPos: THREE.Vector3;
|
|
19
15
|
};
|
|
20
|
-
export declare function recognizeFilletableAngle(pos: THREE.Vector3, tree: IStructureTree, sketchId: ObjectID): NewFilletInfo | null;
|
|
21
|
-
export declare function getTouchPoints(info: FilletInfo, distance: number): THREE.Vector3[] | null;
|
|
22
|
-
export declare function calculateCenterPoint(start: THREE.Vector3, end: THREE.Vector3, control: THREE.Vector3): THREE.Vector3;
|
|
23
16
|
export declare function evaluateClockwise(start: THREE.Vector3, end: THREE.Vector3, control: THREE.Vector3): boolean;
|
|
24
|
-
export declare
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} | null;
|
|
31
|
-
export declare function calculateNewFilletData(object: IStructureObject, tree: IStructureTree, sketchId: ObjectID): {
|
|
32
|
-
info: NewFilletInfo;
|
|
33
|
-
params: {
|
|
34
|
-
start: THREE.Vector3;
|
|
35
|
-
end: THREE.Vector3;
|
|
36
|
-
center: THREE.Vector3;
|
|
37
|
-
clockwise: boolean;
|
|
38
|
-
control: THREE.Vector3;
|
|
39
|
-
};
|
|
40
|
-
} | null;
|
|
41
|
-
export declare function recognizeFilletByArc(object: IStructureObject, tree: IStructureTree, sketchId: ObjectID): ExistingFilletInfo | null;
|
|
42
|
-
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,34 +1,19 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { DrawingID, ObjectID } from
|
|
3
|
-
import {
|
|
2
|
+
import { DrawingID, ObjectID } from '@buerli.io/core';
|
|
3
|
+
import { ScgClassType } from '@buerli.io/classcad';
|
|
4
|
+
import { CCArcInfo, CCCircleInfo, CCLineInfo } from '../../../../utils/sketchIntersectionUtils';
|
|
4
5
|
declare type CommonInfo = {
|
|
5
|
-
class:
|
|
6
|
+
class: ScgClassType.CCLine | ScgClassType.CCArc | ScgClassType.CCCircle;
|
|
6
7
|
bb: THREE.Box2;
|
|
8
|
+
isSplittable: boolean;
|
|
7
9
|
};
|
|
8
|
-
declare type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
declare
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
radius: number;
|
|
18
|
-
clockwise: boolean;
|
|
19
|
-
startAngle: number;
|
|
20
|
-
endAngle: number;
|
|
21
|
-
angularlength: number;
|
|
22
|
-
};
|
|
23
|
-
declare type CircleInfo = CommonInfo & {
|
|
24
|
-
center: THREE.Vector3;
|
|
25
|
-
radius: number;
|
|
26
|
-
};
|
|
27
|
-
export declare type ObjInfo = LineInfo | ArcInfo | CircleInfo;
|
|
28
|
-
export declare function getSketchObjInfo(drawingId: DrawingID, objId: ObjectID): LineInfo | CircleInfo | undefined;
|
|
29
|
-
export declare function getNormalizedPosition(point: THREE.Vector3, sketchObject: ObjInfo): number;
|
|
30
|
-
export declare function getParameterizedPosition(t: number, sketchObject: ObjInfo): THREE.Vector3;
|
|
31
|
-
export declare function calculateIntersections(object: ObjInfo, sketchObjects: ObjInfo[]): number[];
|
|
32
|
-
export declare function calculateClosestIntersection(point: THREE.Vector3, object1: ObjInfo, object2: ObjInfo): number[][];
|
|
33
|
-
export declare function getClosestPoint(point: THREE.Vector3, sketchObject: ObjInfo): THREE.Vector3;
|
|
10
|
+
declare type CCLineInfoE = CommonInfo & CCLineInfo;
|
|
11
|
+
declare type CCArcInfoE = CommonInfo & CCArcInfo;
|
|
12
|
+
declare type CCCircleInfoE = CommonInfo & CCCircleInfo;
|
|
13
|
+
export declare type SketchObjInfoE = CCLineInfoE | CCArcInfoE | CCCircleInfoE;
|
|
14
|
+
export declare function getSketchObjInfo(drawingId: DrawingID, objId: ObjectID, unsplittableIds: ObjectID[]): CCLineInfoE | CCCircleInfoE | undefined;
|
|
15
|
+
export declare function getRigidsetEntityIds(drawingId: DrawingID, sketchId: ObjectID): number[];
|
|
16
|
+
export declare function calculateIntersections(object: SketchObjInfoE, sketchObjects: SketchObjInfoE[]): number[];
|
|
17
|
+
export declare function calculateClosestIntersection(point: THREE.Vector3, object1: SketchObjInfoE, object2: SketchObjInfoE): number[][];
|
|
18
|
+
export declare function getClosestPoint(point: THREE.Vector3, sketchObject: SketchObjInfoE): THREE.Vector3;
|
|
34
19
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ThreeEvent, ReactThreeFiber } from '@react-three/fiber';
|
|
3
|
-
import {
|
|
2
|
+
import { ScgObject, ObjectID } from '@buerli.io/core';
|
|
4
3
|
import { InfinityPlane } from '../../components/graphics/InfinityPlane';
|
|
5
4
|
import { Geometry } from 'three-stdlib';
|
|
6
5
|
export declare type HighlightedConstraintsT = Array<{
|
|
@@ -29,15 +28,13 @@ export declare type SketchPState = {
|
|
|
29
28
|
[key: ObjectID]: ObjectID;
|
|
30
29
|
};
|
|
31
30
|
};
|
|
31
|
+
overdefined: {
|
|
32
|
+
[key: ObjectID]: ObjectID[];
|
|
33
|
+
};
|
|
32
34
|
isDragged: boolean;
|
|
33
35
|
scale: number;
|
|
34
36
|
step: number;
|
|
35
37
|
mousePos: THREE.Vector3 | undefined;
|
|
36
|
-
drawnObjectsRef: React.MutableRefObject<THREE.Group> | undefined;
|
|
37
|
-
rubberBandRectangle: {
|
|
38
|
-
min: THREE.Vector2;
|
|
39
|
-
max: THREE.Vector2;
|
|
40
|
-
} | undefined;
|
|
41
38
|
cursor: null | string;
|
|
42
39
|
needsUpdate: number;
|
|
43
40
|
};
|
|
@@ -57,6 +54,7 @@ export declare enum HandlersList {
|
|
|
57
54
|
HOVER = "hover",
|
|
58
55
|
TRIM = "trim",
|
|
59
56
|
SPLIT = "split",
|
|
57
|
+
USEGEOM = "useGeometry",
|
|
60
58
|
USEREF = "useReference",
|
|
61
59
|
SSELECT = "sSelect"
|
|
62
60
|
}
|
|
@@ -66,7 +64,7 @@ export declare type PointerEventsT = {
|
|
|
66
64
|
};
|
|
67
65
|
export declare type Handler = {
|
|
68
66
|
name: HandlersList;
|
|
69
|
-
filter: (object:
|
|
67
|
+
filter: (object: ScgObject) => boolean;
|
|
70
68
|
onActivate?: () => void;
|
|
71
69
|
onDeactivate?: (() => void) | (() => Promise<void>);
|
|
72
70
|
pointerHandlers: Record<string, (e: ThreeEvent<PointerEvent> & PointerEventsT) => void>;
|
|
@@ -121,6 +119,8 @@ export declare type TmpObject = TmpLineT | TmpPointT | TmpArcT | TmpCircleT | Tm
|
|
|
121
119
|
export declare type TmpObjects = {
|
|
122
120
|
[key: string]: TmpObject;
|
|
123
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';
|
|
124
124
|
declare global {
|
|
125
125
|
type InfinityPlaneT = ReactThreeFiber.Object3DNode<InfinityPlane, typeof InfinityPlane>;
|
|
126
126
|
namespace JSX {
|
|
@@ -2,5 +2,6 @@ import * as THREE from 'three';
|
|
|
2
2
|
import { DrawingID, PluginID, ObjectID } from '@buerli.io/core';
|
|
3
3
|
export declare const hover: (drawingId: DrawingID, pluginId: PluginID, objIds: ObjectID[], hoverPos?: THREE.Vector3) => void;
|
|
4
4
|
export declare const unhover: (drawingId: DrawingID, pluginId: PluginID, objId: ObjectID) => void;
|
|
5
|
-
export declare const select: (drawingId: DrawingID,
|
|
5
|
+
export declare const select: (drawingId: DrawingID, selectedId: ObjectID) => void;
|
|
6
|
+
export declare const setSelected: (drawingId: DrawingID, selectedIds: ObjectID[]) => void;
|
|
6
7
|
export declare const tab: (drawingId: DrawingID, pluginId: PluginID) => void;
|
|
@@ -15,7 +15,7 @@ import { MemberParam } from '../../types';
|
|
|
15
15
|
export declare const PluginForm: React.FC<{
|
|
16
16
|
drawingId: DrawingID;
|
|
17
17
|
pluginId: PluginID;
|
|
18
|
-
update: () => Promise<
|
|
18
|
+
update: () => Promise<any>;
|
|
19
19
|
params: Record<string, MemberParam<any>>;
|
|
20
20
|
children?: React.ReactNode;
|
|
21
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 +1 @@
|
|
|
1
|
-
export declare const getHighlightedColor: (isGHovered: boolean, isGSelected: boolean, isSHovered: boolean, isSSelected: boolean) => "
|
|
1
|
+
export declare const getHighlightedColor: (isGHovered: boolean, isGSelected: boolean, isSHovered: boolean, isSSelected: boolean) => "red" | "green" | "#3280ff" | "#8040c0" | undefined;
|
package/build/utils/helpers.d.ts
CHANGED
|
@@ -1,39 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DrawingID, GeometryElement, GraphicID, IStructureObject, IStructureTree, MemberType, ObjectID, PointMem, PointMemValue, SelectedItem, ContainerGeometryT } from '@buerli.io/core';
|
|
1
|
+
import { DrawingID, GeometryElement, GraphicID, ScgObject, MemberType, ObjectID, ScgPointMem, ScgPoint, ContainerGeometryT } from '@buerli.io/core';
|
|
3
2
|
import * as THREE from 'three';
|
|
4
|
-
export declare function membersValues(drawingId: DrawingID, ccObjId: DrawingID): any;
|
|
5
|
-
export declare function addMembers(drawingId: DrawingID, ccObjId: DrawingID): {
|
|
6
|
-
members?: undefined;
|
|
7
|
-
} | {
|
|
8
|
-
members: any;
|
|
9
|
-
};
|
|
10
3
|
export declare function useGlobalToLocalMatrix(drawingId: DrawingID, objId: ObjectID | undefined): THREE.Matrix4;
|
|
11
4
|
export declare function getGlobalToLocalMatrix(drawingId: DrawingID, objId: ObjectID): THREE.Matrix4;
|
|
12
|
-
export declare function
|
|
13
|
-
export declare function
|
|
14
|
-
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[];
|
|
15
7
|
export declare function linesIntersection(point1: THREE.Vector3, dir1: THREE.Vector3, point2: THREE.Vector3, dir2: THREE.Vector3): THREE.Vector3 | null;
|
|
16
8
|
export declare const angleVecVec: (a: THREE.Vector3, b: THREE.Vector3) => number;
|
|
17
|
-
export declare const calculateTangent: (tree: IStructureTree, object: IStructureObject, point: THREE.Vector3) => THREE.Vector3 | undefined;
|
|
18
|
-
export declare function getDescendants(tree: IStructureTree, objectId: ObjectID): number[];
|
|
19
|
-
export declare function getAncestorIdByClass(drawingId: DrawingID, objectId: ObjectID, parentClass: CCClasses): number | null;
|
|
20
|
-
export declare const isSketchGeometry: (arg: IStructureObject | CCClasses) => boolean;
|
|
21
|
-
export declare const is2DConstraint: (arg: IStructureObject | CCClasses) => boolean;
|
|
22
|
-
export declare const isSketchRegion: (arg: IStructureObject | CCClasses) => boolean;
|
|
23
9
|
export declare const degreesToRadians: (degrees: number) => number;
|
|
24
10
|
export declare const radiansToDegrees: (radians: number) => number;
|
|
25
11
|
export declare const getPointOnPlane: (unprojectedPoint: THREE.Vector3, camera: THREE.Camera, globalToLocalM: THREE.Matrix4) => THREE.Vector3;
|
|
26
12
|
export declare const closestAngle: (value: number, to: number) => number;
|
|
27
|
-
export declare const stringifyValue: (value: string | number |
|
|
28
|
-
export declare function findObject(drawingId: DrawingID, id: GraphicID | ObjectID, unrollRefs?: boolean):
|
|
29
|
-
export declare function round(value: number, digits: number): number;
|
|
30
|
-
export declare function rgbToHex(color: {
|
|
31
|
-
r: number;
|
|
32
|
-
g: number;
|
|
33
|
-
b: number;
|
|
34
|
-
}): string;
|
|
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;
|
|
35
15
|
export declare function fmod(num: number, denom: number): number;
|
|
36
|
-
export declare function numberToHexColor(color: number): string;
|
|
37
16
|
export declare const solveQuadratic: (a: number, b: number, c: number) => number[];
|
|
38
17
|
export declare const solveQuartic: (a: number, b: number, c: number, d: number, e: number) => number[];
|
|
39
|
-
export declare function getRegionCoordSys(drawingId: DrawingID, regionObj:
|
|
18
|
+
export declare function getRegionCoordSys(drawingId: DrawingID, regionObj: ScgObject): THREE.Vector3[];
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { DrawingID, ObjectID } from '@buerli.io/core';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const getActiveReference: (drawingId: DrawingID, matePath: ObjectID[], activeRefs: ObjectID[]) => number | undefined;
|
|
4
|
-
export declare const getProductRigidSet: (drawingId: DrawingID, productId: ObjectID, rigidSets: ObjectID[]) => number | undefined;
|
|
2
|
+
export declare const getProductRigidSet: (drawingId: DrawingID, instanceId: ObjectID, rigidSets: ObjectID[]) => number | undefined;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { DrawingID, ObjectID,
|
|
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
|
-
*
|
|
7
|
-
* csys:
|
|
6
|
+
* path: ObjectID[],
|
|
7
|
+
* csys: ScgObject,
|
|
8
8
|
* flip: FlipType,
|
|
9
|
-
*
|
|
9
|
+
* reorient: ReorientedType,
|
|
10
10
|
* }
|
|
11
11
|
*/
|
|
12
12
|
export declare const MateScope = "HLConstraintScope";
|
|
13
|
-
export declare const createMateItem: (
|
|
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
|
-
|
|
18
|
-
csys:
|
|
17
|
+
path: number[];
|
|
18
|
+
csys: ScgObject;
|
|
19
19
|
flip: FlipType;
|
|
20
|
-
|
|
20
|
+
reorient: ReorientedType;
|
|
21
21
|
};
|
|
22
22
|
label: string;
|
|
23
23
|
};
|
|
24
|
-
export declare function useIsSelected(drawingId: DrawingID,
|
|
25
|
-
export declare function useMateSelection(drawingId: DrawingID,
|
|
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,
|
|
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:
|
|
6
|
+
* object: ScgObject
|
|
7
7
|
* }
|
|
8
8
|
*/
|
|
9
9
|
export declare const TreeObjScope = "TreeObjScope";
|
|
10
|
-
export declare const createTreeObjSelItem: (productId: ObjectID, object:
|
|
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;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export declare type CCLineInfo = {
|
|
3
|
+
start: THREE.Vector3;
|
|
4
|
+
end: THREE.Vector3;
|
|
5
|
+
dir: THREE.Vector3;
|
|
6
|
+
};
|
|
7
|
+
export declare type CCArcInfo = {
|
|
8
|
+
start: THREE.Vector3;
|
|
9
|
+
end: THREE.Vector3;
|
|
10
|
+
center: THREE.Vector3;
|
|
11
|
+
radius: number;
|
|
12
|
+
clockwise: boolean;
|
|
13
|
+
startAngle: number;
|
|
14
|
+
endAngle: number;
|
|
15
|
+
angularLength: number;
|
|
16
|
+
};
|
|
17
|
+
export declare type CCCircleInfo = {
|
|
18
|
+
center: THREE.Vector3;
|
|
19
|
+
radius: number;
|
|
20
|
+
};
|
|
21
|
+
export declare type SketchObjInfo = CCLineInfo | CCArcInfo | CCCircleInfo;
|
|
22
|
+
export declare function getNormalizedPosition(point: THREE.Vector3, sketchObject: SketchObjInfo): number;
|
|
23
|
+
export declare function getParameterizedPosition(t: number, sketchObject: SketchObjInfo): THREE.Vector3;
|
|
24
|
+
export declare function intersectLineLine(line1: CCLineInfo, line2: CCLineInfo): number[][];
|
|
25
|
+
export declare function intersectLineCircle(line: CCLineInfo, circle: CCCircleInfo | CCArcInfo): number[][];
|
|
26
|
+
export declare function intersectLineArc(line: CCLineInfo, arc: CCArcInfo): number[][];
|
|
27
|
+
export declare function intersectCircleCircle(circle1: CCCircleInfo | CCArcInfo, circle2: CCCircleInfo | CCArcInfo): number[][];
|
|
28
|
+
export declare function intersectArcArc(arc1: CCArcInfo, arc2: CCArcInfo): number[][];
|
|
29
|
+
export declare function intersectArcCircle(arc: CCArcInfo, circle: CCCircleInfo): number[][];
|