@buerli.io/react-cad 0.3.0-beta.0 → 0.4.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/components/UI/editors/BooleanEditor/BooleanEditor.d.ts +1 -1
- package/build/index.cjs.js +924 -535
- package/build/index.js +924 -535
- package/build/plugins/Dimensions/index.d.ts +2 -13
- package/build/plugins/Measure/Digits.d.ts +6 -0
- package/build/plugins/Measure/config.d.ts +1 -0
- package/build/plugins/Measure/graphics/MeasureGraphics.d.ts +5 -2
- package/build/plugins/Measure/index.d.ts +2 -1
- package/build/plugins/Measure/utils.d.ts +1 -0
- package/build/plugins/Sketch/Root/Constraints/constraintsHelpers.d.ts +0 -2
- package/build/plugins/Sketch/Root/Position.d.ts +2 -0
- package/build/plugins/Sketch/types.d.ts +4 -0
- package/build/plugins/Sketch/utils/Interaction.d.ts +1 -0
- package/build/plugins/Sketch/utils/getGeometryPriority.d.ts +2 -0
- package/package.json +4 -4
package/build/index.cjs.js
CHANGED
|
@@ -58,9 +58,9 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
|
58
58
|
var THREE__namespace = /*#__PURE__*/_interopNamespaceDefault(THREE);
|
|
59
59
|
var deepmerge__namespace = /*#__PURE__*/_interopNamespaceDefault(deepmerge);
|
|
60
60
|
|
|
61
|
-
function ownKeys$
|
|
61
|
+
function ownKeys$n(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; }
|
|
62
62
|
|
|
63
|
-
function _objectSpread$
|
|
63
|
+
function _objectSpread$n(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$n(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
64
64
|
function getGraphicId(tree, refOrObjId) {
|
|
65
65
|
const res = {
|
|
66
66
|
graphicId: refOrObjId,
|
|
@@ -82,7 +82,7 @@ function getGraphicId(tree, refOrObjId) {
|
|
|
82
82
|
var _refOrObj$members3;
|
|
83
83
|
|
|
84
84
|
res.graphicId = (_refOrObj$members3 = refOrObj.members) == null ? void 0 : _refOrObj$members3.faceId.value;
|
|
85
|
-
} else if (classcad.ccUtils.base.isA(refOrObj.class, classcad.CCClasses.
|
|
85
|
+
} else if (classcad.ccUtils.base.isA(refOrObj.class, classcad.CCClasses.CCBody)) {
|
|
86
86
|
res.graphicId = refOrObj.id;
|
|
87
87
|
res.isSolid = true;
|
|
88
88
|
} else {
|
|
@@ -128,7 +128,7 @@ function useSelectedItems(drawingId, refOrObjIds) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
const createSelItem = React.useCallback(element => {
|
|
131
|
-
return core.createGraphicItem(prodId, _objectSpread$
|
|
131
|
+
return core.createGraphicItem(prodId, _objectSpread$n(_objectSpread$n({}, element), {}, {
|
|
132
132
|
productId: prodId
|
|
133
133
|
}));
|
|
134
134
|
}, [prodId]);
|
|
@@ -159,7 +159,7 @@ function useSelectedItems(drawingId, refOrObjIds) {
|
|
|
159
159
|
const elem = cont.map[Number(grIds[0])];
|
|
160
160
|
|
|
161
161
|
if (elem) {
|
|
162
|
-
elems.push(_objectSpread$
|
|
162
|
+
elems.push(_objectSpread$n(_objectSpread$n({}, elem), {}, {
|
|
163
163
|
graphicId: contId,
|
|
164
164
|
type: cont.type
|
|
165
165
|
}));
|
|
@@ -197,9 +197,9 @@ function useSelectedItems(drawingId, refOrObjIds) {
|
|
|
197
197
|
return selectedItems;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
function ownKeys$
|
|
200
|
+
function ownKeys$m(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; }
|
|
201
201
|
|
|
202
|
-
function _objectSpread$
|
|
202
|
+
function _objectSpread$m(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$m(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$m(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
203
203
|
function addMembers(drawingId, ccObjId) {
|
|
204
204
|
const drawingState = core.getDrawing(drawingId);
|
|
205
205
|
const objInTree = drawingState.structure.tree[ccObjId];
|
|
@@ -212,7 +212,7 @@ function addMembers(drawingId, ccObjId) {
|
|
|
212
212
|
const members = {};
|
|
213
213
|
Object.keys(curMembers).forEach(memberName => {
|
|
214
214
|
const curMember = curMembers[memberName];
|
|
215
|
-
members[memberName] = _objectSpread$
|
|
215
|
+
members[memberName] = _objectSpread$m(_objectSpread$m({}, curMember), {}, {
|
|
216
216
|
name: memberName
|
|
217
217
|
});
|
|
218
218
|
|
|
@@ -567,10 +567,9 @@ const Wrapper = ({
|
|
|
567
567
|
gridColumnStart: '1',
|
|
568
568
|
gridColumnEnd: '2',
|
|
569
569
|
color: 'rgba(0, 0, 0, 0.85)',
|
|
570
|
-
margin: '0px 0px 1px 0px',
|
|
570
|
+
margin: minor ? '-2px 0px 1px 0px' : '0px 0px 1px 0px',
|
|
571
571
|
fontSize: minor ? '12px' : '14px',
|
|
572
|
-
|
|
573
|
-
textAlign: minor ? 'center' : 'start'
|
|
572
|
+
paddingLeft: minor ? '6px' : undefined
|
|
574
573
|
},
|
|
575
574
|
ellipsis: true,
|
|
576
575
|
bold: highlighted
|
|
@@ -1057,9 +1056,9 @@ const isAngular = dim => {
|
|
|
1057
1056
|
return dim.class === classcad.CCClasses.CCAngularDimension || dim.class === classcad.CCClasses.CCAngularFeatureDimension || dim.class === classcad.CCClasses.CCAngularRefDimension;
|
|
1058
1057
|
};
|
|
1059
1058
|
|
|
1060
|
-
function ownKeys$
|
|
1059
|
+
function ownKeys$l(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; }
|
|
1061
1060
|
|
|
1062
|
-
function _objectSpread$
|
|
1061
|
+
function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$l(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1063
1062
|
const appApi = (set, get) => ({
|
|
1064
1063
|
assemblyTree: {
|
|
1065
1064
|
startProdEditing: (drawingId, objId) => {
|
|
@@ -1068,13 +1067,13 @@ const appApi = (set, get) => ({
|
|
|
1068
1067
|
const curNode = core.api.getState().drawing.refs[drawingId].structure.currentNode;
|
|
1069
1068
|
res = state.assemblyTree.prodStack;
|
|
1070
1069
|
curNode && res.push(curNode);
|
|
1071
|
-
return _objectSpread$
|
|
1070
|
+
return _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
1072
1071
|
assemblyTree: {
|
|
1073
1072
|
prodStack: [...res]
|
|
1074
1073
|
}
|
|
1075
1074
|
});
|
|
1076
1075
|
});
|
|
1077
|
-
classcad.ccAPI.assemblyBuilder.setCurrentNode(drawingId, objId).catch();
|
|
1076
|
+
classcad.ccAPI.assemblyBuilder.setCurrentNode(drawingId, objId).catch(console.warn);
|
|
1078
1077
|
},
|
|
1079
1078
|
goBack: drawingId => {
|
|
1080
1079
|
const prodStack = get().assemblyTree.prodStack;
|
|
@@ -1083,16 +1082,16 @@ const appApi = (set, get) => ({
|
|
|
1083
1082
|
set(state => {
|
|
1084
1083
|
const res = state.assemblyTree.prodStack;
|
|
1085
1084
|
res.pop();
|
|
1086
|
-
return _objectSpread$
|
|
1085
|
+
return _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
1087
1086
|
assemblyTree: {
|
|
1088
1087
|
prodStack: [...res]
|
|
1089
1088
|
}
|
|
1090
1089
|
});
|
|
1091
1090
|
});
|
|
1092
|
-
classcad.ccAPI.assemblyBuilder.setCurrentNode(drawingId, prevProd).catch();
|
|
1091
|
+
classcad.ccAPI.assemblyBuilder.setCurrentNode(drawingId, prevProd).catch(console.warn);
|
|
1093
1092
|
},
|
|
1094
1093
|
clearProdStack: () => {
|
|
1095
|
-
set(state => _objectSpread$
|
|
1094
|
+
set(state => _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
1096
1095
|
assemblyTree: {
|
|
1097
1096
|
prodStack: []
|
|
1098
1097
|
}
|
|
@@ -1101,7 +1100,7 @@ const appApi = (set, get) => ({
|
|
|
1101
1100
|
},
|
|
1102
1101
|
blankDiv: {
|
|
1103
1102
|
show: callback => {
|
|
1104
|
-
set(state => _objectSpread$
|
|
1103
|
+
set(state => _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
1105
1104
|
blankDiv: {
|
|
1106
1105
|
isActive: true,
|
|
1107
1106
|
onClose: callback
|
|
@@ -1109,7 +1108,7 @@ const appApi = (set, get) => ({
|
|
|
1109
1108
|
}));
|
|
1110
1109
|
},
|
|
1111
1110
|
hide: () => {
|
|
1112
|
-
set(state => _objectSpread$
|
|
1111
|
+
set(state => _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
1113
1112
|
blankDiv: {
|
|
1114
1113
|
isActive: false,
|
|
1115
1114
|
onClose: undefined
|
|
@@ -1235,7 +1234,7 @@ const DimValue = ({
|
|
|
1235
1234
|
const master_ = core.getDrawing(drawingId).structure.tree[masterId];
|
|
1236
1235
|
|
|
1237
1236
|
if (isSketchConstr) {
|
|
1238
|
-
classcad.ccAPI.base.callSafeAPI(drawingId, 'Sketcher', 'UpdateDimensionValue', [dimId, [valueParam.serverValue.value, valueParam.serverValue.isExpr]]).catch();
|
|
1237
|
+
classcad.ccAPI.base.callSafeAPI(drawingId, 'Sketcher', 'UpdateDimensionValue', [dimId, [valueParam.serverValue.value, valueParam.serverValue.isExpr]]).catch(console.warn);
|
|
1239
1238
|
} else {
|
|
1240
1239
|
switch (master_.class) {
|
|
1241
1240
|
case classcad.CCClasses.CCExtrusion:
|
|
@@ -1256,7 +1255,7 @@ const DimValue = ({
|
|
|
1256
1255
|
}, {
|
|
1257
1256
|
value: direction,
|
|
1258
1257
|
isExpr: false
|
|
1259
|
-
}, capEnds).catch();
|
|
1258
|
+
}, capEnds).catch(console.warn);
|
|
1260
1259
|
break;
|
|
1261
1260
|
}
|
|
1262
1261
|
}
|
|
@@ -1404,7 +1403,7 @@ const PositionHandler = ({
|
|
|
1404
1403
|
const te = e;
|
|
1405
1404
|
|
|
1406
1405
|
if (isDragged.current) {
|
|
1407
|
-
classcad.ccAPI.common.updateDimensionPosition(drawingId, dimId, position);
|
|
1406
|
+
classcad.ccAPI.common.updateDimensionPosition(drawingId, dimId, position).catch(console.warn);
|
|
1408
1407
|
} else {
|
|
1409
1408
|
setPState(state => {
|
|
1410
1409
|
const sel = state.selected;
|
|
@@ -2137,7 +2136,7 @@ function ViewImpl$f({
|
|
|
2137
2136
|
if (e.key === 'Delete') {
|
|
2138
2137
|
const selected = core.getPlugin(drawingId, pluginId).state.selected;
|
|
2139
2138
|
if (selected.length === 0) return;
|
|
2140
|
-
classcad.ccAPI.feature.deleteDimensions(drawingId, selected);
|
|
2139
|
+
classcad.ccAPI.feature.deleteDimensions(drawingId, selected).catch(console.warn);
|
|
2141
2140
|
}
|
|
2142
2141
|
}, [drawingId, pluginId]);
|
|
2143
2142
|
React.useEffect(() => {
|
|
@@ -2192,7 +2191,7 @@ const Dimension = ({
|
|
|
2192
2191
|
} = param;
|
|
2193
2192
|
const update = React.useCallback(() => {
|
|
2194
2193
|
if (isSketchConstr) {
|
|
2195
|
-
classcad.ccAPI.sketcher.updateDimensionValue(drawingId, dimId, serverValue);
|
|
2194
|
+
classcad.ccAPI.sketcher.updateDimensionValue(drawingId, dimId, serverValue).catch(console.warn);
|
|
2196
2195
|
} else {
|
|
2197
2196
|
switch (master == null ? void 0 : master.class) {
|
|
2198
2197
|
case classcad.CCClasses.CCExtrusion:
|
|
@@ -2220,7 +2219,7 @@ const Dimension = ({
|
|
|
2220
2219
|
}, {
|
|
2221
2220
|
value: direction,
|
|
2222
2221
|
isExpr: false
|
|
2223
|
-
}, capEnds).catch();
|
|
2222
|
+
}, capEnds).catch(console.warn);
|
|
2224
2223
|
break;
|
|
2225
2224
|
}
|
|
2226
2225
|
}
|
|
@@ -2392,9 +2391,9 @@ function useRefsParam(drawingId, objId, memberName) {
|
|
|
2392
2391
|
});
|
|
2393
2392
|
}
|
|
2394
2393
|
|
|
2395
|
-
function ownKeys$
|
|
2394
|
+
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; }
|
|
2396
2395
|
|
|
2397
|
-
function _objectSpread$
|
|
2396
|
+
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; }
|
|
2398
2397
|
/**
|
|
2399
2398
|
* Implies the following data structure:
|
|
2400
2399
|
* data: {
|
|
@@ -2531,7 +2530,7 @@ function useTreeObjSelection(drawingId, objId) {
|
|
|
2531
2530
|
const isSelected = useIsSelected$1(drawingId, objId);
|
|
2532
2531
|
const handlers = React.useMemo(() => {
|
|
2533
2532
|
if (isSelectable) {
|
|
2534
|
-
return _objectSpread$
|
|
2533
|
+
return _objectSpread$k(_objectSpread$k({}, hHandlers), sHandlers);
|
|
2535
2534
|
}
|
|
2536
2535
|
|
|
2537
2536
|
return {};
|
|
@@ -2560,7 +2559,7 @@ const isGeometry = (tree, objId) => {
|
|
|
2560
2559
|
return true;
|
|
2561
2560
|
} else {
|
|
2562
2561
|
// If obj isn't one of next classes, the TreeObjScope item should be resstored.
|
|
2563
|
-
return classcad.ccUtils.base.isA(obj.class, classcad.CCClasses.
|
|
2562
|
+
return classcad.ccUtils.base.isA(obj.class, classcad.CCClasses.CCBody) || classcad.ccUtils.base.isA(obj.class, classcad.CCClasses.CCBrepReference);
|
|
2564
2563
|
}
|
|
2565
2564
|
};
|
|
2566
2565
|
const getInteractionInfo = (drawingId, item) => {
|
|
@@ -3018,9 +3017,9 @@ const SelectionRestorer = ({
|
|
|
3018
3017
|
return null;
|
|
3019
3018
|
};
|
|
3020
3019
|
|
|
3021
|
-
function ownKeys$
|
|
3020
|
+
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; }
|
|
3022
3021
|
|
|
3023
|
-
function _objectSpread$
|
|
3022
|
+
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; }
|
|
3024
3023
|
/**
|
|
3025
3024
|
* Implies the following data structure:
|
|
3026
3025
|
* data: {
|
|
@@ -3123,7 +3122,7 @@ function useMateSelection(drawingId, matePath, csysId) {
|
|
|
3123
3122
|
}));
|
|
3124
3123
|
const handlers = React.useMemo(() => {
|
|
3125
3124
|
if (isSelectable) {
|
|
3126
|
-
return _objectSpread$
|
|
3125
|
+
return _objectSpread$j(_objectSpread$j({}, hHandlers), sHandlers);
|
|
3127
3126
|
}
|
|
3128
3127
|
|
|
3129
3128
|
return {};
|
|
@@ -3553,7 +3552,7 @@ const PluginForm = ({
|
|
|
3553
3552
|
return;
|
|
3554
3553
|
}
|
|
3555
3554
|
|
|
3556
|
-
update().then(closePlugin).catch();
|
|
3555
|
+
update().then(closePlugin).catch(console.warn);
|
|
3557
3556
|
}, [update, closePlugin, params, validator]);
|
|
3558
3557
|
const onKeyUp = React.useCallback(e => {
|
|
3559
3558
|
if (e.keyCode === 13) {
|
|
@@ -3685,12 +3684,12 @@ function useSelectorsOrder(drawingId) {
|
|
|
3685
3684
|
}), [addSelector, removeSelector, switchToNext]);
|
|
3686
3685
|
}
|
|
3687
3686
|
|
|
3688
|
-
var Members$
|
|
3687
|
+
var Members$s;
|
|
3689
3688
|
|
|
3690
3689
|
(function (Members) {
|
|
3691
3690
|
Members["Body1"] = "Body1";
|
|
3692
3691
|
Members["Body2"] = "Body2";
|
|
3693
|
-
})(Members$
|
|
3692
|
+
})(Members$s || (Members$s = {}));
|
|
3694
3693
|
|
|
3695
3694
|
const typesCaptions$6 = {
|
|
3696
3695
|
[classcad.BooleanOperationType.INTERSECTION]: 'Intersection',
|
|
@@ -3724,8 +3723,8 @@ function RootImpl$x({
|
|
|
3724
3723
|
objectId
|
|
3725
3724
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
3726
3725
|
const type = useBoolTypeStore(drawingId, objectId);
|
|
3727
|
-
const body1 = useIdParam(drawingId, objectId, Members$
|
|
3728
|
-
const body2 = useRefsParam(drawingId, objectId, Members$
|
|
3726
|
+
const body1 = useIdParam(drawingId, objectId, Members$s.Body1);
|
|
3727
|
+
const body2 = useRefsParam(drawingId, objectId, Members$s.Body2);
|
|
3729
3728
|
const update = React.useCallback(() => {
|
|
3730
3729
|
return classcad.ccAPI.feature.updateBooleanOperation(drawingId, objectId, type.serverValue, [body1.serverValue, ...body2.serverValue]);
|
|
3731
3730
|
}, [drawingId, objectId, type, body1, body2]);
|
|
@@ -3990,9 +3989,9 @@ function usePointParam(drawingId, objId, memberName, options = {
|
|
|
3990
3989
|
}, getServValue);
|
|
3991
3990
|
}
|
|
3992
3991
|
|
|
3993
|
-
var img$
|
|
3992
|
+
var img$10 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADcSURBVEhL3ZTbDcMgDEVJlsgonabfnanfmaajdIlSS0aU+lWEsaLmCCkhMfheB2fJOadI1nIN49wJlv0Jo0xGURPUrZ05wkskH1OuOl+3ctfQE3bERxaLbnyJ+2WFUSYMy4G9shO63lBqvDJQBVbtThNfi39qHDAhqyOqPSY+fcDV4b63xwunFTjsbTAPa7thXFonQidXdURaq4vEIBhJmnnQAf8l8Eoi3hJp+1bGE3ATAH/odQCACcOHKwHRK3qa4AARdwemJdCw+oCgabQJd3BEieby/yUKTpDSG4InWqXAb1/sAAAAAElFTkSuQmCC";
|
|
3994
3993
|
|
|
3995
|
-
var img
|
|
3994
|
+
var img$$ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADjSURBVEhL3ZbbDcIwDEXTLsEoTMM3M/HNNIzCEgRLDpbrRx1iRTyOIrVR09x7ncrqUmstM1nbdRq/LzB4Bsv13u621NOh3b344zOAIuBoc4fLcYXRJhYfShAa78cQELsnxdwShcXtRG5h+s2ECDzmQ9jv632HQ2xaBd8FNc63B04BaANaRi9DqGdkKxBiNDu0ya3xFkYhdBkpB18/nkCURVcJeVtAN2SBWJA6A3Lt2QdGBHZC6EepBAB437EPuF8Rx7TcuSybICT148VDeAczPUFKgFx79oFUiXr47hL1MFmglCeKs2HMN70YFwAAAABJRU5ErkJggg==";
|
|
3996
3995
|
|
|
3997
3996
|
const invert = (value, inverted) => {
|
|
3998
3997
|
return inverted ? 1 - value : value;
|
|
@@ -4008,6 +4007,8 @@ const BooleanEditor = ({
|
|
|
4008
4007
|
Button,
|
|
4009
4008
|
Checkbox
|
|
4010
4009
|
} = react.useBuerli(buerli => buerli.options.elements);
|
|
4010
|
+
const icon_ = Array.isArray(icon) ? true : Boolean(icon);
|
|
4011
|
+
const icons = Array.isArray(icon) && icon.length == 2 ? icon : [img$10, img$$];
|
|
4011
4012
|
const {
|
|
4012
4013
|
setUserValue,
|
|
4013
4014
|
userValue,
|
|
@@ -4024,8 +4025,8 @@ const BooleanEditor = ({
|
|
|
4024
4025
|
React.useEffect(() => {
|
|
4025
4026
|
return () => setUserValue(defaults);
|
|
4026
4027
|
}, [setUserValue, defaults]);
|
|
4027
|
-
return
|
|
4028
|
-
iconSrc: invert(userValue, inverted) === 0 ?
|
|
4028
|
+
return icon_ ? /*#__PURE__*/React.createElement(Button, {
|
|
4029
|
+
iconSrc: invert(userValue, inverted) === 0 ? icons[0] : icons[1],
|
|
4029
4030
|
onClick: onClick
|
|
4030
4031
|
}) : /*#__PURE__*/React.createElement(Wrapper, {
|
|
4031
4032
|
caption: caption,
|
|
@@ -4060,7 +4061,7 @@ function useBoolParam(drawingId, objId, memberName) {
|
|
|
4060
4061
|
});
|
|
4061
4062
|
}
|
|
4062
4063
|
|
|
4063
|
-
var Members$
|
|
4064
|
+
var Members$r;
|
|
4064
4065
|
|
|
4065
4066
|
(function (Members) {
|
|
4066
4067
|
Members["Type"] = "extrudeType";
|
|
@@ -4069,7 +4070,7 @@ var Members$q;
|
|
|
4069
4070
|
Members["Limit2"] = "limit2";
|
|
4070
4071
|
Members["taperAngle"] = "taperAngle";
|
|
4071
4072
|
Members["capEnds"] = "capEnds";
|
|
4072
|
-
})(Members$
|
|
4073
|
+
})(Members$r || (Members$r = {}));
|
|
4073
4074
|
|
|
4074
4075
|
var RegionMembers$1;
|
|
4075
4076
|
|
|
@@ -4097,14 +4098,14 @@ const RootImpl$w = ({
|
|
|
4097
4098
|
return (_drawing$structure$tr = drawing.structure.tree[objectId]) == null ? void 0 : (_drawing$structure$tr2 = _drawing$structure$tr.members) == null ? void 0 : _drawing$structure$tr2.region.value;
|
|
4098
4099
|
});
|
|
4099
4100
|
const region = useRefsParam(drawingId, sketchRegionId, RegionMembers$1.Curves);
|
|
4100
|
-
const type = useTypeParam(drawingId, objectId, Members$
|
|
4101
|
-
const limit1 = useNumParam(drawingId, objectId, Members$
|
|
4102
|
-
const limit2 = useNumParam(drawingId, objectId, Members$
|
|
4103
|
-
const taperAngle = useNumParam(drawingId, objectId, Members$
|
|
4101
|
+
const type = useTypeParam(drawingId, objectId, Members$r.Type);
|
|
4102
|
+
const limit1 = useNumParam(drawingId, objectId, Members$r.Limit1);
|
|
4103
|
+
const limit2 = useNumParam(drawingId, objectId, Members$r.Limit2);
|
|
4104
|
+
const taperAngle = useNumParam(drawingId, objectId, Members$r.taperAngle, {
|
|
4104
4105
|
angle: true
|
|
4105
4106
|
});
|
|
4106
|
-
const direction = usePointParam(drawingId, objectId, Members$
|
|
4107
|
-
const capEnds = useBoolParam(drawingId, objectId, Members$
|
|
4107
|
+
const direction = usePointParam(drawingId, objectId, Members$r.Direction);
|
|
4108
|
+
const capEnds = useBoolParam(drawingId, objectId, Members$r.capEnds);
|
|
4108
4109
|
const sketchId = React.useRef(NOCCID);
|
|
4109
4110
|
React.useEffect(() => {
|
|
4110
4111
|
var _tree$sketchGeometryI;
|
|
@@ -4213,14 +4214,14 @@ var index$w = /*#__PURE__*/Object.freeze({
|
|
|
4213
4214
|
description: description$w
|
|
4214
4215
|
});
|
|
4215
4216
|
|
|
4216
|
-
var Members$
|
|
4217
|
+
var Members$q;
|
|
4217
4218
|
|
|
4218
4219
|
(function (Members) {
|
|
4219
4220
|
Members["Axis"] = "references";
|
|
4220
4221
|
Members["Inverted"] = "inverted";
|
|
4221
4222
|
Members["StartAngle"] = "startAngle";
|
|
4222
4223
|
Members["EndAngle"] = "endAngle";
|
|
4223
|
-
})(Members$
|
|
4224
|
+
})(Members$q || (Members$q = {}));
|
|
4224
4225
|
|
|
4225
4226
|
var RegionMembers;
|
|
4226
4227
|
|
|
@@ -4241,14 +4242,14 @@ const RootImpl$v = ({
|
|
|
4241
4242
|
return (_drawing$structure$tr = drawing.structure.tree[objectId]) == null ? void 0 : (_drawing$structure$tr2 = _drawing$structure$tr.members) == null ? void 0 : _drawing$structure$tr2.region.value;
|
|
4242
4243
|
});
|
|
4243
4244
|
const region = useRefsParam(drawingId, sketchRegionId, RegionMembers.Curves);
|
|
4244
|
-
const axis = useRefsParam(drawingId, objectId, Members$
|
|
4245
|
-
const startAngle = useNumParam(drawingId, objectId, Members$
|
|
4245
|
+
const axis = useRefsParam(drawingId, objectId, Members$q.Axis);
|
|
4246
|
+
const startAngle = useNumParam(drawingId, objectId, Members$q.StartAngle, {
|
|
4246
4247
|
angle: true
|
|
4247
4248
|
});
|
|
4248
|
-
const endAngle = useNumParam(drawingId, objectId, Members$
|
|
4249
|
+
const endAngle = useNumParam(drawingId, objectId, Members$q.EndAngle, {
|
|
4249
4250
|
angle: true
|
|
4250
4251
|
});
|
|
4251
|
-
const inverted = useBoolParam(drawingId, objectId, Members$
|
|
4252
|
+
const inverted = useBoolParam(drawingId, objectId, Members$q.Inverted);
|
|
4252
4253
|
const sketchId = React.useRef(NOCCID);
|
|
4253
4254
|
React.useEffect(() => {
|
|
4254
4255
|
var _tree$sketchGeometryI;
|
|
@@ -4330,14 +4331,14 @@ var index$v = /*#__PURE__*/Object.freeze({
|
|
|
4330
4331
|
description: description$v
|
|
4331
4332
|
});
|
|
4332
4333
|
|
|
4333
|
-
var Members$
|
|
4334
|
+
var Members$p;
|
|
4334
4335
|
|
|
4335
4336
|
(function (Members) {
|
|
4336
4337
|
Members["CSys"] = "references";
|
|
4337
4338
|
Members["Width"] = "width";
|
|
4338
4339
|
Members["Height"] = "height";
|
|
4339
4340
|
Members["Length"] = "length";
|
|
4340
|
-
})(Members$
|
|
4341
|
+
})(Members$p || (Members$p = {}));
|
|
4341
4342
|
|
|
4342
4343
|
function RootImpl$u({
|
|
4343
4344
|
drawingId,
|
|
@@ -4346,10 +4347,10 @@ function RootImpl$u({
|
|
|
4346
4347
|
const {
|
|
4347
4348
|
objectId
|
|
4348
4349
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4349
|
-
const csys = useRefsParam(drawingId, objectId, Members$
|
|
4350
|
-
const width = useNumParam(drawingId, objectId, Members$
|
|
4351
|
-
const height = useNumParam(drawingId, objectId, Members$
|
|
4352
|
-
const length = useNumParam(drawingId, objectId, Members$
|
|
4350
|
+
const csys = useRefsParam(drawingId, objectId, Members$p.CSys);
|
|
4351
|
+
const width = useNumParam(drawingId, objectId, Members$p.Width);
|
|
4352
|
+
const height = useNumParam(drawingId, objectId, Members$p.Height);
|
|
4353
|
+
const length = useNumParam(drawingId, objectId, Members$p.Length);
|
|
4353
4354
|
const update = React.useCallback(() => {
|
|
4354
4355
|
return classcad.ccAPI.feature.updateBox(drawingId, objectId, csys.serverValue, width.serverValue, length.serverValue, height.serverValue);
|
|
4355
4356
|
}, [drawingId, objectId, csys, width, height, length]);
|
|
@@ -4427,12 +4428,12 @@ var index$u = /*#__PURE__*/Object.freeze({
|
|
|
4427
4428
|
description: description$u
|
|
4428
4429
|
});
|
|
4429
4430
|
|
|
4430
|
-
var Members$
|
|
4431
|
+
var Members$o;
|
|
4431
4432
|
|
|
4432
4433
|
(function (Members) {
|
|
4433
4434
|
Members["CSys"] = "references";
|
|
4434
4435
|
Members["Radius"] = "radius";
|
|
4435
|
-
})(Members$
|
|
4436
|
+
})(Members$o || (Members$o = {}));
|
|
4436
4437
|
|
|
4437
4438
|
function RootImpl$t({
|
|
4438
4439
|
drawingId,
|
|
@@ -4441,8 +4442,8 @@ function RootImpl$t({
|
|
|
4441
4442
|
const {
|
|
4442
4443
|
objectId
|
|
4443
4444
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4444
|
-
const csys = useRefsParam(drawingId, objectId, Members$
|
|
4445
|
-
const radius = useNumParam(drawingId, objectId, Members$
|
|
4445
|
+
const csys = useRefsParam(drawingId, objectId, Members$o.CSys);
|
|
4446
|
+
const radius = useNumParam(drawingId, objectId, Members$o.Radius);
|
|
4446
4447
|
const update = React.useCallback(() => {
|
|
4447
4448
|
return classcad.ccAPI.feature.updateSphere(drawingId, objectId, csys.userValue, radius.userValue);
|
|
4448
4449
|
}, [drawingId, objectId, csys, radius]);
|
|
@@ -4500,13 +4501,13 @@ var index$t = /*#__PURE__*/Object.freeze({
|
|
|
4500
4501
|
description: description$t
|
|
4501
4502
|
});
|
|
4502
4503
|
|
|
4503
|
-
var Members$
|
|
4504
|
+
var Members$n;
|
|
4504
4505
|
|
|
4505
4506
|
(function (Members) {
|
|
4506
4507
|
Members["CSys"] = "references";
|
|
4507
4508
|
Members["Diameter"] = "diameter";
|
|
4508
4509
|
Members["Height"] = "height";
|
|
4509
|
-
})(Members$
|
|
4510
|
+
})(Members$n || (Members$n = {}));
|
|
4510
4511
|
|
|
4511
4512
|
function RootImpl$s({
|
|
4512
4513
|
drawingId,
|
|
@@ -4515,9 +4516,9 @@ function RootImpl$s({
|
|
|
4515
4516
|
const {
|
|
4516
4517
|
objectId
|
|
4517
4518
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4518
|
-
const csys = useRefsParam(drawingId, objectId, Members$
|
|
4519
|
-
const diameter = useNumParam(drawingId, objectId, Members$
|
|
4520
|
-
const height = useNumParam(drawingId, objectId, Members$
|
|
4519
|
+
const csys = useRefsParam(drawingId, objectId, Members$n.CSys);
|
|
4520
|
+
const diameter = useNumParam(drawingId, objectId, Members$n.Diameter);
|
|
4521
|
+
const height = useNumParam(drawingId, objectId, Members$n.Height);
|
|
4521
4522
|
const update = React.useCallback(() => {
|
|
4522
4523
|
return classcad.ccAPI.feature.updateCylinder(drawingId, objectId, csys.serverValue, diameter.serverValue, height.serverValue);
|
|
4523
4524
|
}, [drawingId, objectId, csys, diameter, height]);
|
|
@@ -4585,14 +4586,14 @@ var index$s = /*#__PURE__*/Object.freeze({
|
|
|
4585
4586
|
description: description$s
|
|
4586
4587
|
});
|
|
4587
4588
|
|
|
4588
|
-
var Members$
|
|
4589
|
+
var Members$m;
|
|
4589
4590
|
|
|
4590
4591
|
(function (Members) {
|
|
4591
4592
|
Members["CSys"] = "references";
|
|
4592
4593
|
Members["BDiameter"] = "bDiameter";
|
|
4593
4594
|
Members["TDiameter"] = "tDiameter";
|
|
4594
4595
|
Members["Height"] = "height";
|
|
4595
|
-
})(Members$
|
|
4596
|
+
})(Members$m || (Members$m = {}));
|
|
4596
4597
|
|
|
4597
4598
|
function RootImpl$r({
|
|
4598
4599
|
drawingId,
|
|
@@ -4601,10 +4602,10 @@ function RootImpl$r({
|
|
|
4601
4602
|
const {
|
|
4602
4603
|
objectId
|
|
4603
4604
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4604
|
-
const csys = useRefsParam(drawingId, objectId, Members$
|
|
4605
|
-
const bDiameter = useNumParam(drawingId, objectId, Members$
|
|
4606
|
-
const tDiameter = useNumParam(drawingId, objectId, Members$
|
|
4607
|
-
const height = useNumParam(drawingId, objectId, Members$
|
|
4605
|
+
const csys = useRefsParam(drawingId, objectId, Members$m.CSys);
|
|
4606
|
+
const bDiameter = useNumParam(drawingId, objectId, Members$m.BDiameter);
|
|
4607
|
+
const tDiameter = useNumParam(drawingId, objectId, Members$m.TDiameter);
|
|
4608
|
+
const height = useNumParam(drawingId, objectId, Members$m.Height);
|
|
4608
4609
|
const update = React.useCallback(() => {
|
|
4609
4610
|
return classcad.ccAPI.feature.updateCone(drawingId, objectId, csys.serverValue, bDiameter.serverValue, tDiameter.serverValue, height.serverValue);
|
|
4610
4611
|
}, [drawingId, objectId, csys, bDiameter, tDiameter, height]);
|
|
@@ -4682,12 +4683,12 @@ var index$r = /*#__PURE__*/Object.freeze({
|
|
|
4682
4683
|
description: description$r
|
|
4683
4684
|
});
|
|
4684
4685
|
|
|
4685
|
-
var Members$
|
|
4686
|
+
var Members$l;
|
|
4686
4687
|
|
|
4687
4688
|
(function (Members) {
|
|
4688
4689
|
Members["References"] = "References";
|
|
4689
4690
|
Members["Radius"] = "radius";
|
|
4690
|
-
})(Members$
|
|
4691
|
+
})(Members$l || (Members$l = {}));
|
|
4691
4692
|
|
|
4692
4693
|
const RootImpl$q = ({
|
|
4693
4694
|
drawingId,
|
|
@@ -4696,8 +4697,8 @@ const RootImpl$q = ({
|
|
|
4696
4697
|
const {
|
|
4697
4698
|
objectId
|
|
4698
4699
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4699
|
-
const refs = useRefsParam(drawingId, objectId, Members$
|
|
4700
|
-
const radius = useNumParam(drawingId, objectId, Members$
|
|
4700
|
+
const refs = useRefsParam(drawingId, objectId, Members$l.References);
|
|
4701
|
+
const radius = useNumParam(drawingId, objectId, Members$l.Radius);
|
|
4701
4702
|
const update = React.useCallback(() => {
|
|
4702
4703
|
return classcad.ccAPI.feature.updateFillet(drawingId, objectId, refs.serverValue, radius.serverValue);
|
|
4703
4704
|
}, [drawingId, objectId, refs, radius]);
|
|
@@ -4750,7 +4751,7 @@ var index$q = /*#__PURE__*/Object.freeze({
|
|
|
4750
4751
|
description: description$q
|
|
4751
4752
|
});
|
|
4752
4753
|
|
|
4753
|
-
var Members$
|
|
4754
|
+
var Members$k;
|
|
4754
4755
|
|
|
4755
4756
|
(function (Members) {
|
|
4756
4757
|
Members["Type"] = "subType";
|
|
@@ -4758,7 +4759,7 @@ var Members$j;
|
|
|
4758
4759
|
Members["References"] = "References";
|
|
4759
4760
|
Members["Offset1"] = "offset1";
|
|
4760
4761
|
Members["Offset2"] = "offset2";
|
|
4761
|
-
})(Members$
|
|
4762
|
+
})(Members$k || (Members$k = {}));
|
|
4762
4763
|
|
|
4763
4764
|
const typesCaptions$4 = {
|
|
4764
4765
|
[classcad.ChamferType.DISTANCE_AND_ANGLE]: 'Distance and angle',
|
|
@@ -4776,11 +4777,11 @@ const RootImpl$p = ({
|
|
|
4776
4777
|
const {
|
|
4777
4778
|
objectId
|
|
4778
4779
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4779
|
-
const type = useTypeParam(drawingId, objectId, Members$
|
|
4780
|
-
const refs = useRefsParam(drawingId, objectId, Members$
|
|
4781
|
-
const offset1 = useNumParam(drawingId, objectId, Members$
|
|
4782
|
-
const offset2 = useNumParam(drawingId, objectId, Members$
|
|
4783
|
-
const angle = useNumParam(drawingId, objectId, Members$
|
|
4780
|
+
const type = useTypeParam(drawingId, objectId, Members$k.Type);
|
|
4781
|
+
const refs = useRefsParam(drawingId, objectId, Members$k.References);
|
|
4782
|
+
const offset1 = useNumParam(drawingId, objectId, Members$k.Offset1);
|
|
4783
|
+
const offset2 = useNumParam(drawingId, objectId, Members$k.Offset2);
|
|
4784
|
+
const angle = useNumParam(drawingId, objectId, Members$k.Angle, {
|
|
4784
4785
|
angle: true
|
|
4785
4786
|
});
|
|
4786
4787
|
const switchDirections = React.useCallback(() => {
|
|
@@ -4818,7 +4819,7 @@ const RootImpl$p = ({
|
|
|
4818
4819
|
param: offset1,
|
|
4819
4820
|
allowExpr: true
|
|
4820
4821
|
}, type.userValue === classcad.ChamferType.TWO_DISTANCES && /*#__PURE__*/React.createElement(Button, {
|
|
4821
|
-
iconSrc: img$
|
|
4822
|
+
iconSrc: img$10,
|
|
4822
4823
|
onClick: switchDirections
|
|
4823
4824
|
})), type.userValue === classcad.ChamferType.TWO_DISTANCES && /*#__PURE__*/React.createElement(NumberEditor, {
|
|
4824
4825
|
drawingId: drawingId,
|
|
@@ -4862,14 +4863,14 @@ var index$p = /*#__PURE__*/Object.freeze({
|
|
|
4862
4863
|
description: description$p
|
|
4863
4864
|
});
|
|
4864
4865
|
|
|
4865
|
-
var Members$
|
|
4866
|
+
var Members$j;
|
|
4866
4867
|
|
|
4867
4868
|
(function (Members) {
|
|
4868
4869
|
Members["SolidReferences"] = "bodiesToTransform";
|
|
4869
4870
|
Members["AxisReferences"] = "references";
|
|
4870
4871
|
Members["Distance"] = "translationDistance";
|
|
4871
4872
|
Members["Inverted"] = "inverted";
|
|
4872
|
-
})(Members$
|
|
4873
|
+
})(Members$j || (Members$j = {}));
|
|
4873
4874
|
|
|
4874
4875
|
function RootImpl$o({
|
|
4875
4876
|
drawingId,
|
|
@@ -4878,12 +4879,12 @@ function RootImpl$o({
|
|
|
4878
4879
|
const {
|
|
4879
4880
|
objectId
|
|
4880
4881
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4881
|
-
const solidRefs = useRefsParam(drawingId, objectId, Members$
|
|
4882
|
-
const axisRefs = useRefsParam(drawingId, objectId, Members$
|
|
4883
|
-
const distance = useNumParam(drawingId, objectId, Members$
|
|
4884
|
-
const inverted = useBoolParam(drawingId, objectId, Members$
|
|
4882
|
+
const solidRefs = useRefsParam(drawingId, objectId, Members$j.SolidReferences);
|
|
4883
|
+
const axisRefs = useRefsParam(drawingId, objectId, Members$j.AxisReferences);
|
|
4884
|
+
const distance = useNumParam(drawingId, objectId, Members$j.Distance);
|
|
4885
|
+
const inverted = useBoolParam(drawingId, objectId, Members$j.Inverted);
|
|
4885
4886
|
const update = React.useCallback(() => {
|
|
4886
|
-
return classcad.ccAPI.feature.updateTransformation(drawingId, objectId, solidRefs.serverValue, axisRefs.serverValue, inverted.serverValue, distance.serverValue)
|
|
4887
|
+
return classcad.ccAPI.feature.updateTransformation(drawingId, objectId, solidRefs.serverValue, axisRefs.serverValue, inverted.serverValue, distance.serverValue);
|
|
4887
4888
|
}, [drawingId, objectId, solidRefs, axisRefs, inverted, distance]);
|
|
4888
4889
|
return /*#__PURE__*/React.createElement(PluginForm, {
|
|
4889
4890
|
drawingId: drawingId,
|
|
@@ -4946,14 +4947,14 @@ var index$o = /*#__PURE__*/Object.freeze({
|
|
|
4946
4947
|
description: description$o
|
|
4947
4948
|
});
|
|
4948
4949
|
|
|
4949
|
-
var Members$
|
|
4950
|
+
var Members$i;
|
|
4950
4951
|
|
|
4951
4952
|
(function (Members) {
|
|
4952
4953
|
Members["SolidReferences"] = "bodiesToTransform";
|
|
4953
4954
|
Members["AxisReferences"] = "references";
|
|
4954
4955
|
Members["Angle"] = "rotationAngle";
|
|
4955
4956
|
Members["Inverted"] = "inverted";
|
|
4956
|
-
})(Members$
|
|
4957
|
+
})(Members$i || (Members$i = {}));
|
|
4957
4958
|
|
|
4958
4959
|
function RootImpl$n({
|
|
4959
4960
|
drawingId,
|
|
@@ -4962,12 +4963,12 @@ function RootImpl$n({
|
|
|
4962
4963
|
const {
|
|
4963
4964
|
objectId
|
|
4964
4965
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4965
|
-
const solidRefs = useRefsParam(drawingId, objectId, Members$
|
|
4966
|
-
const axisRefs = useRefsParam(drawingId, objectId, Members$
|
|
4967
|
-
const angle = useNumParam(drawingId, objectId, Members$
|
|
4966
|
+
const solidRefs = useRefsParam(drawingId, objectId, Members$i.SolidReferences);
|
|
4967
|
+
const axisRefs = useRefsParam(drawingId, objectId, Members$i.AxisReferences);
|
|
4968
|
+
const angle = useNumParam(drawingId, objectId, Members$i.Angle, {
|
|
4968
4969
|
angle: true
|
|
4969
4970
|
});
|
|
4970
|
-
const inverted = useBoolParam(drawingId, objectId, Members$
|
|
4971
|
+
const inverted = useBoolParam(drawingId, objectId, Members$i.Inverted);
|
|
4971
4972
|
const update = React.useCallback(() => {
|
|
4972
4973
|
return classcad.ccAPI.feature.updateTransformation(drawingId, objectId, solidRefs.serverValue, axisRefs.serverValue, inverted.serverValue, angle.serverValue);
|
|
4973
4974
|
}, [drawingId, objectId, solidRefs, axisRefs, inverted, angle]);
|
|
@@ -5032,12 +5033,12 @@ var index$n = /*#__PURE__*/Object.freeze({
|
|
|
5032
5033
|
description: description$n
|
|
5033
5034
|
});
|
|
5034
5035
|
|
|
5035
|
-
var Members$
|
|
5036
|
+
var Members$h;
|
|
5036
5037
|
|
|
5037
5038
|
(function (Members) {
|
|
5038
5039
|
Members["SolidReferences"] = "bodiesToTransform";
|
|
5039
5040
|
Members["CsysReferences"] = "references";
|
|
5040
|
-
})(Members$
|
|
5041
|
+
})(Members$h || (Members$h = {}));
|
|
5041
5042
|
|
|
5042
5043
|
function RootImpl$m({
|
|
5043
5044
|
drawingId,
|
|
@@ -5046,14 +5047,14 @@ function RootImpl$m({
|
|
|
5046
5047
|
const {
|
|
5047
5048
|
objectId
|
|
5048
5049
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
5049
|
-
const solidRefs = useRefsParam(drawingId, objectId, Members$
|
|
5050
|
-
const csysRefs = useRefsParam(drawingId, objectId, Members$
|
|
5050
|
+
const solidRefs = useRefsParam(drawingId, objectId, Members$h.SolidReferences);
|
|
5051
|
+
const csysRefs = useRefsParam(drawingId, objectId, Members$h.CsysReferences);
|
|
5051
5052
|
const selOrder = useSelectorsOrder(drawingId);
|
|
5052
5053
|
const update = React.useCallback(() => {
|
|
5053
5054
|
return classcad.ccAPI.feature.updateTransformation(drawingId, objectId, solidRefs.userValue, csysRefs.userValue, 0, {
|
|
5054
5055
|
value: 0,
|
|
5055
5056
|
isExpr: false
|
|
5056
|
-
})
|
|
5057
|
+
});
|
|
5057
5058
|
}, [drawingId, objectId, solidRefs, csysRefs]);
|
|
5058
5059
|
return /*#__PURE__*/React.createElement(PluginForm, {
|
|
5059
5060
|
drawingId: drawingId,
|
|
@@ -5116,13 +5117,13 @@ var index$m = /*#__PURE__*/Object.freeze({
|
|
|
5116
5117
|
description: description$m
|
|
5117
5118
|
});
|
|
5118
5119
|
|
|
5119
|
-
var Members$
|
|
5120
|
+
var Members$g;
|
|
5120
5121
|
|
|
5121
5122
|
(function (Members) {
|
|
5122
5123
|
Members["CutDirection"] = "cutDirection";
|
|
5123
5124
|
Members["BodiesToCut"] = "bodiesToCut";
|
|
5124
5125
|
Members["WorkPlaneReference"] = "workPlaneReference";
|
|
5125
|
-
})(Members$
|
|
5126
|
+
})(Members$g || (Members$g = {}));
|
|
5126
5127
|
|
|
5127
5128
|
function RootImpl$l({
|
|
5128
5129
|
drawingId,
|
|
@@ -5131,9 +5132,9 @@ function RootImpl$l({
|
|
|
5131
5132
|
const {
|
|
5132
5133
|
objectId
|
|
5133
5134
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
5134
|
-
const cutDirection = useBoolParam(drawingId, objectId, Members$
|
|
5135
|
-
const bodiesToCut = useRefsParam(drawingId, objectId, Members$
|
|
5136
|
-
const workplaneId = useIdParam(drawingId, objectId, Members$
|
|
5135
|
+
const cutDirection = useBoolParam(drawingId, objectId, Members$g.CutDirection);
|
|
5136
|
+
const bodiesToCut = useRefsParam(drawingId, objectId, Members$g.BodiesToCut);
|
|
5137
|
+
const workplaneId = useIdParam(drawingId, objectId, Members$g.WorkPlaneReference);
|
|
5137
5138
|
const update = React.useCallback(() => {
|
|
5138
5139
|
return classcad.ccAPI.feature.updateSlice(drawingId, objectId, bodiesToCut.serverValue, workplaneId.serverValue, cutDirection.serverValue);
|
|
5139
5140
|
}, [drawingId, objectId, bodiesToCut, cutDirection, workplaneId]);
|
|
@@ -5192,13 +5193,13 @@ var index$l = /*#__PURE__*/Object.freeze({
|
|
|
5192
5193
|
description: description$l
|
|
5193
5194
|
});
|
|
5194
5195
|
|
|
5195
|
-
var Members$
|
|
5196
|
+
var Members$f;
|
|
5196
5197
|
|
|
5197
5198
|
(function (Members) {
|
|
5198
5199
|
Members["Inverted"] = "inverted";
|
|
5199
5200
|
Members["BodyToCut"] = "bodyToCut";
|
|
5200
5201
|
Members["SheetBody"] = "sheetBody";
|
|
5201
|
-
})(Members$
|
|
5202
|
+
})(Members$f || (Members$f = {}));
|
|
5202
5203
|
|
|
5203
5204
|
function RootImpl$k({
|
|
5204
5205
|
drawingId,
|
|
@@ -5207,9 +5208,9 @@ function RootImpl$k({
|
|
|
5207
5208
|
const {
|
|
5208
5209
|
objectId
|
|
5209
5210
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
5210
|
-
const inverted = useBoolParam(drawingId, objectId, Members$
|
|
5211
|
-
const bodyToCut = useIdParam(drawingId, objectId, Members$
|
|
5212
|
-
const sheetBody = useIdParam(drawingId, objectId, Members$
|
|
5211
|
+
const inverted = useBoolParam(drawingId, objectId, Members$f.Inverted);
|
|
5212
|
+
const bodyToCut = useIdParam(drawingId, objectId, Members$f.BodyToCut);
|
|
5213
|
+
const sheetBody = useIdParam(drawingId, objectId, Members$f.SheetBody);
|
|
5213
5214
|
const update = React.useCallback(() => {
|
|
5214
5215
|
return classcad.ccAPI.feature.updateSliceBySheet(drawingId, objectId, bodyToCut.serverValue, sheetBody.serverValue, inverted.serverValue);
|
|
5215
5216
|
}, [drawingId, objectId, bodyToCut, inverted, sheetBody]);
|
|
@@ -5271,7 +5272,7 @@ var index$k = /*#__PURE__*/Object.freeze({
|
|
|
5271
5272
|
description: description$k
|
|
5272
5273
|
});
|
|
5273
5274
|
|
|
5274
|
-
var Members$
|
|
5275
|
+
var Members$e;
|
|
5275
5276
|
|
|
5276
5277
|
(function (Members) {
|
|
5277
5278
|
Members["SolidReferences"] = "toPattern";
|
|
@@ -5284,7 +5285,7 @@ var Members$d;
|
|
|
5284
5285
|
Members["Inverted2"] = "inverted2";
|
|
5285
5286
|
Members["Count2"] = "secondDirInstanceCount";
|
|
5286
5287
|
Members["Merged"] = "merged";
|
|
5287
|
-
})(Members$
|
|
5288
|
+
})(Members$e || (Members$e = {}));
|
|
5288
5289
|
|
|
5289
5290
|
function RootImpl$j({
|
|
5290
5291
|
drawingId,
|
|
@@ -5293,16 +5294,16 @@ function RootImpl$j({
|
|
|
5293
5294
|
const {
|
|
5294
5295
|
objectId
|
|
5295
5296
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
5296
|
-
const solidRefs = useRefsParam(drawingId, objectId, Members$
|
|
5297
|
-
const axis1Refs = useRefsParam(drawingId, objectId, Members$
|
|
5298
|
-
const axis2Refs = useRefsParam(drawingId, objectId, Members$
|
|
5299
|
-
const dist1 = useNumParam(drawingId, objectId, Members$
|
|
5300
|
-
const dist2 = useNumParam(drawingId, objectId, Members$
|
|
5301
|
-
const count1 = useNumParam(drawingId, objectId, Members$
|
|
5302
|
-
const count2 = useNumParam(drawingId, objectId, Members$
|
|
5303
|
-
const inverted1 = useBoolParam(drawingId, objectId, Members$
|
|
5304
|
-
const inverted2 = useBoolParam(drawingId, objectId, Members$
|
|
5305
|
-
const merged = useBoolParam(drawingId, objectId, Members$
|
|
5297
|
+
const solidRefs = useRefsParam(drawingId, objectId, Members$e.SolidReferences);
|
|
5298
|
+
const axis1Refs = useRefsParam(drawingId, objectId, Members$e.Axis1References);
|
|
5299
|
+
const axis2Refs = useRefsParam(drawingId, objectId, Members$e.Axis2References);
|
|
5300
|
+
const dist1 = useNumParam(drawingId, objectId, Members$e.Distance1);
|
|
5301
|
+
const dist2 = useNumParam(drawingId, objectId, Members$e.Distance2);
|
|
5302
|
+
const count1 = useNumParam(drawingId, objectId, Members$e.Count1);
|
|
5303
|
+
const count2 = useNumParam(drawingId, objectId, Members$e.Count2);
|
|
5304
|
+
const inverted1 = useBoolParam(drawingId, objectId, Members$e.Inverted1);
|
|
5305
|
+
const inverted2 = useBoolParam(drawingId, objectId, Members$e.Inverted2);
|
|
5306
|
+
const merged = useBoolParam(drawingId, objectId, Members$e.Merged);
|
|
5306
5307
|
const update = React.useCallback(() => {
|
|
5307
5308
|
const params1 = [inverted1.serverValue, dist1.serverValue, count1.serverValue, merged.serverValue];
|
|
5308
5309
|
const axis2Refs_ = axis2Refs.serverValue.length > 0 ? axis2Refs.serverValue : null;
|
|
@@ -5404,7 +5405,7 @@ var index$j = /*#__PURE__*/Object.freeze({
|
|
|
5404
5405
|
description: description$j
|
|
5405
5406
|
});
|
|
5406
5407
|
|
|
5407
|
-
var Members$
|
|
5408
|
+
var Members$d;
|
|
5408
5409
|
|
|
5409
5410
|
(function (Members) {
|
|
5410
5411
|
Members["SolidReferences"] = "toPattern";
|
|
@@ -5413,7 +5414,7 @@ var Members$c;
|
|
|
5413
5414
|
Members["Inverted"] = "inverted";
|
|
5414
5415
|
Members["Count"] = "instanceCount";
|
|
5415
5416
|
Members["Merged"] = "merged";
|
|
5416
|
-
})(Members$
|
|
5417
|
+
})(Members$d || (Members$d = {}));
|
|
5417
5418
|
|
|
5418
5419
|
function RootImpl$i({
|
|
5419
5420
|
drawingId,
|
|
@@ -5422,14 +5423,14 @@ function RootImpl$i({
|
|
|
5422
5423
|
const {
|
|
5423
5424
|
objectId
|
|
5424
5425
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
5425
|
-
const solidRefs = useRefsParam(drawingId, objectId, Members$
|
|
5426
|
-
const axisRefs = useRefsParam(drawingId, objectId, Members$
|
|
5427
|
-
const angle = useNumParam(drawingId, objectId, Members$
|
|
5426
|
+
const solidRefs = useRefsParam(drawingId, objectId, Members$d.SolidReferences);
|
|
5427
|
+
const axisRefs = useRefsParam(drawingId, objectId, Members$d.AxisReferences);
|
|
5428
|
+
const angle = useNumParam(drawingId, objectId, Members$d.Angle, {
|
|
5428
5429
|
angle: true
|
|
5429
5430
|
});
|
|
5430
|
-
const count = useNumParam(drawingId, objectId, Members$
|
|
5431
|
-
const inverted = useBoolParam(drawingId, objectId, Members$
|
|
5432
|
-
const merged = useBoolParam(drawingId, objectId, Members$
|
|
5431
|
+
const count = useNumParam(drawingId, objectId, Members$d.Count);
|
|
5432
|
+
const inverted = useBoolParam(drawingId, objectId, Members$d.Inverted);
|
|
5433
|
+
const merged = useBoolParam(drawingId, objectId, Members$d.Merged);
|
|
5433
5434
|
const update = React.useCallback(() => {
|
|
5434
5435
|
const params = [inverted.serverValue, angle.serverValue, count.serverValue, merged.serverValue];
|
|
5435
5436
|
return classcad.ccAPI.feature.updatePattern(drawingId, objectId, solidRefs.serverValue, axisRefs.serverValue, params, null, null);
|
|
@@ -5506,12 +5507,12 @@ var index$i = /*#__PURE__*/Object.freeze({
|
|
|
5506
5507
|
description: description$i
|
|
5507
5508
|
});
|
|
5508
5509
|
|
|
5509
|
-
var Members$
|
|
5510
|
+
var Members$c;
|
|
5510
5511
|
|
|
5511
5512
|
(function (Members) {
|
|
5512
5513
|
Members["SolidReferences"] = "toPattern";
|
|
5513
5514
|
Members["FaceReferences"] = "references";
|
|
5514
|
-
})(Members$
|
|
5515
|
+
})(Members$c || (Members$c = {}));
|
|
5515
5516
|
|
|
5516
5517
|
const RootImpl$h = ({
|
|
5517
5518
|
drawingId,
|
|
@@ -5520,8 +5521,8 @@ const RootImpl$h = ({
|
|
|
5520
5521
|
const {
|
|
5521
5522
|
objectId
|
|
5522
5523
|
} = react.usePlugin(drawingId, pluginId, plugin => plugin);
|
|
5523
|
-
const solidRefs = useRefsParam(drawingId, objectId, Members$
|
|
5524
|
-
const faceRefs = useRefsParam(drawingId, objectId, Members$
|
|
5524
|
+
const solidRefs = useRefsParam(drawingId, objectId, Members$c.SolidReferences);
|
|
5525
|
+
const faceRefs = useRefsParam(drawingId, objectId, Members$c.FaceReferences);
|
|
5525
5526
|
const update = React.useCallback(() => {
|
|
5526
5527
|
return classcad.ccAPI.feature.updateMirror(drawingId, objectId, solidRefs.serverValue, faceRefs.serverValue);
|
|
5527
5528
|
}, [drawingId, objectId, solidRefs, faceRefs]);
|
|
@@ -5576,6 +5577,63 @@ var index$h = /*#__PURE__*/Object.freeze({
|
|
|
5576
5577
|
description: description$h
|
|
5577
5578
|
});
|
|
5578
5579
|
|
|
5580
|
+
const defaultNumberOfDigits = 3;
|
|
5581
|
+
|
|
5582
|
+
const DIGITS = [{
|
|
5583
|
+
id: 0,
|
|
5584
|
+
label: '0'
|
|
5585
|
+
}, {
|
|
5586
|
+
id: 1,
|
|
5587
|
+
label: '0.1'
|
|
5588
|
+
}, {
|
|
5589
|
+
id: 2,
|
|
5590
|
+
label: '0.12'
|
|
5591
|
+
}, {
|
|
5592
|
+
id: 3,
|
|
5593
|
+
label: '0.123'
|
|
5594
|
+
}, {
|
|
5595
|
+
id: 4,
|
|
5596
|
+
label: '0.1234'
|
|
5597
|
+
}, {
|
|
5598
|
+
id: 5,
|
|
5599
|
+
label: '0.12345'
|
|
5600
|
+
}, {
|
|
5601
|
+
id: 6,
|
|
5602
|
+
label: '0.123456'
|
|
5603
|
+
}];
|
|
5604
|
+
const Digits = ({
|
|
5605
|
+
drawingId,
|
|
5606
|
+
pluginId
|
|
5607
|
+
}) => {
|
|
5608
|
+
const {
|
|
5609
|
+
Select
|
|
5610
|
+
} = react.useBuerli(buerli => buerli.options.elements);
|
|
5611
|
+
const set = react.usePlugin(drawingId, pluginId, p => p.set);
|
|
5612
|
+
const digits = react.usePlugin(drawingId, pluginId, p => p.state.digits);
|
|
5613
|
+
const curr = React.useMemo(() => {
|
|
5614
|
+
const dig = DIGITS.find(d => d.id === digits);
|
|
5615
|
+
return dig ? dig.label : DIGITS[defaultNumberOfDigits].label;
|
|
5616
|
+
}, [digits]);
|
|
5617
|
+
const onChange = React.useCallback(label => {
|
|
5618
|
+
const dig = DIGITS.find(d => d.label === label);
|
|
5619
|
+
|
|
5620
|
+
if (dig) {
|
|
5621
|
+
set == null ? void 0 : set({
|
|
5622
|
+
digits: dig.id
|
|
5623
|
+
});
|
|
5624
|
+
}
|
|
5625
|
+
}, [set]);
|
|
5626
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
5627
|
+
value: curr,
|
|
5628
|
+
onChange: onChange
|
|
5629
|
+
}, DIGITS.map(p => p.label));
|
|
5630
|
+
};
|
|
5631
|
+
|
|
5632
|
+
const vectorToString = (point, digits) => `${point.toArray().map(n => core.MathUtils.round(n, digits)).join(', ')}`;
|
|
5633
|
+
|
|
5634
|
+
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; }
|
|
5635
|
+
|
|
5636
|
+
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; }
|
|
5579
5637
|
const Excluded = [core.GraphicType.LOOP].concat(core.EntityTypes);
|
|
5580
5638
|
|
|
5581
5639
|
const RootImpl$g = ({
|
|
@@ -5604,7 +5662,19 @@ const RootImpl$g = ({
|
|
|
5604
5662
|
drawingId: drawingId,
|
|
5605
5663
|
pluginId: pluginId,
|
|
5606
5664
|
selectorId: selectorId
|
|
5607
|
-
}))
|
|
5665
|
+
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", {
|
|
5666
|
+
style: {
|
|
5667
|
+
width: '100%',
|
|
5668
|
+
height: '1px',
|
|
5669
|
+
background: 'rgba(0,0,0,0.1)',
|
|
5670
|
+
marginBottom: '5px'
|
|
5671
|
+
}
|
|
5672
|
+
}), /*#__PURE__*/React.createElement(Wrapper, {
|
|
5673
|
+
caption: "Digits"
|
|
5674
|
+
}, /*#__PURE__*/React.createElement(Digits, {
|
|
5675
|
+
drawingId: drawingId,
|
|
5676
|
+
pluginId: pluginId
|
|
5677
|
+
})));
|
|
5608
5678
|
};
|
|
5609
5679
|
|
|
5610
5680
|
const Output = ({
|
|
@@ -5612,6 +5682,8 @@ const Output = ({
|
|
|
5612
5682
|
pluginId,
|
|
5613
5683
|
selectorId
|
|
5614
5684
|
}) => {
|
|
5685
|
+
const set = react.usePlugin(drawingId, pluginId, p => p.set);
|
|
5686
|
+
const digits = react.usePlugin(drawingId, pluginId, p => p.state.digits);
|
|
5615
5687
|
const {
|
|
5616
5688
|
Label
|
|
5617
5689
|
} = react.useBuerli(buerli => buerli.options.elements);
|
|
@@ -5627,22 +5699,52 @@ const Output = ({
|
|
|
5627
5699
|
}
|
|
5628
5700
|
}
|
|
5629
5701
|
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5702
|
+
const extended = results.map(res => {
|
|
5703
|
+
if (res.measureData) {
|
|
5704
|
+
switch (res.type) {
|
|
5705
|
+
case core.MeasureResultType.DISTANCE:
|
|
5706
|
+
case core.MeasureResultType.ANGLE:
|
|
5707
|
+
{
|
|
5708
|
+
const {
|
|
5709
|
+
value
|
|
5710
|
+
} = res.measureData;
|
|
5711
|
+
return _objectSpread$i(_objectSpread$i({}, res), {}, {
|
|
5712
|
+
asString: core.MathUtils.round(value, digits)
|
|
5713
|
+
});
|
|
5714
|
+
}
|
|
5715
|
+
|
|
5716
|
+
case core.MeasureResultType.POSITION:
|
|
5717
|
+
case core.MeasureResultType.VECTOR:
|
|
5718
|
+
{
|
|
5719
|
+
const {
|
|
5720
|
+
value
|
|
5721
|
+
} = res.measureData;
|
|
5722
|
+
return _objectSpread$i(_objectSpread$i({}, res), {}, {
|
|
5723
|
+
asString: vectorToString(value, digits)
|
|
5724
|
+
});
|
|
5725
|
+
}
|
|
5726
|
+
}
|
|
5727
|
+
}
|
|
5728
|
+
|
|
5729
|
+
return _objectSpread$i(_objectSpread$i({}, res), {}, {
|
|
5730
|
+
asString: ''
|
|
5731
|
+
});
|
|
5638
5732
|
});
|
|
5639
|
-
|
|
5733
|
+
return extended;
|
|
5734
|
+
}, [drawingId, selector, digits]);
|
|
5735
|
+
React.useEffect(() => set == null ? void 0 : set({
|
|
5736
|
+
measuredItems: items
|
|
5737
|
+
}), [items, set]);
|
|
5640
5738
|
return /*#__PURE__*/React.createElement(React.Fragment, null, items.map((item, index) => {
|
|
5641
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
5739
|
+
return item.measureData && /*#__PURE__*/React.createElement(Wrapper, {
|
|
5642
5740
|
key: index,
|
|
5643
5741
|
minor: true,
|
|
5644
5742
|
caption: item.description
|
|
5645
|
-
}, /*#__PURE__*/React.createElement(Label,
|
|
5743
|
+
}, /*#__PURE__*/React.createElement(Label, {
|
|
5744
|
+
style: {
|
|
5745
|
+
fontSize: '12px'
|
|
5746
|
+
}
|
|
5747
|
+
}, `${item.asString}`));
|
|
5646
5748
|
}));
|
|
5647
5749
|
};
|
|
5648
5750
|
|
|
@@ -5851,7 +5953,8 @@ const dWidthCoeff = 15;
|
|
|
5851
5953
|
const Distance = ({
|
|
5852
5954
|
p1,
|
|
5853
5955
|
p2,
|
|
5854
|
-
result
|
|
5956
|
+
result,
|
|
5957
|
+
digits = defaultNumberOfDigits
|
|
5855
5958
|
}) => {
|
|
5856
5959
|
const {
|
|
5857
5960
|
start,
|
|
@@ -5873,7 +5976,7 @@ const Distance = ({
|
|
|
5873
5976
|
center: center_
|
|
5874
5977
|
};
|
|
5875
5978
|
}, [p1, p2]);
|
|
5876
|
-
const text =
|
|
5979
|
+
const text = `${core.MathUtils.round(result, digits)}`;
|
|
5877
5980
|
const [showValue, setShowValue] = React.useState(true);
|
|
5878
5981
|
fiber.useFrame(args => {
|
|
5879
5982
|
const [startH, endH] = [start, end].map(p => react.CameraHelper.getPoint2(p.clone(), args.camera, args.size));
|
|
@@ -5902,13 +6005,14 @@ const Distance = ({
|
|
|
5902
6005
|
}));
|
|
5903
6006
|
};
|
|
5904
6007
|
const lineLength = 50;
|
|
5905
|
-
const
|
|
6008
|
+
const radius_ = 40;
|
|
5906
6009
|
const aWidthCoeff = 10;
|
|
5907
6010
|
const Angle = ({
|
|
5908
6011
|
center,
|
|
5909
6012
|
dir1,
|
|
5910
6013
|
dir2,
|
|
5911
|
-
result
|
|
6014
|
+
result,
|
|
6015
|
+
digits = defaultNumberOfDigits
|
|
5912
6016
|
}) => {
|
|
5913
6017
|
const {
|
|
5914
6018
|
end1,
|
|
@@ -5929,12 +6033,12 @@ const Angle = ({
|
|
|
5929
6033
|
const end2_ = center.clone().addScaledVector(dir2N, lineLength);
|
|
5930
6034
|
const normal_ = dir2N.clone().cross(dir1N);
|
|
5931
6035
|
const angle_ = dir1N.angleTo(dir2N);
|
|
5932
|
-
const arrowPos1_ = center.clone().addScaledVector(dir1N,
|
|
5933
|
-
const arrowPos2_ = center.clone().addScaledVector(dir2N,
|
|
6036
|
+
const arrowPos1_ = center.clone().addScaledVector(dir1N, radius_);
|
|
6037
|
+
const arrowPos2_ = center.clone().addScaledVector(dir2N, radius_);
|
|
5934
6038
|
const arrowDir1_ = normal_.clone().cross(dir1N);
|
|
5935
6039
|
const arrowDir2_ = dir2N.clone().cross(normal_);
|
|
5936
6040
|
const midDir = dir1N.clone().lerp(dir2N, 0.5).normalize();
|
|
5937
|
-
const valuePos_ = center.clone().addScaledVector(midDir,
|
|
6041
|
+
const valuePos_ = center.clone().addScaledVector(midDir, radius_ + 5);
|
|
5938
6042
|
const n = normal_.clone().normalize();
|
|
5939
6043
|
const t = dir2N;
|
|
5940
6044
|
const b = n.clone().cross(t).normalize();
|
|
@@ -5954,7 +6058,7 @@ const Angle = ({
|
|
|
5954
6058
|
arcCenterL: arcCenterL_
|
|
5955
6059
|
};
|
|
5956
6060
|
}, [center, dir1, dir2]);
|
|
5957
|
-
const text =
|
|
6061
|
+
const text = `${core.MathUtils.round(result, digits)}`;
|
|
5958
6062
|
const [showValue, setShowValue] = React.useState(true);
|
|
5959
6063
|
fiber.useFrame(args => {
|
|
5960
6064
|
const [end1H, end2H, valuePosH] = [end1, end2, valuePos].map(p => react.CameraHelper.getPoint2(p.clone(), args.camera, args.size));
|
|
@@ -5984,7 +6088,7 @@ const Angle = ({
|
|
|
5984
6088
|
matrixAutoUpdate: false
|
|
5985
6089
|
}, /*#__PURE__*/React.createElement(Arc$2, {
|
|
5986
6090
|
center: arcCenterL,
|
|
5987
|
-
radius:
|
|
6091
|
+
radius: radius_,
|
|
5988
6092
|
startAngle: 0,
|
|
5989
6093
|
endAngle: angle
|
|
5990
6094
|
})), /*#__PURE__*/React.createElement(Arrow$1, {
|
|
@@ -5999,15 +6103,21 @@ const Angle = ({
|
|
|
5999
6103
|
backgroundColor: 0xffffff
|
|
6000
6104
|
}));
|
|
6001
6105
|
};
|
|
6002
|
-
const
|
|
6106
|
+
const zero = new THREE__namespace.Vector3(0, 0, 0);
|
|
6107
|
+
const Position$1 = ({
|
|
6003
6108
|
pos,
|
|
6004
|
-
result
|
|
6109
|
+
result,
|
|
6110
|
+
radius = 5
|
|
6005
6111
|
}) => {
|
|
6006
|
-
|
|
6112
|
+
const ref = useScale$1(pos);
|
|
6113
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("group", {
|
|
6007
6114
|
position: pos,
|
|
6008
|
-
|
|
6115
|
+
ref: ref
|
|
6116
|
+
}, /*#__PURE__*/React.createElement(Point$2, {
|
|
6117
|
+
position: zero,
|
|
6118
|
+
radius: radius,
|
|
6009
6119
|
color: 0xaf1111
|
|
6010
|
-
}), result && /*#__PURE__*/React.createElement(TextValue, {
|
|
6120
|
+
})), result && /*#__PURE__*/React.createElement(TextValue, {
|
|
6011
6121
|
position: pos,
|
|
6012
6122
|
value: result,
|
|
6013
6123
|
backgroundColor: 0xffffff
|
|
@@ -6032,6 +6142,7 @@ function ViewImpl$e({
|
|
|
6032
6142
|
pluginId
|
|
6033
6143
|
}) {
|
|
6034
6144
|
const items = react.usePlugin(drawingId, pluginId, plugin => plugin.state.measuredItems);
|
|
6145
|
+
const digits = react.usePlugin(drawingId, pluginId, p => p.state.digits);
|
|
6035
6146
|
return /*#__PURE__*/React.createElement("group", null, items.map((item, index) => {
|
|
6036
6147
|
if (!item.measureData) {
|
|
6037
6148
|
return null;
|
|
@@ -6042,14 +6153,15 @@ function ViewImpl$e({
|
|
|
6042
6153
|
{
|
|
6043
6154
|
const {
|
|
6044
6155
|
start,
|
|
6045
|
-
end
|
|
6156
|
+
end,
|
|
6157
|
+
value
|
|
6046
6158
|
} = item.measureData;
|
|
6047
|
-
const result = item.value;
|
|
6048
6159
|
return /*#__PURE__*/React.createElement(Distance, {
|
|
6049
6160
|
key: index,
|
|
6050
6161
|
p1: start,
|
|
6051
6162
|
p2: end,
|
|
6052
|
-
result:
|
|
6163
|
+
result: value,
|
|
6164
|
+
digits: digits
|
|
6053
6165
|
});
|
|
6054
6166
|
}
|
|
6055
6167
|
|
|
@@ -6058,27 +6170,28 @@ function ViewImpl$e({
|
|
|
6058
6170
|
const {
|
|
6059
6171
|
center,
|
|
6060
6172
|
dir1,
|
|
6061
|
-
dir2
|
|
6062
|
-
|
|
6063
|
-
|
|
6173
|
+
dir2,
|
|
6174
|
+
value
|
|
6175
|
+
} = item.measureData; // Don't draw the arc if angle === 0 or angle === 180
|
|
6064
6176
|
|
|
6065
|
-
return
|
|
6177
|
+
return value !== 0 && value !== 180 && /*#__PURE__*/React.createElement(Angle, {
|
|
6066
6178
|
key: index,
|
|
6067
6179
|
center: center,
|
|
6068
6180
|
dir1: dir1,
|
|
6069
6181
|
dir2: dir2,
|
|
6070
|
-
result:
|
|
6182
|
+
result: value,
|
|
6183
|
+
digits: digits
|
|
6071
6184
|
});
|
|
6072
6185
|
}
|
|
6073
6186
|
|
|
6074
6187
|
case core.MeasureResultType.POSITION:
|
|
6075
6188
|
{
|
|
6076
6189
|
const {
|
|
6077
|
-
|
|
6190
|
+
value
|
|
6078
6191
|
} = item.measureData;
|
|
6079
|
-
return /*#__PURE__*/React.createElement(Position, {
|
|
6192
|
+
return /*#__PURE__*/React.createElement(Position$1, {
|
|
6080
6193
|
key: index,
|
|
6081
|
-
pos:
|
|
6194
|
+
pos: value
|
|
6082
6195
|
});
|
|
6083
6196
|
}
|
|
6084
6197
|
|
|
@@ -6116,7 +6229,8 @@ const description$g = {
|
|
|
6116
6229
|
persistent: false,
|
|
6117
6230
|
global: true,
|
|
6118
6231
|
initialState: {
|
|
6119
|
-
measuredItems: []
|
|
6232
|
+
measuredItems: [],
|
|
6233
|
+
digits: defaultNumberOfDigits
|
|
6120
6234
|
}
|
|
6121
6235
|
};
|
|
6122
6236
|
|
|
@@ -6349,6 +6463,11 @@ const getInitialState = () => {
|
|
|
6349
6463
|
// When user hovers an obects (line, point, constraint, etc) id of the object is store to this prop.
|
|
6350
6464
|
highlighted: [],
|
|
6351
6465
|
// Shows which objects should be highlighted with different color. (e.g. When user hovers a line, constraints which are applied for this lines are placed to `highlighted` array)
|
|
6466
|
+
interaction: {
|
|
6467
|
+
cycle: 0,
|
|
6468
|
+
objects: []
|
|
6469
|
+
},
|
|
6470
|
+
// Contains information about objects under the pointer (`interaction.objects[interaction.cycle]` should equal `hovered`)
|
|
6352
6471
|
isDragged: false,
|
|
6353
6472
|
// When used drags some objects, this should equal true.
|
|
6354
6473
|
scale: 1,
|
|
@@ -6534,7 +6653,7 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
6534
6653
|
} = tmpObjects[tmpDimensionId];
|
|
6535
6654
|
const sector = calcSector(dimPos, dir0, dir1, center);
|
|
6536
6655
|
const previewValue = calcPreviewValue(dir0, dir1, sector, reflex);
|
|
6537
|
-
classcad.ccAPI.sketcher.addConstraints(drawingId, sketchId, ['Ang'], [classcad.CCClasses.CC2DAngleConstraint], [entities], [previewValue], [dimPos], [[sector, reflex]]);
|
|
6656
|
+
classcad.ccAPI.sketcher.addConstraints(drawingId, sketchId, ['Ang'], [classcad.CCClasses.CC2DAngleConstraint], [entities], [previewValue], [dimPos], [[sector, reflex]]).catch(console.warn);
|
|
6538
6657
|
isPressed = false;
|
|
6539
6658
|
set({
|
|
6540
6659
|
activeHandler: HandlersList.DRAG
|
|
@@ -6570,88 +6689,139 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
6570
6689
|
};
|
|
6571
6690
|
}
|
|
6572
6691
|
|
|
6692
|
+
function getGeometryPriority(object) {
|
|
6693
|
+
if (is2DConstraint(object)) {
|
|
6694
|
+
return 4;
|
|
6695
|
+
}
|
|
6696
|
+
|
|
6697
|
+
switch (object.class) {
|
|
6698
|
+
case classcad.CCClasses.CCLine:
|
|
6699
|
+
return 1;
|
|
6700
|
+
|
|
6701
|
+
case classcad.CCClasses.CCArc:
|
|
6702
|
+
return 2;
|
|
6703
|
+
|
|
6704
|
+
case classcad.CCClasses.CCCircle:
|
|
6705
|
+
return 3;
|
|
6706
|
+
|
|
6707
|
+
case classcad.CCClasses.CCPoint:
|
|
6708
|
+
return 5;
|
|
6709
|
+
}
|
|
6710
|
+
|
|
6711
|
+
return -1;
|
|
6712
|
+
}
|
|
6713
|
+
|
|
6573
6714
|
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; }
|
|
6574
6715
|
|
|
6575
6716
|
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; }
|
|
6576
6717
|
let timerId;
|
|
6577
|
-
|
|
6718
|
+
|
|
6719
|
+
const setHoverState = (drawingId, pluginId, cycle, objects) => {
|
|
6578
6720
|
const {
|
|
6579
|
-
state,
|
|
6580
6721
|
set
|
|
6581
6722
|
} = core.getPlugin(drawingId, pluginId);
|
|
6582
6723
|
const tree = core.getDrawing(drawingId).structure.tree;
|
|
6724
|
+
const hoveredId = objects[cycle % objects.length];
|
|
6583
6725
|
const hoveredObject = tree[hoveredId];
|
|
6584
6726
|
|
|
6585
|
-
if (
|
|
6586
|
-
|
|
6587
|
-
|
|
6727
|
+
if (hoveredObject) {
|
|
6728
|
+
if (is2DConstraint(hoveredObject)) {
|
|
6729
|
+
var _hoveredObject$member;
|
|
6588
6730
|
|
|
6589
|
-
|
|
6590
|
-
|
|
6731
|
+
const constraintEntities = ((_hoveredObject$member = hoveredObject.members) == null ? void 0 : _hoveredObject$member.entities).members.map(entity => entity.value);
|
|
6732
|
+
set(state_ => {
|
|
6733
|
+
const highlighted = state_.highlighted;
|
|
6734
|
+
const highlightedConstraints = highlighted.filter(id => is2DConstraint(tree[id]) && id !== hoveredId);
|
|
6735
|
+
return {
|
|
6736
|
+
hovered: hoveredId,
|
|
6737
|
+
highlighted: [...highlightedConstraints, hoveredId, ...constraintEntities],
|
|
6738
|
+
interaction: {
|
|
6739
|
+
cycle,
|
|
6740
|
+
objects
|
|
6741
|
+
}
|
|
6742
|
+
};
|
|
6743
|
+
});
|
|
6744
|
+
} else {
|
|
6745
|
+
const linkedConstraints = Object.values(tree).filter(obj => is2DConstraint(obj)).filter(obj => {
|
|
6746
|
+
var _obj$members;
|
|
6747
|
+
|
|
6748
|
+
return ((_obj$members = obj.members) == null ? void 0 : _obj$members.entities).members.some(entity => entity.value === hoveredId);
|
|
6749
|
+
}).map(obj => obj.id);
|
|
6750
|
+
const constraintsToGeometry = {};
|
|
6751
|
+
linkedConstraints.forEach(id => {
|
|
6752
|
+
constraintsToGeometry[id] = hoveredId;
|
|
6753
|
+
});
|
|
6754
|
+
set(state_ => {
|
|
6755
|
+
return {
|
|
6756
|
+
hovered: hoveredId,
|
|
6757
|
+
highlighted: [hoveredId, ...linkedConstraints],
|
|
6758
|
+
constraintsToGeometry: _objectSpread$g(_objectSpread$g({}, state_.constraintsToGeometry), constraintsToGeometry),
|
|
6759
|
+
interaction: {
|
|
6760
|
+
cycle,
|
|
6761
|
+
objects
|
|
6762
|
+
}
|
|
6763
|
+
};
|
|
6764
|
+
});
|
|
6765
|
+
}
|
|
6591
6766
|
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
return {
|
|
6597
|
-
hovered: hoveredId,
|
|
6598
|
-
highlighted: [...highlightedConstraints, hoveredId, ...constraintEntities]
|
|
6599
|
-
};
|
|
6600
|
-
});
|
|
6767
|
+
if (timerId) {
|
|
6768
|
+
window.clearTimeout(timerId);
|
|
6769
|
+
timerId = undefined;
|
|
6770
|
+
}
|
|
6601
6771
|
} else {
|
|
6602
|
-
const linkedConstraints = Object.values(tree).filter(obj => is2DConstraint(obj)).filter(obj => {
|
|
6603
|
-
var _obj$members;
|
|
6604
|
-
|
|
6605
|
-
return ((_obj$members = obj.members) == null ? void 0 : _obj$members.entities).members.some(entity => entity.value === hoveredId);
|
|
6606
|
-
}).map(obj => obj.id);
|
|
6607
|
-
const constraintsToGeometry = {};
|
|
6608
|
-
linkedConstraints.forEach(id => {
|
|
6609
|
-
constraintsToGeometry[id] = hoveredId;
|
|
6610
|
-
});
|
|
6611
6772
|
set(state_ => {
|
|
6773
|
+
const highlighted = state_.highlighted;
|
|
6774
|
+
const highlightedConstraints = highlighted.filter(id => is2DConstraint(tree[id]));
|
|
6612
6775
|
return {
|
|
6613
|
-
hovered:
|
|
6614
|
-
highlighted:
|
|
6615
|
-
|
|
6776
|
+
hovered: NOCCID,
|
|
6777
|
+
highlighted: highlightedConstraints,
|
|
6778
|
+
interaction: {
|
|
6779
|
+
cycle,
|
|
6780
|
+
objects
|
|
6781
|
+
}
|
|
6616
6782
|
};
|
|
6617
6783
|
});
|
|
6618
|
-
}
|
|
6619
6784
|
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6785
|
+
if (timerId) {
|
|
6786
|
+
window.clearTimeout(timerId);
|
|
6787
|
+
}
|
|
6788
|
+
|
|
6789
|
+
timerId = window.setTimeout(() => {
|
|
6790
|
+
set({
|
|
6791
|
+
highlighted: []
|
|
6792
|
+
});
|
|
6793
|
+
}, 1000);
|
|
6623
6794
|
}
|
|
6624
6795
|
};
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6796
|
+
|
|
6797
|
+
const hover = (drawingId, pluginId, hoveredId) => {
|
|
6798
|
+
var _tree$hoveredId;
|
|
6799
|
+
|
|
6800
|
+
const state = getSketchState(drawingId, pluginId);
|
|
6630
6801
|
const tree = core.getDrawing(drawingId).structure.tree;
|
|
6631
|
-
const hoveredObject = tree[hoveredId];
|
|
6632
6802
|
|
|
6633
|
-
if (!
|
|
6803
|
+
if (!tree[hoveredId] || ((_tree$hoveredId = tree[hoveredId]) == null ? void 0 : _tree$hoveredId.class) === classcad.CCClasses.CCSketch || state.rubberBandRectangle || state.isDragged) {
|
|
6634
6804
|
return;
|
|
6635
6805
|
}
|
|
6636
6806
|
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
});
|
|
6807
|
+
const objects = state.interaction.objects;
|
|
6808
|
+
const objectsSorted = [...objects, hoveredId].sort((a, b) => getGeometryPriority(tree[b]) - getGeometryPriority(tree[a]) || a - b);
|
|
6809
|
+
const objectsNew = objectsSorted.filter((id, i) => objectsSorted.indexOf(id) === i);
|
|
6810
|
+
setHoverState(drawingId, pluginId, 0, objectsNew);
|
|
6811
|
+
};
|
|
6812
|
+
const unhover = (drawingId, pluginId, hoveredId) => {
|
|
6813
|
+
var _tree$hoveredId2;
|
|
6645
6814
|
|
|
6646
|
-
|
|
6647
|
-
|
|
6815
|
+
const state = getSketchState(drawingId, pluginId);
|
|
6816
|
+
const tree = core.getDrawing(drawingId).structure.tree;
|
|
6817
|
+
|
|
6818
|
+
if (!tree[hoveredId] || ((_tree$hoveredId2 = tree[hoveredId]) == null ? void 0 : _tree$hoveredId2.class) === classcad.CCClasses.CCSketch || state.rubberBandRectangle) {
|
|
6819
|
+
return;
|
|
6648
6820
|
}
|
|
6649
6821
|
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
});
|
|
6654
|
-
}, 1000);
|
|
6822
|
+
const objects = state.interaction.objects;
|
|
6823
|
+
const objectsNew = objects.filter(id => id !== hoveredId);
|
|
6824
|
+
setHoverState(drawingId, pluginId, 0, objectsNew);
|
|
6655
6825
|
};
|
|
6656
6826
|
const select = (drawingId, pluginId, selectedId) => {
|
|
6657
6827
|
const {
|
|
@@ -6672,6 +6842,17 @@ const select = (drawingId, pluginId, selectedId) => {
|
|
|
6672
6842
|
}
|
|
6673
6843
|
});
|
|
6674
6844
|
};
|
|
6845
|
+
const tab = (drawingId, pluginId) => {
|
|
6846
|
+
const state = getSketchState(drawingId, pluginId);
|
|
6847
|
+
|
|
6848
|
+
if (state.rubberBandRectangle || state.isDragged) {
|
|
6849
|
+
return;
|
|
6850
|
+
}
|
|
6851
|
+
|
|
6852
|
+
const cycle = state.interaction.cycle + 1;
|
|
6853
|
+
const objects = state.interaction.objects;
|
|
6854
|
+
setHoverState(drawingId, pluginId, cycle, objects);
|
|
6855
|
+
};
|
|
6675
6856
|
|
|
6676
6857
|
function Hover(drawingId, pluginId) {
|
|
6677
6858
|
const filter = object => true;
|
|
@@ -6685,16 +6866,20 @@ function Hover(drawingId, pluginId) {
|
|
|
6685
6866
|
});
|
|
6686
6867
|
};
|
|
6687
6868
|
|
|
6869
|
+
const onKeyup = e => {
|
|
6870
|
+
if (e.code === 'Tab') {
|
|
6871
|
+
tab(drawingId, pluginId);
|
|
6872
|
+
}
|
|
6873
|
+
};
|
|
6874
|
+
|
|
6688
6875
|
const onPointerOver = e => {
|
|
6689
6876
|
const hoveredId = e.object.userData.objId;
|
|
6690
6877
|
hover(drawingId, pluginId, hoveredId);
|
|
6691
|
-
e.stopPropagation();
|
|
6692
6878
|
};
|
|
6693
6879
|
|
|
6694
6880
|
const onPointerOut = e => {
|
|
6695
6881
|
const hoveredId = e.object.userData.objId;
|
|
6696
6882
|
unhover(drawingId, pluginId, hoveredId);
|
|
6697
|
-
e.stopPropagation();
|
|
6698
6883
|
};
|
|
6699
6884
|
|
|
6700
6885
|
return {
|
|
@@ -6704,6 +6889,9 @@ function Hover(drawingId, pluginId) {
|
|
|
6704
6889
|
pointerHandlers: {
|
|
6705
6890
|
onPointerOver,
|
|
6706
6891
|
onPointerOut
|
|
6892
|
+
},
|
|
6893
|
+
keyHandlers: {
|
|
6894
|
+
keyup: onKeyup
|
|
6707
6895
|
}
|
|
6708
6896
|
};
|
|
6709
6897
|
}
|
|
@@ -7109,7 +7297,7 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7109
7297
|
let defferedDiff = null;
|
|
7110
7298
|
|
|
7111
7299
|
const moveObjects = async (sketch, objectIds, diff) => {
|
|
7112
|
-
promise = classcad.ccAPI.sketcher.moveObjects(drawingId, sketchId, objectIds, diff);
|
|
7300
|
+
promise = classcad.ccAPI.sketcher.moveObjects(drawingId, sketchId, objectIds, diff).catch(console.warn);
|
|
7113
7301
|
moveFrom.add(diff);
|
|
7114
7302
|
await promise; // Artificial slowdown to lessen network/server burden
|
|
7115
7303
|
|
|
@@ -7156,6 +7344,8 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7156
7344
|
};
|
|
7157
7345
|
|
|
7158
7346
|
const onKeyup = e => {
|
|
7347
|
+
var _hoverHandler$keyHand;
|
|
7348
|
+
|
|
7159
7349
|
if (e.code === 'Delete') {
|
|
7160
7350
|
if (pressedId !== NOCCID) {
|
|
7161
7351
|
return;
|
|
@@ -7170,18 +7360,27 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7170
7360
|
});
|
|
7171
7361
|
|
|
7172
7362
|
if (selectedNotNested.length > 0) {
|
|
7173
|
-
classcad.ccAPI.sketcher.removeObjects(drawingId, sketchId, selectedNotNested);
|
|
7363
|
+
classcad.ccAPI.sketcher.removeObjects(drawingId, sketchId, selectedNotNested).catch(console.warn);
|
|
7174
7364
|
}
|
|
7175
7365
|
}
|
|
7366
|
+
|
|
7367
|
+
(_hoverHandler$keyHand = hoverHandler.keyHandlers) == null ? void 0 : _hoverHandler$keyHand.keyup(e);
|
|
7176
7368
|
};
|
|
7177
7369
|
|
|
7178
7370
|
const onPointerDown = e => {
|
|
7179
7371
|
var _sketch$children, _sketch$children2;
|
|
7180
7372
|
|
|
7181
|
-
if (e.buttons !== 1)
|
|
7373
|
+
if (e.buttons !== 1) {
|
|
7374
|
+
// Continue only if 'primary' mouse button is pressed
|
|
7182
7375
|
return;
|
|
7376
|
+
}
|
|
7377
|
+
|
|
7183
7378
|
isMoved = false;
|
|
7184
|
-
|
|
7379
|
+
const {
|
|
7380
|
+
cycle,
|
|
7381
|
+
objects
|
|
7382
|
+
} = getSketchState(drawingId, pluginId).interaction;
|
|
7383
|
+
pressedId = objects.length > 0 ? objects[cycle % objects.length] : e.object.userData.objId;
|
|
7185
7384
|
const pressedObj = core.getDrawing(drawingId).structure.tree[pressedId];
|
|
7186
7385
|
|
|
7187
7386
|
if (e.shiftKey) {
|
|
@@ -7191,7 +7390,7 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7191
7390
|
}
|
|
7192
7391
|
|
|
7193
7392
|
isRectSelectionActive = true;
|
|
7194
|
-
rectClickPoint = e.point.project(e.camera);
|
|
7393
|
+
rectClickPoint = e.point.clone().project(e.camera);
|
|
7195
7394
|
pressedId = NOCCID;
|
|
7196
7395
|
camControls.enabled = false;
|
|
7197
7396
|
e.target.setPointerCapture(e.pointerId);
|
|
@@ -7277,7 +7476,7 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7277
7476
|
isMoved = true;
|
|
7278
7477
|
|
|
7279
7478
|
if (isRectSelectionActive) {
|
|
7280
|
-
const rectMousePoint = e.point.project(e.camera);
|
|
7479
|
+
const rectMousePoint = e.point.clone().project(e.camera);
|
|
7281
7480
|
const min = new THREE__namespace.Vector2(Math.min(rectClickPoint.x, rectMousePoint.x), Math.min(rectClickPoint.y, rectMousePoint.y));
|
|
7282
7481
|
const max = new THREE__namespace.Vector2(Math.max(rectClickPoint.x, rectMousePoint.x), Math.max(rectClickPoint.y, rectMousePoint.y));
|
|
7283
7482
|
const rubberBandRectangle = new THREE__namespace.Box2(min, max);
|
|
@@ -7329,6 +7528,7 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7329
7528
|
max: max.clone()
|
|
7330
7529
|
}
|
|
7331
7530
|
});
|
|
7531
|
+
e.stopPropagation();
|
|
7332
7532
|
return;
|
|
7333
7533
|
}
|
|
7334
7534
|
|
|
@@ -7346,7 +7546,7 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7346
7546
|
// If we are waiting for the response from server, defer next diff and make it after current change.
|
|
7347
7547
|
defferedDiff = diff;
|
|
7348
7548
|
} else {
|
|
7349
|
-
moveObjects(sketchId, [pressedId, ...selected], diff)
|
|
7549
|
+
moveObjects(sketchId, [pressedId, ...selected], diff);
|
|
7350
7550
|
}
|
|
7351
7551
|
}
|
|
7352
7552
|
|
|
@@ -7423,7 +7623,7 @@ function DrawPoint(drawingId, pluginId) {
|
|
|
7423
7623
|
incidence: true,
|
|
7424
7624
|
tangency: false,
|
|
7425
7625
|
vertAndHoriz: false
|
|
7426
|
-
});
|
|
7626
|
+
}).catch(console.warn);
|
|
7427
7627
|
}
|
|
7428
7628
|
|
|
7429
7629
|
e.stopPropagation();
|
|
@@ -7584,7 +7784,7 @@ function DrawLine(drawingId, pluginId) {
|
|
|
7584
7784
|
if (lineId === null) return;
|
|
7585
7785
|
const lastAddedLine = core.getDrawing(drawingId).structure.tree[lineId];
|
|
7586
7786
|
lastAddedEndPointId = ((_lastAddedLine$childr = lastAddedLine.children) == null ? void 0 : _lastAddedLine$childr[1]) || NOCCID;
|
|
7587
|
-
}).catch();
|
|
7787
|
+
}).catch(console.warn);
|
|
7588
7788
|
set(state => {
|
|
7589
7789
|
const tmpStartP = state.tmpObjects[tmpStartPId];
|
|
7590
7790
|
const tmpEndP = state.tmpObjects[tmpEndPId];
|
|
@@ -7762,7 +7962,7 @@ function DrawRectangle(drawingId, pluginId) {
|
|
|
7762
7962
|
incidence: true,
|
|
7763
7963
|
tangency: true,
|
|
7764
7964
|
vertAndHoriz: false
|
|
7765
|
-
});
|
|
7965
|
+
}).catch(console.warn);
|
|
7766
7966
|
set(state => {
|
|
7767
7967
|
const tmpRect_ = state.tmpObjects[tmpRectId];
|
|
7768
7968
|
const tmpPoint = {
|
|
@@ -8322,7 +8522,7 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
8322
8522
|
if (arcId === null) return;
|
|
8323
8523
|
const lastAddedArc = core.getDrawing(drawingId).structure.tree[arcId];
|
|
8324
8524
|
lastAddedEndPointId = ((_lastAddedArc$childre = lastAddedArc.children) == null ? void 0 : _lastAddedArc$childre[0]) || NOCCID;
|
|
8325
|
-
}).catch();
|
|
8525
|
+
}).catch(console.warn);
|
|
8326
8526
|
|
|
8327
8527
|
if (arcType === HandlersList.DRAWARCTANGENT) {
|
|
8328
8528
|
const dir = endPos.clone().sub(centerPos);
|
|
@@ -8535,7 +8735,7 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
8535
8735
|
incidence: true,
|
|
8536
8736
|
tangency: false,
|
|
8537
8737
|
vertAndHoriz: false
|
|
8538
|
-
});
|
|
8738
|
+
}).catch(console.warn);
|
|
8539
8739
|
set(state => {
|
|
8540
8740
|
const tmpCenterP = state.tmpObjects[tmpCenterPId];
|
|
8541
8741
|
return {
|
|
@@ -8600,73 +8800,73 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
8600
8800
|
};
|
|
8601
8801
|
}
|
|
8602
8802
|
|
|
8603
|
-
var img$
|
|
8803
|
+
var img$_ = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M98.6501 57.944V63.1826H71.546V80.9483H28.9538V63.1826H1.84961V57.944H28.9538V38.3561H36.0145V33.8008C36.0145 26.0568 42.3919 19.4515 50.3638 19.4515C58.3356 19.4515 64.713 25.829 64.713 33.8008V38.3561H71.7738V57.944H98.6501ZM66.9907 76.393V42.9114H59.9299V33.8008C59.9299 28.5622 55.6024 24.0069 50.136 24.0069C44.6696 24.0069 40.5698 28.5622 40.5698 33.8008V42.9114H33.5091V76.393H66.9907Z' fill='black'/%3e%3cpath d='M66.9918 42.9114V76.393H33.5103V42.9114H40.571V33.8008C40.571 28.5622 44.8985 24.0068 50.3649 24.0068C55.8313 24.0068 60.1589 28.3344 60.1589 33.8008V42.9114H66.9918ZM56.7424 40.6338V34.0285C56.7424 30.612 53.7814 27.6511 50.3649 27.6511C46.9484 27.6511 43.9875 30.612 43.9875 34.0285V40.6338H56.7424ZM55.6036 65.9158V56.5774C55.6036 53.6164 53.3259 51.3388 50.3649 51.3388C47.404 51.3388 45.1263 53.6164 45.1263 56.5774V65.9158H55.6036Z' fill='%239D9D9C'/%3e%3cpath d='M56.7412 34.0286V40.6338H43.9863V34.0286C43.9863 30.6121 46.9473 27.6511 50.3638 27.6511C53.7803 27.6511 56.7412 30.3843 56.7412 34.0286ZM52.1859 36.0785V34.0286C52.1859 33.1175 51.2748 32.2064 50.3638 32.2064C49.4527 32.2064 48.5416 32.8897 48.5416 34.0286V36.0785H52.1859Z' fill='black'/%3e%3cpath d='M55.6027 56.5774V65.9158H45.1255V56.5774C45.1255 53.6164 47.4031 51.3387 50.3641 51.3387C53.0973 51.3387 55.6027 53.6164 55.6027 56.5774Z' fill='black'/%3e%3c/svg%3e";
|
|
8604
8804
|
|
|
8605
|
-
var img$
|
|
8805
|
+
var img$Z = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M93.7715 47.5999H6.8291V53H93.7715V47.5999Z' fill='black'/%3e%3c/svg%3e";
|
|
8606
8806
|
|
|
8607
|
-
var img$
|
|
8807
|
+
var img$Y = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M53 12H47.6006V88.5999H53V12Z' fill='black'/%3e%3c/svg%3e";
|
|
8608
8808
|
|
|
8609
|
-
var img$
|
|
8809
|
+
var img$X = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M44.05 49.7792L50 55.6417L55.95 49.7792L50 43.9167L44.05 49.7792ZM54.8167 40.8458L80.0333 16L84 19.9083L58.7833 44.7542L63.6 49.5L58.7833 54.2458L84 79.0917L80.0333 83L54.8167 58.1542L50 62.9L45.1833 58.1542L19.9667 83L16 79.0917L41.2167 54.2458L36.4 49.5L50.2833 35.8208L54.8167 40.8458Z' fill='black'/%3e%3c/svg%3e";
|
|
8610
8810
|
|
|
8611
|
-
var img$
|
|
8811
|
+
var img$W = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M63 46C67.3243 46 71.973 46.8784 75 50C78.027 53.1216 80.5 59.2635 80.5 63.5C80.5 67.9595 77.2703 71.973 74.2432 75.0946C71.2162 78.2162 67.1081 80 63 80C58.6757 80 54.7838 78.2162 51.7568 75.0946C48.7297 71.973 46.5 67.7365 46.5 63.5C46.5 59.0406 46.973 54.1216 50 51C52.8108 47.8784 58.6757 46 63 46Z' fill='%239D9D9C'/%3e%3cpath d='M46.796 63.1473C46.796 67.5666 48.5637 71.5439 51.6572 74.6374C54.7507 77.7309 58.949 79.4986 63.1473 79.4986C67.5666 79.4986 71.5439 77.7309 74.6374 74.6374C77.7309 71.5439 79.4986 67.3456 79.4986 63.1473C79.4986 58.728 77.7309 54.7507 74.6374 51.6572C71.5439 48.5637 67.3456 46.796 63.1473 46.796C58.728 46.796 54.7507 48.5637 51.6572 51.6572C48.5637 54.7507 46.796 58.728 46.796 63.1473ZM63.1473 83.9178C57.8442 83.9178 52.5411 81.9292 48.5637 77.7309C43.9235 73.0906 41.9348 66.4617 42.5977 60.4957L14.0935 89L11 85.9065L85.9065 11L89 14.0935L60.4957 42.5977C66.6827 41.7139 73.0906 43.7025 77.7309 48.5637C85.9065 56.7394 85.9065 69.7762 77.7309 77.9518C73.7535 81.9292 68.4504 83.9178 63.1473 83.9178Z' fill='black'/%3e%3c/svg%3e";
|
|
8612
8812
|
|
|
8613
|
-
var img$
|
|
8813
|
+
var img$V = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M88 36.7379L36.7561 88L33 84.2621L84.2439 33L88 36.7379Z' fill='black'/%3e%3cpath d='M67 16.0777L15.7561 68L12 64.1942L63.2439 12L67 16.0777Z' fill='black'/%3e%3c/svg%3e";
|
|
8614
8814
|
|
|
8615
|
-
var img$
|
|
8815
|
+
var img$U = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 75H50.5M88 75H50.5M50.5 75V24.5' stroke='black' stroke-width='5'/%3e%3c/svg%3e";
|
|
8616
8816
|
|
|
8617
|
-
var img$
|
|
8817
|
+
var img$T = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M60.4698 20.5082L56.6826 16.7236L16.9448 56.4895L20.7321 60.2741L60.4698 20.5082Z' fill='black'/%3e%3cpath d='M82.8491 21.6999L79.0635 17.9143L18.115 78.8628L21.9006 82.6484L82.8491 21.6999Z' fill='black'/%3e%3cpath d='M83.9996 44.0778L80.2124 40.2932L40.4746 80.0591L44.2619 83.8437L83.9996 44.0778Z' fill='black'/%3e%3c/svg%3e";
|
|
8618
8818
|
|
|
8619
|
-
var img$
|
|
8819
|
+
var img$S = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='50' cy='50' r='32.5' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3ccircle cx='50' cy='50' r='19.5' stroke='black' stroke-width='5'/%3e%3crect x='44' y='44' width='12' height='12' fill='white' stroke='black' stroke-width='4'/%3e%3c/svg%3e";
|
|
8620
8820
|
|
|
8621
|
-
var img$
|
|
8821
|
+
var img$R = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M34.6614 51.5994L48.7943 65.8707L62.9272 51.5994L48.7943 37.3281L34.6614 51.5994ZM69.75 51.5994L48.7943 72.7603L40.2658 64.1483L15.8987 89L12 84.817L36.6108 60.2114L27.8386 51.5994L48.7943 30.4385L57.3228 39.0505L85.1013 11L89 14.9369L61.2215 43.2334L69.75 51.5994Z' fill='black'/%3e%3c/svg%3e";
|
|
8622
8822
|
|
|
8623
|
-
var img$
|
|
8823
|
+
var img$Q = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M87.5 27L80 52.5L89 78.5H63V27H87.5Z' fill='%239D9D9C'/%3e%3cpath d='M53 79H48V84H53V79Z' fill='black'/%3e%3cpath d='M53 71H48V75H53V71Z' fill='black'/%3e%3cpath d='M53 61H48V66H53V61Z' fill='black'/%3e%3cpath d='M53 53H48V57H53V53Z' fill='black'/%3e%3cpath d='M53 43H48V48H53V43Z' fill='black'/%3e%3cpath d='M53 34H48V39H53V34Z' fill='black'/%3e%3cpath d='M53 25H48V30H53V25Z' fill='black'/%3e%3cpath d='M53 16H48V21H53V16Z' fill='black'/%3e%3cpath d='M38 27L38.5 78L13.5 77L20.5 52L12.5 27.5L38 27Z' fill='%239D9D9C'/%3e%3cpath d='M14.2877 28.4358L21.9726 52.3891L14.2877 76.5642H37.5753V28.4358H14.2877ZM42 24V81H8L17.0822 52.3891L8 24H42Z' fill='black'/%3e%3cpath d='M63.6259 76.5642H86.7551L78.8912 52.3891L86.5238 28.214H63.3946V76.5642H63.6259ZM59 81V24H93L83.7483 52.3891L92.7687 81H59Z' fill='black'/%3e%3c/svg%3e";
|
|
8624
8824
|
|
|
8625
|
-
var img$
|
|
8825
|
+
var img$P = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M87.0685 59.9326H13.5317V66.7416H87.0685V59.9326Z' fill='black'/%3e%3cpath d='M87.0685 34.0582H13.5317V40.8672H87.0685V34.0582Z' fill='black'/%3e%3c/svg%3e";
|
|
8626
8826
|
|
|
8627
|
-
var img$
|
|
8827
|
+
var img$O = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M80 50H19' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3cpath d='M74 59L82 50.3692L74 42' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3cpath d='M26 42L19 50.3692V50.6308L25.75 59' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3cpath d='M5 30V70' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3cpath d='M96 30V70' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3c/svg%3e";
|
|
8628
8828
|
|
|
8629
|
-
var img$
|
|
8829
|
+
var img$N = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M31 95H69' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3cpath d='M50 21V81' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3cpath d='M58 27L49.8769 20L42 27' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3cpath d='M42 74L50.1231 81L58 74.25' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3cpath d='M31 6H69' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3c/svg%3e";
|
|
8630
8830
|
|
|
8631
|
-
var img$
|
|
8831
|
+
var img$M = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M68.0001 32L31.2217 69L34.2036 66' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3cpath d='M69 40L68.3478 30.6522L59 30' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3cpath d='M30 59L30.8696 68.3478L40 69' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3cpath d='M10 65L34 89' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3cpath d='M65 10L89 34' stroke='black' stroke-width='4' stroke-miterlimit='10'/%3e%3c/svg%3e";
|
|
8632
8832
|
|
|
8633
|
-
var img$
|
|
8833
|
+
var img$L = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='50' cy='50' r='35.5' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3crect x='43.5' y='43.5' width='12' height='12' fill='white' stroke='black' stroke-width='5'/%3e%3cline x1='55.2322' y1='43.2322' x2='73.2322' y2='25.2322' stroke='black' stroke-width='5'/%3e%3c/svg%3e";
|
|
8634
8834
|
|
|
8635
|
-
var img$
|
|
8835
|
+
var img$K = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M49.8772 47C40.8772 47 34.5 54.036 34.5 54.036L27.5 42.7085C27.5 42.7085 36.2983 33 49.8772 33C63.4562 33 71.6769 42 71.6769 42L64.6502 53C64.6502 53 58.8772 47 49.8772 47Z' fill='%23C4C4C4'/%3e%3cpath d='M34.5 54.036L48.9999 77.5L64.6502 53C64.6502 53 58.8772 47 49.8772 47C40.8772 47 34.5 54.036 34.5 54.036Z' fill='%23C4C4C4'/%3e%3cpath d='M15.1406 22.7083L48.9999 77.5M48.9999 77.5L84.0002 22.7083M48.9999 77.5L34.5 54.036M48.9999 77.5L64.6502 53M34.5 54.036C34.5 54.036 40.8772 47 49.8772 47C58.8772 47 64.6502 53 64.6502 53M34.5 54.036L27.5 42.7085C27.5 42.7085 36.2983 33 49.8772 33C63.4562 33 71.6769 42 71.6769 42L64.6502 53' stroke='black' stroke-width='4'/%3e%3c/svg%3e";
|
|
8636
8836
|
|
|
8637
|
-
var img$
|
|
8837
|
+
var img$J = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M65 16.5L15.5 66H80.5M80.5 66L74 59M80.5 66L75 73' stroke='black' stroke-width='5'/%3e%3cpath d='M55.9524 46.4372L53 51L48.5 42.5H58.5L55.9524 46.4372Z' fill='black'/%3e%3cpath d='M56.5 61.5C56.5 61.5 59.5 58.5 59.5 54C59.5 49.5 55.5 46 55.5 46M53 51L58.5 42.5H48.5L53 51Z' stroke='black' stroke-width='2'/%3e%3cpath d='M77.0859 82.5469L79.2188 78.625H81.9141L78.6016 84.2656L82 90H79.2734L77.0859 86.0156L74.8984 90H72.1719L75.5703 84.2656L72.2578 78.625H74.9531L77.0859 82.5469Z' fill='black'/%3e%3c/svg%3e";
|
|
8638
8838
|
|
|
8639
|
-
var img$
|
|
8839
|
+
var img$I = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect x='18.5' y='18.5' width='64' height='64' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3cpath d='M60.5352 58.7656C59.5859 59.9023 58.2441 60.7871 56.5098 61.4199C54.7754 62.041 52.8535 62.3516 50.7441 62.3516C48.5293 62.3516 46.584 61.8711 44.9082 60.9102C43.2441 59.9375 41.9551 58.5312 41.041 56.6914C40.1387 54.8516 39.6758 52.6895 39.6523 50.2051V48.4648C39.6523 45.9102 40.0801 43.7012 40.9355 41.8379C41.8027 39.9629 43.0449 38.5332 44.6621 37.5488C46.291 36.5527 48.1953 36.0547 50.375 36.0547C53.4102 36.0547 55.7832 36.7812 57.4941 38.2344C59.2051 39.6758 60.2188 41.7793 60.5352 44.5449H55.4023C55.168 43.0801 54.6465 42.0078 53.8379 41.3281C53.041 40.6484 51.9395 40.3086 50.5332 40.3086C48.7402 40.3086 47.375 40.9824 46.4375 42.3301C45.5 43.6777 45.0254 45.6816 45.0137 48.3418V49.9766C45.0137 52.6602 45.5234 54.6875 46.543 56.0586C47.5625 57.4297 49.0566 58.1152 51.0254 58.1152C53.0059 58.1152 54.418 57.6934 55.2617 56.8496V52.4375H50.4629V48.5527H60.5352V58.7656Z' fill='black'/%3e%3c/svg%3e";
|
|
8640
8840
|
|
|
8641
|
-
var img$
|
|
8841
|
+
var img$H = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M54 53V79.6063L46 84V57.6378L54 53Z' fill='%239D9D9C'/%3e%3cpath d='M52.5 49L43.5 54L21 40.25L29.5 34.5L52.5 49Z' fill='%239D9D9C'/%3e%3cpath d='M42.5 56.5V84.5L18 70.6667V44L42.5 56.5Z' fill='%239D9D9C'/%3e%3cpath d='M82.1815 79.7636V36.9565L67.967 45.1793V87.9864L82.1815 79.7636ZM79.2904 33.087L42.9109 11.3207L28.6964 19.5435L65.5578 40.8261L79.2904 33.087ZM53.9934 79.2799V52.9185L46.2838 57.5136V83.6331L53.9934 79.2799ZM63.1485 45.1793L26.2871 23.6549V31.6359L27.7327 30.9103H27.9736L29.1782 30.1848L59.0528 48.0815V82.1821L55.6799 83.6331L63.1485 87.9864V45.1793ZM41.4653 57.5136L18.8185 44.4538V70.5734L41.4653 83.6331V57.5136ZM21.2277 40.1005L43.8746 53.1603L51.3432 48.8071L29.1782 35.5054L21.2277 40.1005ZM21.4686 34.538V18.3342L22.6733 17.6087L41.7063 6.72554L42.9109 6L87 32.1196V82.6658L65.5578 95L50.8614 86.5353L43.6337 90.6467L14 73.2337V38.8913L15.2046 38.1658L21.4686 34.538Z' fill='black'/%3e%3c/svg%3e";
|
|
8642
8842
|
|
|
8643
|
-
var img$
|
|
8843
|
+
var img$G = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M46.9476 18C64.6143 18 79 32.5294 79 50.3726C79 68.2157 64.6143 83 46.9476 83C39.3762 83 32.5619 80.451 27.0095 76.1176C29.281 75.3529 31.8048 74.3333 34.0762 72.549C37.1048 70 39.1238 67.1961 40.1333 64.1373C42.1524 65.1569 44.4238 65.6667 46.9476 65.6667C55.2762 65.6667 62.0905 58.7843 62.0905 50.3726C62.0905 41.9608 55.2762 35.5 46.9476 35.5C44.1714 35.5 41.2714 36.7255 39 38C37.9905 35.1961 35.2762 31.7941 32.5 29.5C30.2286 27.7157 28.0238 26.5098 25.5 26C31.3048 21.1569 39.1238 18 46.9476 18Z' fill='%239D9D9C'/%3e%3cpath d='M31.5682 68.64C29.1136 70.6 26.6591 71.72 24.4773 72C24.2045 72 23.9318 72 23.6591 72C22.5682 72 21.75 71.72 21.4773 71.16L21.2045 70.6C20.9318 70.04 20.9318 68.92 21.2045 67.8C22.0227 65.56 23.6591 63.32 25.8409 61.36C28.2955 59.4 31.2955 58 33.4773 58C34.2955 58 35.1136 58 35.6591 58.84C36.2045 59.4 35.9318 60.52 35.9318 61.36C35.9318 63.88 34.0227 66.68 31.5682 68.64Z' fill='white'/%3e%3cpath d='M20.3098 30.8104C20.8464 30.2701 21.9197 30 22.993 30C25.1395 30.2701 27.8226 31.3506 29.9691 33.2414C32.3839 35.1323 34.2621 37.5634 34.7988 39.7243C35.0671 40.5347 35.0671 41.345 34.7988 41.8853L34.5304 42.1554C33.9938 42.6956 33.1889 42.9658 32.6523 42.9658C30.2374 43.2359 27.286 41.8853 24.8712 39.7243C22.7246 38.1036 21.1148 35.9426 20.3098 33.7817C20.0415 33.2414 19.7732 31.6207 20.3098 30.8104Z' fill='white'/%3e%3cpath d='M24.4306 71.3333C26.4499 71.0808 28.7216 70.0707 30.9933 68.303C33.265 66.5354 35.0319 64.0101 35.2843 61.9899C35.5367 61.4848 35.5367 60.4747 35.0319 59.7172C34.5271 59.2121 33.5174 58.9596 33.0126 58.9596C30.9933 58.9596 28.2168 59.9697 25.9451 61.9899C23.9258 63.7576 22.1589 65.7778 21.654 67.798C21.4016 68.8081 21.4016 69.8182 21.654 70.3232L21.9065 70.5758C22.4113 71.0808 22.9161 71.3333 23.9258 71.3333C23.9258 71.3333 24.1782 71.3333 24.4306 71.3333ZM20.8968 31.4343C20.1396 32.4444 20.6444 33.7071 20.8968 34.4646C21.654 36.4848 23.1685 38.5051 25.1878 40.0202C27.4595 42.0404 30.4885 43.0505 32.5078 43.0505C33.0126 43.0505 34.0223 42.798 34.2747 42.2929L34.5271 42.0404C34.7795 41.5354 34.7795 40.7778 34.5271 40.0202C34.0223 38 32.2554 35.7273 29.9837 33.9596C27.9644 32.1919 25.4402 31.1818 23.4209 30.9293C22.4113 30.6768 21.4016 30.9293 20.8968 31.4343ZM84 50.6263C84 71.0808 67.3408 88 46.8953 88C35.2843 88 24.9354 82.697 18.1203 74.3636C17.8679 74.1111 17.8679 74.1111 17.6154 73.8586C17.6154 73.6061 17.363 73.6061 17.363 73.3535L17.1106 73.101C17.1106 72.8485 16.8582 72.8485 16.8582 72.596C16.101 70.8283 16.101 68.8081 16.8582 66.2828C17.8679 63.5051 19.8872 60.4747 22.9161 58.202C26.1975 55.6768 29.9837 54.1616 33.265 54.1616C35.5368 54.1616 37.5561 54.9192 39.0705 56.4343L39.3229 56.6869C39.5754 56.6869 39.5754 56.9394 39.5754 57.1919C41.3422 59.4646 44.1188 60.7273 47.1477 60.7273C52.7008 60.7273 57.2442 56.1818 57.2442 50.6263C57.2442 45.0707 52.7008 40.5253 47.1477 40.5253C43.8664 40.5253 40.8374 42.0404 39.0705 44.5657C38.8181 44.8182 38.8181 45.0707 38.5657 45.3232C37.3036 46.8384 35.5367 47.8485 33.0126 47.8485C32.7602 47.8485 32.7602 47.8485 32.5078 47.8485C29.2264 47.8485 25.4402 46.3333 22.4113 43.8081C19.6347 41.5354 17.6154 38.7576 16.6058 35.9798C15.5961 32.9495 15.8486 30.1717 17.363 28.1515L17.6154 27.6465L17.8679 27.3939C24.683 18.8081 35.2843 13 47.1477 13C67.3408 13.2525 84 29.9192 84 50.6263ZM78.9517 50.6263C78.9517 32.9495 64.5642 18.5556 46.8953 18.5556C39.0705 18.5556 31.7506 21.3333 26.1975 26.1313C28.7216 26.6364 31.2457 27.899 33.5174 29.6667C36.294 31.9394 38.3133 34.7172 39.3229 37.495C41.5947 36.2323 44.1188 35.4747 47.1477 35.4747C55.4774 35.4747 62.2925 42.2929 62.2925 50.6263C62.2925 58.9596 55.4774 65.7778 47.1477 65.7778C44.6236 65.7778 42.3519 65.2727 40.3326 64.2626C39.5754 67.0404 37.3036 70.0707 34.2747 72.596C32.003 74.3636 29.7313 75.6263 27.2071 76.1313C32.7602 80.4242 39.5754 82.9495 47.1477 82.9495C64.5642 82.697 78.9517 68.303 78.9517 50.6263Z' fill='black'/%3e%3c/svg%3e";
|
|
8644
8844
|
|
|
8645
|
-
var img$
|
|
8845
|
+
var img$F = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M54.5901 49.2615V54.9931H48.7076H42.8252V49.2615V43.5299H48.7076H54.5901V49.2615Z' fill='white'/%3e%3cpath d='M48.7074 54.9931V79.8303M42.825 43.5299L34.0766 35.0832L42.825 43.5299ZM42.825 43.5299V49.2615V43.5299ZM42.825 43.5299H48.7074H42.825ZM42.825 54.9931L34.0766 64.1437L42.825 54.9931ZM42.825 54.9931V49.2615V54.9931ZM42.825 54.9931H48.7074H42.825ZM54.5899 54.9931L63.0365 64.1437L54.5899 54.9931ZM54.5899 54.9931V49.2615V54.9931ZM54.5899 54.9931H48.7074H54.5899ZM54.5899 43.5299L63.0365 35.0832L54.5899 43.5299ZM54.5899 43.5299V49.2615V43.5299ZM54.5899 43.5299H48.7074H54.5899ZM54.5899 49.2615H79.1253H54.5899ZM42.825 49.2615H17.9878H42.825ZM48.7074 43.5299V18.9944V43.5299Z' stroke='black' stroke-width='4'/%3e%3c/svg%3e";
|
|
8646
8846
|
|
|
8647
|
-
var img$
|
|
8847
|
+
var img$E = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M82 23.5C82 25.8684 80.0541 28 77.3784 28C76.6486 28 75.9189 27.7632 75.1892 27.5263C74.2162 27.0526 73.4865 26.1053 73.2432 25.1579C73 24.6842 73 24.2105 73 23.5C73 21.1316 74.9459 19 77.6216 19C80.0541 19 82 21.1316 82 23.5Z' fill='%239D9D9C'/%3e%3cpath d='M73.359 25.2051C73.6026 26.1795 74.5769 27.1538 75.3077 27.641C76.0385 28.1282 76.7692 28.1282 77.5 28.1282C79.9359 28.1282 82.1282 26.1795 82.1282 23.5C82.1282 20.8205 80.1795 18.8718 77.5 18.8718C75.0641 18.8718 72.8718 20.8205 72.8718 23.5C73.1154 23.9872 73.1154 24.7179 73.359 25.2051ZM77.5 14C82.6154 14 87 18.141 87 23.5C87 28.859 82.859 33 77.5 33C76.0385 33 74.3333 32.5128 73.1154 31.7821C72.8718 31.7821 72.6282 31.5385 72.6282 31.2949C71.1667 30.5641 70.1923 29.1026 69.2179 27.641C68.9744 27.3974 68.9744 26.9103 68.7308 26.6667C68.2436 25.6923 68 24.4744 68 23.2564C68.2436 18.3846 72.3846 14 77.5 14Z' fill='black'/%3e%3cpath d='M69.5946 28C70.3243 29.4516 71.5405 30.6613 73 31.629L31.4054 73C30.4324 71.5484 29.2162 70.3387 28 69.6129L69.5946 28Z' fill='black'/%3e%3cpath d='M19 77.6216C19 75.1892 20.8947 73 23.5 73C24.2105 73 24.6842 73.2432 25.3947 73.2432C26.3421 73.7297 27.2895 74.4595 27.5263 75.4324C27.7632 75.9189 28 76.6487 28 77.3784C28 79.8108 26.1053 82 23.5 82C20.8947 82 19 80.0541 19 77.6216Z' fill='%239D9D9C'/%3e%3cpath d='M23.5 81.8846C25.9359 81.8846 28.1282 79.9359 28.1282 77.2564C28.1282 76.5256 27.8846 75.7949 27.641 75.3077C27.1538 74.3333 26.4231 73.6026 25.4487 73.1154C24.9615 72.8718 24.2308 72.8718 23.5 72.8718C21.0641 72.8718 18.8718 74.8205 18.8718 77.5C19.1154 79.9359 21.0641 81.8846 23.5 81.8846ZM32.0256 73.359C32.7564 74.5769 33 76.0385 33 77.5C33 82.6154 28.859 87 23.5 87C18.3846 87 14 82.859 14 77.5C14 72.141 18.141 68 23.5 68C24.7179 68 25.9359 68.2436 27.1538 68.7308C27.3974 68.9744 27.641 68.9744 27.8846 69.2179C29.3462 69.9487 30.5641 71.1667 31.2949 72.6282C31.7821 72.8718 32.0256 73.1154 32.0256 73.359Z' fill='black'/%3e%3c/svg%3e";
|
|
8648
8848
|
|
|
8649
|
-
var img$
|
|
8849
|
+
var img$D = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect x='12.5' y='22.5' width='77' height='53' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3ccircle cx='89' cy='24' r='8.5' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3ccircle cx='13' cy='76' r='8.5' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3c/svg%3e";
|
|
8650
8850
|
|
|
8651
|
-
var img$
|
|
8851
|
+
var img$C = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M45 17.5C45 14.6053 47.3158 12 50.5 12C53.3947 12 56 14.3158 56 17.5C56 20.3947 53.6842 23 50.5 23C47.3158 22.7105 45 20.3947 45 17.5Z' fill='%239D9D9C'/%3e%3cpath d='M84 53.72C84 71.92 68.8594 87 50 87V62.82H58.5V45.5H50V27C54.25 27 57.7031 24.64 59.2969 21C75 25 84 38.64 84 53.72Z' fill='%239D9D9C'/%3e%3cpath d='M46.4 49.9565V57.5217H53.8571V49.9565H46.4ZM50 63H41V45H50H59V63H50V63Z' fill='black'/%3e%3cpath d='M37 15H31V20H37V15Z' fill='black'/%3e%3cpath d='M16 15H10V20H16V15Z' fill='black'/%3e%3cpath d='M26 15H21V20H26V15Z' fill='black'/%3e%3cpath d='M89 53.1728C89 74.4228 71.7059 92 50.2193 92V89.3765V86.7531C68.5615 86.7531 83.7594 71.7994 83.7594 53.1728C83.7594 37.9568 73.5401 25.1019 59.6524 21.1667C58.0802 24.8395 54.4118 27.463 50.2193 27.463C44.7166 27.463 40 23.0031 40 17.2315C40 11.7222 44.4545 7 50.2193 7C55.4599 7 59.6524 10.9352 60.1765 15.9198C76.6845 20.3796 89 35.3333 89 53.1728ZM50.2193 12.2469C47.5989 12.2469 45.2406 14.3457 45.2406 17.2315C45.2406 19.8549 47.3369 22.216 50.2193 22.216C52.8396 22.216 55.1979 20.1173 55.1979 17.2315C55.1979 14.3457 53.1016 12.2469 50.2193 12.2469Z' fill='black'/%3e%3c/svg%3e";
|
|
8652
8852
|
|
|
8653
|
-
var img$
|
|
8853
|
+
var img$B = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cmask id='path-1-inside-1' fill='white'%3e%3cpath d='M10.6184 60.8555C10.6184 50.4737 14.7426 40.5171 22.0836 33.1761C29.4246 25.8351 39.3812 21.7109 49.7629 21.7109C60.1447 21.7109 70.1013 25.8351 77.4423 33.1761C84.7833 40.5171 88.9074 50.4737 88.9074 60.8554L49.7629 60.8555L10.6184 60.8555Z'/%3e%3c/mask%3e%3cpath d='M10.6184 60.8555C10.6184 50.4737 14.7426 40.5171 22.0836 33.1761C29.4246 25.8351 39.3812 21.7109 49.7629 21.7109C60.1447 21.7109 70.1013 25.8351 77.4423 33.1761C84.7833 40.5171 88.9074 50.4737 88.9074 60.8554L49.7629 60.8555L10.6184 60.8555Z' stroke='black' stroke-width='12' mask='url(%23path-1-inside-1)'/%3e%3cpath d='M82.9238 60.8556C82.9238 52.0608 79.43 43.6262 73.2112 37.4074C66.9924 31.1885 58.5578 27.6948 49.763 27.6948C40.9683 27.6948 32.5337 31.1885 26.3149 37.4074C20.096 43.6262 16.6023 52.0608 16.6023 60.8556L49.763 60.8556H82.9238Z' fill='%23C4C4C4'/%3e%3ccircle cx='13.5545' cy='60.8554' r='7.04754' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3ccircle cx='86.4455' cy='60.8554' r='7.04754' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3crect x='43.5242' y='53.8079' width='12.4774' height='12.4774' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3c/svg%3e";
|
|
8654
8854
|
|
|
8655
|
-
var img$
|
|
8855
|
+
var img$A = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M84 63.5C84 58.9694 83.1076 54.4832 81.3738 50.2974C79.6401 46.1117 77.0988 42.3084 73.8952 39.1048C70.6916 35.9012 66.8883 33.3599 62.7026 31.6262C58.5168 29.8924 54.0306 29 49.5 29C44.9694 29 40.4832 29.8924 36.2974 31.6262C32.1117 33.3599 28.3084 35.9012 25.1048 39.1048C21.9012 42.3084 19.3599 46.1117 17.6262 50.2974C15.8924 54.4832 15 58.9694 15 63.5L49.5 63.5H84Z' fill='%23C4C4C4'/%3e%3cpath d='M84 63.5C84 58.9694 83.1076 54.4832 81.3738 50.2974C79.6401 46.1117 77.0988 42.3084 73.8952 39.1048C70.6916 35.9012 66.8883 33.3599 62.7026 31.6262C58.5168 29.8924 54.0306 29 49.5 29C44.9694 29 40.4832 29.8924 36.2974 31.6262C32.1117 33.3599 28.3084 35.9012 25.1048 39.1048C21.9012 42.3084 19.3599 46.1117 17.6262 50.2974C15.8924 54.4832 15 58.9694 15 63.5' stroke='black' stroke-width='5'/%3e%3ccircle cx='17.5' cy='63.5' r='8' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3ccircle cx='81.5' cy='63.5' r='8' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3ccircle cx='49.5' cy='31.5' r='8' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3c/svg%3e";
|
|
8656
8856
|
|
|
8657
|
-
var img$
|
|
8857
|
+
var img$z = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M49.7712 85C30.6811 85 15 68.9977 15 49.6349C15 30.2721 30.5448 15 49.9076 15C56.4528 15 63.3478 16.7601 68.5294 20.0327C67.984 21.3963 67.1569 23.2443 67.1569 24.6078C67.1569 30.3349 71.2225 34.6732 77.2222 34.6732C78.5858 34.6732 80.249 34.3036 81.3399 33.7582C83.5216 38.3943 85 44.3169 85 49.7712C85 69.1341 68.8613 85 49.7712 85ZM58.4641 58.4641V41.0784H41.0784V58.4641H58.4641Z' fill='%239D9D9C'/%3e%3cpath d='M55 46H46V55H55V46Z' fill='white'/%3e%3cpath d='M72 25C72 21.8421 74.3158 19 77.5 19C80.3947 19 83 21.5263 83 25C83 28.1579 80.6842 31 77.5 31C74.3158 31 72 28.1579 72 25Z' fill='%239D9D9C'/%3e%3cpath d='M77.4136 30.0678C80.0915 30.0678 82.5017 27.8983 82.5017 24.9153C82.5017 22.2034 80.3593 19.7627 77.4136 19.7627C74.7356 19.7627 72.3254 21.9322 72.3254 24.9153C72.5932 27.6271 74.7356 30.0678 77.4136 30.0678ZM50.6339 84.5763C69.3797 84.5763 84.6441 69.1186 84.6441 49.8644C84.6441 44.4407 83.3051 39.2881 81.1627 34.678C80.0915 34.9492 78.7525 35.4915 77.6814 35.4915C72.0576 35.4915 67.2373 30.8814 67.2373 24.9153C67.2373 23.2881 67.5051 21.9322 68.3085 20.5763C63.2203 17.322 57.061 15.4237 50.6339 15.4237C31.8881 15.4237 16.3559 30.8814 16.3559 50.1356C16.3559 69.3898 31.6203 84.5763 50.6339 84.5763ZM71.522 16.2373C73.1288 15.1525 75.2712 14.339 77.4136 14.339C83.0373 14.339 87.8576 18.9492 87.8576 24.9153C87.8576 27.3559 86.7864 29.7966 85.4475 31.4237C88.3932 37.1186 90 43.3559 90 49.8644C90 72.1017 72.3254 90 50.6339 90C28.9424 90 11 72.1017 11 49.8644C11 27.6271 28.6746 10 50.6339 10C58.4 10 65.6305 12.4407 71.522 16.2373Z' fill='black'/%3e%3cpath d='M46.2174 53.7826H53.7826V46.2174H46.2174V53.7826ZM41 41H59V59H41V41V41Z' fill='black'/%3e%3c/svg%3e";
|
|
8658
8858
|
|
|
8659
|
-
var img$
|
|
8859
|
+
var img$y = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M61.8771 19.8479C71.6505 19.8479 79.795 27.6795 79.795 37.6715V61.9765V71.4284V75.7493V79.5301H75.9942H71.6505H62.1486H37.7152H28.2133H23.8696H20.0688V75.7493V71.4284V61.9765V37.6715V28.2196V23.8987V20.118H23.8696H28.2133H37.7152H61.8771V19.8479Z' fill='%239D9D9C'/%3e%3cpath d='M84.2997 84.2994H62.0418H38.1941H16.2012V62.0415V38.1937V16.2008H38.4591H62.3068C65.7515 16.2008 69.1962 16.9957 72.1109 18.5856C73.4358 19.3805 74.7606 20.1754 75.8205 20.9704C77.1454 22.0303 78.4703 23.3551 79.5302 24.68C80.3251 25.7399 81.385 27.0648 81.915 28.3897C83.5048 31.3044 84.2997 34.7491 84.2997 38.4587V62.3065V84.2994V84.2994ZM79.5302 38.4587C79.5302 28.9196 71.5809 20.9704 62.0418 20.9704H38.1941H28.92H24.6804H20.9707V24.68V28.9196V38.1937V62.0415V71.3156V75.5552V79.2649H24.6804H28.92H38.1941H62.0418H71.316H75.5556H79.2652V75.5552V71.3156V62.0415V38.4587H79.5302Z' fill='black'/%3e%3c/svg%3e";
|
|
8660
8860
|
|
|
8661
|
-
var img$
|
|
8861
|
+
var img$x = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M43.5 70L18 81L21 61L27.5 56.5L43.5 70Z' fill='white'/%3e%3cpath d='M90 84V91H10V87.5L20.8949 84H90Z' fill='black'/%3e%3cpath d='M67 18L79 30.1141L43.5 66L31 53.5L67 18Z' fill='%239D9D9C'/%3e%3cpath d='M78.3496 29.9585L67.2276 18.9046L32.0081 53.6017L43.1301 64.6556L78.3496 29.9585ZM23.0488 62.8133L19.0325 78.166L34.1707 73.8672L39.1138 68.9544L27.6829 57.9004L23.0488 62.8133ZM11 84L17.1789 59.7427L25.2114 51.7593L67.2276 10L87 29.6515L37.2602 79.3942L20.8862 84H11Z' fill='black'/%3e%3cpath d='M21 84L10 88L10.6286 84H21Z' fill='black'/%3e%3c/svg%3e";
|
|
8662
8862
|
|
|
8663
|
-
var img$
|
|
8863
|
+
var img$w = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect x='12.5' y='10.5' width='19' height='19' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3crect x='12.5' y='70.5' width='19' height='19' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3crect x='69.5' y='70.5' width='19' height='19' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3cpath d='M21.5 62V47.5' stroke='black' stroke-width='3'/%3e%3cpath d='M26 47H17L21.5 39L26 47Z' fill='black' stroke='black'/%3e%3cpath d='M39 80.5L53.5 80.5' stroke='black' stroke-width='3'/%3e%3cpath d='M54 85L54 76L62 80.5L54 85Z' fill='black' stroke='black'/%3e%3c/svg%3e";
|
|
8664
8864
|
|
|
8665
|
-
var img$
|
|
8865
|
+
var img$v = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect x='56.5' y='40.5' width='19' height='19' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3crect x='24.5' y='70.5' width='19' height='19' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3crect x='24.5' y='10.5' width='19' height='19' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3cpath d='M64 23L64 26L59 23L64 20L64 23Z' fill='black'/%3e%3cpath d='M70 32C70 32 69.9661 27.6452 68.5 25.5C67.0339 23.3548 64 23 64 23M64 26L64 20L59 23L64 26Z' stroke='black' stroke-width='2'/%3e%3cpath d='M67.0001 73.9992L64.0001 73.9984L67 69L70.0001 74L67.0001 73.9992Z' fill='black'/%3e%3cpath d='M58.0001 80C58.0001 80 62.1802 80 64.5 78.5C66.8198 77 67.0001 73.9992 67.0001 73.9992M64.0001 73.9984L70.0001 74L67 69L64.0001 73.9984Z' stroke='black' stroke-width='2'/%3e%3ccircle cx='34' cy='50' r='6.5' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3c/svg%3e";
|
|
8666
8866
|
|
|
8667
|
-
var img$
|
|
8867
|
+
var img$u = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='49.5' y1='16' x2='49.5' y2='85' stroke='black' stroke-width='5'/%3e%3crect x='11.5' y='37.5' width='25' height='25' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3crect x='63.5' y='37.5' width='25' height='25' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3c/svg%3e";
|
|
8668
8868
|
|
|
8669
|
-
var img$
|
|
8869
|
+
var img$t = "data:image/svg+xml,%3csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect x='18.5' y='18.5' width='64' height='64' fill='%23C4C4C4' stroke='black' stroke-width='5'/%3e%3cpath d='M48.6562 36.4062V53.2637C48.6562 56.0645 47.7773 58.2793 46.0195 59.9082C44.2734 61.5371 41.8828 62.3516 38.8477 62.3516C35.8594 62.3516 33.4863 61.5605 31.7285 59.9785C29.9707 58.3965 29.0742 56.2227 29.0391 53.457V36.4062H34.3125V53.2988C34.3125 54.9746 34.7109 56.1992 35.5078 56.9727C36.3164 57.7344 37.4297 58.1152 38.8477 58.1152C41.8125 58.1152 43.3184 56.5566 43.3652 53.4395V36.4062H48.6562ZM66.252 55.2852C66.252 54.2891 65.9004 53.5273 65.1973 53C64.4941 52.4609 63.2285 51.8984 61.4004 51.3125C59.5723 50.7148 58.125 50.1289 57.0586 49.5547C54.1523 47.9844 52.6992 45.8691 52.6992 43.209C52.6992 41.8262 53.0859 40.5957 53.8594 39.5176C54.6445 38.4277 55.7637 37.5781 57.2168 36.9688C58.6816 36.3594 60.3223 36.0547 62.1387 36.0547C63.9668 36.0547 65.5957 36.3887 67.0254 37.0566C68.4551 37.7129 69.5625 38.6445 70.3477 39.8516C71.1445 41.0586 71.543 42.4297 71.543 43.9648H66.2695C66.2695 42.793 65.9004 41.8848 65.1621 41.2402C64.4238 40.584 63.3867 40.2559 62.0508 40.2559C60.7617 40.2559 59.7598 40.5312 59.0449 41.082C58.3301 41.6211 57.9727 42.3359 57.9727 43.2266C57.9727 44.0586 58.3887 44.7559 59.2207 45.3184C60.0645 45.8809 61.3008 46.4082 62.9297 46.9004C65.9297 47.8027 68.1152 48.9219 69.4863 50.2578C70.8574 51.5938 71.543 53.2578 71.543 55.25C71.543 57.4648 70.7051 59.2051 69.0293 60.4707C67.3535 61.7246 65.0977 62.3516 62.2617 62.3516C60.293 62.3516 58.5 61.9941 56.8828 61.2793C55.2656 60.5527 54.0293 59.5625 53.1738 58.3086C52.3301 57.0547 51.9082 55.6016 51.9082 53.9492H57.1992C57.1992 56.7734 58.8867 58.1855 62.2617 58.1855C63.5156 58.1855 64.4941 57.9336 65.1973 57.4297C65.9004 56.9141 66.252 56.1992 66.252 55.2852Z' fill='black'/%3e%3c/svg%3e";
|
|
8670
8870
|
|
|
8671
8871
|
const RootContext = /*#__PURE__*/React.createContext({
|
|
8672
8872
|
drawingId: -1,
|
|
@@ -8874,7 +9074,7 @@ const RectPattern = () => {
|
|
|
8874
9074
|
classcad.ccAPI.sketcher.copyRectangularPattern(drawingId, sketchId, rigidSetOrObjId, originIndex, translate, numX - 1, numY - 1).then(() => {
|
|
8875
9075
|
core.getDrawing(drawingId).api.selection.setItems(rgSetSelId, []);
|
|
8876
9076
|
core.getDrawing(drawingId).api.selection.setItems(originSelId, []);
|
|
8877
|
-
}).catch();
|
|
9077
|
+
}).catch(console.warn);
|
|
8878
9078
|
}, [drawingId, numX, numY, offsetX, offsetY, originSelId, rgSetSelId, sketchId, rigidSetOrObjId]);
|
|
8879
9079
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Wrapper, {
|
|
8880
9080
|
caption: "Num X"
|
|
@@ -8967,7 +9167,7 @@ const CircPattern = () => {
|
|
|
8967
9167
|
classcad.ccAPI.sketcher.copyCircularPattern(drawingId, sketchId, rigidSetId, rotationOriginPoint, angleStep, numSteps - 1).then(() => {
|
|
8968
9168
|
core.getDrawing(drawingId).api.selection.setItems(rgSetSelId, []);
|
|
8969
9169
|
core.getDrawing(drawingId).api.selection.setItems(originSelId, []);
|
|
8970
|
-
}).catch();
|
|
9170
|
+
}).catch(console.warn);
|
|
8971
9171
|
}, [drawingId, sketchId, angle, numSteps, rgSetSelId, originSelId]);
|
|
8972
9172
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Wrapper, {
|
|
8973
9173
|
caption: "Num"
|
|
@@ -9031,7 +9231,7 @@ const MirrorPattern = () => {
|
|
|
9031
9231
|
return;
|
|
9032
9232
|
}
|
|
9033
9233
|
|
|
9034
|
-
classcad.ccAPI.sketcher.copyMirrorPattern(drawingId, sketchId, rigidSetId, lineId);
|
|
9234
|
+
classcad.ccAPI.sketcher.copyMirrorPattern(drawingId, sketchId, rigidSetId, lineId).catch(console.warn);
|
|
9035
9235
|
}, [drawingId, sketchId, rgSetSelId, lineSelId]);
|
|
9036
9236
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Wrapper, {
|
|
9037
9237
|
caption: "Rigidset/Object"
|
|
@@ -9055,44 +9255,44 @@ const MirrorPattern = () => {
|
|
|
9055
9255
|
};
|
|
9056
9256
|
|
|
9057
9257
|
const resources = {
|
|
9058
|
-
[classcad.CCClasses.CC2DFixationConstraint]: img$
|
|
9059
|
-
[classcad.CCClasses.CC2DHorizontalConstraint]: img$
|
|
9060
|
-
[classcad.CCClasses.CC2DVerticalConstraint]: img$
|
|
9061
|
-
[classcad.CCClasses.CC2DCoincidentConstraint]: img$
|
|
9062
|
-
[classcad.CCClasses.CC2DTangentSketchConstraint]: img$
|
|
9063
|
-
[classcad.CCClasses.CC2DParallelConstraint]: img$
|
|
9064
|
-
[classcad.CCClasses.CC2DPerpendicularConstraint]: img$
|
|
9065
|
-
[classcad.CCClasses.CC2DColinearConstraint]: img$
|
|
9066
|
-
[classcad.CCClasses.CC2DConcentricConstraint]: img$
|
|
9067
|
-
[classcad.CCClasses.CC2DMidpointConstraint]: img$
|
|
9068
|
-
[classcad.CCClasses.CC2DSymmetryConstraint]: img$
|
|
9069
|
-
[classcad.CCClasses.CC2DEqualLengthConstraint]: img$
|
|
9070
|
-
[classcad.CCClasses.CC2DEqualRadiusConstraint]: img$
|
|
9071
|
-
[classcad.CCClasses.CC2DHorizontalDistanceConstraint]: img$
|
|
9072
|
-
[classcad.CCClasses.CC2DVerticalDistanceConstraint]: img$
|
|
9073
|
-
[classcad.CCClasses.CC2DOffsetConstraint]: img$
|
|
9074
|
-
[classcad.CCClasses.CC2DRadiusConstraint]: img$
|
|
9075
|
-
[classcad.CCClasses.CC2DDiameterConstraint]: img$
|
|
9076
|
-
[classcad.CCClasses.CC2DAngleConstraint]: img$
|
|
9077
|
-
[classcad.CCClasses.CC2DAngleOXConstraint]: img$
|
|
9078
|
-
[classcad.CCClasses.CCRigidSet]: img$
|
|
9079
|
-
[classcad.CCClasses.CCUse]: img$
|
|
9080
|
-
[classcad.CCClasses.CCExtrusion]: img$
|
|
9081
|
-
[classcad.CCClasses.CCRevolve]: img$
|
|
9082
|
-
[classcad.CCClasses.CCRevolve]: img$
|
|
9083
|
-
[HandlersList.DRAWPOINT]: img$
|
|
9084
|
-
[HandlersList.DRAWLINE]: img$
|
|
9085
|
-
[HandlersList.DRAWRECTANGLE]: img$
|
|
9086
|
-
[HandlersList.DRAWARCTANGENT]: img$
|
|
9087
|
-
[HandlersList.DRAWARCCENTER]: img$
|
|
9088
|
-
[HandlersList.DRAWARCMIDDLE]: img$
|
|
9089
|
-
[HandlersList.DRAWCIRCLE]: img$
|
|
9090
|
-
[HandlersList.FILLET]: img$
|
|
9091
|
-
[HandlersList.TRIM]: img$
|
|
9092
|
-
[HandlersList.USEREF]: img$
|
|
9093
|
-
[Patterns.RECTANGULAR]: img$
|
|
9094
|
-
[Patterns.CIRCULAR]: img$
|
|
9095
|
-
[Patterns.MIRROR]: img$
|
|
9258
|
+
[classcad.CCClasses.CC2DFixationConstraint]: img$_,
|
|
9259
|
+
[classcad.CCClasses.CC2DHorizontalConstraint]: img$Z,
|
|
9260
|
+
[classcad.CCClasses.CC2DVerticalConstraint]: img$Y,
|
|
9261
|
+
[classcad.CCClasses.CC2DCoincidentConstraint]: img$X,
|
|
9262
|
+
[classcad.CCClasses.CC2DTangentSketchConstraint]: img$W,
|
|
9263
|
+
[classcad.CCClasses.CC2DParallelConstraint]: img$V,
|
|
9264
|
+
[classcad.CCClasses.CC2DPerpendicularConstraint]: img$U,
|
|
9265
|
+
[classcad.CCClasses.CC2DColinearConstraint]: img$T,
|
|
9266
|
+
[classcad.CCClasses.CC2DConcentricConstraint]: img$S,
|
|
9267
|
+
[classcad.CCClasses.CC2DMidpointConstraint]: img$R,
|
|
9268
|
+
[classcad.CCClasses.CC2DSymmetryConstraint]: img$Q,
|
|
9269
|
+
[classcad.CCClasses.CC2DEqualLengthConstraint]: img$P,
|
|
9270
|
+
[classcad.CCClasses.CC2DEqualRadiusConstraint]: img$P,
|
|
9271
|
+
[classcad.CCClasses.CC2DHorizontalDistanceConstraint]: img$O,
|
|
9272
|
+
[classcad.CCClasses.CC2DVerticalDistanceConstraint]: img$N,
|
|
9273
|
+
[classcad.CCClasses.CC2DOffsetConstraint]: img$M,
|
|
9274
|
+
[classcad.CCClasses.CC2DRadiusConstraint]: img$L,
|
|
9275
|
+
[classcad.CCClasses.CC2DDiameterConstraint]: img$M,
|
|
9276
|
+
[classcad.CCClasses.CC2DAngleConstraint]: img$K,
|
|
9277
|
+
[classcad.CCClasses.CC2DAngleOXConstraint]: img$J,
|
|
9278
|
+
[classcad.CCClasses.CCRigidSet]: img$I,
|
|
9279
|
+
[classcad.CCClasses.CCUse]: img$t,
|
|
9280
|
+
[classcad.CCClasses.CCExtrusion]: img$H,
|
|
9281
|
+
[classcad.CCClasses.CCRevolve]: img$G,
|
|
9282
|
+
[classcad.CCClasses.CCRevolve]: img$G,
|
|
9283
|
+
[HandlersList.DRAWPOINT]: img$F,
|
|
9284
|
+
[HandlersList.DRAWLINE]: img$E,
|
|
9285
|
+
[HandlersList.DRAWRECTANGLE]: img$D,
|
|
9286
|
+
[HandlersList.DRAWARCTANGENT]: img$C,
|
|
9287
|
+
[HandlersList.DRAWARCCENTER]: img$B,
|
|
9288
|
+
[HandlersList.DRAWARCMIDDLE]: img$A,
|
|
9289
|
+
[HandlersList.DRAWCIRCLE]: img$z,
|
|
9290
|
+
[HandlersList.FILLET]: img$y,
|
|
9291
|
+
[HandlersList.TRIM]: img$x,
|
|
9292
|
+
[HandlersList.USEREF]: img$t,
|
|
9293
|
+
[Patterns.RECTANGULAR]: img$w,
|
|
9294
|
+
[Patterns.CIRCULAR]: img$v,
|
|
9295
|
+
[Patterns.MIRROR]: img$u
|
|
9096
9296
|
};
|
|
9097
9297
|
const textures = {};
|
|
9098
9298
|
const textureLoader = new THREE__namespace.TextureLoader();
|
|
@@ -9100,55 +9300,87 @@ Object.entries(resources).forEach(([key, value]) => {
|
|
|
9100
9300
|
textures[key] = textureLoader.load(value);
|
|
9101
9301
|
});
|
|
9102
9302
|
|
|
9103
|
-
|
|
9104
|
-
|
|
9303
|
+
// Checker functions return either 0, if check failed, or an index otherwise.
|
|
9304
|
+
// The index is set on creation; it determines the order of entities for constraint creation.
|
|
9305
|
+
// Index should be a number if the entity should be constrainted directly, or an array of numbers, if its children should be constrainted.
|
|
9306
|
+
// In a single input-describing array for n-sized output, indices should be in range [1, n], without spaces and unique.
|
|
9307
|
+
// e.g. if we want both [line, point] and [point, line] pairs to be selectable for the constraint, and the output should be [point1, point2, point3], with point2 always being an original point, the indices should be set like this:
|
|
9308
|
+
// [line([1, 3]), point(2)], [point(2), line([1, 3])]
|
|
9309
|
+
|
|
9310
|
+
function point(index) {
|
|
9311
|
+
return object => {
|
|
9312
|
+
return object.class === classcad.CCClasses.CCPoint ? index : 0;
|
|
9313
|
+
};
|
|
9105
9314
|
}
|
|
9106
9315
|
|
|
9107
|
-
function line(
|
|
9108
|
-
return object
|
|
9316
|
+
function line(index) {
|
|
9317
|
+
return object => {
|
|
9318
|
+
return object.class === classcad.CCClasses.CCLine ? index : 0;
|
|
9319
|
+
};
|
|
9109
9320
|
}
|
|
9110
9321
|
|
|
9111
|
-
function notLine(
|
|
9112
|
-
return
|
|
9322
|
+
function notLine(index) {
|
|
9323
|
+
return object => {
|
|
9324
|
+
return object.class === classcad.CCClasses.CCPoint || object.class === classcad.CCClasses.CCArc || object.class === classcad.CCClasses.CCCircle ? index : 0;
|
|
9325
|
+
};
|
|
9113
9326
|
}
|
|
9114
9327
|
|
|
9115
|
-
function arc(
|
|
9116
|
-
return object
|
|
9328
|
+
function arc(index) {
|
|
9329
|
+
return object => {
|
|
9330
|
+
return object.class === classcad.CCClasses.CCArc || object.class === classcad.CCClasses.CCCircle ? index : 0;
|
|
9331
|
+
};
|
|
9117
9332
|
}
|
|
9118
9333
|
|
|
9119
|
-
function curve(
|
|
9120
|
-
return
|
|
9334
|
+
function curve(index) {
|
|
9335
|
+
return object => {
|
|
9336
|
+
return object.class === classcad.CCClasses.CCLine || object.class === classcad.CCClasses.CCArc || object.class === classcad.CCClasses.CCCircle ? index : 0;
|
|
9337
|
+
};
|
|
9121
9338
|
}
|
|
9122
9339
|
|
|
9123
|
-
function any(
|
|
9124
|
-
return
|
|
9340
|
+
function any(index) {
|
|
9341
|
+
return object => {
|
|
9342
|
+
return object.class === classcad.CCClasses.CCPoint || object.class === classcad.CCClasses.CCLine || object.class === classcad.CCClasses.CCArc || object.class === classcad.CCClasses.CCCircle ? index : 0;
|
|
9343
|
+
};
|
|
9344
|
+
} // Entity adapters.
|
|
9345
|
+
// Some constraints should support multi-creation if entity selection allows so.
|
|
9346
|
+
// These are entity-remapping functions, which take the original entity array and create an array of combinations of entities.
|
|
9347
|
+
// These combinations, if further checks are successful, can be used as entities for creating separate constraints
|
|
9348
|
+
|
|
9349
|
+
|
|
9350
|
+
function singular(entities) {
|
|
9351
|
+
return [entities];
|
|
9352
|
+
}
|
|
9353
|
+
|
|
9354
|
+
function multipleUnary(entities) {
|
|
9355
|
+
return entities.map(entity => [entity]);
|
|
9356
|
+
}
|
|
9357
|
+
|
|
9358
|
+
function multipleBinary(entities) {
|
|
9359
|
+
const entities1ToN = entities.slice(1);
|
|
9360
|
+
return entities1ToN.map(entity => [entities[0], entity]);
|
|
9125
9361
|
}
|
|
9126
9362
|
|
|
9127
9363
|
function createHelper(type, name, ...constraintGeometryCombinations) {
|
|
9128
|
-
const isParametric = constraintGeometryCombinations[0].desc.includes('p');
|
|
9129
|
-
const isCommutative = constraintGeometryCombinations[0].desc.includes('c');
|
|
9130
9364
|
return {
|
|
9131
9365
|
type,
|
|
9132
9366
|
name,
|
|
9133
|
-
isParametric,
|
|
9134
|
-
isCommutative,
|
|
9135
9367
|
|
|
9136
9368
|
adapt(entities, tree) {
|
|
9137
9369
|
entities = [...entities];
|
|
9138
9370
|
|
|
9139
|
-
const
|
|
9140
|
-
if (this.type !== classcad.CCClasses.CCRigidSet &&
|
|
9371
|
+
const checkInput = (input, formattedEntities) => {
|
|
9372
|
+
if (this.type !== classcad.CCClasses.CCRigidSet && input.length !== formattedEntities.length) return false;
|
|
9141
9373
|
let entityIdx = 0; // eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
9142
9374
|
|
|
9143
|
-
for (let i = 0; i <
|
|
9375
|
+
for (let i = 0; i < input.length; i++) {
|
|
9144
9376
|
if (entityIdx >= formattedEntities.length) {
|
|
9145
9377
|
return false;
|
|
9146
9378
|
}
|
|
9147
9379
|
|
|
9148
|
-
const
|
|
9380
|
+
const checker = input[i];
|
|
9149
9381
|
const entity = tree[formattedEntities[entityIdx++]];
|
|
9150
9382
|
|
|
9151
|
-
if (!entity || !
|
|
9383
|
+
if (!entity || !checker(entity)) {
|
|
9152
9384
|
return false;
|
|
9153
9385
|
}
|
|
9154
9386
|
}
|
|
@@ -9164,179 +9396,176 @@ function createHelper(type, name, ...constraintGeometryCombinations) {
|
|
|
9164
9396
|
}
|
|
9165
9397
|
|
|
9166
9398
|
info = [{
|
|
9167
|
-
|
|
9168
|
-
|
|
9399
|
+
entityAdapter: singular,
|
|
9400
|
+
input: entities.map((entity, i) => any(i + 1))
|
|
9169
9401
|
}];
|
|
9170
|
-
} //
|
|
9402
|
+
} // Process specified combinations until a suitable one is found, or there are no combinations left...
|
|
9403
|
+
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
9171
9404
|
|
|
9172
9405
|
|
|
9173
9406
|
for (let i = 0; i < info.length; i++) {
|
|
9174
|
-
const
|
|
9175
|
-
|
|
9176
|
-
const isStrictlyLenient = info[i].desc.includes('L'); // must select lines instead of endpoints
|
|
9177
|
-
|
|
9178
|
-
const isMultySelU = info[i].desc.includes('m'); // allow selecting multiple entities to be constrained; the constraint should be unary, and a separate constraint will be created for each entity
|
|
9179
|
-
|
|
9180
|
-
const isMultySelB = info[i].desc.includes('M'); // allow selecting multiple entities to be constrained; the constraint should be binary, n-1 constraints for entity pairs (1, 2), ..., (1, n) will be created
|
|
9181
|
-
|
|
9182
|
-
if (isMultySelU) {
|
|
9183
|
-
if (entities.length > 0 && entities.every(entity => checkPredicates(info[i].predicates, [entity]))) {
|
|
9184
|
-
return entities.map(entity => [entity]);
|
|
9185
|
-
}
|
|
9186
|
-
} // TODO: refactor into a more linear, less intertwined solution?
|
|
9407
|
+
const input = info[i].input;
|
|
9408
|
+
const entityGroups = info[i].entityAdapter(entities);
|
|
9187
9409
|
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
const entities1ToN = entities.slice(1);
|
|
9191
|
-
|
|
9192
|
-
if (entities1ToN.length > 0 && entities1ToN.every(entity => checkPredicates(info[i].predicates, [entities[0], entity]))) {
|
|
9193
|
-
const entity0 = tree[entities[0]];
|
|
9194
|
-
const entities0 = isStrictlyLenient && entity0 && line(entity0) ? entity0.children || [] : [entities[0]];
|
|
9195
|
-
return entities1ToN.map(entityId => {
|
|
9196
|
-
const entity = tree[entityId];
|
|
9197
|
-
const entities_ = isStrictlyLenient && entity && line(entity) ? entity.children || [] : [entityId];
|
|
9198
|
-
return [...entities0, ...entities_];
|
|
9199
|
-
});
|
|
9200
|
-
}
|
|
9201
|
-
}
|
|
9202
|
-
|
|
9203
|
-
for (let j = 0; j < entities.length; j++) {
|
|
9204
|
-
const entity = tree[entities[j]];
|
|
9205
|
-
if (isLenient && entity && line(entity)) entities.splice(j, 1, ...(entity.children || []));
|
|
9410
|
+
if (entityGroups.length === 0 || entityGroups.some(entityGroup => !checkInput(input, entityGroup))) {
|
|
9411
|
+
continue;
|
|
9206
9412
|
}
|
|
9207
9413
|
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9414
|
+
const output = entityGroups.map(entityGroup => {
|
|
9415
|
+
// Assume there are no index spaces in input checkers...
|
|
9416
|
+
const output_ = [];
|
|
9417
|
+
entityGroup.forEach((entityId, j) => {
|
|
9418
|
+
const checker = input[j];
|
|
9419
|
+
const entity = tree[entityId];
|
|
9420
|
+
const index = checker(entity);
|
|
9421
|
+
|
|
9422
|
+
if (Array.isArray(index)) {
|
|
9423
|
+
index.forEach((index_, k) => {
|
|
9424
|
+
var _entity$children;
|
|
9425
|
+
|
|
9426
|
+
const childId = ((_entity$children = entity.children) == null ? void 0 : _entity$children[k]) || -1;
|
|
9427
|
+
output_[index_ - 1] = childId;
|
|
9428
|
+
});
|
|
9429
|
+
} else {
|
|
9430
|
+
output_[index - 1] = entityId;
|
|
9214
9431
|
}
|
|
9215
|
-
}
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9432
|
+
});
|
|
9433
|
+
return output_;
|
|
9434
|
+
});
|
|
9435
|
+
return output.every(output_ => output_.every(id => id !== -1)) ? output : undefined;
|
|
9219
9436
|
}
|
|
9220
9437
|
|
|
9221
9438
|
return undefined;
|
|
9222
9439
|
}
|
|
9223
9440
|
|
|
9224
9441
|
};
|
|
9225
|
-
}
|
|
9442
|
+
} // TODO: describe in comments how this helpers works
|
|
9443
|
+
|
|
9226
9444
|
|
|
9227
|
-
// TODO: describe in comments how this helpers works
|
|
9228
9445
|
const constraintsHelpers = {
|
|
9229
9446
|
angle: createHelper(classcad.CCClasses.CC2DAngleConstraint, 'Ang', {
|
|
9230
|
-
|
|
9231
|
-
|
|
9447
|
+
entityAdapter: singular,
|
|
9448
|
+
input: [line(1), line(2)]
|
|
9232
9449
|
}),
|
|
9233
9450
|
angleox: createHelper(classcad.CCClasses.CC2DAngleOXConstraint, 'AngOX', {
|
|
9234
|
-
|
|
9235
|
-
|
|
9451
|
+
entityAdapter: singular,
|
|
9452
|
+
input: [line(1)]
|
|
9236
9453
|
}),
|
|
9237
9454
|
colinear: createHelper(classcad.CCClasses.CC2DCoincidentConstraint, 'Colin', {
|
|
9238
|
-
|
|
9239
|
-
|
|
9455
|
+
entityAdapter: multipleBinary,
|
|
9456
|
+
input: [line(1), line(2)]
|
|
9240
9457
|
}, {
|
|
9241
|
-
|
|
9242
|
-
|
|
9458
|
+
entityAdapter: singular,
|
|
9459
|
+
input: [line(1), point(2)]
|
|
9243
9460
|
}, {
|
|
9244
|
-
|
|
9245
|
-
|
|
9461
|
+
entityAdapter: singular,
|
|
9462
|
+
input: [point(2), line(1)]
|
|
9246
9463
|
}),
|
|
9247
9464
|
concentric: createHelper(classcad.CCClasses.CC2DConcentricConstraint, 'Ccntr', {
|
|
9248
|
-
|
|
9249
|
-
|
|
9465
|
+
entityAdapter: multipleBinary,
|
|
9466
|
+
input: [arc(1), arc(2)]
|
|
9250
9467
|
}),
|
|
9251
9468
|
distance: createHelper(classcad.CCClasses.CC2DOffsetConstraint, 'Offset', {
|
|
9252
|
-
|
|
9253
|
-
|
|
9469
|
+
entityAdapter: singular,
|
|
9470
|
+
input: [any(1), any(2)]
|
|
9254
9471
|
}, {
|
|
9255
|
-
|
|
9256
|
-
|
|
9472
|
+
entityAdapter: singular,
|
|
9473
|
+
input: [line([1, 2])]
|
|
9257
9474
|
}),
|
|
9258
9475
|
equalDistance: createHelper(classcad.CCClasses.CC2DEqualLengthConstraint, 'EL', {
|
|
9259
|
-
|
|
9260
|
-
|
|
9476
|
+
entityAdapter: multipleBinary,
|
|
9477
|
+
input: [line([1, 2]), line([3, 4])]
|
|
9261
9478
|
}),
|
|
9262
9479
|
equalRadius: createHelper(classcad.CCClasses.CC2DEqualRadiusConstraint, 'ER', {
|
|
9263
|
-
|
|
9264
|
-
|
|
9480
|
+
entityAdapter: multipleBinary,
|
|
9481
|
+
input: [arc(1), arc(2)]
|
|
9265
9482
|
}),
|
|
9266
9483
|
fixation: createHelper(classcad.CCClasses.CC2DFixationConstraint, 'Fix', {
|
|
9267
|
-
|
|
9268
|
-
|
|
9484
|
+
entityAdapter: multipleUnary,
|
|
9485
|
+
input: [any(1)]
|
|
9269
9486
|
}),
|
|
9270
9487
|
horizontalDistance: createHelper(classcad.CCClasses.CC2DHorizontalDistanceConstraint, 'HD', {
|
|
9271
|
-
|
|
9272
|
-
|
|
9488
|
+
entityAdapter: singular,
|
|
9489
|
+
input: [point(1), point(2)]
|
|
9490
|
+
}, {
|
|
9491
|
+
entityAdapter: singular,
|
|
9492
|
+
input: [line([1, 2])]
|
|
9273
9493
|
}),
|
|
9274
9494
|
horizontality: createHelper(classcad.CCClasses.CC2DHorizontalConstraint, 'H', {
|
|
9275
|
-
|
|
9276
|
-
|
|
9495
|
+
entityAdapter: multipleUnary,
|
|
9496
|
+
input: [line(1)]
|
|
9277
9497
|
}, {
|
|
9278
|
-
|
|
9279
|
-
|
|
9498
|
+
entityAdapter: singular,
|
|
9499
|
+
input: [point(1), point(2)]
|
|
9280
9500
|
}),
|
|
9281
9501
|
incidence: createHelper(classcad.CCClasses.CC2DCoincidentConstraint, 'Coinc', {
|
|
9282
|
-
|
|
9283
|
-
|
|
9502
|
+
entityAdapter: multipleBinary,
|
|
9503
|
+
input: [notLine(1), notLine(2)]
|
|
9284
9504
|
}),
|
|
9285
9505
|
midpoint: createHelper(classcad.CCClasses.CC2DMidpointConstraint, 'MP', {
|
|
9286
|
-
|
|
9287
|
-
|
|
9506
|
+
entityAdapter: singular,
|
|
9507
|
+
input: [point(1), point(2), point(3)]
|
|
9508
|
+
}, {
|
|
9509
|
+
entityAdapter: singular,
|
|
9510
|
+
input: [line([1, 3]), point(2)]
|
|
9511
|
+
}, {
|
|
9512
|
+
entityAdapter: singular,
|
|
9513
|
+
input: [point(2), line([1, 3])]
|
|
9288
9514
|
}),
|
|
9289
9515
|
parallelity: createHelper(classcad.CCClasses.CC2DParallelConstraint, 'Par', {
|
|
9290
|
-
|
|
9291
|
-
|
|
9516
|
+
entityAdapter: multipleBinary,
|
|
9517
|
+
input: [line(1), line(2)]
|
|
9292
9518
|
}),
|
|
9293
9519
|
perpendicularity: createHelper(classcad.CCClasses.CC2DPerpendicularConstraint, 'Perp', {
|
|
9294
|
-
|
|
9295
|
-
|
|
9520
|
+
entityAdapter: singular,
|
|
9521
|
+
input: [line(1), line(2)]
|
|
9296
9522
|
}),
|
|
9297
9523
|
radius: createHelper(classcad.CCClasses.CC2DRadiusConstraint, 'R', {
|
|
9298
|
-
|
|
9299
|
-
|
|
9524
|
+
entityAdapter: singular,
|
|
9525
|
+
input: [arc(1)]
|
|
9300
9526
|
}),
|
|
9301
9527
|
diameter: createHelper(classcad.CCClasses.CC2DDiameterConstraint, 'D', {
|
|
9302
|
-
|
|
9303
|
-
|
|
9528
|
+
entityAdapter: singular,
|
|
9529
|
+
input: [arc(1)]
|
|
9304
9530
|
}),
|
|
9305
9531
|
symmetric: createHelper(classcad.CCClasses.CC2DSymmetryConstraint, 'Symm', {
|
|
9306
|
-
|
|
9307
|
-
|
|
9532
|
+
entityAdapter: singular,
|
|
9533
|
+
input: [line(1), point(2), point(3)]
|
|
9308
9534
|
}, {
|
|
9309
|
-
|
|
9310
|
-
|
|
9535
|
+
entityAdapter: singular,
|
|
9536
|
+
input: [line(1), line(2), line(3)]
|
|
9311
9537
|
}, {
|
|
9312
|
-
|
|
9313
|
-
|
|
9538
|
+
entityAdapter: singular,
|
|
9539
|
+
input: [line(1), arc(2), arc(3)]
|
|
9314
9540
|
}),
|
|
9315
9541
|
tangency: createHelper(classcad.CCClasses.CC2DTangentSketchConstraint, 'Tan', {
|
|
9316
|
-
|
|
9317
|
-
|
|
9542
|
+
entityAdapter: singular,
|
|
9543
|
+
input: [arc(1), curve(2)]
|
|
9318
9544
|
}, {
|
|
9319
|
-
|
|
9320
|
-
|
|
9545
|
+
entityAdapter: singular,
|
|
9546
|
+
input: [curve(2), arc(1)]
|
|
9321
9547
|
}),
|
|
9322
9548
|
verticalDistance: createHelper(classcad.CCClasses.CC2DVerticalDistanceConstraint, 'VD', {
|
|
9323
|
-
|
|
9324
|
-
|
|
9549
|
+
entityAdapter: singular,
|
|
9550
|
+
input: [point(1), point(2)]
|
|
9551
|
+
}, {
|
|
9552
|
+
entityAdapter: singular,
|
|
9553
|
+
input: [line([1, 2])]
|
|
9325
9554
|
}),
|
|
9326
9555
|
verticality: createHelper(classcad.CCClasses.CC2DVerticalConstraint, 'V', {
|
|
9327
|
-
|
|
9328
|
-
|
|
9556
|
+
entityAdapter: multipleUnary,
|
|
9557
|
+
input: [line(1)]
|
|
9329
9558
|
}, {
|
|
9330
|
-
|
|
9331
|
-
|
|
9559
|
+
entityAdapter: singular,
|
|
9560
|
+
input: [point(1), point(2)]
|
|
9332
9561
|
}),
|
|
9333
9562
|
rigidSet: createHelper(classcad.CCClasses.CCRigidSet, 'RS', {
|
|
9334
|
-
|
|
9335
|
-
|
|
9563
|
+
entityAdapter: singular,
|
|
9564
|
+
input: []
|
|
9336
9565
|
}),
|
|
9337
9566
|
use: createHelper(classcad.CCClasses.CCUse, 'Use', {
|
|
9338
|
-
|
|
9339
|
-
|
|
9567
|
+
entityAdapter: singular,
|
|
9568
|
+
input: [any(1)]
|
|
9340
9569
|
})
|
|
9341
9570
|
};
|
|
9342
9571
|
|
|
@@ -9463,7 +9692,7 @@ const ConstrBtn = ({
|
|
|
9463
9692
|
|
|
9464
9693
|
if (constrClass === classcad.CCClasses.CCRigidSet) {
|
|
9465
9694
|
if (selected.length === 0) return;
|
|
9466
|
-
classcad.ccAPI.sketcher.createRigidSet(drawingId, sketchId, selected);
|
|
9695
|
+
classcad.ccAPI.sketcher.createRigidSet(drawingId, sketchId, selected).catch(console.warn);
|
|
9467
9696
|
} else {
|
|
9468
9697
|
const tree = core.getDrawing(drawingId).structure.tree;
|
|
9469
9698
|
const ct = constraintsHelpers[classNameMap[constrClass]];
|
|
@@ -9478,7 +9707,7 @@ const ConstrBtn = ({
|
|
|
9478
9707
|
set({
|
|
9479
9708
|
selected: []
|
|
9480
9709
|
});
|
|
9481
|
-
classcad.ccAPI.sketcher.addConstraints(drawingId, sketchId, entities.map(() => ct.name), entities.map(() => ct.type), entities);
|
|
9710
|
+
classcad.ccAPI.sketcher.addConstraints(drawingId, sketchId, entities.map(() => ct.name), entities.map(() => ct.type), entities).catch(console.warn);
|
|
9482
9711
|
}
|
|
9483
9712
|
}
|
|
9484
9713
|
}, [drawingId, set, sketchId, pluginId, constrClass]);
|
|
@@ -9941,7 +10170,7 @@ function Fillet(drawingId, pluginId, camControls) {
|
|
|
9941
10170
|
|
|
9942
10171
|
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), {}, {
|
|
9943
10172
|
radius: 1
|
|
9944
|
-
})).mid, data.params.end);
|
|
10173
|
+
})).mid, data.params.end).catch(console.warn);
|
|
9945
10174
|
set({
|
|
9946
10175
|
tmpObjects: {},
|
|
9947
10176
|
cursor: null
|
|
@@ -9961,7 +10190,7 @@ function Fillet(drawingId, pluginId, camControls) {
|
|
|
9961
10190
|
|
|
9962
10191
|
return ((_tree$id$members = tree[id].members) == null ? void 0 : _tree$id$members.entities).members.some(entity => entity.value === filletRelatedObjectId);
|
|
9963
10192
|
}));
|
|
9964
|
-
classcad.ccAPI.sketcher.deleteFillet(drawingId, sketchId, info.object.id, info.filletPoint.id, info.lineStarts.map(lineStart => lineStart.id), unrelatedConstraintIds);
|
|
10193
|
+
classcad.ccAPI.sketcher.deleteFillet(drawingId, sketchId, info.object.id, info.filletPoint.id, info.lineStarts.map(lineStart => lineStart.id), unrelatedConstraintIds).catch(console.warn);
|
|
9965
10194
|
set({
|
|
9966
10195
|
tmpObjects: {},
|
|
9967
10196
|
cursor: null
|
|
@@ -9999,14 +10228,14 @@ function Trim(drawingId, pluginId) {
|
|
|
9999
10228
|
};
|
|
10000
10229
|
|
|
10001
10230
|
const onActivate = () => {
|
|
10002
|
-
classcad.ccAPI.sketcher.splitAllCurves(drawingId, sketchId);
|
|
10231
|
+
classcad.ccAPI.sketcher.splitAllCurves(drawingId, sketchId).catch(console.warn);
|
|
10003
10232
|
};
|
|
10004
10233
|
|
|
10005
10234
|
const onDeactivate = () => {
|
|
10006
10235
|
set({
|
|
10007
10236
|
cursor: null
|
|
10008
10237
|
});
|
|
10009
|
-
classcad.ccAPI.sketcher.splitCurvesMergeBack(drawingId, sketchId);
|
|
10238
|
+
classcad.ccAPI.sketcher.splitCurvesMergeBack(drawingId, sketchId).catch(console.warn);
|
|
10010
10239
|
};
|
|
10011
10240
|
|
|
10012
10241
|
const onPointerOver = e => {
|
|
@@ -10037,7 +10266,7 @@ function Trim(drawingId, pluginId) {
|
|
|
10037
10266
|
const tree = core.getDrawing(drawingId).structure.tree;
|
|
10038
10267
|
|
|
10039
10268
|
if (((_tree2 = tree[tree[e.object.userData.objId].parent || NOCCID]) == null ? void 0 : _tree2.class) === classcad.CCClasses.CCContainer) {
|
|
10040
|
-
classcad.ccAPI.sketcher.removeObjects(drawingId, sketchId, [e.object.userData.objId]);
|
|
10269
|
+
classcad.ccAPI.sketcher.removeObjects(drawingId, sketchId, [e.object.userData.objId]).catch(console.warn);
|
|
10041
10270
|
}
|
|
10042
10271
|
|
|
10043
10272
|
e.stopPropagation();
|
|
@@ -10101,36 +10330,11 @@ const HandlersConstructors = {
|
|
|
10101
10330
|
|
|
10102
10331
|
const orderStep = 2;
|
|
10103
10332
|
const unitsBase = 0;
|
|
10104
|
-
const orderBase = 1000;
|
|
10105
|
-
|
|
10106
|
-
function getPriority(object) {
|
|
10107
|
-
if (is2DConstraint(object)) {
|
|
10108
|
-
// Since constraints are drawn on separate HUD it base might be 1.
|
|
10109
|
-
// If constraints will be drawn on common canvas it should be 4.
|
|
10110
|
-
return 1;
|
|
10111
|
-
}
|
|
10112
|
-
|
|
10113
|
-
switch (object.class) {
|
|
10114
|
-
case classcad.CCClasses.CCLine:
|
|
10115
|
-
return 1;
|
|
10116
|
-
|
|
10117
|
-
case classcad.CCClasses.CCArc:
|
|
10118
|
-
return 2;
|
|
10119
|
-
|
|
10120
|
-
case classcad.CCClasses.CCCircle:
|
|
10121
|
-
return 3;
|
|
10122
|
-
|
|
10123
|
-
case classcad.CCClasses.CCPoint:
|
|
10124
|
-
return 5;
|
|
10125
|
-
}
|
|
10126
|
-
|
|
10127
|
-
return -1;
|
|
10128
|
-
} // If there are two faces with the same depth, face with smaller offsetUnits will be drawn on top of plane with bigger offsetUnits
|
|
10333
|
+
const orderBase = 1000; // If there are two faces with the same depth, face with smaller offsetUnits will be drawn on top of plane with bigger offsetUnits
|
|
10129
10334
|
// renderOrder means object idx in intersections array. Object with the highest renderOrder goes first.
|
|
10130
10335
|
|
|
10131
|
-
|
|
10132
10336
|
function getUnitsAndOrder(object) {
|
|
10133
|
-
const priority =
|
|
10337
|
+
const priority = getGeometryPriority(object);
|
|
10134
10338
|
|
|
10135
10339
|
if (priority === -1) {
|
|
10136
10340
|
return {
|
|
@@ -11748,7 +11952,7 @@ function useUseRef(drawingId, sketchId) {
|
|
|
11748
11952
|
const selApi = core.getDrawing(drawingId).api.selection;
|
|
11749
11953
|
selApi.setItems('UseRef', []);
|
|
11750
11954
|
const ids = itemsUseRef.map(item => item.data.graphicId);
|
|
11751
|
-
classcad.ccAPI.sketcher.createReferenceGeometry(drawingId, sketchId, ids);
|
|
11955
|
+
classcad.ccAPI.sketcher.createReferenceGeometry(drawingId, sketchId, ids).catch(console.warn);
|
|
11752
11956
|
}
|
|
11753
11957
|
}, [drawingId, sketchId, itemsUseRef]);
|
|
11754
11958
|
}
|
|
@@ -11766,7 +11970,8 @@ function useInteractionReset(drawingId, pluginId) {
|
|
|
11766
11970
|
const {
|
|
11767
11971
|
hovered,
|
|
11768
11972
|
selected,
|
|
11769
|
-
highlighted
|
|
11973
|
+
highlighted,
|
|
11974
|
+
interaction
|
|
11770
11975
|
} = getSketchState(drawingId, pluginId);
|
|
11771
11976
|
const state_ = {};
|
|
11772
11977
|
const hoveredValid = tree[hovered] !== undefined ? hovered : NOCCID;
|
|
@@ -11787,7 +11992,16 @@ function useInteractionReset(drawingId, pluginId) {
|
|
|
11787
11992
|
state_.highlighted = [];
|
|
11788
11993
|
}
|
|
11789
11994
|
|
|
11790
|
-
|
|
11995
|
+
const cursorOverValid = interaction.objects.filter(id => tree[id] !== undefined);
|
|
11996
|
+
|
|
11997
|
+
if (cursorOverValid.length !== interaction.objects.length) {
|
|
11998
|
+
state_.interaction = {
|
|
11999
|
+
cycle: 0,
|
|
12000
|
+
objects: cursorOverValid
|
|
12001
|
+
};
|
|
12002
|
+
}
|
|
12003
|
+
|
|
12004
|
+
if (state_.hovered || state_.selected || state_.highlighted || state_.interaction) {
|
|
11791
12005
|
core.getPlugin(drawingId, pluginId).set(state_);
|
|
11792
12006
|
}
|
|
11793
12007
|
}, [drawingId, pluginId, children]);
|
|
@@ -12302,7 +12516,7 @@ function useMenuItems$4(drawingId, featureId, isActive, setEditName) {
|
|
|
12302
12516
|
callback: () => {
|
|
12303
12517
|
const pluginAPI = core.getDrawing(drawingId).api.plugin;
|
|
12304
12518
|
if (isActive) pluginAPI.setActiveFeature(null);
|
|
12305
|
-
classcad.ccAPI.baseModeler.deleteObject(drawingId, featureId);
|
|
12519
|
+
classcad.ccAPI.baseModeler.deleteObject(drawingId, featureId).catch(console.warn);
|
|
12306
12520
|
}
|
|
12307
12521
|
}
|
|
12308
12522
|
};
|
|
@@ -12444,9 +12658,9 @@ const PlaneSelection = ({
|
|
|
12444
12658
|
const onChange = React.useCallback(items => {
|
|
12445
12659
|
if (items.length !== 0) {
|
|
12446
12660
|
if (items[0].scope === TreeObjScope) {
|
|
12447
|
-
classcad.ccAPI.sketcher.setWorkPlane(drawingId, sketchId, items[0].data.object.id);
|
|
12661
|
+
classcad.ccAPI.sketcher.setWorkPlane(drawingId, sketchId, items[0].data.object.id).catch(console.warn);
|
|
12448
12662
|
} else {
|
|
12449
|
-
classcad.ccAPI.sketcher.createAndSetWorkPlane(drawingId, sketchId, items[0].data.graphicId);
|
|
12663
|
+
classcad.ccAPI.sketcher.createAndSetWorkPlane(drawingId, sketchId, items[0].data.graphicId).catch(console.warn);
|
|
12450
12664
|
}
|
|
12451
12665
|
}
|
|
12452
12666
|
}, [drawingId, sketchId]);
|
|
@@ -12542,7 +12756,7 @@ const NameEdit = ({
|
|
|
12542
12756
|
const ref = React.useRef(null);
|
|
12543
12757
|
const onEnter = React.useCallback(async e => {
|
|
12544
12758
|
if (e.target.value !== '') {
|
|
12545
|
-
await classcad.ccAPI.common.setObjectName(drawingId, objId, e.target.value);
|
|
12759
|
+
await classcad.ccAPI.common.setObjectName(drawingId, objId, e.target.value).catch(console.warn);
|
|
12546
12760
|
}
|
|
12547
12761
|
|
|
12548
12762
|
setEditName(false);
|
|
@@ -12677,7 +12891,7 @@ function useMenuItems$3(drawingId, pluginId, objectId, setRename) {
|
|
|
12677
12891
|
caption: 'delete',
|
|
12678
12892
|
icon: /*#__PURE__*/React.createElement(icons.DeleteOutlined, null),
|
|
12679
12893
|
callback: () => {
|
|
12680
|
-
classcad.ccAPI.sketcher.removeObjects(drawingId, sketchId, [objectId]);
|
|
12894
|
+
classcad.ccAPI.sketcher.removeObjects(drawingId, sketchId, [objectId]).catch(console.warn);
|
|
12681
12895
|
const tree = core.getDrawing(drawingId).structure.tree;
|
|
12682
12896
|
set(state_ => {
|
|
12683
12897
|
const selected = state_.selected.filter(id => id !== objectId && tree[id].parent !== objectId);
|
|
@@ -12756,7 +12970,7 @@ const RefTag = ({
|
|
|
12756
12970
|
remove.current = undefined;
|
|
12757
12971
|
} else if (itemsRefChange && itemsRefChange.length > 0) {
|
|
12758
12972
|
const newRefId = itemsRefChange[0].data.graphicId;
|
|
12759
|
-
classcad.ccAPI.sketcher.changeReferenceGeometry(drawingId, sketchId, objId, newRefId);
|
|
12973
|
+
classcad.ccAPI.sketcher.changeReferenceGeometry(drawingId, sketchId, objId, newRefId).catch(console.warn);
|
|
12760
12974
|
remove.current && remove.current();
|
|
12761
12975
|
remove.current = undefined;
|
|
12762
12976
|
}
|
|
@@ -12937,10 +13151,7 @@ const Details = () => {
|
|
|
12937
13151
|
return /*#__PURE__*/React.createElement(Collapse, {
|
|
12938
13152
|
header: "Details",
|
|
12939
13153
|
isActive: false
|
|
12940
|
-
}, /*#__PURE__*/React.createElement(
|
|
12941
|
-
drawingId: drawingId,
|
|
12942
|
-
sketchId: sketchId
|
|
12943
|
-
}), !hasGeometry && /*#__PURE__*/React.createElement(Text$2, {
|
|
13154
|
+
}, !hasGeometry && /*#__PURE__*/React.createElement(Text$2, {
|
|
12944
13155
|
strong: true
|
|
12945
13156
|
}, "The sketch is empty"), hasGeometry && isTrimActive && /*#__PURE__*/React.createElement(Text$2, {
|
|
12946
13157
|
strong: true
|
|
@@ -12972,6 +13183,161 @@ const Details = () => {
|
|
|
12972
13183
|
}))));
|
|
12973
13184
|
};
|
|
12974
13185
|
|
|
13186
|
+
var img$s = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAB9SURBVEhL7ZFBCsAgDAT7HP//l77HCrsHCbaJiUKFDHtJgjsHr7qZFKikQOV/gruUFg4GnAK7JiSwOKIChLcRFIgHvqBKsFLQgraexQIEnWCLAEHzmQJ0gqM+GVUCCuyIUoS3EVEBt++EBFx94hRwMDAtmCUFKilQ2Syo9QGcSz3H8BHMoQAAAABJRU5ErkJggg==";
|
|
13187
|
+
|
|
13188
|
+
var img$r = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABzSURBVEhL7Y1BCsAwCAT7nLy837SFLCFsY0woQQ8OexF155LDBBOUu7zBsEYkQW3fdYQR9O01WFgsCai6BespAQRUSsGRjreA6obBqYKrgIomwcMIVUAVZvD2wU/QQ10tWE9JgUkKTFJgkgKTGII/HBaIPHzTFiPbxQ1UAAAAAElFTkSuQmCC";
|
|
13189
|
+
|
|
13190
|
+
const noSameSketchFilter = (drawingId, sketchId, objectId) => {
|
|
13191
|
+
const parentSketchId = getAncestorIdByClass(drawingId, objectId, classcad.CCClasses.CCSketch);
|
|
13192
|
+
return parentSketchId !== sketchId;
|
|
13193
|
+
};
|
|
13194
|
+
|
|
13195
|
+
function usePositionParam(drawingId, objId, memberName) {
|
|
13196
|
+
var _getDrawing$structure;
|
|
13197
|
+
|
|
13198
|
+
const member = (_getDrawing$structure = core.getDrawing(drawingId).structure.tree[objId].members) == null ? void 0 : _getDrawing$structure[memberName];
|
|
13199
|
+
const defaultValue = React.useMemo(() => {
|
|
13200
|
+
const obj = findObject(drawingId, member.value, true);
|
|
13201
|
+
return (obj == null ? void 0 : obj.graphicId) || (obj == null ? void 0 : obj.id) || 0; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13202
|
+
}, []);
|
|
13203
|
+
const [value, setValue] = React.useState(defaultValue);
|
|
13204
|
+
return {
|
|
13205
|
+
value,
|
|
13206
|
+
setValue
|
|
13207
|
+
};
|
|
13208
|
+
}
|
|
13209
|
+
|
|
13210
|
+
const PositionSelection = ({
|
|
13211
|
+
children,
|
|
13212
|
+
drawingId,
|
|
13213
|
+
param,
|
|
13214
|
+
caption,
|
|
13215
|
+
onChange,
|
|
13216
|
+
filter,
|
|
13217
|
+
noDeselect = false
|
|
13218
|
+
}) => {
|
|
13219
|
+
const {
|
|
13220
|
+
Selection
|
|
13221
|
+
} = react.useBuerli(buerli => buerli.options.elements);
|
|
13222
|
+
const objSelection = React.useMemo(() => {
|
|
13223
|
+
if (param.value !== 0) {
|
|
13224
|
+
const prodId = core.getDrawing(drawingId).structure.currentProduct;
|
|
13225
|
+
const obj = findObject(drawingId, param.value, true);
|
|
13226
|
+
|
|
13227
|
+
if (obj != null && obj.graphicId) {
|
|
13228
|
+
return [core.createGraphicItem(prodId, obj)];
|
|
13229
|
+
} else {
|
|
13230
|
+
return [createTreeObjSelItem(prodId, obj)];
|
|
13231
|
+
}
|
|
13232
|
+
}
|
|
13233
|
+
|
|
13234
|
+
return []; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13235
|
+
}, []);
|
|
13236
|
+
const onChange_ = React.useCallback(items => {
|
|
13237
|
+
var _items$, _items$$data$object, _items$2;
|
|
13238
|
+
|
|
13239
|
+
const value = ((_items$ = items[0]) == null ? void 0 : (_items$$data$object = _items$.data.object) == null ? void 0 : _items$$data$object.id) || ((_items$2 = items[0]) == null ? void 0 : _items$2.data.graphicId) || 0;
|
|
13240
|
+
param.setValue(value);
|
|
13241
|
+
|
|
13242
|
+
if (param.value !== value) {
|
|
13243
|
+
onChange(value);
|
|
13244
|
+
}
|
|
13245
|
+
}, [param, onChange]);
|
|
13246
|
+
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
13247
|
+
caption: caption
|
|
13248
|
+
}, /*#__PURE__*/React.createElement(Selection, {
|
|
13249
|
+
drawingId: drawingId,
|
|
13250
|
+
maxLen: 1,
|
|
13251
|
+
initialItems: objSelection,
|
|
13252
|
+
defaultActive: false,
|
|
13253
|
+
autoDisable: true,
|
|
13254
|
+
filter: filter,
|
|
13255
|
+
onChange: onChange_ // Is this a good solution from the user perspective? To just disallow deselection of plane...
|
|
13256
|
+
,
|
|
13257
|
+
customUnSelect: noDeselect ? () => void {} : undefined
|
|
13258
|
+
}), children);
|
|
13259
|
+
};
|
|
13260
|
+
|
|
13261
|
+
var Members$b;
|
|
13262
|
+
|
|
13263
|
+
(function (Members) {
|
|
13264
|
+
Members["PlaneReference"] = "planeReference";
|
|
13265
|
+
Members["AxisReference"] = "axisReference";
|
|
13266
|
+
Members["OriginReference"] = "originReference";
|
|
13267
|
+
Members["AxisIsX"] = "axisIsX";
|
|
13268
|
+
Members["PlaneInverted"] = "planeInverted";
|
|
13269
|
+
Members["AxisInverted"] = "axisInverted";
|
|
13270
|
+
})(Members$b || (Members$b = {}));
|
|
13271
|
+
|
|
13272
|
+
const Position = () => {
|
|
13273
|
+
const {
|
|
13274
|
+
Collapse
|
|
13275
|
+
} = react.useBuerli(buerli => buerli.options.elements);
|
|
13276
|
+
const {
|
|
13277
|
+
drawingId,
|
|
13278
|
+
pluginId
|
|
13279
|
+
} = React.useContext(RootContext);
|
|
13280
|
+
const sketchId = react.usePlugin(drawingId, pluginId, plugin => plugin.objectId);
|
|
13281
|
+
const planeId = usePositionParam(drawingId, sketchId, Members$b.PlaneReference);
|
|
13282
|
+
const axisId = usePositionParam(drawingId, sketchId, Members$b.AxisReference);
|
|
13283
|
+
const originId = usePositionParam(drawingId, sketchId, Members$b.OriginReference);
|
|
13284
|
+
const isXAxis = useBoolParam(drawingId, sketchId, Members$b.AxisIsX);
|
|
13285
|
+
const planeInverted = useBoolParam(drawingId, sketchId, Members$b.PlaneInverted);
|
|
13286
|
+
const axisInverted = useBoolParam(drawingId, sketchId, Members$b.AxisInverted);
|
|
13287
|
+
const onPlaneChange = React.useCallback(value => {
|
|
13288
|
+
classcad.ccAPI.sketcher.setSketchRefs(drawingId, sketchId, value || null, Boolean(planeInverted.serverValue), axisId.value || null, Boolean(isXAxis.serverValue), Boolean(axisInverted.serverValue), originId.value || null);
|
|
13289
|
+
}, [drawingId, sketchId, planeInverted, axisId, isXAxis, axisInverted, originId]);
|
|
13290
|
+
const onAxisChange = React.useCallback(value => {
|
|
13291
|
+
classcad.ccAPI.sketcher.setSketchRefs(drawingId, sketchId, null, Boolean(planeInverted.serverValue), value || null, Boolean(isXAxis.serverValue), Boolean(axisInverted.serverValue), originId.value || null);
|
|
13292
|
+
}, [drawingId, sketchId, planeInverted, isXAxis, axisInverted, originId]);
|
|
13293
|
+
const onOriginChange = React.useCallback(value => {
|
|
13294
|
+
classcad.ccAPI.sketcher.setSketchRefs(drawingId, sketchId, null, Boolean(planeInverted.serverValue), axisId.value || null, Boolean(isXAxis.serverValue), Boolean(axisInverted.serverValue), value || null);
|
|
13295
|
+
}, [drawingId, sketchId, planeInverted, axisId, isXAxis, axisInverted]);
|
|
13296
|
+
React.useEffect(() => {
|
|
13297
|
+
const params = [isXAxis, planeInverted, axisInverted];
|
|
13298
|
+
|
|
13299
|
+
if (params.some(param => param.isChanged())) {
|
|
13300
|
+
classcad.ccAPI.sketcher.setSketchRefs(drawingId, sketchId, null, Boolean(planeInverted.serverValue), axisId.value || null, Boolean(isXAxis.serverValue), Boolean(axisInverted.serverValue), originId.value || null);
|
|
13301
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13302
|
+
|
|
13303
|
+
}, [planeInverted.userValue, isXAxis.userValue, axisInverted.userValue]);
|
|
13304
|
+
const planeFilter_ = React.useCallback((scope, data) => core.planeFilter(scope, data) || workPlaneFilter(scope, data), []);
|
|
13305
|
+
const axisFilter_ = React.useCallback((scope, data) => core.lineFilter(scope, data) || workAxisFilter(scope, data) || ccLineFilter(scope, data) && noSameSketchFilter(drawingId, sketchId, data.object.id), [drawingId, sketchId]);
|
|
13306
|
+
const originFilter_ = React.useCallback((scope, data) => core.pointFilter(scope, data) || workPointFilter(scope, data) || ccPointFilter(scope, data) && noSameSketchFilter(drawingId, sketchId, data.object.id), [drawingId, sketchId]);
|
|
13307
|
+
return /*#__PURE__*/React.createElement(Collapse, {
|
|
13308
|
+
header: "Position",
|
|
13309
|
+
isActive: false
|
|
13310
|
+
}, /*#__PURE__*/React.createElement(PositionSelection, {
|
|
13311
|
+
drawingId: drawingId,
|
|
13312
|
+
param: planeId,
|
|
13313
|
+
caption: "Plane",
|
|
13314
|
+
onChange: onPlaneChange,
|
|
13315
|
+
filter: planeFilter_,
|
|
13316
|
+
noDeselect: true
|
|
13317
|
+
}, /*#__PURE__*/React.createElement(BooleanEditor, {
|
|
13318
|
+
param: planeInverted,
|
|
13319
|
+
icon: true
|
|
13320
|
+
})), /*#__PURE__*/React.createElement(PositionSelection, {
|
|
13321
|
+
drawingId: drawingId,
|
|
13322
|
+
param: axisId,
|
|
13323
|
+
caption: "Axis",
|
|
13324
|
+
onChange: onAxisChange,
|
|
13325
|
+
filter: axisFilter_
|
|
13326
|
+
}, /*#__PURE__*/React.createElement(BooleanEditor, {
|
|
13327
|
+
param: isXAxis,
|
|
13328
|
+
icon: [img$r, img$s]
|
|
13329
|
+
}), /*#__PURE__*/React.createElement(BooleanEditor, {
|
|
13330
|
+
param: axisInverted,
|
|
13331
|
+
icon: true
|
|
13332
|
+
})), /*#__PURE__*/React.createElement(PositionSelection, {
|
|
13333
|
+
drawingId: drawingId,
|
|
13334
|
+
param: originId,
|
|
13335
|
+
caption: "Origin",
|
|
13336
|
+
onChange: onOriginChange,
|
|
13337
|
+
filter: originFilter_
|
|
13338
|
+
}));
|
|
13339
|
+
};
|
|
13340
|
+
|
|
12975
13341
|
const PlaneSelectionMode = ({
|
|
12976
13342
|
drawingId,
|
|
12977
13343
|
pluginId
|
|
@@ -13169,7 +13535,7 @@ const SketchMode = ({
|
|
|
13169
13535
|
tooltip: "Mirror copy pattern."
|
|
13170
13536
|
}),
|
|
13171
13537
|
key: "Mirror"
|
|
13172
|
-
}, /*#__PURE__*/React.createElement(MirrorPattern, null)))), /*#__PURE__*/React.createElement(Details, null)));
|
|
13538
|
+
}, /*#__PURE__*/React.createElement(MirrorPattern, null)))), /*#__PURE__*/React.createElement(Details, null), /*#__PURE__*/React.createElement(Position, null)));
|
|
13173
13539
|
};
|
|
13174
13540
|
|
|
13175
13541
|
const RootImpl$f = ({
|
|
@@ -14793,9 +15159,9 @@ function ViewImpl$8({
|
|
|
14793
15159
|
const zMax = origin.clone().setComponent(2, max.z);
|
|
14794
15160
|
|
|
14795
15161
|
const CreateBoundaryLineGeometry = (point1, point2, componentIndex) => {
|
|
14796
|
-
const
|
|
14797
|
-
|
|
14798
|
-
return
|
|
15162
|
+
const start = point1.clone();
|
|
15163
|
+
const end = point1.clone().setComponent(componentIndex, point2.getComponent(componentIndex));
|
|
15164
|
+
return new THREE__namespace.BufferGeometry().setFromPoints([start, end]);
|
|
14799
15165
|
};
|
|
14800
15166
|
|
|
14801
15167
|
return /*#__PURE__*/React.createElement("group", null, /*#__PURE__*/React.createElement(Arrow, {
|
|
@@ -15286,7 +15652,7 @@ const RootImpl$9 = ({
|
|
|
15286
15652
|
}, type]];
|
|
15287
15653
|
setName(undefined);
|
|
15288
15654
|
setExpression(undefined);
|
|
15289
|
-
return classcad.ccAPI.feature.updateExpressionSet(drawingId, productId, toAddMembers, [], []);
|
|
15655
|
+
return classcad.ccAPI.feature.updateExpressionSet(drawingId, productId, toAddMembers, [], []).catch(console.warn);
|
|
15290
15656
|
}, [drawingId, productId, name, expression, type]);
|
|
15291
15657
|
const deleteExpression = React.useCallback(name_ => {
|
|
15292
15658
|
const {
|
|
@@ -15474,7 +15840,7 @@ function RootImpl$8({
|
|
|
15474
15840
|
|
|
15475
15841
|
const update = React.useCallback(async () => {
|
|
15476
15842
|
/* stopPreview.current() */
|
|
15477
|
-
return classcad.ccAPI.assemblyBuilder.updateFastenedOriginConstraint(drawingId, objectId, mateRef.serverValue, xOffset.serverValue, yOffset.serverValue, zOffset.serverValue)
|
|
15843
|
+
return classcad.ccAPI.assemblyBuilder.updateFastenedOriginConstraint(drawingId, objectId, mateRef.serverValue, xOffset.serverValue, yOffset.serverValue, zOffset.serverValue);
|
|
15478
15844
|
}, [drawingId, objectId, mateRef, xOffset, yOffset, zOffset]);
|
|
15479
15845
|
return /*#__PURE__*/React.createElement(PluginForm, {
|
|
15480
15846
|
drawingId: drawingId,
|
|
@@ -16013,10 +16379,33 @@ const CSysDisplayImpl = ({
|
|
|
16013
16379
|
|
|
16014
16380
|
return csysUDataArray_;
|
|
16015
16381
|
}, [drawingId, hoveredOnly, activeProducts, hoveredProductIds, hoveredCSysIds, selItems, activeSelItems, rigidSets, selRigidSets]);
|
|
16382
|
+
const lnTh = fiber.useThree(state => {
|
|
16383
|
+
var _state$raycaster$para;
|
|
16384
|
+
|
|
16385
|
+
return (_state$raycaster$para = state.raycaster.params.Line) == null ? void 0 : _state$raycaster$para.threshold;
|
|
16386
|
+
});
|
|
16387
|
+
const ptsTh = fiber.useThree(state => {
|
|
16388
|
+
var _state$raycaster$para2;
|
|
16389
|
+
|
|
16390
|
+
return (_state$raycaster$para2 = state.raycaster.params.Points) == null ? void 0 : _state$raycaster$para2.threshold;
|
|
16391
|
+
});
|
|
16392
|
+
const {
|
|
16393
|
+
camera,
|
|
16394
|
+
size
|
|
16395
|
+
} = fiber.useThree();
|
|
16396
|
+
const {
|
|
16397
|
+
lineThreshold,
|
|
16398
|
+
pointThreshold
|
|
16399
|
+
} = React.useMemo(() => {
|
|
16400
|
+
return {
|
|
16401
|
+
lineThreshold: lnTh || react.CameraHelper.calculateScaleFactor(camera.position, 4, camera, size),
|
|
16402
|
+
pointThreshold: ptsTh || react.CameraHelper.calculateScaleFactor(camera.position, 6, camera, size)
|
|
16403
|
+
};
|
|
16404
|
+
}, [camera, size, lnTh, ptsTh]);
|
|
16016
16405
|
const onInfiniteMove = React.useCallback(e => {
|
|
16017
|
-
const geom = react.findBuerliGeometry(e);
|
|
16406
|
+
const geom = react.findBuerliGeometry(e, lineThreshold, pointThreshold)[0];
|
|
16018
16407
|
setHoveredProductId(geom == null ? void 0 : geom.productId);
|
|
16019
|
-
}, [setHoveredProductId]);
|
|
16408
|
+
}, [setHoveredProductId, lineThreshold, pointThreshold]);
|
|
16020
16409
|
return /*#__PURE__*/React.createElement(HUD, null, /*#__PURE__*/React.createElement("infinityPlane", {
|
|
16021
16410
|
onPointerMove: onInfiniteMove
|
|
16022
16411
|
}), /*#__PURE__*/React.createElement("group", null, csysUDataArray.map(userData => /*#__PURE__*/React.createElement(CSysWrapper, {
|
|
@@ -16149,7 +16538,7 @@ function RootImpl$7({
|
|
|
16149
16538
|
|
|
16150
16539
|
const update = React.useCallback(async () => {
|
|
16151
16540
|
/* stopPreview.current() */
|
|
16152
|
-
return classcad.ccAPI.assemblyBuilder.updateFastenedConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, xOffset.serverValue, yOffset.serverValue, zOffset.serverValue)
|
|
16541
|
+
return classcad.ccAPI.assemblyBuilder.updateFastenedConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, xOffset.serverValue, yOffset.serverValue, zOffset.serverValue);
|
|
16153
16542
|
}, [drawingId, objectId, mate1Ref, mate2Ref, xOffset, yOffset, zOffset]);
|
|
16154
16543
|
return /*#__PURE__*/React.createElement(PluginForm, {
|
|
16155
16544
|
drawingId: drawingId,
|
|
@@ -16531,7 +16920,7 @@ const LimitedValue = ({
|
|
|
16531
16920
|
promise.current = onUpdate(updateTo_).then(() => {
|
|
16532
16921
|
promise.current = undefined;
|
|
16533
16922
|
sendToServer();
|
|
16534
|
-
});
|
|
16923
|
+
}).catch(console.warn);
|
|
16535
16924
|
}
|
|
16536
16925
|
}, [onUpdate]);
|
|
16537
16926
|
const commit = React.useCallback(value_ => {
|
|
@@ -16672,7 +17061,7 @@ function RootImpl$6({
|
|
|
16672
17061
|
const update = React.useCallback(async () => {
|
|
16673
17062
|
/* stopPreview.current() */
|
|
16674
17063
|
setDisableVals(true);
|
|
16675
|
-
return classcad.ccAPI.assemblyBuilder.updateSliderConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, xOffset.serverValue, yOffset.serverValue, zOffsetLimits.serverValue).then(() => setDisableVals(false))
|
|
17064
|
+
return classcad.ccAPI.assemblyBuilder.updateSliderConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, xOffset.serverValue, yOffset.serverValue, zOffsetLimits.serverValue).then(() => setDisableVals(false));
|
|
16676
17065
|
}, [drawingId, objectId, mate1Ref, mate2Ref, xOffset, yOffset, zOffsetLimits]);
|
|
16677
17066
|
const updateValue = React.useCallback(value => {
|
|
16678
17067
|
return classcad.ccAPI.assemblyBuilder.update3DConstraintValue(drawingId, objectId, 'zOffsetValue', value);
|
|
@@ -16832,10 +17221,10 @@ function RootImpl$5({
|
|
|
16832
17221
|
const update = React.useCallback(async () => {
|
|
16833
17222
|
/* stopPreview.current() */
|
|
16834
17223
|
setDisableVals(true);
|
|
16835
|
-
return classcad.ccAPI.assemblyBuilder.updateRevoluteConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, zOffset.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false))
|
|
17224
|
+
return classcad.ccAPI.assemblyBuilder.updateRevoluteConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, zOffset.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false));
|
|
16836
17225
|
}, [drawingId, objectId, mate1Ref, mate2Ref, zOffset, zRotationLimits]);
|
|
16837
17226
|
const updateValue = React.useCallback(value => {
|
|
16838
|
-
return classcad.ccAPI.assemblyBuilder.update3DConstraintValue(drawingId, objectId, 'zRotationValue', value)
|
|
17227
|
+
return classcad.ccAPI.assemblyBuilder.update3DConstraintValue(drawingId, objectId, 'zRotationValue', value);
|
|
16839
17228
|
}, [drawingId, objectId]);
|
|
16840
17229
|
const validate = React.useCallback(() => {
|
|
16841
17230
|
return validateLimits(zRotationLimits.userValue, 'Rotation Z');
|
|
@@ -16991,7 +17380,7 @@ function RootImpl$4({
|
|
|
16991
17380
|
const update = React.useCallback(async () => {
|
|
16992
17381
|
/* stopPreview.current() */
|
|
16993
17382
|
setDisableVals(true);
|
|
16994
|
-
return classcad.ccAPI.assemblyBuilder.updateCylindricalConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, zOffsetLimits.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false))
|
|
17383
|
+
return classcad.ccAPI.assemblyBuilder.updateCylindricalConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, zOffsetLimits.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false));
|
|
16995
17384
|
}, [drawingId, objectId, mate1Ref, mate2Ref, zOffsetLimits, zRotationLimits]);
|
|
16996
17385
|
const updateOffset = React.useCallback(value => {
|
|
16997
17386
|
return classcad.ccAPI.assemblyBuilder.update3DConstraintValue(drawingId, objectId, 'zOffsetValue', value);
|
|
@@ -17169,7 +17558,7 @@ function RootImpl$3({
|
|
|
17169
17558
|
const update = React.useCallback(async () => {
|
|
17170
17559
|
/* stopPreview.current() */
|
|
17171
17560
|
setDisableVals(true);
|
|
17172
|
-
return classcad.ccAPI.assemblyBuilder.updatePlanarConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, zOffset.serverValue, xOffsetLimits.serverValue, yOffsetLimits.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false))
|
|
17561
|
+
return classcad.ccAPI.assemblyBuilder.updatePlanarConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, zOffset.serverValue, xOffsetLimits.serverValue, yOffsetLimits.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false));
|
|
17173
17562
|
}, [drawingId, objectId, mate1Ref, mate2Ref, zOffset, xOffsetLimits, yOffsetLimits, zRotationLimits]);
|
|
17174
17563
|
const updateXOffset = React.useCallback(value => {
|
|
17175
17564
|
return classcad.ccAPI.assemblyBuilder.update3DConstraintValue(drawingId, objectId, 'xOffsetValue', value);
|
|
@@ -17370,7 +17759,7 @@ function RootImpl$2({
|
|
|
17370
17759
|
const update = React.useCallback(async () => {
|
|
17371
17760
|
/* stopPreview.current() */
|
|
17372
17761
|
setDisableVals(true);
|
|
17373
|
-
return classcad.ccAPI.assemblyBuilder.updateParallelConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, xOffsetLimits.serverValue, yOffsetLimits.serverValue, zOffsetLimits.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false))
|
|
17762
|
+
return classcad.ccAPI.assemblyBuilder.updateParallelConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, xOffsetLimits.serverValue, yOffsetLimits.serverValue, zOffsetLimits.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false));
|
|
17374
17763
|
}, [drawingId, objectId, mate1Ref, mate2Ref, xOffsetLimits, yOffsetLimits, zOffsetLimits, zRotationLimits]);
|
|
17375
17764
|
const updateXOffset = React.useCallback(value => {
|
|
17376
17765
|
return classcad.ccAPI.assemblyBuilder.update3DConstraintValue(drawingId, objectId, 'xOffsetValue', value);
|
|
@@ -17755,7 +18144,7 @@ const FileUtils = {
|
|
|
17755
18144
|
const isRoot = objectId === structure.root;
|
|
17756
18145
|
const productId = ((_tree$objectId$member = tree[objectId].members) == null ? void 0 : (_tree$objectId$member2 = _tree$objectId$member.productId) == null ? void 0 : _tree$objectId$member2.value) || objectId;
|
|
17757
18146
|
const name = tree[productId].name;
|
|
17758
|
-
const data = isRoot ? await classcad.ccAPI.baseModeler.save(drawingId, type) : await classcad.ccAPI.assemblyBuilder.exportNode(drawingId, objectId, type);
|
|
18147
|
+
const data = isRoot ? await classcad.ccAPI.baseModeler.save(drawingId, type).catch(console.warn) : await classcad.ccAPI.assemblyBuilder.exportNode(drawingId, objectId, type).catch(console.warn);
|
|
17759
18148
|
|
|
17760
18149
|
if (data) {
|
|
17761
18150
|
const link = document.createElement('a');
|
|
@@ -17806,7 +18195,7 @@ function useMenuItems$2(drawingId, prodId, setEditName, pluginId) {
|
|
|
17806
18195
|
x: 0,
|
|
17807
18196
|
y: 1,
|
|
17808
18197
|
z: 0
|
|
17809
|
-
}]);
|
|
18198
|
+
}]).catch(console.warn);
|
|
17810
18199
|
}
|
|
17811
18200
|
},
|
|
17812
18201
|
export: {
|
|
@@ -17834,7 +18223,7 @@ function useMenuItems$2(drawingId, prodId, setEditName, pluginId) {
|
|
|
17834
18223
|
caption: 'delete',
|
|
17835
18224
|
icon: /*#__PURE__*/React.createElement(icons.DeleteOutlined, null),
|
|
17836
18225
|
callback: () => {
|
|
17837
|
-
classcad.ccAPI.baseModeler.deleteObject(drawingId, prodId);
|
|
18226
|
+
classcad.ccAPI.baseModeler.deleteObject(drawingId, prodId).catch(console.warn);
|
|
17838
18227
|
}
|
|
17839
18228
|
}
|
|
17840
18229
|
};
|
|
@@ -17921,7 +18310,7 @@ const NewProd = ({
|
|
|
17921
18310
|
}, []);
|
|
17922
18311
|
const createProd = React.useCallback(async () => {
|
|
17923
18312
|
const func = type === 'part' ? classcad.ccAPI.assemblyBuilder.createPartAsTemplate : classcad.ccAPI.assemblyBuilder.createAssemblyAsTemplate;
|
|
17924
|
-
await func(drawingId, name);
|
|
18313
|
+
await func(drawingId, name).catch(console.warn);
|
|
17925
18314
|
setCreateMode(false);
|
|
17926
18315
|
}, [name, drawingId, type, setCreateMode]);
|
|
17927
18316
|
const onKeyPress = React.useCallback(e => {
|
|
@@ -18177,7 +18566,7 @@ const ImportModel = ({
|
|
|
18177
18566
|
content
|
|
18178
18567
|
}) => {
|
|
18179
18568
|
const type = pathBrowserify.extname(file.name).replace('.', '');
|
|
18180
|
-
classcad.ccAPI.assemblyBuilder.loadProduct(drawingId, content, type, file.name).catch();
|
|
18569
|
+
classcad.ccAPI.assemblyBuilder.loadProduct(drawingId, content, type, file.name).catch(console.warn);
|
|
18181
18570
|
});
|
|
18182
18571
|
}, undefined, true);
|
|
18183
18572
|
}, [drawingId]);
|
|
@@ -18320,7 +18709,7 @@ const ViewImpl = ({
|
|
|
18320
18709
|
x: 0,
|
|
18321
18710
|
y: 1,
|
|
18322
18711
|
z: 0
|
|
18323
|
-
}]).catch();
|
|
18712
|
+
}]).catch(console.warn);
|
|
18324
18713
|
}
|
|
18325
18714
|
};
|
|
18326
18715
|
|
|
@@ -18382,13 +18771,13 @@ const load = (file, singleDrawingApp) => {
|
|
|
18382
18771
|
reader.onload = async () => {
|
|
18383
18772
|
const result = reader.result;
|
|
18384
18773
|
const oldDrawingId = core.api.getState().drawing.active;
|
|
18385
|
-
const drawingId = await classcad.ccAPI.base.createCCDrawing(file.name);
|
|
18774
|
+
const drawingId = await classcad.ccAPI.base.createCCDrawing(file.name).catch(console.warn);
|
|
18386
18775
|
|
|
18387
18776
|
if (drawingId) {
|
|
18388
18777
|
try {
|
|
18389
18778
|
core.api.getState().api.setActiveDrawing(drawingId);
|
|
18390
18779
|
const type = pathBrowserify.extname(file.name).replace('.', '');
|
|
18391
|
-
await classcad.ccAPI.baseModeler.load(drawingId, result, type, file.name);
|
|
18780
|
+
await classcad.ccAPI.baseModeler.load(drawingId, result, type, file.name).catch(console.warn);
|
|
18392
18781
|
|
|
18393
18782
|
if (oldDrawingId && singleDrawingApp) {
|
|
18394
18783
|
core.api.getState().api.removeDrawing(oldDrawingId);
|
|
@@ -18416,7 +18805,7 @@ const Readfile = /*#__PURE__*/React.forwardRef(({
|
|
|
18416
18805
|
const readFile = React.useCallback(event => {
|
|
18417
18806
|
if (event.target && event.target.files) {
|
|
18418
18807
|
const file = event.target.files[0];
|
|
18419
|
-
load(file, singleDrawingApp);
|
|
18808
|
+
load(file, singleDrawingApp).catch(console.warn);
|
|
18420
18809
|
event.target.value = '';
|
|
18421
18810
|
}
|
|
18422
18811
|
}, [singleDrawingApp]);
|
|
@@ -20626,9 +21015,9 @@ const List$1 = ({
|
|
|
20626
21015
|
const move = classcad.ccAPI.feature.rollback.calculateMovement(oldIndex, newIndex, features, offset);
|
|
20627
21016
|
|
|
20628
21017
|
if (move.moveTo === 'end') {
|
|
20629
|
-
classcad.ccAPI.feature.rollback.moveToEnd(drawingId).catch();
|
|
21018
|
+
classcad.ccAPI.feature.rollback.moveToEnd(drawingId).catch(console.warn);
|
|
20630
21019
|
} else {
|
|
20631
|
-
classcad.ccAPI.feature.rollback.moveBefore(drawingId, move.featureId).catch();
|
|
21020
|
+
classcad.ccAPI.feature.rollback.moveBefore(drawingId, move.featureId).catch(console.warn);
|
|
20632
21021
|
}
|
|
20633
21022
|
}
|
|
20634
21023
|
}, featureRefIds.map(refId => /*#__PURE__*/React.createElement(Item$1, {
|
|
@@ -20669,7 +21058,7 @@ function useMenuItems$1(drawingId, objectId, setRename) {
|
|
|
20669
21058
|
caption: 'delete',
|
|
20670
21059
|
icon: /*#__PURE__*/React.createElement(icons.DeleteOutlined, null),
|
|
20671
21060
|
callback: () => {
|
|
20672
|
-
classcad.ccAPI.baseModeler.deleteObject(drawingId, objectId);
|
|
21061
|
+
classcad.ccAPI.baseModeler.deleteObject(drawingId, objectId).catch(console.warn);
|
|
20673
21062
|
}
|
|
20674
21063
|
}
|
|
20675
21064
|
};
|
|
@@ -21013,7 +21402,7 @@ const NameChoice = ({
|
|
|
21013
21402
|
visible: true,
|
|
21014
21403
|
onCancel: hideWindow,
|
|
21015
21404
|
onOk: () => {
|
|
21016
|
-
classcad.ccAPI.assemblyBuilder.convertToTemplate(drawingId, subName);
|
|
21405
|
+
classcad.ccAPI.assemblyBuilder.convertToTemplate(drawingId, subName).catch(console.warn);
|
|
21017
21406
|
hideWindow();
|
|
21018
21407
|
}
|
|
21019
21408
|
}, "New SubAssembly Name: ", /*#__PURE__*/React.createElement(antd.Input, {
|
|
@@ -21207,8 +21596,8 @@ const ColorPicker = ({
|
|
|
21207
21596
|
});
|
|
21208
21597
|
}, [drawingId, solidId]);
|
|
21209
21598
|
const applyColor = React.useCallback(async () => {
|
|
21210
|
-
await classcad.ccAPI.
|
|
21211
|
-
await classcad.ccAPI.
|
|
21599
|
+
await classcad.ccAPI.baseModeler.setColor(drawingId, [solidOwner], userColor.r, userColor.g, userColor.b).catch(console.warn);
|
|
21600
|
+
await classcad.ccAPI.baseModeler.setTransparency(drawingId, [solidOwner], 1 - userColor.a).catch(console.warn); // Update color in geometry
|
|
21212
21601
|
// TODO: use 256 format directly
|
|
21213
21602
|
|
|
21214
21603
|
core.getDrawing(drawingId).api.geometry.setColor(solidId, userColor.r / 255, userColor.g / 255, userColor.b / 255);
|
|
@@ -21536,7 +21925,7 @@ const PartModeCmds = (drawingId, rootId) => {
|
|
|
21536
21925
|
const pluginApi = core.getDrawing(drawingId).api.plugin;
|
|
21537
21926
|
|
|
21538
21927
|
const wrapper = cmd => async () => {
|
|
21539
|
-
const res = await cmd();
|
|
21928
|
+
const res = await cmd().catch(console.warn);
|
|
21540
21929
|
|
|
21541
21930
|
if (res && res.errors && res.errors.length === 0 && res.results[0].result !== null) {
|
|
21542
21931
|
pluginApi.setActiveFeature(res.results[0].result);
|
|
@@ -21551,7 +21940,7 @@ const PartModeCmds = (drawingId, rootId) => {
|
|
|
21551
21940
|
Sketch: {
|
|
21552
21941
|
label: 'Sketch',
|
|
21553
21942
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
21554
|
-
url: img$
|
|
21943
|
+
url: img$x
|
|
21555
21944
|
}),
|
|
21556
21945
|
callback: wrapper(() => classcad.ccAPI.sketcher.createSketch(drawingId, rootId))
|
|
21557
21946
|
},
|
|
@@ -21583,13 +21972,13 @@ const PartModeCmds = (drawingId, rootId) => {
|
|
|
21583
21972
|
Solid: [{
|
|
21584
21973
|
label: 'Extrusion',
|
|
21585
21974
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
21586
|
-
url: img$
|
|
21975
|
+
url: img$H
|
|
21587
21976
|
}),
|
|
21588
21977
|
callback: wrapper(() => featureApi.createExtrusion(drawingId, rootId))
|
|
21589
21978
|
}, {
|
|
21590
21979
|
label: 'Revolve',
|
|
21591
21980
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
21592
|
-
url: img$
|
|
21981
|
+
url: img$G
|
|
21593
21982
|
}),
|
|
21594
21983
|
callback: wrapper(() => featureApi.createRevolve(drawingId, rootId))
|
|
21595
21984
|
}],
|
|
@@ -21641,7 +22030,7 @@ const PartModeCmds = (drawingId, rootId) => {
|
|
|
21641
22030
|
}, {
|
|
21642
22031
|
label: 'Mirror',
|
|
21643
22032
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
21644
|
-
url: img$
|
|
22033
|
+
url: img$u
|
|
21645
22034
|
}),
|
|
21646
22035
|
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, classcad.CCClasses.CCMirror, 'Mirror'))
|
|
21647
22036
|
}],
|
|
@@ -21718,7 +22107,7 @@ const AssemblyModeCmds = (drawingId, rootId) => {
|
|
|
21718
22107
|
const pluginApi = core.getDrawing(drawingId).api.plugin;
|
|
21719
22108
|
|
|
21720
22109
|
const wrapper = cmd => async () => {
|
|
21721
|
-
const res = await cmd();
|
|
22110
|
+
const res = await cmd().catch(console.warn);
|
|
21722
22111
|
|
|
21723
22112
|
if (res && res.errors && res.errors.length === 0 && res.results[0].result !== null) {
|
|
21724
22113
|
pluginApi.setActiveFeature(res.results[0].result);
|
|
@@ -21978,7 +22367,7 @@ const useOptionCommands = () => {
|
|
|
21978
22367
|
}, {
|
|
21979
22368
|
label: 'Vertices',
|
|
21980
22369
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
21981
|
-
url: img$
|
|
22370
|
+
url: img$F
|
|
21982
22371
|
}),
|
|
21983
22372
|
isChecked: showVertices,
|
|
21984
22373
|
command: () => setShowVertices(!showVertices)
|