@buerli.io/react-cad 0.0.23-beta.0 → 0.0.23-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.
package/build/index.cjs.js
CHANGED
|
@@ -10,6 +10,9 @@ var THREE = require('three');
|
|
|
10
10
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
11
|
var fiber = require('@react-three/fiber');
|
|
12
12
|
var drei = require('@react-three/drei');
|
|
13
|
+
var create = require('zustand');
|
|
14
|
+
var vanilla = require('zustand/vanilla');
|
|
15
|
+
require('antd/dist/antd.css');
|
|
13
16
|
var icons = require('@ant-design/icons');
|
|
14
17
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
15
18
|
var Switch = require('antd/lib/switch');
|
|
@@ -20,14 +23,11 @@ var Tooltip = require('antd/lib/tooltip');
|
|
|
20
23
|
var RadioGroupImpl = require('antd/lib/radio/group');
|
|
21
24
|
var RadioButtonImpl = require('antd/lib/radio/radioButton');
|
|
22
25
|
var antd = require('antd');
|
|
23
|
-
require('antd/dist/antd.css');
|
|
24
26
|
var guid = require('uuid');
|
|
25
27
|
var shallow = require('zustand/shallow');
|
|
26
28
|
var threeStdlib = require('three-stdlib');
|
|
27
29
|
var SelectImpl = require('antd/lib/select');
|
|
28
30
|
var path = require('path');
|
|
29
|
-
var create = require('zustand');
|
|
30
|
-
var vanilla = require('zustand/vanilla');
|
|
31
31
|
var reactUid = require('react-uid');
|
|
32
32
|
var deepmerge = require('deepmerge');
|
|
33
33
|
var reactSortableHoc = require('react-sortable-hoc');
|
|
@@ -904,6 +904,133 @@ const isAngular = dim => {
|
|
|
904
904
|
return dim.class === classcad.CCClasses.CCAngularDimension || dim.class === classcad.CCClasses.CCAngularFeatureDimension || dim.class === classcad.CCClasses.CCAngularRefDimension;
|
|
905
905
|
};
|
|
906
906
|
|
|
907
|
+
const zoomToFit = drawingId => {
|
|
908
|
+
var _getCamera;
|
|
909
|
+
|
|
910
|
+
const drawing = core.getDrawing(drawingId);
|
|
911
|
+
const camApi = (_getCamera = react.getCamera(drawingId)) == null ? void 0 : _getCamera.api;
|
|
912
|
+
|
|
913
|
+
if (!drawing || !camApi) {
|
|
914
|
+
return;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
const {
|
|
918
|
+
structure,
|
|
919
|
+
api: drawingApi
|
|
920
|
+
} = drawing;
|
|
921
|
+
const {
|
|
922
|
+
root,
|
|
923
|
+
currentProduct,
|
|
924
|
+
currentNode
|
|
925
|
+
} = structure;
|
|
926
|
+
let currRoot = currentNode || currentProduct || root;
|
|
927
|
+
|
|
928
|
+
if (currentProduct && structure.tree[currentProduct].class === 'CC_Part') {
|
|
929
|
+
currRoot = currentProduct;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
const bounds = drawingApi.structure.calculateProductBounds(currRoot);
|
|
933
|
+
camApi.setZoom('fit', bounds);
|
|
934
|
+
};
|
|
935
|
+
|
|
936
|
+
function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
937
|
+
|
|
938
|
+
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$k(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
939
|
+
const appApi = (set, get) => ({
|
|
940
|
+
assemblyTree: {
|
|
941
|
+
startProdEditing: (drawingId, objId) => {
|
|
942
|
+
set(state => {
|
|
943
|
+
let res = [];
|
|
944
|
+
const curNode = core.api.getState().drawing.refs[drawingId].structure.currentNode;
|
|
945
|
+
res = state.assemblyTree.prodStack;
|
|
946
|
+
curNode && res.push(curNode);
|
|
947
|
+
return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
948
|
+
assemblyTree: {
|
|
949
|
+
prodStack: [...res]
|
|
950
|
+
}
|
|
951
|
+
});
|
|
952
|
+
});
|
|
953
|
+
classcad.ccAPI.assemblyBuilder.setCurrentNode(drawingId, objId).then(() => zoomToFit(drawingId)).catch();
|
|
954
|
+
},
|
|
955
|
+
goBack: drawingId => {
|
|
956
|
+
const prodStack = get().assemblyTree.prodStack;
|
|
957
|
+
const prevProd = prodStack[prodStack.length - 1];
|
|
958
|
+
if (!prevProd) return;
|
|
959
|
+
set(state => {
|
|
960
|
+
const res = state.assemblyTree.prodStack;
|
|
961
|
+
res.pop();
|
|
962
|
+
return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
963
|
+
assemblyTree: {
|
|
964
|
+
prodStack: [...res]
|
|
965
|
+
}
|
|
966
|
+
});
|
|
967
|
+
});
|
|
968
|
+
classcad.ccAPI.assemblyBuilder.setCurrentNode(drawingId, prevProd).then(() => zoomToFit(drawingId)).catch();
|
|
969
|
+
},
|
|
970
|
+
clearProdStack: () => {
|
|
971
|
+
set(state => _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
972
|
+
assemblyTree: {
|
|
973
|
+
prodStack: []
|
|
974
|
+
}
|
|
975
|
+
}));
|
|
976
|
+
}
|
|
977
|
+
},
|
|
978
|
+
blankDiv: {
|
|
979
|
+
show: callback => {
|
|
980
|
+
set(state => _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
981
|
+
blankDiv: {
|
|
982
|
+
isActive: true,
|
|
983
|
+
onClose: callback
|
|
984
|
+
}
|
|
985
|
+
}));
|
|
986
|
+
},
|
|
987
|
+
hide: () => {
|
|
988
|
+
set(state => _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
989
|
+
blankDiv: {
|
|
990
|
+
isActive: false,
|
|
991
|
+
onClose: undefined
|
|
992
|
+
}
|
|
993
|
+
}));
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
});
|
|
997
|
+
|
|
998
|
+
const createAppState = (set, get) => ({
|
|
999
|
+
assemblyTree: {
|
|
1000
|
+
prodStack: []
|
|
1001
|
+
},
|
|
1002
|
+
blankDiv: {
|
|
1003
|
+
isActive: false,
|
|
1004
|
+
onClose: undefined
|
|
1005
|
+
},
|
|
1006
|
+
api: appApi(set, get)
|
|
1007
|
+
});
|
|
1008
|
+
|
|
1009
|
+
const CADApi = vanilla((set, get) => createAppState(set, get));
|
|
1010
|
+
const useCADStore = create(CADApi);
|
|
1011
|
+
const getCADState = CADApi.getState;
|
|
1012
|
+
|
|
1013
|
+
const blankZIndex = 1000;
|
|
1014
|
+
const BlankDiv = () => {
|
|
1015
|
+
const isActive = useCADStore(s => s.blankDiv.isActive);
|
|
1016
|
+
const onClick = React.useCallback(() => {
|
|
1017
|
+
const cadState = getCADState();
|
|
1018
|
+
cadState.blankDiv.onClose && cadState.blankDiv.onClose();
|
|
1019
|
+
cadState.api.blankDiv.hide();
|
|
1020
|
+
}, []);
|
|
1021
|
+
return isActive ? /*#__PURE__*/React.createElement("div", {
|
|
1022
|
+
onClick: onClick,
|
|
1023
|
+
style: {
|
|
1024
|
+
zIndex: blankZIndex,
|
|
1025
|
+
position: 'fixed',
|
|
1026
|
+
top: 0,
|
|
1027
|
+
left: 0,
|
|
1028
|
+
bottom: 0,
|
|
1029
|
+
right: 0
|
|
1030
|
+
}
|
|
1031
|
+
}) : null;
|
|
1032
|
+
};
|
|
1033
|
+
|
|
907
1034
|
const mainColor = 0x424242;
|
|
908
1035
|
const lineWidth$1 = 0.5;
|
|
909
1036
|
const arrowSize = 5;
|
|
@@ -927,7 +1054,7 @@ const TextValue = ({
|
|
|
927
1054
|
backgroundColor: backgroundColor ? `#${backgroundColor.toString(16)}` : undefined,
|
|
928
1055
|
color: `#${mainColor.toString(16)}`,
|
|
929
1056
|
fontSize: '17px',
|
|
930
|
-
cursor: '
|
|
1057
|
+
cursor: 'text'
|
|
931
1058
|
}
|
|
932
1059
|
}, value)));
|
|
933
1060
|
};
|
|
@@ -964,6 +1091,12 @@ const DimValue = ({
|
|
|
964
1091
|
return expr ? expr + ' (' + value.toFixed(2) + ')' : value.toFixed(2);
|
|
965
1092
|
}, [master, dimension, memberName]);
|
|
966
1093
|
const [editMode, setEditMode] = React.useState(false);
|
|
1094
|
+
React.useEffect(() => {
|
|
1095
|
+
if (editMode) {
|
|
1096
|
+
getCADState().api.blankDiv.show(() => setEditMode(false));
|
|
1097
|
+
return () => getCADState().api.blankDiv.hide();
|
|
1098
|
+
}
|
|
1099
|
+
}, [editMode, setEditMode]);
|
|
967
1100
|
const update = React.useCallback(() => {
|
|
968
1101
|
const master_ = core.getDrawing(drawingId).structure.tree[masterId];
|
|
969
1102
|
|
|
@@ -1006,7 +1139,7 @@ const DimValue = ({
|
|
|
1006
1139
|
return /*#__PURE__*/React.createElement("group", {
|
|
1007
1140
|
position: position
|
|
1008
1141
|
}, /*#__PURE__*/React.createElement(drei.Html, {
|
|
1009
|
-
zIndexRange: [
|
|
1142
|
+
zIndexRange: [blankZIndex + 1, blankZIndex + 1],
|
|
1010
1143
|
style: {
|
|
1011
1144
|
marginTop: '22px'
|
|
1012
1145
|
},
|
|
@@ -1021,7 +1154,7 @@ const DimValue = ({
|
|
|
1021
1154
|
backgroundColor: backgroundColor ? `#${backgroundColor.toString(16)}` : undefined,
|
|
1022
1155
|
color: `#${mainColor.toString(16)}`,
|
|
1023
1156
|
fontSize: '17px',
|
|
1024
|
-
cursor: '
|
|
1157
|
+
cursor: 'text'
|
|
1025
1158
|
}
|
|
1026
1159
|
}, caption) : /*#__PURE__*/React.createElement("div", {
|
|
1027
1160
|
style: {
|
|
@@ -1120,6 +1253,8 @@ const PositionHandler = ({
|
|
|
1120
1253
|
camera
|
|
1121
1254
|
} = fiber.useThree();
|
|
1122
1255
|
const ref = useScale$1(position, sf => [hRadius$1 * sf, hRadius$1 * sf, hRadius$1 * sf]);
|
|
1256
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
1257
|
+
drei.useCursor(isHovered, 'move');
|
|
1123
1258
|
const onPointerDown = React.useCallback(e => {
|
|
1124
1259
|
if (e.buttons !== 1) // Continue only if 'primary' mouse button is pressed
|
|
1125
1260
|
return;
|
|
@@ -1159,6 +1294,10 @@ const PositionHandler = ({
|
|
|
1159
1294
|
te.target.releasePointerCapture(te.pointerId);
|
|
1160
1295
|
te.stopPropagation();
|
|
1161
1296
|
}, [dimId, drawingId, position, setPState]);
|
|
1297
|
+
const onPointerOver = React.useCallback(e => {
|
|
1298
|
+
setIsHovered(true);
|
|
1299
|
+
e.stopPropagation();
|
|
1300
|
+
}, []);
|
|
1162
1301
|
const onPointerMove = React.useCallback(e => {
|
|
1163
1302
|
if (isPressed.current) {
|
|
1164
1303
|
isDragged.current = true;
|
|
@@ -1168,12 +1307,18 @@ const PositionHandler = ({
|
|
|
1168
1307
|
|
|
1169
1308
|
e.stopPropagation();
|
|
1170
1309
|
}, [setPosition, globalToLocalM, camera]);
|
|
1310
|
+
const onPointerOut = React.useCallback(e => {
|
|
1311
|
+
setIsHovered(false);
|
|
1312
|
+
e.stopPropagation();
|
|
1313
|
+
}, []);
|
|
1171
1314
|
return /*#__PURE__*/React.createElement("mesh", {
|
|
1172
1315
|
ref: ref,
|
|
1173
1316
|
position: position,
|
|
1174
1317
|
onPointerDown: onPointerDown,
|
|
1175
1318
|
onPointerMove: onPointerMove,
|
|
1176
|
-
onPointerUp: onPointerUp
|
|
1319
|
+
onPointerUp: onPointerUp,
|
|
1320
|
+
onPointerOver: onPointerOver,
|
|
1321
|
+
onPointerOut: onPointerOut
|
|
1177
1322
|
}, /*#__PURE__*/React.createElement("sphereGeometry", {
|
|
1178
1323
|
args: [1.5, 16, 16]
|
|
1179
1324
|
}), /*#__PURE__*/React.createElement("meshBasicMaterial", {
|
|
@@ -1967,9 +2112,9 @@ var index$w = /*#__PURE__*/Object.freeze({
|
|
|
1967
2112
|
useDimensionSetId: useDimensionSetId
|
|
1968
2113
|
});
|
|
1969
2114
|
|
|
1970
|
-
function ownKeys$
|
|
2115
|
+
function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
1971
2116
|
|
|
1972
|
-
function _objectSpread$
|
|
2117
|
+
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$j(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1973
2118
|
/**
|
|
1974
2119
|
* Implies the following data structure:
|
|
1975
2120
|
* data: {
|
|
@@ -2072,7 +2217,7 @@ function useMateSelection(drawingId, matePath, csysId) {
|
|
|
2072
2217
|
}));
|
|
2073
2218
|
const handlers = React.useMemo(() => {
|
|
2074
2219
|
if (isSelectable) {
|
|
2075
|
-
return _objectSpread$
|
|
2220
|
+
return _objectSpread$j(_objectSpread$j({}, hHandlers), sHandlers);
|
|
2076
2221
|
}
|
|
2077
2222
|
|
|
2078
2223
|
return {};
|
|
@@ -2088,9 +2233,9 @@ function useMateSelection(drawingId, matePath, csysId) {
|
|
|
2088
2233
|
}, [isHovered, isSelected, isSelectable, handlers]);
|
|
2089
2234
|
}
|
|
2090
2235
|
|
|
2091
|
-
function ownKeys$
|
|
2236
|
+
function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2092
2237
|
|
|
2093
|
-
function _objectSpread$
|
|
2238
|
+
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$i(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2094
2239
|
/**
|
|
2095
2240
|
* Implies the following data structure:
|
|
2096
2241
|
* data: {
|
|
@@ -2219,7 +2364,7 @@ function useTreeObjSelection(drawingId, objId) {
|
|
|
2219
2364
|
const isSelected = useIsSelected(drawingId, objId);
|
|
2220
2365
|
const handlers = React.useMemo(() => {
|
|
2221
2366
|
if (isSelectable) {
|
|
2222
|
-
return _objectSpread$
|
|
2367
|
+
return _objectSpread$i(_objectSpread$i({}, hHandlers), sHandlers);
|
|
2223
2368
|
}
|
|
2224
2369
|
|
|
2225
2370
|
return {};
|
|
@@ -5742,9 +5887,9 @@ function getSketchState(drawingId, pluginId) {
|
|
|
5742
5887
|
return plugin.state;
|
|
5743
5888
|
}
|
|
5744
5889
|
|
|
5745
|
-
function ownKeys$
|
|
5890
|
+
function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
5746
5891
|
|
|
5747
|
-
function _objectSpread$
|
|
5892
|
+
function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$h(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
5748
5893
|
function CreateAngle(drawingId, pluginId) {
|
|
5749
5894
|
const {
|
|
5750
5895
|
set
|
|
@@ -5794,8 +5939,8 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
5794
5939
|
set(state_ => {
|
|
5795
5940
|
const tmpAngularDimension = state_.tmpObjects[tmpDimensionId];
|
|
5796
5941
|
return {
|
|
5797
|
-
tmpObjects: _objectSpread$
|
|
5798
|
-
[tmpDimensionId]: _objectSpread$
|
|
5942
|
+
tmpObjects: _objectSpread$h(_objectSpread$h({}, state_.tmpObjects), {}, {
|
|
5943
|
+
[tmpDimensionId]: _objectSpread$h(_objectSpread$h({}, tmpAngularDimension), params)
|
|
5799
5944
|
})
|
|
5800
5945
|
};
|
|
5801
5946
|
});
|
|
@@ -5842,7 +5987,7 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
5842
5987
|
const center = linesInfo.center;
|
|
5843
5988
|
const dimPos = center.clone().addScaledVector(dir0.clone().add(dir1).normalize(), 10);
|
|
5844
5989
|
|
|
5845
|
-
const tmpAngularDimension = _objectSpread$
|
|
5990
|
+
const tmpAngularDimension = _objectSpread$h(_objectSpread$h({
|
|
5846
5991
|
class: classcad.CCClasses.CCAngularDimension,
|
|
5847
5992
|
id: tmpDimensionId
|
|
5848
5993
|
}, linesInfo), {}, {
|
|
@@ -5922,9 +6067,9 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
5922
6067
|
};
|
|
5923
6068
|
}
|
|
5924
6069
|
|
|
5925
|
-
function ownKeys$
|
|
6070
|
+
function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
5926
6071
|
|
|
5927
|
-
function _objectSpread$
|
|
6072
|
+
function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$g(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
5928
6073
|
let timerId;
|
|
5929
6074
|
const hover = (drawingId, pluginId, hoveredId) => {
|
|
5930
6075
|
const {
|
|
@@ -5958,7 +6103,7 @@ const hover = (drawingId, pluginId, hoveredId) => {
|
|
|
5958
6103
|
return {
|
|
5959
6104
|
hovered: hoveredId,
|
|
5960
6105
|
highlighted: [hoveredId, ...linkedConstraints],
|
|
5961
|
-
constraintsToGeometry: _objectSpread$
|
|
6106
|
+
constraintsToGeometry: _objectSpread$g(_objectSpread$g({}, state_.constraintsToGeometry), constraintsToGeometry)
|
|
5962
6107
|
};
|
|
5963
6108
|
});
|
|
5964
6109
|
}
|
|
@@ -6139,9 +6284,9 @@ const snapDraggedPoints = (diff, drawingId) => {
|
|
|
6139
6284
|
return snapResult;
|
|
6140
6285
|
};
|
|
6141
6286
|
|
|
6142
|
-
function ownKeys$
|
|
6287
|
+
function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
6143
6288
|
|
|
6144
|
-
function _objectSpread$
|
|
6289
|
+
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$f(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6145
6290
|
|
|
6146
6291
|
const artifDelay = 16;
|
|
6147
6292
|
|
|
@@ -6415,7 +6560,7 @@ function Drag(drawingId, pluginId) {
|
|
|
6415
6560
|
name: HandlersList.DRAG,
|
|
6416
6561
|
filter,
|
|
6417
6562
|
onDestruct: destructor,
|
|
6418
|
-
pointerHandlers: _objectSpread$
|
|
6563
|
+
pointerHandlers: _objectSpread$f({
|
|
6419
6564
|
onPointerDown,
|
|
6420
6565
|
onPointerUp,
|
|
6421
6566
|
onPointerMove
|
|
@@ -6427,9 +6572,9 @@ function Drag(drawingId, pluginId) {
|
|
|
6427
6572
|
};
|
|
6428
6573
|
}
|
|
6429
6574
|
|
|
6430
|
-
function ownKeys$
|
|
6575
|
+
function ownKeys$e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
6431
6576
|
|
|
6432
|
-
function _objectSpread$
|
|
6577
|
+
function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$e(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6433
6578
|
function DrawPoint(drawingId, pluginId) {
|
|
6434
6579
|
const {
|
|
6435
6580
|
set
|
|
@@ -6498,8 +6643,8 @@ function DrawPoint(drawingId, pluginId) {
|
|
|
6498
6643
|
set(state => {
|
|
6499
6644
|
const tmpPoint = state.tmpObjects[tmpPointId];
|
|
6500
6645
|
return {
|
|
6501
|
-
tmpObjects: _objectSpread$
|
|
6502
|
-
[tmpPointId]: _objectSpread$
|
|
6646
|
+
tmpObjects: _objectSpread$e(_objectSpread$e({}, state.tmpObjects), {}, {
|
|
6647
|
+
[tmpPointId]: _objectSpread$e(_objectSpread$e({}, tmpPoint), {}, {
|
|
6503
6648
|
position: mousePos
|
|
6504
6649
|
})
|
|
6505
6650
|
})
|
|
@@ -6521,9 +6666,9 @@ function DrawPoint(drawingId, pluginId) {
|
|
|
6521
6666
|
};
|
|
6522
6667
|
}
|
|
6523
6668
|
|
|
6524
|
-
function ownKeys$
|
|
6669
|
+
function ownKeys$d(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
6525
6670
|
|
|
6526
|
-
function _objectSpread$
|
|
6671
|
+
function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$d(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6527
6672
|
function DrawLine(drawingId, pluginId) {
|
|
6528
6673
|
// Global hooks:
|
|
6529
6674
|
const {
|
|
@@ -6609,7 +6754,7 @@ function DrawLine(drawingId, pluginId) {
|
|
|
6609
6754
|
endPId: tmpEndP.id
|
|
6610
6755
|
};
|
|
6611
6756
|
return {
|
|
6612
|
-
tmpObjects: _objectSpread$
|
|
6757
|
+
tmpObjects: _objectSpread$d(_objectSpread$d({}, state.tmpObjects), {}, {
|
|
6613
6758
|
[tmpStartP.id]: tmpStartP,
|
|
6614
6759
|
[tmpLine.id]: tmpLine
|
|
6615
6760
|
})
|
|
@@ -6647,8 +6792,8 @@ function DrawLine(drawingId, pluginId) {
|
|
|
6647
6792
|
const tmpStartP = state.tmpObjects[tmpStartPId];
|
|
6648
6793
|
const tmpEndP = state.tmpObjects[tmpEndPId];
|
|
6649
6794
|
return {
|
|
6650
|
-
tmpObjects: _objectSpread$
|
|
6651
|
-
[tmpStartPId]: _objectSpread$
|
|
6795
|
+
tmpObjects: _objectSpread$d(_objectSpread$d({}, state.tmpObjects), {}, {
|
|
6796
|
+
[tmpStartPId]: _objectSpread$d(_objectSpread$d({}, tmpStartP), {}, {
|
|
6652
6797
|
position: tmpEndP.position.clone()
|
|
6653
6798
|
})
|
|
6654
6799
|
})
|
|
@@ -6670,8 +6815,8 @@ function DrawLine(drawingId, pluginId) {
|
|
|
6670
6815
|
set(state => {
|
|
6671
6816
|
const tmpEndP = state.tmpObjects[tmpEndPId];
|
|
6672
6817
|
return {
|
|
6673
|
-
tmpObjects: _objectSpread$
|
|
6674
|
-
[tmpEndPId]: _objectSpread$
|
|
6818
|
+
tmpObjects: _objectSpread$d(_objectSpread$d({}, state.tmpObjects), {}, {
|
|
6819
|
+
[tmpEndPId]: _objectSpread$d(_objectSpread$d({}, tmpEndP), {}, {
|
|
6675
6820
|
position: mousePos
|
|
6676
6821
|
})
|
|
6677
6822
|
})
|
|
@@ -6696,9 +6841,9 @@ function DrawLine(drawingId, pluginId) {
|
|
|
6696
6841
|
};
|
|
6697
6842
|
}
|
|
6698
6843
|
|
|
6699
|
-
function ownKeys$
|
|
6844
|
+
function ownKeys$c(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
6700
6845
|
|
|
6701
|
-
function _objectSpread$
|
|
6846
|
+
function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$c(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6702
6847
|
function DrawRectangle(drawingId, pluginId) {
|
|
6703
6848
|
// Global hooks:
|
|
6704
6849
|
const {
|
|
@@ -6754,7 +6899,7 @@ function DrawRectangle(drawingId, pluginId) {
|
|
|
6754
6899
|
set(state => {
|
|
6755
6900
|
const tmpPoint11 = state.tmpObjects[tmpPoint11Id];
|
|
6756
6901
|
|
|
6757
|
-
const tmpPoint00 = _objectSpread$
|
|
6902
|
+
const tmpPoint00 = _objectSpread$c(_objectSpread$c({}, state.tmpObjects[tmpPoint00Id]), {}, {
|
|
6758
6903
|
position: tmpPoint11.position.clone()
|
|
6759
6904
|
});
|
|
6760
6905
|
|
|
@@ -6822,7 +6967,7 @@ function DrawRectangle(drawingId, pluginId) {
|
|
|
6822
6967
|
endPId: tmpPoint11.id
|
|
6823
6968
|
};
|
|
6824
6969
|
return {
|
|
6825
|
-
tmpObjects: _objectSpread$
|
|
6970
|
+
tmpObjects: _objectSpread$c(_objectSpread$c({}, state.tmpObjects), {}, {
|
|
6826
6971
|
[tmpPoint00.id]: tmpPoint00,
|
|
6827
6972
|
[tmpPoint01.id]: tmpPoint01,
|
|
6828
6973
|
[tmpPoint10.id]: tmpPoint10,
|
|
@@ -6850,7 +6995,7 @@ function DrawRectangle(drawingId, pluginId) {
|
|
|
6850
6995
|
const tmpPoint11 = state.tmpObjects[tmpPoint11Id];
|
|
6851
6996
|
return {
|
|
6852
6997
|
tmpObjects: {
|
|
6853
|
-
[tmpPoint00Id]: _objectSpread$
|
|
6998
|
+
[tmpPoint00Id]: _objectSpread$c(_objectSpread$c({}, tmpPoint00), {}, {
|
|
6854
6999
|
position: tmpPoint11.position.clone()
|
|
6855
7000
|
})
|
|
6856
7001
|
}
|
|
@@ -6874,8 +7019,8 @@ function DrawRectangle(drawingId, pluginId) {
|
|
|
6874
7019
|
if (additionIndex === 0) {
|
|
6875
7020
|
const tmpPoint00 = state.tmpObjects[tmpPoint00Id];
|
|
6876
7021
|
return {
|
|
6877
|
-
tmpObjects: _objectSpread$
|
|
6878
|
-
[tmpPoint00Id]: _objectSpread$
|
|
7022
|
+
tmpObjects: _objectSpread$c(_objectSpread$c({}, state.tmpObjects), {}, {
|
|
7023
|
+
[tmpPoint00Id]: _objectSpread$c(_objectSpread$c({}, tmpPoint00), {}, {
|
|
6879
7024
|
position: snappedPos
|
|
6880
7025
|
})
|
|
6881
7026
|
})
|
|
@@ -6886,14 +7031,14 @@ function DrawRectangle(drawingId, pluginId) {
|
|
|
6886
7031
|
const tmpPoint10 = state.tmpObjects[tmpPoint10Id];
|
|
6887
7032
|
const tmpPoint11 = state.tmpObjects[tmpPoint11Id];
|
|
6888
7033
|
return {
|
|
6889
|
-
tmpObjects: _objectSpread$
|
|
6890
|
-
[tmpPoint01Id]: _objectSpread$
|
|
7034
|
+
tmpObjects: _objectSpread$c(_objectSpread$c({}, state.tmpObjects), {}, {
|
|
7035
|
+
[tmpPoint01Id]: _objectSpread$c(_objectSpread$c({}, tmpPoint01), {}, {
|
|
6891
7036
|
position: new THREE__namespace.Vector3(startPos.x, snappedPos.y, startPos.z)
|
|
6892
7037
|
}),
|
|
6893
|
-
[tmpPoint10Id]: _objectSpread$
|
|
7038
|
+
[tmpPoint10Id]: _objectSpread$c(_objectSpread$c({}, tmpPoint10), {}, {
|
|
6894
7039
|
position: new THREE__namespace.Vector3(snappedPos.x, startPos.y, startPos.z)
|
|
6895
7040
|
}),
|
|
6896
|
-
[tmpPoint11Id]: _objectSpread$
|
|
7041
|
+
[tmpPoint11Id]: _objectSpread$c(_objectSpread$c({}, tmpPoint11), {}, {
|
|
6897
7042
|
position: new THREE__namespace.Vector3(snappedPos.x, snappedPos.y, startPos.z)
|
|
6898
7043
|
})
|
|
6899
7044
|
})
|
|
@@ -7060,9 +7205,9 @@ const Circle = ({
|
|
|
7060
7205
|
}), /*#__PURE__*/React.createElement("meshBasicMaterial", materialProps));
|
|
7061
7206
|
};
|
|
7062
7207
|
|
|
7063
|
-
function ownKeys$
|
|
7208
|
+
function ownKeys$b(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
7064
7209
|
|
|
7065
|
-
function _objectSpread$
|
|
7210
|
+
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$b(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$b(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
7066
7211
|
function DrawArc(drawingId, pluginId, arcType) {
|
|
7067
7212
|
// Global hooks:
|
|
7068
7213
|
const {
|
|
@@ -7118,7 +7263,7 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
7118
7263
|
additionIndex = 0;
|
|
7119
7264
|
lastAddedEndPointId = UNDEFINEDID;
|
|
7120
7265
|
set(state => {
|
|
7121
|
-
const tmpStartP = _objectSpread$
|
|
7266
|
+
const tmpStartP = _objectSpread$b(_objectSpread$b({}, state.tmpObjects[tmpStartPId]), {}, {
|
|
7122
7267
|
position: lastMousePos.clone()
|
|
7123
7268
|
});
|
|
7124
7269
|
|
|
@@ -7133,24 +7278,24 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
7133
7278
|
set(state => {
|
|
7134
7279
|
const tmpStartP = state.tmpObjects[tmpStartPId];
|
|
7135
7280
|
|
|
7136
|
-
const tmpEndP = _objectSpread$
|
|
7281
|
+
const tmpEndP = _objectSpread$b(_objectSpread$b({}, state.tmpObjects[tmpEndPId]), {}, {
|
|
7137
7282
|
position: lastMousePos.clone()
|
|
7138
7283
|
});
|
|
7139
7284
|
|
|
7140
7285
|
const centerPos = calculateCenterPoint(tmpStartP.position, lastMousePos, lastMousePos);
|
|
7141
7286
|
|
|
7142
|
-
const tmpCenterP = _objectSpread$
|
|
7287
|
+
const tmpCenterP = _objectSpread$b(_objectSpread$b({}, state.tmpObjects[tmpCenterPId]), {}, {
|
|
7143
7288
|
position: centerPos ? centerPos : lastMousePos.clone()
|
|
7144
7289
|
});
|
|
7145
7290
|
|
|
7146
|
-
const tmpArc = _objectSpread$
|
|
7291
|
+
const tmpArc = _objectSpread$b(_objectSpread$b({}, state.tmpObjects[tmpArcId]), {}, {
|
|
7147
7292
|
// In case centerPos couldn't be calculated, the arc should be drawn as a line
|
|
7148
7293
|
drawAsLine: centerPos === undefined,
|
|
7149
7294
|
clockwise: false
|
|
7150
7295
|
});
|
|
7151
7296
|
|
|
7152
7297
|
return {
|
|
7153
|
-
tmpObjects: _objectSpread$
|
|
7298
|
+
tmpObjects: _objectSpread$b(_objectSpread$b({}, state.tmpObjects), {}, {
|
|
7154
7299
|
[tmpEndP.id]: tmpEndP,
|
|
7155
7300
|
[tmpCenterP.id]: tmpCenterP,
|
|
7156
7301
|
[tmpArc.id]: tmpArc
|
|
@@ -7271,7 +7416,7 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
7271
7416
|
clockwise: false
|
|
7272
7417
|
};
|
|
7273
7418
|
return {
|
|
7274
|
-
tmpObjects: _objectSpread$
|
|
7419
|
+
tmpObjects: _objectSpread$b(_objectSpread$b({}, state.tmpObjects), {}, {
|
|
7275
7420
|
[tmpEndP.id]: tmpEndP,
|
|
7276
7421
|
[tmpCenterP.id]: tmpCenterP,
|
|
7277
7422
|
[tmpArc.id]: tmpArc
|
|
@@ -7300,7 +7445,7 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
7300
7445
|
clockwise: false
|
|
7301
7446
|
};
|
|
7302
7447
|
return {
|
|
7303
|
-
tmpObjects: _objectSpread$
|
|
7448
|
+
tmpObjects: _objectSpread$b(_objectSpread$b({}, state.tmpObjects), {}, {
|
|
7304
7449
|
[tmpCenterP.id]: tmpCenterP,
|
|
7305
7450
|
[tmpArc.id]: tmpArc
|
|
7306
7451
|
})
|
|
@@ -7358,11 +7503,11 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
7358
7503
|
const tmpEndP = state.tmpObjects[tmpEndPId];
|
|
7359
7504
|
const tmpCenterP = state.tmpObjects[tmpCenterPId];
|
|
7360
7505
|
return {
|
|
7361
|
-
tmpObjects: _objectSpread$
|
|
7362
|
-
[tmpStartPId]: _objectSpread$
|
|
7506
|
+
tmpObjects: _objectSpread$b(_objectSpread$b({}, state.tmpObjects), {}, {
|
|
7507
|
+
[tmpStartPId]: _objectSpread$b(_objectSpread$b({}, tmpStartP), {}, {
|
|
7363
7508
|
position: tmpEndP.position.clone()
|
|
7364
7509
|
}),
|
|
7365
|
-
[tmpCenterPId]: _objectSpread$
|
|
7510
|
+
[tmpCenterPId]: _objectSpread$b(_objectSpread$b({}, tmpCenterP), {}, {
|
|
7366
7511
|
position: tmpEndP.position.clone()
|
|
7367
7512
|
})
|
|
7368
7513
|
})
|
|
@@ -7386,8 +7531,8 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
7386
7531
|
if (additionIndex === 0) {
|
|
7387
7532
|
const tmpStartP = state.tmpObjects[tmpStartPId];
|
|
7388
7533
|
return {
|
|
7389
|
-
tmpObjects: _objectSpread$
|
|
7390
|
-
[tmpStartPId]: _objectSpread$
|
|
7534
|
+
tmpObjects: _objectSpread$b(_objectSpread$b({}, state.tmpObjects), {}, {
|
|
7535
|
+
[tmpStartPId]: _objectSpread$b(_objectSpread$b({}, tmpStartP), {}, {
|
|
7391
7536
|
position: lastMousePos.clone()
|
|
7392
7537
|
})
|
|
7393
7538
|
})
|
|
@@ -7399,14 +7544,14 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
7399
7544
|
const tmpCenterP = state.tmpObjects[tmpCenterPId];
|
|
7400
7545
|
const centerPos = calculateCenterPoint(tmpStartP.position, lastMousePos, lastMousePos);
|
|
7401
7546
|
return {
|
|
7402
|
-
tmpObjects: _objectSpread$
|
|
7403
|
-
[tmpEndPId]: _objectSpread$
|
|
7547
|
+
tmpObjects: _objectSpread$b(_objectSpread$b({}, state.tmpObjects), {}, {
|
|
7548
|
+
[tmpEndPId]: _objectSpread$b(_objectSpread$b({}, tmpEndP), {}, {
|
|
7404
7549
|
position: lastMousePos.clone()
|
|
7405
7550
|
}),
|
|
7406
|
-
[tmpCenterPId]: _objectSpread$
|
|
7551
|
+
[tmpCenterPId]: _objectSpread$b(_objectSpread$b({}, tmpCenterP), {}, {
|
|
7407
7552
|
position: centerPos ? centerPos : lastMousePos.clone()
|
|
7408
7553
|
}),
|
|
7409
|
-
[tmpArcId]: _objectSpread$
|
|
7554
|
+
[tmpArcId]: _objectSpread$b(_objectSpread$b({}, tmpArc), {}, {
|
|
7410
7555
|
// In case centerPos couldn't be calculated, the arc should be drawn as a line
|
|
7411
7556
|
drawAsLine: centerPos === undefined,
|
|
7412
7557
|
clockwise: false
|
|
@@ -7420,14 +7565,14 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
7420
7565
|
const tmpCenterP = state.tmpObjects[tmpCenterPId];
|
|
7421
7566
|
const centerPos = calculateCenterPoint(tmpStartP.position, tmpEndP.position, lastMousePos);
|
|
7422
7567
|
return {
|
|
7423
|
-
tmpObjects: _objectSpread$
|
|
7424
|
-
[tmpEndPId]: _objectSpread$
|
|
7568
|
+
tmpObjects: _objectSpread$b(_objectSpread$b({}, state.tmpObjects), {}, {
|
|
7569
|
+
[tmpEndPId]: _objectSpread$b(_objectSpread$b({}, tmpEndP), {}, {
|
|
7425
7570
|
position: arcType === HandlersList.DRAWARCTANGENT ? lastMousePos.clone() : tmpEndP.position
|
|
7426
7571
|
}),
|
|
7427
|
-
[tmpCenterPId]: _objectSpread$
|
|
7572
|
+
[tmpCenterPId]: _objectSpread$b(_objectSpread$b({}, tmpCenterP), {}, {
|
|
7428
7573
|
position: centerPos ? centerPos : lastMousePos.clone()
|
|
7429
7574
|
}),
|
|
7430
|
-
[tmpArcId]: _objectSpread$
|
|
7575
|
+
[tmpArcId]: _objectSpread$b(_objectSpread$b({}, tmpArc), {}, {
|
|
7431
7576
|
// In case centerPos couldn't be calculated, the arc should be drawn as a line
|
|
7432
7577
|
drawAsLine: centerPos === undefined,
|
|
7433
7578
|
clockwise: evaluateClockwise(tmpStartP.position, tmpEndP.position, lastMousePos)
|
|
@@ -7455,9 +7600,9 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
7455
7600
|
};
|
|
7456
7601
|
}
|
|
7457
7602
|
|
|
7458
|
-
function ownKeys$
|
|
7603
|
+
function ownKeys$a(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
7459
7604
|
|
|
7460
|
-
function _objectSpread$
|
|
7605
|
+
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$a(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
7461
7606
|
function DrawCircle(drawingId, pluginId) {
|
|
7462
7607
|
const {
|
|
7463
7608
|
set
|
|
@@ -7504,7 +7649,7 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
7504
7649
|
} else {
|
|
7505
7650
|
additionIndex = 0;
|
|
7506
7651
|
set(state => {
|
|
7507
|
-
const tmpCenterP = _objectSpread$
|
|
7652
|
+
const tmpCenterP = _objectSpread$a(_objectSpread$a({}, state.tmpObjects[tmpCenterPId]), {}, {
|
|
7508
7653
|
position: lastMousePos.clone()
|
|
7509
7654
|
});
|
|
7510
7655
|
|
|
@@ -7538,7 +7683,7 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
7538
7683
|
radius: 0.001
|
|
7539
7684
|
};
|
|
7540
7685
|
return {
|
|
7541
|
-
tmpObjects: _objectSpread$
|
|
7686
|
+
tmpObjects: _objectSpread$a(_objectSpread$a({}, state.tmpObjects), {}, {
|
|
7542
7687
|
[tmpCenterP.id]: tmpCenterP,
|
|
7543
7688
|
[tmpCircle.id]: tmpCircle
|
|
7544
7689
|
})
|
|
@@ -7559,7 +7704,7 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
7559
7704
|
const tmpCenterP = state.tmpObjects[tmpCenterPId];
|
|
7560
7705
|
return {
|
|
7561
7706
|
tmpObjects: {
|
|
7562
|
-
[tmpCenterPId]: _objectSpread$
|
|
7707
|
+
[tmpCenterPId]: _objectSpread$a(_objectSpread$a({}, tmpCenterP), {}, {
|
|
7563
7708
|
position: e.point.clone().applyMatrix4(getGlobalToLocalMatrix(drawingId, sketchId))
|
|
7564
7709
|
})
|
|
7565
7710
|
}
|
|
@@ -7583,8 +7728,8 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
7583
7728
|
if (additionIndex === 0) {
|
|
7584
7729
|
const tmpCenterP = state.tmpObjects[tmpCenterPId];
|
|
7585
7730
|
return {
|
|
7586
|
-
tmpObjects: _objectSpread$
|
|
7587
|
-
[tmpCenterPId]: _objectSpread$
|
|
7731
|
+
tmpObjects: _objectSpread$a(_objectSpread$a({}, state.tmpObjects), {}, {
|
|
7732
|
+
[tmpCenterPId]: _objectSpread$a(_objectSpread$a({}, tmpCenterP), {}, {
|
|
7588
7733
|
position: snappedPos || localPos
|
|
7589
7734
|
})
|
|
7590
7735
|
})
|
|
@@ -7593,8 +7738,8 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
7593
7738
|
const tmpCenterP = state.tmpObjects[tmpCenterPId];
|
|
7594
7739
|
const tmpCircle = state.tmpObjects[tmpCircleId];
|
|
7595
7740
|
return {
|
|
7596
|
-
tmpObjects: _objectSpread$
|
|
7597
|
-
[tmpCircleId]: _objectSpread$
|
|
7741
|
+
tmpObjects: _objectSpread$a(_objectSpread$a({}, state.tmpObjects), {}, {
|
|
7742
|
+
[tmpCircleId]: _objectSpread$a(_objectSpread$a({}, tmpCircle), {}, {
|
|
7598
7743
|
radius: Math.max(tmpCenterP.position.distanceTo(localPos), 0.001)
|
|
7599
7744
|
})
|
|
7600
7745
|
})
|
|
@@ -8092,9 +8237,9 @@ function recognizeFilletByArc(object, tree, sketchId) {
|
|
|
8092
8237
|
};
|
|
8093
8238
|
}
|
|
8094
8239
|
|
|
8095
|
-
function ownKeys$
|
|
8240
|
+
function ownKeys$9(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
8096
8241
|
|
|
8097
|
-
function _objectSpread$
|
|
8242
|
+
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$9(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$9(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8098
8243
|
function Fillet(drawingId, pluginId) {
|
|
8099
8244
|
const actions = core.getDrawing(drawingId).api;
|
|
8100
8245
|
const plugin = core.getPlugin(drawingId, pluginId);
|
|
@@ -8243,7 +8388,7 @@ function Fillet(drawingId, pluginId) {
|
|
|
8243
8388
|
return;
|
|
8244
8389
|
}
|
|
8245
8390
|
|
|
8246
|
-
classcad.ccAPI.sketcher.createFillet(drawingId, sketchId, data.info.lines.map(line => line.id), data.info.lineStarts.map(lineStart => lineStart.id), data.info.incidence, data.info.control, data.params.start, getArcAngles(_objectSpread$
|
|
8391
|
+
classcad.ccAPI.sketcher.createFillet(drawingId, sketchId, data.info.lines.map(line => line.id), data.info.lineStarts.map(lineStart => lineStart.id), data.info.incidence, data.info.control, data.params.start, getArcAngles(_objectSpread$9(_objectSpread$9({}, data.params), {}, {
|
|
8247
8392
|
radius: 1
|
|
8248
8393
|
})).mid, data.params.end);
|
|
8249
8394
|
set({
|
|
@@ -9504,9 +9649,9 @@ const Point = ({
|
|
|
9504
9649
|
}));
|
|
9505
9650
|
};
|
|
9506
9651
|
|
|
9507
|
-
function ownKeys$
|
|
9652
|
+
function ownKeys$8(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
9508
9653
|
|
|
9509
|
-
function _objectSpread$
|
|
9654
|
+
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$8(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
9510
9655
|
/*
|
|
9511
9656
|
* !polygonOffset!
|
|
9512
9657
|
* For correct drawing of objects that lie in the same plane, polygonOffset is used.
|
|
@@ -9552,7 +9697,7 @@ const CCLine = props => {
|
|
|
9552
9697
|
start: start,
|
|
9553
9698
|
end: end,
|
|
9554
9699
|
scalePlus: isHovered || isSelected,
|
|
9555
|
-
meshProps: _objectSpread$
|
|
9700
|
+
meshProps: _objectSpread$8(_objectSpread$8({
|
|
9556
9701
|
renderOrder
|
|
9557
9702
|
}, handlers), {}, {
|
|
9558
9703
|
userData
|
|
@@ -9601,7 +9746,7 @@ const CCPoint = props => {
|
|
|
9601
9746
|
// so we have to increase size of hovered or selected point to make the point not occluded buy other ones
|
|
9602
9747
|
,
|
|
9603
9748
|
scalePlus: isHovered || isSelected,
|
|
9604
|
-
meshProps: _objectSpread$
|
|
9749
|
+
meshProps: _objectSpread$8(_objectSpread$8({
|
|
9605
9750
|
renderOrder
|
|
9606
9751
|
}, handlers), {}, {
|
|
9607
9752
|
userData
|
|
@@ -9652,7 +9797,7 @@ const CCArc = props => {
|
|
|
9652
9797
|
end: endPoint,
|
|
9653
9798
|
center: centerPoint,
|
|
9654
9799
|
clockwise: clockwise,
|
|
9655
|
-
meshProps: _objectSpread$
|
|
9800
|
+
meshProps: _objectSpread$8({
|
|
9656
9801
|
renderOrder,
|
|
9657
9802
|
userData
|
|
9658
9803
|
}, handlers),
|
|
@@ -9709,7 +9854,7 @@ const CCCircle = props => {
|
|
|
9709
9854
|
radius: radius,
|
|
9710
9855
|
scale: scale,
|
|
9711
9856
|
width: arcWidth + hoverZone,
|
|
9712
|
-
meshProps: _objectSpread$
|
|
9857
|
+
meshProps: _objectSpread$8(_objectSpread$8({}, handlers), {}, {
|
|
9713
9858
|
renderOrder,
|
|
9714
9859
|
userData
|
|
9715
9860
|
}),
|
|
@@ -10162,7 +10307,8 @@ function useHandleGSelection(drawingId, pluginId, activeHandler) {
|
|
|
10162
10307
|
prevHandler.current = undefined;
|
|
10163
10308
|
}
|
|
10164
10309
|
}, [drawingId, pluginId, activeSelection, activeHandler, set]);
|
|
10165
|
-
}
|
|
10310
|
+
} // Creates reference geometry in the sketch for all the graphic objects appearing in the 'UseRef' selection; the selection is reset after each triggering
|
|
10311
|
+
|
|
10166
10312
|
|
|
10167
10313
|
function useUseRef(drawingId, sketchId) {
|
|
10168
10314
|
const itemsUseRef = react.useDrawing(drawingId, d => {
|
|
@@ -10852,11 +10998,20 @@ const NameEdit = ({
|
|
|
10852
10998
|
React.useEffect(() => {
|
|
10853
10999
|
var _ref$current;
|
|
10854
11000
|
|
|
11001
|
+
getCADState().api.blankDiv.show(() => setEditName(false));
|
|
10855
11002
|
(_ref$current = ref.current) == null ? void 0 : _ref$current.focus({
|
|
10856
11003
|
cursor: 'all'
|
|
10857
|
-
});
|
|
10858
|
-
|
|
11004
|
+
}); // Deactivate BlankDiv on dismount
|
|
11005
|
+
|
|
11006
|
+
return () => getCADState().api.blankDiv.hide();
|
|
11007
|
+
}, [setEditName]); // When BlankDiv is active, increase zIndex so this element would overlap it
|
|
11008
|
+
|
|
11009
|
+
const showBlankDiv = useCADStore(s => s.blankDiv.isActive);
|
|
11010
|
+
const zIndex = showBlankDiv ? blankZIndex + 1 : 0;
|
|
10859
11011
|
return /*#__PURE__*/React.createElement(antd.Input, {
|
|
11012
|
+
style: {
|
|
11013
|
+
zIndex
|
|
11014
|
+
},
|
|
10860
11015
|
ref: ref,
|
|
10861
11016
|
onPressEnter: onEnter,
|
|
10862
11017
|
defaultValue: name,
|
|
@@ -12164,9 +12319,9 @@ var index$c = /*#__PURE__*/Object.freeze({
|
|
|
12164
12319
|
description: description$c
|
|
12165
12320
|
});
|
|
12166
12321
|
|
|
12167
|
-
function ownKeys$
|
|
12322
|
+
function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
12168
12323
|
|
|
12169
|
-
function _objectSpread$
|
|
12324
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$7(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
12170
12325
|
|
|
12171
12326
|
const NumInput = ({
|
|
12172
12327
|
onChange,
|
|
@@ -12227,7 +12382,7 @@ const CSysEditor = ({
|
|
|
12227
12382
|
const [z, setZ] = React.useState(() => userValue[csysRow].z);
|
|
12228
12383
|
React.useEffect(() => {
|
|
12229
12384
|
setUserValue(val => {
|
|
12230
|
-
const newVal = [_objectSpread$
|
|
12385
|
+
const newVal = [_objectSpread$7({}, val[0]), _objectSpread$7({}, val[1]), _objectSpread$7({}, val[2]), _objectSpread$7({}, val[3])];
|
|
12231
12386
|
newVal[csysRow] = {
|
|
12232
12387
|
x,
|
|
12233
12388
|
y,
|
|
@@ -15721,90 +15876,6 @@ const FileUtils = {
|
|
|
15721
15876
|
}
|
|
15722
15877
|
};
|
|
15723
15878
|
|
|
15724
|
-
const zoomToFit = drawingId => {
|
|
15725
|
-
var _getCamera;
|
|
15726
|
-
|
|
15727
|
-
const drawing = core.getDrawing(drawingId);
|
|
15728
|
-
const camApi = (_getCamera = react.getCamera(drawingId)) == null ? void 0 : _getCamera.api;
|
|
15729
|
-
|
|
15730
|
-
if (!drawing || !camApi) {
|
|
15731
|
-
return;
|
|
15732
|
-
}
|
|
15733
|
-
|
|
15734
|
-
const {
|
|
15735
|
-
structure,
|
|
15736
|
-
api: drawingApi
|
|
15737
|
-
} = drawing;
|
|
15738
|
-
const {
|
|
15739
|
-
root,
|
|
15740
|
-
currentProduct,
|
|
15741
|
-
currentNode
|
|
15742
|
-
} = structure;
|
|
15743
|
-
let currRoot = currentNode || currentProduct || root;
|
|
15744
|
-
|
|
15745
|
-
if (currentProduct && structure.tree[currentProduct].class === 'CC_Part') {
|
|
15746
|
-
currRoot = currentProduct;
|
|
15747
|
-
}
|
|
15748
|
-
|
|
15749
|
-
const bounds = drawingApi.structure.calculateProductBounds(currRoot);
|
|
15750
|
-
camApi.setZoom('fit', bounds);
|
|
15751
|
-
};
|
|
15752
|
-
|
|
15753
|
-
function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15754
|
-
|
|
15755
|
-
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$7(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
15756
|
-
const appApi = (set, get) => ({
|
|
15757
|
-
assemblyTree: {
|
|
15758
|
-
startProdEditing: (drawingId, objId) => {
|
|
15759
|
-
set(state => {
|
|
15760
|
-
let res = [];
|
|
15761
|
-
const curNode = core.api.getState().drawing.refs[drawingId].structure.currentNode;
|
|
15762
|
-
res = state.assemblyTree.prodStack;
|
|
15763
|
-
curNode && res.push(curNode);
|
|
15764
|
-
return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
15765
|
-
assemblyTree: {
|
|
15766
|
-
prodStack: [...res]
|
|
15767
|
-
}
|
|
15768
|
-
});
|
|
15769
|
-
});
|
|
15770
|
-
classcad.ccAPI.assemblyBuilder.setCurrentNode(drawingId, objId).then(() => zoomToFit(drawingId)).catch();
|
|
15771
|
-
},
|
|
15772
|
-
goBack: drawingId => {
|
|
15773
|
-
const prodStack = get().assemblyTree.prodStack;
|
|
15774
|
-
const prevProd = prodStack[prodStack.length - 1];
|
|
15775
|
-
if (!prevProd) return;
|
|
15776
|
-
set(state => {
|
|
15777
|
-
const res = state.assemblyTree.prodStack;
|
|
15778
|
-
res.pop();
|
|
15779
|
-
return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
15780
|
-
assemblyTree: {
|
|
15781
|
-
prodStack: [...res]
|
|
15782
|
-
}
|
|
15783
|
-
});
|
|
15784
|
-
});
|
|
15785
|
-
classcad.ccAPI.assemblyBuilder.setCurrentNode(drawingId, prevProd).then(() => zoomToFit(drawingId)).catch();
|
|
15786
|
-
},
|
|
15787
|
-
clearProdStack: () => {
|
|
15788
|
-
set(state => _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
15789
|
-
assemblyTree: {
|
|
15790
|
-
prodStack: []
|
|
15791
|
-
}
|
|
15792
|
-
}));
|
|
15793
|
-
}
|
|
15794
|
-
}
|
|
15795
|
-
});
|
|
15796
|
-
|
|
15797
|
-
const createAppState = (set, get) => ({
|
|
15798
|
-
assemblyTree: {
|
|
15799
|
-
prodStack: []
|
|
15800
|
-
},
|
|
15801
|
-
api: appApi(set, get)
|
|
15802
|
-
});
|
|
15803
|
-
|
|
15804
|
-
const CADApi = vanilla((set, get) => createAppState(set, get));
|
|
15805
|
-
const useCADStore = create(CADApi);
|
|
15806
|
-
const getCADState = CADApi.getState;
|
|
15807
|
-
|
|
15808
15879
|
function useMenuItems$3(drawingId, prodId, setEditName, pluginId) {
|
|
15809
15880
|
const isCurrent = react.useDrawing(drawingId, d => d.structure.currentProduct === prodId);
|
|
15810
15881
|
const isAssembly = react.useDrawing(drawingId, d => d.structure.tree[prodId].class === classcad.CCClasses.CCAssembly);
|
|
@@ -19245,23 +19316,6 @@ const useMsgStore = create((set, get) => ({
|
|
|
19245
19316
|
api: createApi(set)
|
|
19246
19317
|
}));
|
|
19247
19318
|
|
|
19248
|
-
const blankZIndex = 1000;
|
|
19249
|
-
const BlankDiv = ({
|
|
19250
|
-
onClick
|
|
19251
|
-
}) => {
|
|
19252
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
19253
|
-
onClick: onClick,
|
|
19254
|
-
style: {
|
|
19255
|
-
zIndex: blankZIndex,
|
|
19256
|
-
position: 'fixed',
|
|
19257
|
-
top: 0,
|
|
19258
|
-
left: 0,
|
|
19259
|
-
bottom: 0,
|
|
19260
|
-
right: 0
|
|
19261
|
-
}
|
|
19262
|
-
});
|
|
19263
|
-
};
|
|
19264
|
-
|
|
19265
19319
|
function getBorderColor(msg) {
|
|
19266
19320
|
if (msg.isShown) return '#dddddd';
|
|
19267
19321
|
if (msg.type === 'success') return '#b7eb8f';
|
|
@@ -19431,20 +19485,24 @@ const Messages = ({
|
|
|
19431
19485
|
if (msgsLen === 0) setShowList(false);
|
|
19432
19486
|
}, [msgsLen]);
|
|
19433
19487
|
const onClick = React.useCallback(() => {
|
|
19488
|
+
if (showList) {
|
|
19489
|
+
getCADState().api.blankDiv.hide();
|
|
19490
|
+
} else {
|
|
19491
|
+
getCADState().api.blankDiv.show(() => setShowList(false));
|
|
19492
|
+
}
|
|
19493
|
+
|
|
19434
19494
|
setShowList(s => !s);
|
|
19435
19495
|
setShowBadge(false);
|
|
19436
|
-
}, []);
|
|
19496
|
+
}, [showList]);
|
|
19437
19497
|
return /*#__PURE__*/React.createElement("div", {
|
|
19438
19498
|
style: {
|
|
19439
19499
|
display: 'flex',
|
|
19440
19500
|
flexDirection: 'column',
|
|
19441
19501
|
alignItems: 'flex-end'
|
|
19442
19502
|
}
|
|
19443
|
-
}, showList && /*#__PURE__*/React.createElement(
|
|
19503
|
+
}, showList && /*#__PURE__*/React.createElement(MessageList, {
|
|
19444
19504
|
drawingId: drawingId
|
|
19445
|
-
}), /*#__PURE__*/React.createElement(
|
|
19446
|
-
onClick: () => setShowList(false)
|
|
19447
|
-
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
19505
|
+
}), /*#__PURE__*/React.createElement(Tooltip, {
|
|
19448
19506
|
title: "Messages"
|
|
19449
19507
|
}, /*#__PURE__*/React.createElement(antd.Badge, {
|
|
19450
19508
|
dot: showBadge
|
|
@@ -19601,7 +19659,7 @@ const Drawing = ({
|
|
|
19601
19659
|
}
|
|
19602
19660
|
}, /*#__PURE__*/React.createElement(Messages, {
|
|
19603
19661
|
drawingId: drawingId
|
|
19604
|
-
}))));
|
|
19662
|
+
})), /*#__PURE__*/React.createElement(BlankDiv, null)));
|
|
19605
19663
|
};
|
|
19606
19664
|
|
|
19607
19665
|
const CAD = ({
|