@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.js
CHANGED
|
@@ -32,9 +32,9 @@ import { SortableContainer, SortableElement } from 'react-sortable-hoc';
|
|
|
32
32
|
import { RgbaColorPicker } from 'react-colorful';
|
|
33
33
|
import * as deepmerge from 'deepmerge';
|
|
34
34
|
|
|
35
|
-
function ownKeys$
|
|
35
|
+
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; }
|
|
36
36
|
|
|
37
|
-
function _objectSpread$
|
|
37
|
+
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; }
|
|
38
38
|
function getGraphicId(tree, refOrObjId) {
|
|
39
39
|
const res = {
|
|
40
40
|
graphicId: refOrObjId,
|
|
@@ -56,7 +56,7 @@ function getGraphicId(tree, refOrObjId) {
|
|
|
56
56
|
var _refOrObj$members3;
|
|
57
57
|
|
|
58
58
|
res.graphicId = (_refOrObj$members3 = refOrObj.members) == null ? void 0 : _refOrObj$members3.faceId.value;
|
|
59
|
-
} else if (ccUtils.base.isA(refOrObj.class, CCClasses.
|
|
59
|
+
} else if (ccUtils.base.isA(refOrObj.class, CCClasses.CCBody)) {
|
|
60
60
|
res.graphicId = refOrObj.id;
|
|
61
61
|
res.isSolid = true;
|
|
62
62
|
} else {
|
|
@@ -102,7 +102,7 @@ function useSelectedItems(drawingId, refOrObjIds) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
const createSelItem = React__default.useCallback(element => {
|
|
105
|
-
return createGraphicItem(prodId, _objectSpread$
|
|
105
|
+
return createGraphicItem(prodId, _objectSpread$n(_objectSpread$n({}, element), {}, {
|
|
106
106
|
productId: prodId
|
|
107
107
|
}));
|
|
108
108
|
}, [prodId]);
|
|
@@ -133,7 +133,7 @@ function useSelectedItems(drawingId, refOrObjIds) {
|
|
|
133
133
|
const elem = cont.map[Number(grIds[0])];
|
|
134
134
|
|
|
135
135
|
if (elem) {
|
|
136
|
-
elems.push(_objectSpread$
|
|
136
|
+
elems.push(_objectSpread$n(_objectSpread$n({}, elem), {}, {
|
|
137
137
|
graphicId: contId,
|
|
138
138
|
type: cont.type
|
|
139
139
|
}));
|
|
@@ -171,9 +171,9 @@ function useSelectedItems(drawingId, refOrObjIds) {
|
|
|
171
171
|
return selectedItems;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
function ownKeys$
|
|
174
|
+
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; }
|
|
175
175
|
|
|
176
|
-
function _objectSpread$
|
|
176
|
+
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; }
|
|
177
177
|
function addMembers(drawingId, ccObjId) {
|
|
178
178
|
const drawingState = getDrawing(drawingId);
|
|
179
179
|
const objInTree = drawingState.structure.tree[ccObjId];
|
|
@@ -186,7 +186,7 @@ function addMembers(drawingId, ccObjId) {
|
|
|
186
186
|
const members = {};
|
|
187
187
|
Object.keys(curMembers).forEach(memberName => {
|
|
188
188
|
const curMember = curMembers[memberName];
|
|
189
|
-
members[memberName] = _objectSpread$
|
|
189
|
+
members[memberName] = _objectSpread$m(_objectSpread$m({}, curMember), {}, {
|
|
190
190
|
name: memberName
|
|
191
191
|
});
|
|
192
192
|
|
|
@@ -541,10 +541,9 @@ const Wrapper = ({
|
|
|
541
541
|
gridColumnStart: '1',
|
|
542
542
|
gridColumnEnd: '2',
|
|
543
543
|
color: 'rgba(0, 0, 0, 0.85)',
|
|
544
|
-
margin: '0px 0px 1px 0px',
|
|
544
|
+
margin: minor ? '-2px 0px 1px 0px' : '0px 0px 1px 0px',
|
|
545
545
|
fontSize: minor ? '12px' : '14px',
|
|
546
|
-
|
|
547
|
-
textAlign: minor ? 'center' : 'start'
|
|
546
|
+
paddingLeft: minor ? '6px' : undefined
|
|
548
547
|
},
|
|
549
548
|
ellipsis: true,
|
|
550
549
|
bold: highlighted
|
|
@@ -1031,9 +1030,9 @@ const isAngular = dim => {
|
|
|
1031
1030
|
return dim.class === CCClasses.CCAngularDimension || dim.class === CCClasses.CCAngularFeatureDimension || dim.class === CCClasses.CCAngularRefDimension;
|
|
1032
1031
|
};
|
|
1033
1032
|
|
|
1034
|
-
function ownKeys$
|
|
1033
|
+
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; }
|
|
1035
1034
|
|
|
1036
|
-
function _objectSpread$
|
|
1035
|
+
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; }
|
|
1037
1036
|
const appApi = (set, get) => ({
|
|
1038
1037
|
assemblyTree: {
|
|
1039
1038
|
startProdEditing: (drawingId, objId) => {
|
|
@@ -1042,13 +1041,13 @@ const appApi = (set, get) => ({
|
|
|
1042
1041
|
const curNode = api.getState().drawing.refs[drawingId].structure.currentNode;
|
|
1043
1042
|
res = state.assemblyTree.prodStack;
|
|
1044
1043
|
curNode && res.push(curNode);
|
|
1045
|
-
return _objectSpread$
|
|
1044
|
+
return _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
1046
1045
|
assemblyTree: {
|
|
1047
1046
|
prodStack: [...res]
|
|
1048
1047
|
}
|
|
1049
1048
|
});
|
|
1050
1049
|
});
|
|
1051
|
-
ccAPI.assemblyBuilder.setCurrentNode(drawingId, objId).catch();
|
|
1050
|
+
ccAPI.assemblyBuilder.setCurrentNode(drawingId, objId).catch(console.warn);
|
|
1052
1051
|
},
|
|
1053
1052
|
goBack: drawingId => {
|
|
1054
1053
|
const prodStack = get().assemblyTree.prodStack;
|
|
@@ -1057,16 +1056,16 @@ const appApi = (set, get) => ({
|
|
|
1057
1056
|
set(state => {
|
|
1058
1057
|
const res = state.assemblyTree.prodStack;
|
|
1059
1058
|
res.pop();
|
|
1060
|
-
return _objectSpread$
|
|
1059
|
+
return _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
1061
1060
|
assemblyTree: {
|
|
1062
1061
|
prodStack: [...res]
|
|
1063
1062
|
}
|
|
1064
1063
|
});
|
|
1065
1064
|
});
|
|
1066
|
-
ccAPI.assemblyBuilder.setCurrentNode(drawingId, prevProd).catch();
|
|
1065
|
+
ccAPI.assemblyBuilder.setCurrentNode(drawingId, prevProd).catch(console.warn);
|
|
1067
1066
|
},
|
|
1068
1067
|
clearProdStack: () => {
|
|
1069
|
-
set(state => _objectSpread$
|
|
1068
|
+
set(state => _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
1070
1069
|
assemblyTree: {
|
|
1071
1070
|
prodStack: []
|
|
1072
1071
|
}
|
|
@@ -1075,7 +1074,7 @@ const appApi = (set, get) => ({
|
|
|
1075
1074
|
},
|
|
1076
1075
|
blankDiv: {
|
|
1077
1076
|
show: callback => {
|
|
1078
|
-
set(state => _objectSpread$
|
|
1077
|
+
set(state => _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
1079
1078
|
blankDiv: {
|
|
1080
1079
|
isActive: true,
|
|
1081
1080
|
onClose: callback
|
|
@@ -1083,7 +1082,7 @@ const appApi = (set, get) => ({
|
|
|
1083
1082
|
}));
|
|
1084
1083
|
},
|
|
1085
1084
|
hide: () => {
|
|
1086
|
-
set(state => _objectSpread$
|
|
1085
|
+
set(state => _objectSpread$l(_objectSpread$l({}, state), {}, {
|
|
1087
1086
|
blankDiv: {
|
|
1088
1087
|
isActive: false,
|
|
1089
1088
|
onClose: undefined
|
|
@@ -1209,7 +1208,7 @@ const DimValue = ({
|
|
|
1209
1208
|
const master_ = getDrawing(drawingId).structure.tree[masterId];
|
|
1210
1209
|
|
|
1211
1210
|
if (isSketchConstr) {
|
|
1212
|
-
ccAPI.base.callSafeAPI(drawingId, 'Sketcher', 'UpdateDimensionValue', [dimId, [valueParam.serverValue.value, valueParam.serverValue.isExpr]]).catch();
|
|
1211
|
+
ccAPI.base.callSafeAPI(drawingId, 'Sketcher', 'UpdateDimensionValue', [dimId, [valueParam.serverValue.value, valueParam.serverValue.isExpr]]).catch(console.warn);
|
|
1213
1212
|
} else {
|
|
1214
1213
|
switch (master_.class) {
|
|
1215
1214
|
case CCClasses.CCExtrusion:
|
|
@@ -1230,7 +1229,7 @@ const DimValue = ({
|
|
|
1230
1229
|
}, {
|
|
1231
1230
|
value: direction,
|
|
1232
1231
|
isExpr: false
|
|
1233
|
-
}, capEnds).catch();
|
|
1232
|
+
}, capEnds).catch(console.warn);
|
|
1234
1233
|
break;
|
|
1235
1234
|
}
|
|
1236
1235
|
}
|
|
@@ -1378,7 +1377,7 @@ const PositionHandler = ({
|
|
|
1378
1377
|
const te = e;
|
|
1379
1378
|
|
|
1380
1379
|
if (isDragged.current) {
|
|
1381
|
-
ccAPI.common.updateDimensionPosition(drawingId, dimId, position);
|
|
1380
|
+
ccAPI.common.updateDimensionPosition(drawingId, dimId, position).catch(console.warn);
|
|
1382
1381
|
} else {
|
|
1383
1382
|
setPState(state => {
|
|
1384
1383
|
const sel = state.selected;
|
|
@@ -2111,7 +2110,7 @@ function ViewImpl$f({
|
|
|
2111
2110
|
if (e.key === 'Delete') {
|
|
2112
2111
|
const selected = getPlugin(drawingId, pluginId).state.selected;
|
|
2113
2112
|
if (selected.length === 0) return;
|
|
2114
|
-
ccAPI.feature.deleteDimensions(drawingId, selected);
|
|
2113
|
+
ccAPI.feature.deleteDimensions(drawingId, selected).catch(console.warn);
|
|
2115
2114
|
}
|
|
2116
2115
|
}, [drawingId, pluginId]);
|
|
2117
2116
|
React__default.useEffect(() => {
|
|
@@ -2166,7 +2165,7 @@ const Dimension = ({
|
|
|
2166
2165
|
} = param;
|
|
2167
2166
|
const update = React__default.useCallback(() => {
|
|
2168
2167
|
if (isSketchConstr) {
|
|
2169
|
-
ccAPI.sketcher.updateDimensionValue(drawingId, dimId, serverValue);
|
|
2168
|
+
ccAPI.sketcher.updateDimensionValue(drawingId, dimId, serverValue).catch(console.warn);
|
|
2170
2169
|
} else {
|
|
2171
2170
|
switch (master == null ? void 0 : master.class) {
|
|
2172
2171
|
case CCClasses.CCExtrusion:
|
|
@@ -2194,7 +2193,7 @@ const Dimension = ({
|
|
|
2194
2193
|
}, {
|
|
2195
2194
|
value: direction,
|
|
2196
2195
|
isExpr: false
|
|
2197
|
-
}, capEnds).catch();
|
|
2196
|
+
}, capEnds).catch(console.warn);
|
|
2198
2197
|
break;
|
|
2199
2198
|
}
|
|
2200
2199
|
}
|
|
@@ -2366,9 +2365,9 @@ function useRefsParam(drawingId, objId, memberName) {
|
|
|
2366
2365
|
});
|
|
2367
2366
|
}
|
|
2368
2367
|
|
|
2369
|
-
function ownKeys$
|
|
2368
|
+
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; }
|
|
2370
2369
|
|
|
2371
|
-
function _objectSpread$
|
|
2370
|
+
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; }
|
|
2372
2371
|
/**
|
|
2373
2372
|
* Implies the following data structure:
|
|
2374
2373
|
* data: {
|
|
@@ -2505,7 +2504,7 @@ function useTreeObjSelection(drawingId, objId) {
|
|
|
2505
2504
|
const isSelected = useIsSelected$1(drawingId, objId);
|
|
2506
2505
|
const handlers = React__default.useMemo(() => {
|
|
2507
2506
|
if (isSelectable) {
|
|
2508
|
-
return _objectSpread$
|
|
2507
|
+
return _objectSpread$k(_objectSpread$k({}, hHandlers), sHandlers);
|
|
2509
2508
|
}
|
|
2510
2509
|
|
|
2511
2510
|
return {};
|
|
@@ -2534,7 +2533,7 @@ const isGeometry = (tree, objId) => {
|
|
|
2534
2533
|
return true;
|
|
2535
2534
|
} else {
|
|
2536
2535
|
// If obj isn't one of next classes, the TreeObjScope item should be resstored.
|
|
2537
|
-
return ccUtils.base.isA(obj.class, CCClasses.
|
|
2536
|
+
return ccUtils.base.isA(obj.class, CCClasses.CCBody) || ccUtils.base.isA(obj.class, CCClasses.CCBrepReference);
|
|
2538
2537
|
}
|
|
2539
2538
|
};
|
|
2540
2539
|
const getInteractionInfo = (drawingId, item) => {
|
|
@@ -2992,9 +2991,9 @@ const SelectionRestorer = ({
|
|
|
2992
2991
|
return null;
|
|
2993
2992
|
};
|
|
2994
2993
|
|
|
2995
|
-
function ownKeys$
|
|
2994
|
+
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; }
|
|
2996
2995
|
|
|
2997
|
-
function _objectSpread$
|
|
2996
|
+
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; }
|
|
2998
2997
|
/**
|
|
2999
2998
|
* Implies the following data structure:
|
|
3000
2999
|
* data: {
|
|
@@ -3097,7 +3096,7 @@ function useMateSelection(drawingId, matePath, csysId) {
|
|
|
3097
3096
|
}));
|
|
3098
3097
|
const handlers = React__default.useMemo(() => {
|
|
3099
3098
|
if (isSelectable) {
|
|
3100
|
-
return _objectSpread$
|
|
3099
|
+
return _objectSpread$j(_objectSpread$j({}, hHandlers), sHandlers);
|
|
3101
3100
|
}
|
|
3102
3101
|
|
|
3103
3102
|
return {};
|
|
@@ -3527,7 +3526,7 @@ const PluginForm = ({
|
|
|
3527
3526
|
return;
|
|
3528
3527
|
}
|
|
3529
3528
|
|
|
3530
|
-
update().then(closePlugin).catch();
|
|
3529
|
+
update().then(closePlugin).catch(console.warn);
|
|
3531
3530
|
}, [update, closePlugin, params, validator]);
|
|
3532
3531
|
const onKeyUp = React__default.useCallback(e => {
|
|
3533
3532
|
if (e.keyCode === 13) {
|
|
@@ -3659,12 +3658,12 @@ function useSelectorsOrder(drawingId) {
|
|
|
3659
3658
|
}), [addSelector, removeSelector, switchToNext]);
|
|
3660
3659
|
}
|
|
3661
3660
|
|
|
3662
|
-
var Members$
|
|
3661
|
+
var Members$s;
|
|
3663
3662
|
|
|
3664
3663
|
(function (Members) {
|
|
3665
3664
|
Members["Body1"] = "Body1";
|
|
3666
3665
|
Members["Body2"] = "Body2";
|
|
3667
|
-
})(Members$
|
|
3666
|
+
})(Members$s || (Members$s = {}));
|
|
3668
3667
|
|
|
3669
3668
|
const typesCaptions$6 = {
|
|
3670
3669
|
[BooleanOperationType.INTERSECTION]: 'Intersection',
|
|
@@ -3698,8 +3697,8 @@ function RootImpl$x({
|
|
|
3698
3697
|
objectId
|
|
3699
3698
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
3700
3699
|
const type = useBoolTypeStore(drawingId, objectId);
|
|
3701
|
-
const body1 = useIdParam(drawingId, objectId, Members$
|
|
3702
|
-
const body2 = useRefsParam(drawingId, objectId, Members$
|
|
3700
|
+
const body1 = useIdParam(drawingId, objectId, Members$s.Body1);
|
|
3701
|
+
const body2 = useRefsParam(drawingId, objectId, Members$s.Body2);
|
|
3703
3702
|
const update = React__default.useCallback(() => {
|
|
3704
3703
|
return ccAPI.feature.updateBooleanOperation(drawingId, objectId, type.serverValue, [body1.serverValue, ...body2.serverValue]);
|
|
3705
3704
|
}, [drawingId, objectId, type, body1, body2]);
|
|
@@ -3964,9 +3963,9 @@ function usePointParam(drawingId, objId, memberName, options = {
|
|
|
3964
3963
|
}, getServValue);
|
|
3965
3964
|
}
|
|
3966
3965
|
|
|
3967
|
-
var img$
|
|
3966
|
+
var img$10 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADcSURBVEhL3ZTbDcMgDEVJlsgonabfnanfmaajdIlSS0aU+lWEsaLmCCkhMfheB2fJOadI1nIN49wJlv0Jo0xGURPUrZ05wkskH1OuOl+3ctfQE3bERxaLbnyJ+2WFUSYMy4G9shO63lBqvDJQBVbtThNfi39qHDAhqyOqPSY+fcDV4b63xwunFTjsbTAPa7thXFonQidXdURaq4vEIBhJmnnQAf8l8Eoi3hJp+1bGE3ATAH/odQCACcOHKwHRK3qa4AARdwemJdCw+oCgabQJd3BEieby/yUKTpDSG4InWqXAb1/sAAAAAElFTkSuQmCC";
|
|
3968
3967
|
|
|
3969
|
-
var img
|
|
3968
|
+
var img$$ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADjSURBVEhL3ZbbDcIwDEXTLsEoTMM3M/HNNIzCEgRLDpbrRx1iRTyOIrVR09x7ncrqUmstM1nbdRq/LzB4Bsv13u621NOh3b344zOAIuBoc4fLcYXRJhYfShAa78cQELsnxdwShcXtRG5h+s2ECDzmQ9jv632HQ2xaBd8FNc63B04BaANaRi9DqGdkKxBiNDu0ya3xFkYhdBkpB18/nkCURVcJeVtAN2SBWJA6A3Lt2QdGBHZC6EepBAB437EPuF8Rx7TcuSybICT148VDeAczPUFKgFx79oFUiXr47hL1MFmglCeKs2HMN70YFwAAAABJRU5ErkJggg==";
|
|
3970
3969
|
|
|
3971
3970
|
const invert = (value, inverted) => {
|
|
3972
3971
|
return inverted ? 1 - value : value;
|
|
@@ -3982,6 +3981,8 @@ const BooleanEditor = ({
|
|
|
3982
3981
|
Button,
|
|
3983
3982
|
Checkbox
|
|
3984
3983
|
} = useBuerli(buerli => buerli.options.elements);
|
|
3984
|
+
const icon_ = Array.isArray(icon) ? true : Boolean(icon);
|
|
3985
|
+
const icons = Array.isArray(icon) && icon.length == 2 ? icon : [img$10, img$$];
|
|
3985
3986
|
const {
|
|
3986
3987
|
setUserValue,
|
|
3987
3988
|
userValue,
|
|
@@ -3998,8 +3999,8 @@ const BooleanEditor = ({
|
|
|
3998
3999
|
React__default.useEffect(() => {
|
|
3999
4000
|
return () => setUserValue(defaults);
|
|
4000
4001
|
}, [setUserValue, defaults]);
|
|
4001
|
-
return
|
|
4002
|
-
iconSrc: invert(userValue, inverted) === 0 ?
|
|
4002
|
+
return icon_ ? /*#__PURE__*/React__default.createElement(Button, {
|
|
4003
|
+
iconSrc: invert(userValue, inverted) === 0 ? icons[0] : icons[1],
|
|
4003
4004
|
onClick: onClick
|
|
4004
4005
|
}) : /*#__PURE__*/React__default.createElement(Wrapper, {
|
|
4005
4006
|
caption: caption,
|
|
@@ -4034,7 +4035,7 @@ function useBoolParam(drawingId, objId, memberName) {
|
|
|
4034
4035
|
});
|
|
4035
4036
|
}
|
|
4036
4037
|
|
|
4037
|
-
var Members$
|
|
4038
|
+
var Members$r;
|
|
4038
4039
|
|
|
4039
4040
|
(function (Members) {
|
|
4040
4041
|
Members["Type"] = "extrudeType";
|
|
@@ -4043,7 +4044,7 @@ var Members$q;
|
|
|
4043
4044
|
Members["Limit2"] = "limit2";
|
|
4044
4045
|
Members["taperAngle"] = "taperAngle";
|
|
4045
4046
|
Members["capEnds"] = "capEnds";
|
|
4046
|
-
})(Members$
|
|
4047
|
+
})(Members$r || (Members$r = {}));
|
|
4047
4048
|
|
|
4048
4049
|
var RegionMembers$1;
|
|
4049
4050
|
|
|
@@ -4071,14 +4072,14 @@ const RootImpl$w = ({
|
|
|
4071
4072
|
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;
|
|
4072
4073
|
});
|
|
4073
4074
|
const region = useRefsParam(drawingId, sketchRegionId, RegionMembers$1.Curves);
|
|
4074
|
-
const type = useTypeParam(drawingId, objectId, Members$
|
|
4075
|
-
const limit1 = useNumParam(drawingId, objectId, Members$
|
|
4076
|
-
const limit2 = useNumParam(drawingId, objectId, Members$
|
|
4077
|
-
const taperAngle = useNumParam(drawingId, objectId, Members$
|
|
4075
|
+
const type = useTypeParam(drawingId, objectId, Members$r.Type);
|
|
4076
|
+
const limit1 = useNumParam(drawingId, objectId, Members$r.Limit1);
|
|
4077
|
+
const limit2 = useNumParam(drawingId, objectId, Members$r.Limit2);
|
|
4078
|
+
const taperAngle = useNumParam(drawingId, objectId, Members$r.taperAngle, {
|
|
4078
4079
|
angle: true
|
|
4079
4080
|
});
|
|
4080
|
-
const direction = usePointParam(drawingId, objectId, Members$
|
|
4081
|
-
const capEnds = useBoolParam(drawingId, objectId, Members$
|
|
4081
|
+
const direction = usePointParam(drawingId, objectId, Members$r.Direction);
|
|
4082
|
+
const capEnds = useBoolParam(drawingId, objectId, Members$r.capEnds);
|
|
4082
4083
|
const sketchId = React__default.useRef(NOCCID);
|
|
4083
4084
|
React__default.useEffect(() => {
|
|
4084
4085
|
var _tree$sketchGeometryI;
|
|
@@ -4187,14 +4188,14 @@ var index$w = /*#__PURE__*/Object.freeze({
|
|
|
4187
4188
|
description: description$w
|
|
4188
4189
|
});
|
|
4189
4190
|
|
|
4190
|
-
var Members$
|
|
4191
|
+
var Members$q;
|
|
4191
4192
|
|
|
4192
4193
|
(function (Members) {
|
|
4193
4194
|
Members["Axis"] = "references";
|
|
4194
4195
|
Members["Inverted"] = "inverted";
|
|
4195
4196
|
Members["StartAngle"] = "startAngle";
|
|
4196
4197
|
Members["EndAngle"] = "endAngle";
|
|
4197
|
-
})(Members$
|
|
4198
|
+
})(Members$q || (Members$q = {}));
|
|
4198
4199
|
|
|
4199
4200
|
var RegionMembers;
|
|
4200
4201
|
|
|
@@ -4215,14 +4216,14 @@ const RootImpl$v = ({
|
|
|
4215
4216
|
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;
|
|
4216
4217
|
});
|
|
4217
4218
|
const region = useRefsParam(drawingId, sketchRegionId, RegionMembers.Curves);
|
|
4218
|
-
const axis = useRefsParam(drawingId, objectId, Members$
|
|
4219
|
-
const startAngle = useNumParam(drawingId, objectId, Members$
|
|
4219
|
+
const axis = useRefsParam(drawingId, objectId, Members$q.Axis);
|
|
4220
|
+
const startAngle = useNumParam(drawingId, objectId, Members$q.StartAngle, {
|
|
4220
4221
|
angle: true
|
|
4221
4222
|
});
|
|
4222
|
-
const endAngle = useNumParam(drawingId, objectId, Members$
|
|
4223
|
+
const endAngle = useNumParam(drawingId, objectId, Members$q.EndAngle, {
|
|
4223
4224
|
angle: true
|
|
4224
4225
|
});
|
|
4225
|
-
const inverted = useBoolParam(drawingId, objectId, Members$
|
|
4226
|
+
const inverted = useBoolParam(drawingId, objectId, Members$q.Inverted);
|
|
4226
4227
|
const sketchId = React__default.useRef(NOCCID);
|
|
4227
4228
|
React__default.useEffect(() => {
|
|
4228
4229
|
var _tree$sketchGeometryI;
|
|
@@ -4304,14 +4305,14 @@ var index$v = /*#__PURE__*/Object.freeze({
|
|
|
4304
4305
|
description: description$v
|
|
4305
4306
|
});
|
|
4306
4307
|
|
|
4307
|
-
var Members$
|
|
4308
|
+
var Members$p;
|
|
4308
4309
|
|
|
4309
4310
|
(function (Members) {
|
|
4310
4311
|
Members["CSys"] = "references";
|
|
4311
4312
|
Members["Width"] = "width";
|
|
4312
4313
|
Members["Height"] = "height";
|
|
4313
4314
|
Members["Length"] = "length";
|
|
4314
|
-
})(Members$
|
|
4315
|
+
})(Members$p || (Members$p = {}));
|
|
4315
4316
|
|
|
4316
4317
|
function RootImpl$u({
|
|
4317
4318
|
drawingId,
|
|
@@ -4320,10 +4321,10 @@ function RootImpl$u({
|
|
|
4320
4321
|
const {
|
|
4321
4322
|
objectId
|
|
4322
4323
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4323
|
-
const csys = useRefsParam(drawingId, objectId, Members$
|
|
4324
|
-
const width = useNumParam(drawingId, objectId, Members$
|
|
4325
|
-
const height = useNumParam(drawingId, objectId, Members$
|
|
4326
|
-
const length = useNumParam(drawingId, objectId, Members$
|
|
4324
|
+
const csys = useRefsParam(drawingId, objectId, Members$p.CSys);
|
|
4325
|
+
const width = useNumParam(drawingId, objectId, Members$p.Width);
|
|
4326
|
+
const height = useNumParam(drawingId, objectId, Members$p.Height);
|
|
4327
|
+
const length = useNumParam(drawingId, objectId, Members$p.Length);
|
|
4327
4328
|
const update = React__default.useCallback(() => {
|
|
4328
4329
|
return ccAPI.feature.updateBox(drawingId, objectId, csys.serverValue, width.serverValue, length.serverValue, height.serverValue);
|
|
4329
4330
|
}, [drawingId, objectId, csys, width, height, length]);
|
|
@@ -4401,12 +4402,12 @@ var index$u = /*#__PURE__*/Object.freeze({
|
|
|
4401
4402
|
description: description$u
|
|
4402
4403
|
});
|
|
4403
4404
|
|
|
4404
|
-
var Members$
|
|
4405
|
+
var Members$o;
|
|
4405
4406
|
|
|
4406
4407
|
(function (Members) {
|
|
4407
4408
|
Members["CSys"] = "references";
|
|
4408
4409
|
Members["Radius"] = "radius";
|
|
4409
|
-
})(Members$
|
|
4410
|
+
})(Members$o || (Members$o = {}));
|
|
4410
4411
|
|
|
4411
4412
|
function RootImpl$t({
|
|
4412
4413
|
drawingId,
|
|
@@ -4415,8 +4416,8 @@ function RootImpl$t({
|
|
|
4415
4416
|
const {
|
|
4416
4417
|
objectId
|
|
4417
4418
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4418
|
-
const csys = useRefsParam(drawingId, objectId, Members$
|
|
4419
|
-
const radius = useNumParam(drawingId, objectId, Members$
|
|
4419
|
+
const csys = useRefsParam(drawingId, objectId, Members$o.CSys);
|
|
4420
|
+
const radius = useNumParam(drawingId, objectId, Members$o.Radius);
|
|
4420
4421
|
const update = React__default.useCallback(() => {
|
|
4421
4422
|
return ccAPI.feature.updateSphere(drawingId, objectId, csys.userValue, radius.userValue);
|
|
4422
4423
|
}, [drawingId, objectId, csys, radius]);
|
|
@@ -4474,13 +4475,13 @@ var index$t = /*#__PURE__*/Object.freeze({
|
|
|
4474
4475
|
description: description$t
|
|
4475
4476
|
});
|
|
4476
4477
|
|
|
4477
|
-
var Members$
|
|
4478
|
+
var Members$n;
|
|
4478
4479
|
|
|
4479
4480
|
(function (Members) {
|
|
4480
4481
|
Members["CSys"] = "references";
|
|
4481
4482
|
Members["Diameter"] = "diameter";
|
|
4482
4483
|
Members["Height"] = "height";
|
|
4483
|
-
})(Members$
|
|
4484
|
+
})(Members$n || (Members$n = {}));
|
|
4484
4485
|
|
|
4485
4486
|
function RootImpl$s({
|
|
4486
4487
|
drawingId,
|
|
@@ -4489,9 +4490,9 @@ function RootImpl$s({
|
|
|
4489
4490
|
const {
|
|
4490
4491
|
objectId
|
|
4491
4492
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4492
|
-
const csys = useRefsParam(drawingId, objectId, Members$
|
|
4493
|
-
const diameter = useNumParam(drawingId, objectId, Members$
|
|
4494
|
-
const height = useNumParam(drawingId, objectId, Members$
|
|
4493
|
+
const csys = useRefsParam(drawingId, objectId, Members$n.CSys);
|
|
4494
|
+
const diameter = useNumParam(drawingId, objectId, Members$n.Diameter);
|
|
4495
|
+
const height = useNumParam(drawingId, objectId, Members$n.Height);
|
|
4495
4496
|
const update = React__default.useCallback(() => {
|
|
4496
4497
|
return ccAPI.feature.updateCylinder(drawingId, objectId, csys.serverValue, diameter.serverValue, height.serverValue);
|
|
4497
4498
|
}, [drawingId, objectId, csys, diameter, height]);
|
|
@@ -4559,14 +4560,14 @@ var index$s = /*#__PURE__*/Object.freeze({
|
|
|
4559
4560
|
description: description$s
|
|
4560
4561
|
});
|
|
4561
4562
|
|
|
4562
|
-
var Members$
|
|
4563
|
+
var Members$m;
|
|
4563
4564
|
|
|
4564
4565
|
(function (Members) {
|
|
4565
4566
|
Members["CSys"] = "references";
|
|
4566
4567
|
Members["BDiameter"] = "bDiameter";
|
|
4567
4568
|
Members["TDiameter"] = "tDiameter";
|
|
4568
4569
|
Members["Height"] = "height";
|
|
4569
|
-
})(Members$
|
|
4570
|
+
})(Members$m || (Members$m = {}));
|
|
4570
4571
|
|
|
4571
4572
|
function RootImpl$r({
|
|
4572
4573
|
drawingId,
|
|
@@ -4575,10 +4576,10 @@ function RootImpl$r({
|
|
|
4575
4576
|
const {
|
|
4576
4577
|
objectId
|
|
4577
4578
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4578
|
-
const csys = useRefsParam(drawingId, objectId, Members$
|
|
4579
|
-
const bDiameter = useNumParam(drawingId, objectId, Members$
|
|
4580
|
-
const tDiameter = useNumParam(drawingId, objectId, Members$
|
|
4581
|
-
const height = useNumParam(drawingId, objectId, Members$
|
|
4579
|
+
const csys = useRefsParam(drawingId, objectId, Members$m.CSys);
|
|
4580
|
+
const bDiameter = useNumParam(drawingId, objectId, Members$m.BDiameter);
|
|
4581
|
+
const tDiameter = useNumParam(drawingId, objectId, Members$m.TDiameter);
|
|
4582
|
+
const height = useNumParam(drawingId, objectId, Members$m.Height);
|
|
4582
4583
|
const update = React__default.useCallback(() => {
|
|
4583
4584
|
return ccAPI.feature.updateCone(drawingId, objectId, csys.serverValue, bDiameter.serverValue, tDiameter.serverValue, height.serverValue);
|
|
4584
4585
|
}, [drawingId, objectId, csys, bDiameter, tDiameter, height]);
|
|
@@ -4656,12 +4657,12 @@ var index$r = /*#__PURE__*/Object.freeze({
|
|
|
4656
4657
|
description: description$r
|
|
4657
4658
|
});
|
|
4658
4659
|
|
|
4659
|
-
var Members$
|
|
4660
|
+
var Members$l;
|
|
4660
4661
|
|
|
4661
4662
|
(function (Members) {
|
|
4662
4663
|
Members["References"] = "References";
|
|
4663
4664
|
Members["Radius"] = "radius";
|
|
4664
|
-
})(Members$
|
|
4665
|
+
})(Members$l || (Members$l = {}));
|
|
4665
4666
|
|
|
4666
4667
|
const RootImpl$q = ({
|
|
4667
4668
|
drawingId,
|
|
@@ -4670,8 +4671,8 @@ const RootImpl$q = ({
|
|
|
4670
4671
|
const {
|
|
4671
4672
|
objectId
|
|
4672
4673
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4673
|
-
const refs = useRefsParam(drawingId, objectId, Members$
|
|
4674
|
-
const radius = useNumParam(drawingId, objectId, Members$
|
|
4674
|
+
const refs = useRefsParam(drawingId, objectId, Members$l.References);
|
|
4675
|
+
const radius = useNumParam(drawingId, objectId, Members$l.Radius);
|
|
4675
4676
|
const update = React__default.useCallback(() => {
|
|
4676
4677
|
return ccAPI.feature.updateFillet(drawingId, objectId, refs.serverValue, radius.serverValue);
|
|
4677
4678
|
}, [drawingId, objectId, refs, radius]);
|
|
@@ -4724,7 +4725,7 @@ var index$q = /*#__PURE__*/Object.freeze({
|
|
|
4724
4725
|
description: description$q
|
|
4725
4726
|
});
|
|
4726
4727
|
|
|
4727
|
-
var Members$
|
|
4728
|
+
var Members$k;
|
|
4728
4729
|
|
|
4729
4730
|
(function (Members) {
|
|
4730
4731
|
Members["Type"] = "subType";
|
|
@@ -4732,7 +4733,7 @@ var Members$j;
|
|
|
4732
4733
|
Members["References"] = "References";
|
|
4733
4734
|
Members["Offset1"] = "offset1";
|
|
4734
4735
|
Members["Offset2"] = "offset2";
|
|
4735
|
-
})(Members$
|
|
4736
|
+
})(Members$k || (Members$k = {}));
|
|
4736
4737
|
|
|
4737
4738
|
const typesCaptions$4 = {
|
|
4738
4739
|
[ChamferType.DISTANCE_AND_ANGLE]: 'Distance and angle',
|
|
@@ -4750,11 +4751,11 @@ const RootImpl$p = ({
|
|
|
4750
4751
|
const {
|
|
4751
4752
|
objectId
|
|
4752
4753
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4753
|
-
const type = useTypeParam(drawingId, objectId, Members$
|
|
4754
|
-
const refs = useRefsParam(drawingId, objectId, Members$
|
|
4755
|
-
const offset1 = useNumParam(drawingId, objectId, Members$
|
|
4756
|
-
const offset2 = useNumParam(drawingId, objectId, Members$
|
|
4757
|
-
const angle = useNumParam(drawingId, objectId, Members$
|
|
4754
|
+
const type = useTypeParam(drawingId, objectId, Members$k.Type);
|
|
4755
|
+
const refs = useRefsParam(drawingId, objectId, Members$k.References);
|
|
4756
|
+
const offset1 = useNumParam(drawingId, objectId, Members$k.Offset1);
|
|
4757
|
+
const offset2 = useNumParam(drawingId, objectId, Members$k.Offset2);
|
|
4758
|
+
const angle = useNumParam(drawingId, objectId, Members$k.Angle, {
|
|
4758
4759
|
angle: true
|
|
4759
4760
|
});
|
|
4760
4761
|
const switchDirections = React__default.useCallback(() => {
|
|
@@ -4792,7 +4793,7 @@ const RootImpl$p = ({
|
|
|
4792
4793
|
param: offset1,
|
|
4793
4794
|
allowExpr: true
|
|
4794
4795
|
}, type.userValue === ChamferType.TWO_DISTANCES && /*#__PURE__*/React__default.createElement(Button, {
|
|
4795
|
-
iconSrc: img$
|
|
4796
|
+
iconSrc: img$10,
|
|
4796
4797
|
onClick: switchDirections
|
|
4797
4798
|
})), type.userValue === ChamferType.TWO_DISTANCES && /*#__PURE__*/React__default.createElement(NumberEditor, {
|
|
4798
4799
|
drawingId: drawingId,
|
|
@@ -4836,14 +4837,14 @@ var index$p = /*#__PURE__*/Object.freeze({
|
|
|
4836
4837
|
description: description$p
|
|
4837
4838
|
});
|
|
4838
4839
|
|
|
4839
|
-
var Members$
|
|
4840
|
+
var Members$j;
|
|
4840
4841
|
|
|
4841
4842
|
(function (Members) {
|
|
4842
4843
|
Members["SolidReferences"] = "bodiesToTransform";
|
|
4843
4844
|
Members["AxisReferences"] = "references";
|
|
4844
4845
|
Members["Distance"] = "translationDistance";
|
|
4845
4846
|
Members["Inverted"] = "inverted";
|
|
4846
|
-
})(Members$
|
|
4847
|
+
})(Members$j || (Members$j = {}));
|
|
4847
4848
|
|
|
4848
4849
|
function RootImpl$o({
|
|
4849
4850
|
drawingId,
|
|
@@ -4852,12 +4853,12 @@ function RootImpl$o({
|
|
|
4852
4853
|
const {
|
|
4853
4854
|
objectId
|
|
4854
4855
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4855
|
-
const solidRefs = useRefsParam(drawingId, objectId, Members$
|
|
4856
|
-
const axisRefs = useRefsParam(drawingId, objectId, Members$
|
|
4857
|
-
const distance = useNumParam(drawingId, objectId, Members$
|
|
4858
|
-
const inverted = useBoolParam(drawingId, objectId, Members$
|
|
4856
|
+
const solidRefs = useRefsParam(drawingId, objectId, Members$j.SolidReferences);
|
|
4857
|
+
const axisRefs = useRefsParam(drawingId, objectId, Members$j.AxisReferences);
|
|
4858
|
+
const distance = useNumParam(drawingId, objectId, Members$j.Distance);
|
|
4859
|
+
const inverted = useBoolParam(drawingId, objectId, Members$j.Inverted);
|
|
4859
4860
|
const update = React__default.useCallback(() => {
|
|
4860
|
-
return ccAPI.feature.updateTransformation(drawingId, objectId, solidRefs.serverValue, axisRefs.serverValue, inverted.serverValue, distance.serverValue)
|
|
4861
|
+
return ccAPI.feature.updateTransformation(drawingId, objectId, solidRefs.serverValue, axisRefs.serverValue, inverted.serverValue, distance.serverValue);
|
|
4861
4862
|
}, [drawingId, objectId, solidRefs, axisRefs, inverted, distance]);
|
|
4862
4863
|
return /*#__PURE__*/React__default.createElement(PluginForm, {
|
|
4863
4864
|
drawingId: drawingId,
|
|
@@ -4920,14 +4921,14 @@ var index$o = /*#__PURE__*/Object.freeze({
|
|
|
4920
4921
|
description: description$o
|
|
4921
4922
|
});
|
|
4922
4923
|
|
|
4923
|
-
var Members$
|
|
4924
|
+
var Members$i;
|
|
4924
4925
|
|
|
4925
4926
|
(function (Members) {
|
|
4926
4927
|
Members["SolidReferences"] = "bodiesToTransform";
|
|
4927
4928
|
Members["AxisReferences"] = "references";
|
|
4928
4929
|
Members["Angle"] = "rotationAngle";
|
|
4929
4930
|
Members["Inverted"] = "inverted";
|
|
4930
|
-
})(Members$
|
|
4931
|
+
})(Members$i || (Members$i = {}));
|
|
4931
4932
|
|
|
4932
4933
|
function RootImpl$n({
|
|
4933
4934
|
drawingId,
|
|
@@ -4936,12 +4937,12 @@ function RootImpl$n({
|
|
|
4936
4937
|
const {
|
|
4937
4938
|
objectId
|
|
4938
4939
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
4939
|
-
const solidRefs = useRefsParam(drawingId, objectId, Members$
|
|
4940
|
-
const axisRefs = useRefsParam(drawingId, objectId, Members$
|
|
4941
|
-
const angle = useNumParam(drawingId, objectId, Members$
|
|
4940
|
+
const solidRefs = useRefsParam(drawingId, objectId, Members$i.SolidReferences);
|
|
4941
|
+
const axisRefs = useRefsParam(drawingId, objectId, Members$i.AxisReferences);
|
|
4942
|
+
const angle = useNumParam(drawingId, objectId, Members$i.Angle, {
|
|
4942
4943
|
angle: true
|
|
4943
4944
|
});
|
|
4944
|
-
const inverted = useBoolParam(drawingId, objectId, Members$
|
|
4945
|
+
const inverted = useBoolParam(drawingId, objectId, Members$i.Inverted);
|
|
4945
4946
|
const update = React__default.useCallback(() => {
|
|
4946
4947
|
return ccAPI.feature.updateTransformation(drawingId, objectId, solidRefs.serverValue, axisRefs.serverValue, inverted.serverValue, angle.serverValue);
|
|
4947
4948
|
}, [drawingId, objectId, solidRefs, axisRefs, inverted, angle]);
|
|
@@ -5006,12 +5007,12 @@ var index$n = /*#__PURE__*/Object.freeze({
|
|
|
5006
5007
|
description: description$n
|
|
5007
5008
|
});
|
|
5008
5009
|
|
|
5009
|
-
var Members$
|
|
5010
|
+
var Members$h;
|
|
5010
5011
|
|
|
5011
5012
|
(function (Members) {
|
|
5012
5013
|
Members["SolidReferences"] = "bodiesToTransform";
|
|
5013
5014
|
Members["CsysReferences"] = "references";
|
|
5014
|
-
})(Members$
|
|
5015
|
+
})(Members$h || (Members$h = {}));
|
|
5015
5016
|
|
|
5016
5017
|
function RootImpl$m({
|
|
5017
5018
|
drawingId,
|
|
@@ -5020,14 +5021,14 @@ function RootImpl$m({
|
|
|
5020
5021
|
const {
|
|
5021
5022
|
objectId
|
|
5022
5023
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
5023
|
-
const solidRefs = useRefsParam(drawingId, objectId, Members$
|
|
5024
|
-
const csysRefs = useRefsParam(drawingId, objectId, Members$
|
|
5024
|
+
const solidRefs = useRefsParam(drawingId, objectId, Members$h.SolidReferences);
|
|
5025
|
+
const csysRefs = useRefsParam(drawingId, objectId, Members$h.CsysReferences);
|
|
5025
5026
|
const selOrder = useSelectorsOrder(drawingId);
|
|
5026
5027
|
const update = React__default.useCallback(() => {
|
|
5027
5028
|
return ccAPI.feature.updateTransformation(drawingId, objectId, solidRefs.userValue, csysRefs.userValue, 0, {
|
|
5028
5029
|
value: 0,
|
|
5029
5030
|
isExpr: false
|
|
5030
|
-
})
|
|
5031
|
+
});
|
|
5031
5032
|
}, [drawingId, objectId, solidRefs, csysRefs]);
|
|
5032
5033
|
return /*#__PURE__*/React__default.createElement(PluginForm, {
|
|
5033
5034
|
drawingId: drawingId,
|
|
@@ -5090,13 +5091,13 @@ var index$m = /*#__PURE__*/Object.freeze({
|
|
|
5090
5091
|
description: description$m
|
|
5091
5092
|
});
|
|
5092
5093
|
|
|
5093
|
-
var Members$
|
|
5094
|
+
var Members$g;
|
|
5094
5095
|
|
|
5095
5096
|
(function (Members) {
|
|
5096
5097
|
Members["CutDirection"] = "cutDirection";
|
|
5097
5098
|
Members["BodiesToCut"] = "bodiesToCut";
|
|
5098
5099
|
Members["WorkPlaneReference"] = "workPlaneReference";
|
|
5099
|
-
})(Members$
|
|
5100
|
+
})(Members$g || (Members$g = {}));
|
|
5100
5101
|
|
|
5101
5102
|
function RootImpl$l({
|
|
5102
5103
|
drawingId,
|
|
@@ -5105,9 +5106,9 @@ function RootImpl$l({
|
|
|
5105
5106
|
const {
|
|
5106
5107
|
objectId
|
|
5107
5108
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
5108
|
-
const cutDirection = useBoolParam(drawingId, objectId, Members$
|
|
5109
|
-
const bodiesToCut = useRefsParam(drawingId, objectId, Members$
|
|
5110
|
-
const workplaneId = useIdParam(drawingId, objectId, Members$
|
|
5109
|
+
const cutDirection = useBoolParam(drawingId, objectId, Members$g.CutDirection);
|
|
5110
|
+
const bodiesToCut = useRefsParam(drawingId, objectId, Members$g.BodiesToCut);
|
|
5111
|
+
const workplaneId = useIdParam(drawingId, objectId, Members$g.WorkPlaneReference);
|
|
5111
5112
|
const update = React__default.useCallback(() => {
|
|
5112
5113
|
return ccAPI.feature.updateSlice(drawingId, objectId, bodiesToCut.serverValue, workplaneId.serverValue, cutDirection.serverValue);
|
|
5113
5114
|
}, [drawingId, objectId, bodiesToCut, cutDirection, workplaneId]);
|
|
@@ -5166,13 +5167,13 @@ var index$l = /*#__PURE__*/Object.freeze({
|
|
|
5166
5167
|
description: description$l
|
|
5167
5168
|
});
|
|
5168
5169
|
|
|
5169
|
-
var Members$
|
|
5170
|
+
var Members$f;
|
|
5170
5171
|
|
|
5171
5172
|
(function (Members) {
|
|
5172
5173
|
Members["Inverted"] = "inverted";
|
|
5173
5174
|
Members["BodyToCut"] = "bodyToCut";
|
|
5174
5175
|
Members["SheetBody"] = "sheetBody";
|
|
5175
|
-
})(Members$
|
|
5176
|
+
})(Members$f || (Members$f = {}));
|
|
5176
5177
|
|
|
5177
5178
|
function RootImpl$k({
|
|
5178
5179
|
drawingId,
|
|
@@ -5181,9 +5182,9 @@ function RootImpl$k({
|
|
|
5181
5182
|
const {
|
|
5182
5183
|
objectId
|
|
5183
5184
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
5184
|
-
const inverted = useBoolParam(drawingId, objectId, Members$
|
|
5185
|
-
const bodyToCut = useIdParam(drawingId, objectId, Members$
|
|
5186
|
-
const sheetBody = useIdParam(drawingId, objectId, Members$
|
|
5185
|
+
const inverted = useBoolParam(drawingId, objectId, Members$f.Inverted);
|
|
5186
|
+
const bodyToCut = useIdParam(drawingId, objectId, Members$f.BodyToCut);
|
|
5187
|
+
const sheetBody = useIdParam(drawingId, objectId, Members$f.SheetBody);
|
|
5187
5188
|
const update = React__default.useCallback(() => {
|
|
5188
5189
|
return ccAPI.feature.updateSliceBySheet(drawingId, objectId, bodyToCut.serverValue, sheetBody.serverValue, inverted.serverValue);
|
|
5189
5190
|
}, [drawingId, objectId, bodyToCut, inverted, sheetBody]);
|
|
@@ -5245,7 +5246,7 @@ var index$k = /*#__PURE__*/Object.freeze({
|
|
|
5245
5246
|
description: description$k
|
|
5246
5247
|
});
|
|
5247
5248
|
|
|
5248
|
-
var Members$
|
|
5249
|
+
var Members$e;
|
|
5249
5250
|
|
|
5250
5251
|
(function (Members) {
|
|
5251
5252
|
Members["SolidReferences"] = "toPattern";
|
|
@@ -5258,7 +5259,7 @@ var Members$d;
|
|
|
5258
5259
|
Members["Inverted2"] = "inverted2";
|
|
5259
5260
|
Members["Count2"] = "secondDirInstanceCount";
|
|
5260
5261
|
Members["Merged"] = "merged";
|
|
5261
|
-
})(Members$
|
|
5262
|
+
})(Members$e || (Members$e = {}));
|
|
5262
5263
|
|
|
5263
5264
|
function RootImpl$j({
|
|
5264
5265
|
drawingId,
|
|
@@ -5267,16 +5268,16 @@ function RootImpl$j({
|
|
|
5267
5268
|
const {
|
|
5268
5269
|
objectId
|
|
5269
5270
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
5270
|
-
const solidRefs = useRefsParam(drawingId, objectId, Members$
|
|
5271
|
-
const axis1Refs = useRefsParam(drawingId, objectId, Members$
|
|
5272
|
-
const axis2Refs = useRefsParam(drawingId, objectId, Members$
|
|
5273
|
-
const dist1 = useNumParam(drawingId, objectId, Members$
|
|
5274
|
-
const dist2 = useNumParam(drawingId, objectId, Members$
|
|
5275
|
-
const count1 = useNumParam(drawingId, objectId, Members$
|
|
5276
|
-
const count2 = useNumParam(drawingId, objectId, Members$
|
|
5277
|
-
const inverted1 = useBoolParam(drawingId, objectId, Members$
|
|
5278
|
-
const inverted2 = useBoolParam(drawingId, objectId, Members$
|
|
5279
|
-
const merged = useBoolParam(drawingId, objectId, Members$
|
|
5271
|
+
const solidRefs = useRefsParam(drawingId, objectId, Members$e.SolidReferences);
|
|
5272
|
+
const axis1Refs = useRefsParam(drawingId, objectId, Members$e.Axis1References);
|
|
5273
|
+
const axis2Refs = useRefsParam(drawingId, objectId, Members$e.Axis2References);
|
|
5274
|
+
const dist1 = useNumParam(drawingId, objectId, Members$e.Distance1);
|
|
5275
|
+
const dist2 = useNumParam(drawingId, objectId, Members$e.Distance2);
|
|
5276
|
+
const count1 = useNumParam(drawingId, objectId, Members$e.Count1);
|
|
5277
|
+
const count2 = useNumParam(drawingId, objectId, Members$e.Count2);
|
|
5278
|
+
const inverted1 = useBoolParam(drawingId, objectId, Members$e.Inverted1);
|
|
5279
|
+
const inverted2 = useBoolParam(drawingId, objectId, Members$e.Inverted2);
|
|
5280
|
+
const merged = useBoolParam(drawingId, objectId, Members$e.Merged);
|
|
5280
5281
|
const update = React__default.useCallback(() => {
|
|
5281
5282
|
const params1 = [inverted1.serverValue, dist1.serverValue, count1.serverValue, merged.serverValue];
|
|
5282
5283
|
const axis2Refs_ = axis2Refs.serverValue.length > 0 ? axis2Refs.serverValue : null;
|
|
@@ -5378,7 +5379,7 @@ var index$j = /*#__PURE__*/Object.freeze({
|
|
|
5378
5379
|
description: description$j
|
|
5379
5380
|
});
|
|
5380
5381
|
|
|
5381
|
-
var Members$
|
|
5382
|
+
var Members$d;
|
|
5382
5383
|
|
|
5383
5384
|
(function (Members) {
|
|
5384
5385
|
Members["SolidReferences"] = "toPattern";
|
|
@@ -5387,7 +5388,7 @@ var Members$c;
|
|
|
5387
5388
|
Members["Inverted"] = "inverted";
|
|
5388
5389
|
Members["Count"] = "instanceCount";
|
|
5389
5390
|
Members["Merged"] = "merged";
|
|
5390
|
-
})(Members$
|
|
5391
|
+
})(Members$d || (Members$d = {}));
|
|
5391
5392
|
|
|
5392
5393
|
function RootImpl$i({
|
|
5393
5394
|
drawingId,
|
|
@@ -5396,14 +5397,14 @@ function RootImpl$i({
|
|
|
5396
5397
|
const {
|
|
5397
5398
|
objectId
|
|
5398
5399
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
5399
|
-
const solidRefs = useRefsParam(drawingId, objectId, Members$
|
|
5400
|
-
const axisRefs = useRefsParam(drawingId, objectId, Members$
|
|
5401
|
-
const angle = useNumParam(drawingId, objectId, Members$
|
|
5400
|
+
const solidRefs = useRefsParam(drawingId, objectId, Members$d.SolidReferences);
|
|
5401
|
+
const axisRefs = useRefsParam(drawingId, objectId, Members$d.AxisReferences);
|
|
5402
|
+
const angle = useNumParam(drawingId, objectId, Members$d.Angle, {
|
|
5402
5403
|
angle: true
|
|
5403
5404
|
});
|
|
5404
|
-
const count = useNumParam(drawingId, objectId, Members$
|
|
5405
|
-
const inverted = useBoolParam(drawingId, objectId, Members$
|
|
5406
|
-
const merged = useBoolParam(drawingId, objectId, Members$
|
|
5405
|
+
const count = useNumParam(drawingId, objectId, Members$d.Count);
|
|
5406
|
+
const inverted = useBoolParam(drawingId, objectId, Members$d.Inverted);
|
|
5407
|
+
const merged = useBoolParam(drawingId, objectId, Members$d.Merged);
|
|
5407
5408
|
const update = React__default.useCallback(() => {
|
|
5408
5409
|
const params = [inverted.serverValue, angle.serverValue, count.serverValue, merged.serverValue];
|
|
5409
5410
|
return ccAPI.feature.updatePattern(drawingId, objectId, solidRefs.serverValue, axisRefs.serverValue, params, null, null);
|
|
@@ -5480,12 +5481,12 @@ var index$i = /*#__PURE__*/Object.freeze({
|
|
|
5480
5481
|
description: description$i
|
|
5481
5482
|
});
|
|
5482
5483
|
|
|
5483
|
-
var Members$
|
|
5484
|
+
var Members$c;
|
|
5484
5485
|
|
|
5485
5486
|
(function (Members) {
|
|
5486
5487
|
Members["SolidReferences"] = "toPattern";
|
|
5487
5488
|
Members["FaceReferences"] = "references";
|
|
5488
|
-
})(Members$
|
|
5489
|
+
})(Members$c || (Members$c = {}));
|
|
5489
5490
|
|
|
5490
5491
|
const RootImpl$h = ({
|
|
5491
5492
|
drawingId,
|
|
@@ -5494,8 +5495,8 @@ const RootImpl$h = ({
|
|
|
5494
5495
|
const {
|
|
5495
5496
|
objectId
|
|
5496
5497
|
} = usePlugin(drawingId, pluginId, plugin => plugin);
|
|
5497
|
-
const solidRefs = useRefsParam(drawingId, objectId, Members$
|
|
5498
|
-
const faceRefs = useRefsParam(drawingId, objectId, Members$
|
|
5498
|
+
const solidRefs = useRefsParam(drawingId, objectId, Members$c.SolidReferences);
|
|
5499
|
+
const faceRefs = useRefsParam(drawingId, objectId, Members$c.FaceReferences);
|
|
5499
5500
|
const update = React__default.useCallback(() => {
|
|
5500
5501
|
return ccAPI.feature.updateMirror(drawingId, objectId, solidRefs.serverValue, faceRefs.serverValue);
|
|
5501
5502
|
}, [drawingId, objectId, solidRefs, faceRefs]);
|
|
@@ -5550,6 +5551,63 @@ var index$h = /*#__PURE__*/Object.freeze({
|
|
|
5550
5551
|
description: description$h
|
|
5551
5552
|
});
|
|
5552
5553
|
|
|
5554
|
+
const defaultNumberOfDigits = 3;
|
|
5555
|
+
|
|
5556
|
+
const DIGITS = [{
|
|
5557
|
+
id: 0,
|
|
5558
|
+
label: '0'
|
|
5559
|
+
}, {
|
|
5560
|
+
id: 1,
|
|
5561
|
+
label: '0.1'
|
|
5562
|
+
}, {
|
|
5563
|
+
id: 2,
|
|
5564
|
+
label: '0.12'
|
|
5565
|
+
}, {
|
|
5566
|
+
id: 3,
|
|
5567
|
+
label: '0.123'
|
|
5568
|
+
}, {
|
|
5569
|
+
id: 4,
|
|
5570
|
+
label: '0.1234'
|
|
5571
|
+
}, {
|
|
5572
|
+
id: 5,
|
|
5573
|
+
label: '0.12345'
|
|
5574
|
+
}, {
|
|
5575
|
+
id: 6,
|
|
5576
|
+
label: '0.123456'
|
|
5577
|
+
}];
|
|
5578
|
+
const Digits = ({
|
|
5579
|
+
drawingId,
|
|
5580
|
+
pluginId
|
|
5581
|
+
}) => {
|
|
5582
|
+
const {
|
|
5583
|
+
Select
|
|
5584
|
+
} = useBuerli(buerli => buerli.options.elements);
|
|
5585
|
+
const set = usePlugin(drawingId, pluginId, p => p.set);
|
|
5586
|
+
const digits = usePlugin(drawingId, pluginId, p => p.state.digits);
|
|
5587
|
+
const curr = React__default.useMemo(() => {
|
|
5588
|
+
const dig = DIGITS.find(d => d.id === digits);
|
|
5589
|
+
return dig ? dig.label : DIGITS[defaultNumberOfDigits].label;
|
|
5590
|
+
}, [digits]);
|
|
5591
|
+
const onChange = React__default.useCallback(label => {
|
|
5592
|
+
const dig = DIGITS.find(d => d.label === label);
|
|
5593
|
+
|
|
5594
|
+
if (dig) {
|
|
5595
|
+
set == null ? void 0 : set({
|
|
5596
|
+
digits: dig.id
|
|
5597
|
+
});
|
|
5598
|
+
}
|
|
5599
|
+
}, [set]);
|
|
5600
|
+
return /*#__PURE__*/React__default.createElement(Select, {
|
|
5601
|
+
value: curr,
|
|
5602
|
+
onChange: onChange
|
|
5603
|
+
}, DIGITS.map(p => p.label));
|
|
5604
|
+
};
|
|
5605
|
+
|
|
5606
|
+
const vectorToString = (point, digits) => `${point.toArray().map(n => MathUtils.round(n, digits)).join(', ')}`;
|
|
5607
|
+
|
|
5608
|
+
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; }
|
|
5609
|
+
|
|
5610
|
+
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; }
|
|
5553
5611
|
const Excluded = [GraphicType.LOOP].concat(EntityTypes);
|
|
5554
5612
|
|
|
5555
5613
|
const RootImpl$g = ({
|
|
@@ -5578,7 +5636,19 @@ const RootImpl$g = ({
|
|
|
5578
5636
|
drawingId: drawingId,
|
|
5579
5637
|
pluginId: pluginId,
|
|
5580
5638
|
selectorId: selectorId
|
|
5581
|
-
}))
|
|
5639
|
+
}), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("div", {
|
|
5640
|
+
style: {
|
|
5641
|
+
width: '100%',
|
|
5642
|
+
height: '1px',
|
|
5643
|
+
background: 'rgba(0,0,0,0.1)',
|
|
5644
|
+
marginBottom: '5px'
|
|
5645
|
+
}
|
|
5646
|
+
}), /*#__PURE__*/React__default.createElement(Wrapper, {
|
|
5647
|
+
caption: "Digits"
|
|
5648
|
+
}, /*#__PURE__*/React__default.createElement(Digits, {
|
|
5649
|
+
drawingId: drawingId,
|
|
5650
|
+
pluginId: pluginId
|
|
5651
|
+
})));
|
|
5582
5652
|
};
|
|
5583
5653
|
|
|
5584
5654
|
const Output = ({
|
|
@@ -5586,6 +5656,8 @@ const Output = ({
|
|
|
5586
5656
|
pluginId,
|
|
5587
5657
|
selectorId
|
|
5588
5658
|
}) => {
|
|
5659
|
+
const set = usePlugin(drawingId, pluginId, p => p.set);
|
|
5660
|
+
const digits = usePlugin(drawingId, pluginId, p => p.state.digits);
|
|
5589
5661
|
const {
|
|
5590
5662
|
Label
|
|
5591
5663
|
} = useBuerli(buerli => buerli.options.elements);
|
|
@@ -5601,22 +5673,52 @@ const Output = ({
|
|
|
5601
5673
|
}
|
|
5602
5674
|
}
|
|
5603
5675
|
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5676
|
+
const extended = results.map(res => {
|
|
5677
|
+
if (res.measureData) {
|
|
5678
|
+
switch (res.type) {
|
|
5679
|
+
case MeasureResultType.DISTANCE:
|
|
5680
|
+
case MeasureResultType.ANGLE:
|
|
5681
|
+
{
|
|
5682
|
+
const {
|
|
5683
|
+
value
|
|
5684
|
+
} = res.measureData;
|
|
5685
|
+
return _objectSpread$i(_objectSpread$i({}, res), {}, {
|
|
5686
|
+
asString: MathUtils.round(value, digits)
|
|
5687
|
+
});
|
|
5688
|
+
}
|
|
5689
|
+
|
|
5690
|
+
case MeasureResultType.POSITION:
|
|
5691
|
+
case MeasureResultType.VECTOR:
|
|
5692
|
+
{
|
|
5693
|
+
const {
|
|
5694
|
+
value
|
|
5695
|
+
} = res.measureData;
|
|
5696
|
+
return _objectSpread$i(_objectSpread$i({}, res), {}, {
|
|
5697
|
+
asString: vectorToString(value, digits)
|
|
5698
|
+
});
|
|
5699
|
+
}
|
|
5700
|
+
}
|
|
5701
|
+
}
|
|
5702
|
+
|
|
5703
|
+
return _objectSpread$i(_objectSpread$i({}, res), {}, {
|
|
5704
|
+
asString: ''
|
|
5705
|
+
});
|
|
5612
5706
|
});
|
|
5613
|
-
|
|
5707
|
+
return extended;
|
|
5708
|
+
}, [drawingId, selector, digits]);
|
|
5709
|
+
React__default.useEffect(() => set == null ? void 0 : set({
|
|
5710
|
+
measuredItems: items
|
|
5711
|
+
}), [items, set]);
|
|
5614
5712
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, items.map((item, index) => {
|
|
5615
|
-
return /*#__PURE__*/React__default.createElement(Wrapper, {
|
|
5713
|
+
return item.measureData && /*#__PURE__*/React__default.createElement(Wrapper, {
|
|
5616
5714
|
key: index,
|
|
5617
5715
|
minor: true,
|
|
5618
5716
|
caption: item.description
|
|
5619
|
-
}, /*#__PURE__*/React__default.createElement(Label,
|
|
5717
|
+
}, /*#__PURE__*/React__default.createElement(Label, {
|
|
5718
|
+
style: {
|
|
5719
|
+
fontSize: '12px'
|
|
5720
|
+
}
|
|
5721
|
+
}, `${item.asString}`));
|
|
5620
5722
|
}));
|
|
5621
5723
|
};
|
|
5622
5724
|
|
|
@@ -5825,7 +5927,8 @@ const dWidthCoeff = 15;
|
|
|
5825
5927
|
const Distance = ({
|
|
5826
5928
|
p1,
|
|
5827
5929
|
p2,
|
|
5828
|
-
result
|
|
5930
|
+
result,
|
|
5931
|
+
digits = defaultNumberOfDigits
|
|
5829
5932
|
}) => {
|
|
5830
5933
|
const {
|
|
5831
5934
|
start,
|
|
@@ -5847,7 +5950,7 @@ const Distance = ({
|
|
|
5847
5950
|
center: center_
|
|
5848
5951
|
};
|
|
5849
5952
|
}, [p1, p2]);
|
|
5850
|
-
const text =
|
|
5953
|
+
const text = `${MathUtils.round(result, digits)}`;
|
|
5851
5954
|
const [showValue, setShowValue] = React__default.useState(true);
|
|
5852
5955
|
useFrame(args => {
|
|
5853
5956
|
const [startH, endH] = [start, end].map(p => CameraHelper.getPoint2(p.clone(), args.camera, args.size));
|
|
@@ -5876,13 +5979,14 @@ const Distance = ({
|
|
|
5876
5979
|
}));
|
|
5877
5980
|
};
|
|
5878
5981
|
const lineLength = 50;
|
|
5879
|
-
const
|
|
5982
|
+
const radius_ = 40;
|
|
5880
5983
|
const aWidthCoeff = 10;
|
|
5881
5984
|
const Angle = ({
|
|
5882
5985
|
center,
|
|
5883
5986
|
dir1,
|
|
5884
5987
|
dir2,
|
|
5885
|
-
result
|
|
5988
|
+
result,
|
|
5989
|
+
digits = defaultNumberOfDigits
|
|
5886
5990
|
}) => {
|
|
5887
5991
|
const {
|
|
5888
5992
|
end1,
|
|
@@ -5903,12 +6007,12 @@ const Angle = ({
|
|
|
5903
6007
|
const end2_ = center.clone().addScaledVector(dir2N, lineLength);
|
|
5904
6008
|
const normal_ = dir2N.clone().cross(dir1N);
|
|
5905
6009
|
const angle_ = dir1N.angleTo(dir2N);
|
|
5906
|
-
const arrowPos1_ = center.clone().addScaledVector(dir1N,
|
|
5907
|
-
const arrowPos2_ = center.clone().addScaledVector(dir2N,
|
|
6010
|
+
const arrowPos1_ = center.clone().addScaledVector(dir1N, radius_);
|
|
6011
|
+
const arrowPos2_ = center.clone().addScaledVector(dir2N, radius_);
|
|
5908
6012
|
const arrowDir1_ = normal_.clone().cross(dir1N);
|
|
5909
6013
|
const arrowDir2_ = dir2N.clone().cross(normal_);
|
|
5910
6014
|
const midDir = dir1N.clone().lerp(dir2N, 0.5).normalize();
|
|
5911
|
-
const valuePos_ = center.clone().addScaledVector(midDir,
|
|
6015
|
+
const valuePos_ = center.clone().addScaledVector(midDir, radius_ + 5);
|
|
5912
6016
|
const n = normal_.clone().normalize();
|
|
5913
6017
|
const t = dir2N;
|
|
5914
6018
|
const b = n.clone().cross(t).normalize();
|
|
@@ -5928,7 +6032,7 @@ const Angle = ({
|
|
|
5928
6032
|
arcCenterL: arcCenterL_
|
|
5929
6033
|
};
|
|
5930
6034
|
}, [center, dir1, dir2]);
|
|
5931
|
-
const text =
|
|
6035
|
+
const text = `${MathUtils.round(result, digits)}`;
|
|
5932
6036
|
const [showValue, setShowValue] = React__default.useState(true);
|
|
5933
6037
|
useFrame(args => {
|
|
5934
6038
|
const [end1H, end2H, valuePosH] = [end1, end2, valuePos].map(p => CameraHelper.getPoint2(p.clone(), args.camera, args.size));
|
|
@@ -5958,7 +6062,7 @@ const Angle = ({
|
|
|
5958
6062
|
matrixAutoUpdate: false
|
|
5959
6063
|
}, /*#__PURE__*/React__default.createElement(Arc$2, {
|
|
5960
6064
|
center: arcCenterL,
|
|
5961
|
-
radius:
|
|
6065
|
+
radius: radius_,
|
|
5962
6066
|
startAngle: 0,
|
|
5963
6067
|
endAngle: angle
|
|
5964
6068
|
})), /*#__PURE__*/React__default.createElement(Arrow$1, {
|
|
@@ -5973,15 +6077,21 @@ const Angle = ({
|
|
|
5973
6077
|
backgroundColor: 0xffffff
|
|
5974
6078
|
}));
|
|
5975
6079
|
};
|
|
5976
|
-
const
|
|
6080
|
+
const zero = new THREE.Vector3(0, 0, 0);
|
|
6081
|
+
const Position$1 = ({
|
|
5977
6082
|
pos,
|
|
5978
|
-
result
|
|
6083
|
+
result,
|
|
6084
|
+
radius = 5
|
|
5979
6085
|
}) => {
|
|
5980
|
-
|
|
6086
|
+
const ref = useScale$1(pos);
|
|
6087
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("group", {
|
|
5981
6088
|
position: pos,
|
|
5982
|
-
|
|
6089
|
+
ref: ref
|
|
6090
|
+
}, /*#__PURE__*/React__default.createElement(Point$2, {
|
|
6091
|
+
position: zero,
|
|
6092
|
+
radius: radius,
|
|
5983
6093
|
color: 0xaf1111
|
|
5984
|
-
}), result && /*#__PURE__*/React__default.createElement(TextValue, {
|
|
6094
|
+
})), result && /*#__PURE__*/React__default.createElement(TextValue, {
|
|
5985
6095
|
position: pos,
|
|
5986
6096
|
value: result,
|
|
5987
6097
|
backgroundColor: 0xffffff
|
|
@@ -6006,6 +6116,7 @@ function ViewImpl$e({
|
|
|
6006
6116
|
pluginId
|
|
6007
6117
|
}) {
|
|
6008
6118
|
const items = usePlugin(drawingId, pluginId, plugin => plugin.state.measuredItems);
|
|
6119
|
+
const digits = usePlugin(drawingId, pluginId, p => p.state.digits);
|
|
6009
6120
|
return /*#__PURE__*/React__default.createElement("group", null, items.map((item, index) => {
|
|
6010
6121
|
if (!item.measureData) {
|
|
6011
6122
|
return null;
|
|
@@ -6016,14 +6127,15 @@ function ViewImpl$e({
|
|
|
6016
6127
|
{
|
|
6017
6128
|
const {
|
|
6018
6129
|
start,
|
|
6019
|
-
end
|
|
6130
|
+
end,
|
|
6131
|
+
value
|
|
6020
6132
|
} = item.measureData;
|
|
6021
|
-
const result = item.value;
|
|
6022
6133
|
return /*#__PURE__*/React__default.createElement(Distance, {
|
|
6023
6134
|
key: index,
|
|
6024
6135
|
p1: start,
|
|
6025
6136
|
p2: end,
|
|
6026
|
-
result:
|
|
6137
|
+
result: value,
|
|
6138
|
+
digits: digits
|
|
6027
6139
|
});
|
|
6028
6140
|
}
|
|
6029
6141
|
|
|
@@ -6032,27 +6144,28 @@ function ViewImpl$e({
|
|
|
6032
6144
|
const {
|
|
6033
6145
|
center,
|
|
6034
6146
|
dir1,
|
|
6035
|
-
dir2
|
|
6036
|
-
|
|
6037
|
-
|
|
6147
|
+
dir2,
|
|
6148
|
+
value
|
|
6149
|
+
} = item.measureData; // Don't draw the arc if angle === 0 or angle === 180
|
|
6038
6150
|
|
|
6039
|
-
return
|
|
6151
|
+
return value !== 0 && value !== 180 && /*#__PURE__*/React__default.createElement(Angle, {
|
|
6040
6152
|
key: index,
|
|
6041
6153
|
center: center,
|
|
6042
6154
|
dir1: dir1,
|
|
6043
6155
|
dir2: dir2,
|
|
6044
|
-
result:
|
|
6156
|
+
result: value,
|
|
6157
|
+
digits: digits
|
|
6045
6158
|
});
|
|
6046
6159
|
}
|
|
6047
6160
|
|
|
6048
6161
|
case MeasureResultType.POSITION:
|
|
6049
6162
|
{
|
|
6050
6163
|
const {
|
|
6051
|
-
|
|
6164
|
+
value
|
|
6052
6165
|
} = item.measureData;
|
|
6053
|
-
return /*#__PURE__*/React__default.createElement(Position, {
|
|
6166
|
+
return /*#__PURE__*/React__default.createElement(Position$1, {
|
|
6054
6167
|
key: index,
|
|
6055
|
-
pos:
|
|
6168
|
+
pos: value
|
|
6056
6169
|
});
|
|
6057
6170
|
}
|
|
6058
6171
|
|
|
@@ -6090,7 +6203,8 @@ const description$g = {
|
|
|
6090
6203
|
persistent: false,
|
|
6091
6204
|
global: true,
|
|
6092
6205
|
initialState: {
|
|
6093
|
-
measuredItems: []
|
|
6206
|
+
measuredItems: [],
|
|
6207
|
+
digits: defaultNumberOfDigits
|
|
6094
6208
|
}
|
|
6095
6209
|
};
|
|
6096
6210
|
|
|
@@ -6323,6 +6437,11 @@ const getInitialState = () => {
|
|
|
6323
6437
|
// When user hovers an obects (line, point, constraint, etc) id of the object is store to this prop.
|
|
6324
6438
|
highlighted: [],
|
|
6325
6439
|
// 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)
|
|
6440
|
+
interaction: {
|
|
6441
|
+
cycle: 0,
|
|
6442
|
+
objects: []
|
|
6443
|
+
},
|
|
6444
|
+
// Contains information about objects under the pointer (`interaction.objects[interaction.cycle]` should equal `hovered`)
|
|
6326
6445
|
isDragged: false,
|
|
6327
6446
|
// When used drags some objects, this should equal true.
|
|
6328
6447
|
scale: 1,
|
|
@@ -6508,7 +6627,7 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
6508
6627
|
} = tmpObjects[tmpDimensionId];
|
|
6509
6628
|
const sector = calcSector(dimPos, dir0, dir1, center);
|
|
6510
6629
|
const previewValue = calcPreviewValue(dir0, dir1, sector, reflex);
|
|
6511
|
-
ccAPI.sketcher.addConstraints(drawingId, sketchId, ['Ang'], [CCClasses.CC2DAngleConstraint], [entities], [previewValue], [dimPos], [[sector, reflex]]);
|
|
6630
|
+
ccAPI.sketcher.addConstraints(drawingId, sketchId, ['Ang'], [CCClasses.CC2DAngleConstraint], [entities], [previewValue], [dimPos], [[sector, reflex]]).catch(console.warn);
|
|
6512
6631
|
isPressed = false;
|
|
6513
6632
|
set({
|
|
6514
6633
|
activeHandler: HandlersList.DRAG
|
|
@@ -6544,88 +6663,139 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
6544
6663
|
};
|
|
6545
6664
|
}
|
|
6546
6665
|
|
|
6666
|
+
function getGeometryPriority(object) {
|
|
6667
|
+
if (is2DConstraint(object)) {
|
|
6668
|
+
return 4;
|
|
6669
|
+
}
|
|
6670
|
+
|
|
6671
|
+
switch (object.class) {
|
|
6672
|
+
case CCClasses.CCLine:
|
|
6673
|
+
return 1;
|
|
6674
|
+
|
|
6675
|
+
case CCClasses.CCArc:
|
|
6676
|
+
return 2;
|
|
6677
|
+
|
|
6678
|
+
case CCClasses.CCCircle:
|
|
6679
|
+
return 3;
|
|
6680
|
+
|
|
6681
|
+
case CCClasses.CCPoint:
|
|
6682
|
+
return 5;
|
|
6683
|
+
}
|
|
6684
|
+
|
|
6685
|
+
return -1;
|
|
6686
|
+
}
|
|
6687
|
+
|
|
6547
6688
|
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; }
|
|
6548
6689
|
|
|
6549
6690
|
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; }
|
|
6550
6691
|
let timerId;
|
|
6551
|
-
|
|
6692
|
+
|
|
6693
|
+
const setHoverState = (drawingId, pluginId, cycle, objects) => {
|
|
6552
6694
|
const {
|
|
6553
|
-
state,
|
|
6554
6695
|
set
|
|
6555
6696
|
} = getPlugin(drawingId, pluginId);
|
|
6556
6697
|
const tree = getDrawing(drawingId).structure.tree;
|
|
6698
|
+
const hoveredId = objects[cycle % objects.length];
|
|
6557
6699
|
const hoveredObject = tree[hoveredId];
|
|
6558
6700
|
|
|
6559
|
-
if (
|
|
6560
|
-
|
|
6561
|
-
|
|
6701
|
+
if (hoveredObject) {
|
|
6702
|
+
if (is2DConstraint(hoveredObject)) {
|
|
6703
|
+
var _hoveredObject$member;
|
|
6562
6704
|
|
|
6563
|
-
|
|
6564
|
-
|
|
6705
|
+
const constraintEntities = ((_hoveredObject$member = hoveredObject.members) == null ? void 0 : _hoveredObject$member.entities).members.map(entity => entity.value);
|
|
6706
|
+
set(state_ => {
|
|
6707
|
+
const highlighted = state_.highlighted;
|
|
6708
|
+
const highlightedConstraints = highlighted.filter(id => is2DConstraint(tree[id]) && id !== hoveredId);
|
|
6709
|
+
return {
|
|
6710
|
+
hovered: hoveredId,
|
|
6711
|
+
highlighted: [...highlightedConstraints, hoveredId, ...constraintEntities],
|
|
6712
|
+
interaction: {
|
|
6713
|
+
cycle,
|
|
6714
|
+
objects
|
|
6715
|
+
}
|
|
6716
|
+
};
|
|
6717
|
+
});
|
|
6718
|
+
} else {
|
|
6719
|
+
const linkedConstraints = Object.values(tree).filter(obj => is2DConstraint(obj)).filter(obj => {
|
|
6720
|
+
var _obj$members;
|
|
6721
|
+
|
|
6722
|
+
return ((_obj$members = obj.members) == null ? void 0 : _obj$members.entities).members.some(entity => entity.value === hoveredId);
|
|
6723
|
+
}).map(obj => obj.id);
|
|
6724
|
+
const constraintsToGeometry = {};
|
|
6725
|
+
linkedConstraints.forEach(id => {
|
|
6726
|
+
constraintsToGeometry[id] = hoveredId;
|
|
6727
|
+
});
|
|
6728
|
+
set(state_ => {
|
|
6729
|
+
return {
|
|
6730
|
+
hovered: hoveredId,
|
|
6731
|
+
highlighted: [hoveredId, ...linkedConstraints],
|
|
6732
|
+
constraintsToGeometry: _objectSpread$g(_objectSpread$g({}, state_.constraintsToGeometry), constraintsToGeometry),
|
|
6733
|
+
interaction: {
|
|
6734
|
+
cycle,
|
|
6735
|
+
objects
|
|
6736
|
+
}
|
|
6737
|
+
};
|
|
6738
|
+
});
|
|
6739
|
+
}
|
|
6565
6740
|
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
return {
|
|
6571
|
-
hovered: hoveredId,
|
|
6572
|
-
highlighted: [...highlightedConstraints, hoveredId, ...constraintEntities]
|
|
6573
|
-
};
|
|
6574
|
-
});
|
|
6741
|
+
if (timerId) {
|
|
6742
|
+
window.clearTimeout(timerId);
|
|
6743
|
+
timerId = undefined;
|
|
6744
|
+
}
|
|
6575
6745
|
} else {
|
|
6576
|
-
const linkedConstraints = Object.values(tree).filter(obj => is2DConstraint(obj)).filter(obj => {
|
|
6577
|
-
var _obj$members;
|
|
6578
|
-
|
|
6579
|
-
return ((_obj$members = obj.members) == null ? void 0 : _obj$members.entities).members.some(entity => entity.value === hoveredId);
|
|
6580
|
-
}).map(obj => obj.id);
|
|
6581
|
-
const constraintsToGeometry = {};
|
|
6582
|
-
linkedConstraints.forEach(id => {
|
|
6583
|
-
constraintsToGeometry[id] = hoveredId;
|
|
6584
|
-
});
|
|
6585
6746
|
set(state_ => {
|
|
6747
|
+
const highlighted = state_.highlighted;
|
|
6748
|
+
const highlightedConstraints = highlighted.filter(id => is2DConstraint(tree[id]));
|
|
6586
6749
|
return {
|
|
6587
|
-
hovered:
|
|
6588
|
-
highlighted:
|
|
6589
|
-
|
|
6750
|
+
hovered: NOCCID,
|
|
6751
|
+
highlighted: highlightedConstraints,
|
|
6752
|
+
interaction: {
|
|
6753
|
+
cycle,
|
|
6754
|
+
objects
|
|
6755
|
+
}
|
|
6590
6756
|
};
|
|
6591
6757
|
});
|
|
6592
|
-
}
|
|
6593
6758
|
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6759
|
+
if (timerId) {
|
|
6760
|
+
window.clearTimeout(timerId);
|
|
6761
|
+
}
|
|
6762
|
+
|
|
6763
|
+
timerId = window.setTimeout(() => {
|
|
6764
|
+
set({
|
|
6765
|
+
highlighted: []
|
|
6766
|
+
});
|
|
6767
|
+
}, 1000);
|
|
6597
6768
|
}
|
|
6598
6769
|
};
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6770
|
+
|
|
6771
|
+
const hover = (drawingId, pluginId, hoveredId) => {
|
|
6772
|
+
var _tree$hoveredId;
|
|
6773
|
+
|
|
6774
|
+
const state = getSketchState(drawingId, pluginId);
|
|
6604
6775
|
const tree = getDrawing(drawingId).structure.tree;
|
|
6605
|
-
const hoveredObject = tree[hoveredId];
|
|
6606
6776
|
|
|
6607
|
-
if (!
|
|
6777
|
+
if (!tree[hoveredId] || ((_tree$hoveredId = tree[hoveredId]) == null ? void 0 : _tree$hoveredId.class) === CCClasses.CCSketch || state.rubberBandRectangle || state.isDragged) {
|
|
6608
6778
|
return;
|
|
6609
6779
|
}
|
|
6610
6780
|
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
});
|
|
6781
|
+
const objects = state.interaction.objects;
|
|
6782
|
+
const objectsSorted = [...objects, hoveredId].sort((a, b) => getGeometryPriority(tree[b]) - getGeometryPriority(tree[a]) || a - b);
|
|
6783
|
+
const objectsNew = objectsSorted.filter((id, i) => objectsSorted.indexOf(id) === i);
|
|
6784
|
+
setHoverState(drawingId, pluginId, 0, objectsNew);
|
|
6785
|
+
};
|
|
6786
|
+
const unhover = (drawingId, pluginId, hoveredId) => {
|
|
6787
|
+
var _tree$hoveredId2;
|
|
6619
6788
|
|
|
6620
|
-
|
|
6621
|
-
|
|
6789
|
+
const state = getSketchState(drawingId, pluginId);
|
|
6790
|
+
const tree = getDrawing(drawingId).structure.tree;
|
|
6791
|
+
|
|
6792
|
+
if (!tree[hoveredId] || ((_tree$hoveredId2 = tree[hoveredId]) == null ? void 0 : _tree$hoveredId2.class) === CCClasses.CCSketch || state.rubberBandRectangle) {
|
|
6793
|
+
return;
|
|
6622
6794
|
}
|
|
6623
6795
|
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
});
|
|
6628
|
-
}, 1000);
|
|
6796
|
+
const objects = state.interaction.objects;
|
|
6797
|
+
const objectsNew = objects.filter(id => id !== hoveredId);
|
|
6798
|
+
setHoverState(drawingId, pluginId, 0, objectsNew);
|
|
6629
6799
|
};
|
|
6630
6800
|
const select = (drawingId, pluginId, selectedId) => {
|
|
6631
6801
|
const {
|
|
@@ -6646,6 +6816,17 @@ const select = (drawingId, pluginId, selectedId) => {
|
|
|
6646
6816
|
}
|
|
6647
6817
|
});
|
|
6648
6818
|
};
|
|
6819
|
+
const tab = (drawingId, pluginId) => {
|
|
6820
|
+
const state = getSketchState(drawingId, pluginId);
|
|
6821
|
+
|
|
6822
|
+
if (state.rubberBandRectangle || state.isDragged) {
|
|
6823
|
+
return;
|
|
6824
|
+
}
|
|
6825
|
+
|
|
6826
|
+
const cycle = state.interaction.cycle + 1;
|
|
6827
|
+
const objects = state.interaction.objects;
|
|
6828
|
+
setHoverState(drawingId, pluginId, cycle, objects);
|
|
6829
|
+
};
|
|
6649
6830
|
|
|
6650
6831
|
function Hover(drawingId, pluginId) {
|
|
6651
6832
|
const filter = object => true;
|
|
@@ -6659,16 +6840,20 @@ function Hover(drawingId, pluginId) {
|
|
|
6659
6840
|
});
|
|
6660
6841
|
};
|
|
6661
6842
|
|
|
6843
|
+
const onKeyup = e => {
|
|
6844
|
+
if (e.code === 'Tab') {
|
|
6845
|
+
tab(drawingId, pluginId);
|
|
6846
|
+
}
|
|
6847
|
+
};
|
|
6848
|
+
|
|
6662
6849
|
const onPointerOver = e => {
|
|
6663
6850
|
const hoveredId = e.object.userData.objId;
|
|
6664
6851
|
hover(drawingId, pluginId, hoveredId);
|
|
6665
|
-
e.stopPropagation();
|
|
6666
6852
|
};
|
|
6667
6853
|
|
|
6668
6854
|
const onPointerOut = e => {
|
|
6669
6855
|
const hoveredId = e.object.userData.objId;
|
|
6670
6856
|
unhover(drawingId, pluginId, hoveredId);
|
|
6671
|
-
e.stopPropagation();
|
|
6672
6857
|
};
|
|
6673
6858
|
|
|
6674
6859
|
return {
|
|
@@ -6678,6 +6863,9 @@ function Hover(drawingId, pluginId) {
|
|
|
6678
6863
|
pointerHandlers: {
|
|
6679
6864
|
onPointerOver,
|
|
6680
6865
|
onPointerOut
|
|
6866
|
+
},
|
|
6867
|
+
keyHandlers: {
|
|
6868
|
+
keyup: onKeyup
|
|
6681
6869
|
}
|
|
6682
6870
|
};
|
|
6683
6871
|
}
|
|
@@ -7083,7 +7271,7 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7083
7271
|
let defferedDiff = null;
|
|
7084
7272
|
|
|
7085
7273
|
const moveObjects = async (sketch, objectIds, diff) => {
|
|
7086
|
-
promise = ccAPI.sketcher.moveObjects(drawingId, sketchId, objectIds, diff);
|
|
7274
|
+
promise = ccAPI.sketcher.moveObjects(drawingId, sketchId, objectIds, diff).catch(console.warn);
|
|
7087
7275
|
moveFrom.add(diff);
|
|
7088
7276
|
await promise; // Artificial slowdown to lessen network/server burden
|
|
7089
7277
|
|
|
@@ -7130,6 +7318,8 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7130
7318
|
};
|
|
7131
7319
|
|
|
7132
7320
|
const onKeyup = e => {
|
|
7321
|
+
var _hoverHandler$keyHand;
|
|
7322
|
+
|
|
7133
7323
|
if (e.code === 'Delete') {
|
|
7134
7324
|
if (pressedId !== NOCCID) {
|
|
7135
7325
|
return;
|
|
@@ -7144,18 +7334,27 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7144
7334
|
});
|
|
7145
7335
|
|
|
7146
7336
|
if (selectedNotNested.length > 0) {
|
|
7147
|
-
ccAPI.sketcher.removeObjects(drawingId, sketchId, selectedNotNested);
|
|
7337
|
+
ccAPI.sketcher.removeObjects(drawingId, sketchId, selectedNotNested).catch(console.warn);
|
|
7148
7338
|
}
|
|
7149
7339
|
}
|
|
7340
|
+
|
|
7341
|
+
(_hoverHandler$keyHand = hoverHandler.keyHandlers) == null ? void 0 : _hoverHandler$keyHand.keyup(e);
|
|
7150
7342
|
};
|
|
7151
7343
|
|
|
7152
7344
|
const onPointerDown = e => {
|
|
7153
7345
|
var _sketch$children, _sketch$children2;
|
|
7154
7346
|
|
|
7155
|
-
if (e.buttons !== 1)
|
|
7347
|
+
if (e.buttons !== 1) {
|
|
7348
|
+
// Continue only if 'primary' mouse button is pressed
|
|
7156
7349
|
return;
|
|
7350
|
+
}
|
|
7351
|
+
|
|
7157
7352
|
isMoved = false;
|
|
7158
|
-
|
|
7353
|
+
const {
|
|
7354
|
+
cycle,
|
|
7355
|
+
objects
|
|
7356
|
+
} = getSketchState(drawingId, pluginId).interaction;
|
|
7357
|
+
pressedId = objects.length > 0 ? objects[cycle % objects.length] : e.object.userData.objId;
|
|
7159
7358
|
const pressedObj = getDrawing(drawingId).structure.tree[pressedId];
|
|
7160
7359
|
|
|
7161
7360
|
if (e.shiftKey) {
|
|
@@ -7165,7 +7364,7 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7165
7364
|
}
|
|
7166
7365
|
|
|
7167
7366
|
isRectSelectionActive = true;
|
|
7168
|
-
rectClickPoint = e.point.project(e.camera);
|
|
7367
|
+
rectClickPoint = e.point.clone().project(e.camera);
|
|
7169
7368
|
pressedId = NOCCID;
|
|
7170
7369
|
camControls.enabled = false;
|
|
7171
7370
|
e.target.setPointerCapture(e.pointerId);
|
|
@@ -7251,7 +7450,7 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7251
7450
|
isMoved = true;
|
|
7252
7451
|
|
|
7253
7452
|
if (isRectSelectionActive) {
|
|
7254
|
-
const rectMousePoint = e.point.project(e.camera);
|
|
7453
|
+
const rectMousePoint = e.point.clone().project(e.camera);
|
|
7255
7454
|
const min = new THREE.Vector2(Math.min(rectClickPoint.x, rectMousePoint.x), Math.min(rectClickPoint.y, rectMousePoint.y));
|
|
7256
7455
|
const max = new THREE.Vector2(Math.max(rectClickPoint.x, rectMousePoint.x), Math.max(rectClickPoint.y, rectMousePoint.y));
|
|
7257
7456
|
const rubberBandRectangle = new THREE.Box2(min, max);
|
|
@@ -7303,6 +7502,7 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7303
7502
|
max: max.clone()
|
|
7304
7503
|
}
|
|
7305
7504
|
});
|
|
7505
|
+
e.stopPropagation();
|
|
7306
7506
|
return;
|
|
7307
7507
|
}
|
|
7308
7508
|
|
|
@@ -7320,7 +7520,7 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7320
7520
|
// If we are waiting for the response from server, defer next diff and make it after current change.
|
|
7321
7521
|
defferedDiff = diff;
|
|
7322
7522
|
} else {
|
|
7323
|
-
moveObjects(sketchId, [pressedId, ...selected], diff)
|
|
7523
|
+
moveObjects(sketchId, [pressedId, ...selected], diff);
|
|
7324
7524
|
}
|
|
7325
7525
|
}
|
|
7326
7526
|
|
|
@@ -7397,7 +7597,7 @@ function DrawPoint(drawingId, pluginId) {
|
|
|
7397
7597
|
incidence: true,
|
|
7398
7598
|
tangency: false,
|
|
7399
7599
|
vertAndHoriz: false
|
|
7400
|
-
});
|
|
7600
|
+
}).catch(console.warn);
|
|
7401
7601
|
}
|
|
7402
7602
|
|
|
7403
7603
|
e.stopPropagation();
|
|
@@ -7558,7 +7758,7 @@ function DrawLine(drawingId, pluginId) {
|
|
|
7558
7758
|
if (lineId === null) return;
|
|
7559
7759
|
const lastAddedLine = getDrawing(drawingId).structure.tree[lineId];
|
|
7560
7760
|
lastAddedEndPointId = ((_lastAddedLine$childr = lastAddedLine.children) == null ? void 0 : _lastAddedLine$childr[1]) || NOCCID;
|
|
7561
|
-
}).catch();
|
|
7761
|
+
}).catch(console.warn);
|
|
7562
7762
|
set(state => {
|
|
7563
7763
|
const tmpStartP = state.tmpObjects[tmpStartPId];
|
|
7564
7764
|
const tmpEndP = state.tmpObjects[tmpEndPId];
|
|
@@ -7736,7 +7936,7 @@ function DrawRectangle(drawingId, pluginId) {
|
|
|
7736
7936
|
incidence: true,
|
|
7737
7937
|
tangency: true,
|
|
7738
7938
|
vertAndHoriz: false
|
|
7739
|
-
});
|
|
7939
|
+
}).catch(console.warn);
|
|
7740
7940
|
set(state => {
|
|
7741
7941
|
const tmpRect_ = state.tmpObjects[tmpRectId];
|
|
7742
7942
|
const tmpPoint = {
|
|
@@ -8296,7 +8496,7 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
8296
8496
|
if (arcId === null) return;
|
|
8297
8497
|
const lastAddedArc = getDrawing(drawingId).structure.tree[arcId];
|
|
8298
8498
|
lastAddedEndPointId = ((_lastAddedArc$childre = lastAddedArc.children) == null ? void 0 : _lastAddedArc$childre[0]) || NOCCID;
|
|
8299
|
-
}).catch();
|
|
8499
|
+
}).catch(console.warn);
|
|
8300
8500
|
|
|
8301
8501
|
if (arcType === HandlersList.DRAWARCTANGENT) {
|
|
8302
8502
|
const dir = endPos.clone().sub(centerPos);
|
|
@@ -8509,7 +8709,7 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
8509
8709
|
incidence: true,
|
|
8510
8710
|
tangency: false,
|
|
8511
8711
|
vertAndHoriz: false
|
|
8512
|
-
});
|
|
8712
|
+
}).catch(console.warn);
|
|
8513
8713
|
set(state => {
|
|
8514
8714
|
const tmpCenterP = state.tmpObjects[tmpCenterPId];
|
|
8515
8715
|
return {
|
|
@@ -8574,73 +8774,73 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
8574
8774
|
};
|
|
8575
8775
|
}
|
|
8576
8776
|
|
|
8577
|
-
var img$
|
|
8777
|
+
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";
|
|
8578
8778
|
|
|
8579
|
-
var img$
|
|
8779
|
+
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";
|
|
8580
8780
|
|
|
8581
|
-
var img$
|
|
8781
|
+
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";
|
|
8582
8782
|
|
|
8583
|
-
var img$
|
|
8783
|
+
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";
|
|
8584
8784
|
|
|
8585
|
-
var img$
|
|
8785
|
+
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";
|
|
8586
8786
|
|
|
8587
|
-
var img$
|
|
8787
|
+
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";
|
|
8588
8788
|
|
|
8589
|
-
var img$
|
|
8789
|
+
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";
|
|
8590
8790
|
|
|
8591
|
-
var img$
|
|
8791
|
+
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";
|
|
8592
8792
|
|
|
8593
|
-
var img$
|
|
8793
|
+
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";
|
|
8594
8794
|
|
|
8595
|
-
var img$
|
|
8795
|
+
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";
|
|
8596
8796
|
|
|
8597
|
-
var img$
|
|
8797
|
+
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";
|
|
8598
8798
|
|
|
8599
|
-
var img$
|
|
8799
|
+
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";
|
|
8600
8800
|
|
|
8601
|
-
var img$
|
|
8801
|
+
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";
|
|
8602
8802
|
|
|
8603
|
-
var img$
|
|
8803
|
+
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";
|
|
8604
8804
|
|
|
8605
|
-
var img$
|
|
8805
|
+
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";
|
|
8606
8806
|
|
|
8607
|
-
var img$
|
|
8807
|
+
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";
|
|
8608
8808
|
|
|
8609
|
-
var img$
|
|
8809
|
+
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";
|
|
8610
8810
|
|
|
8611
|
-
var img$
|
|
8811
|
+
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";
|
|
8612
8812
|
|
|
8613
|
-
var img$
|
|
8813
|
+
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";
|
|
8614
8814
|
|
|
8615
|
-
var img$
|
|
8815
|
+
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";
|
|
8616
8816
|
|
|
8617
|
-
var img$
|
|
8817
|
+
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";
|
|
8618
8818
|
|
|
8619
|
-
var img$
|
|
8819
|
+
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";
|
|
8620
8820
|
|
|
8621
|
-
var img$
|
|
8821
|
+
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";
|
|
8622
8822
|
|
|
8623
|
-
var img$
|
|
8823
|
+
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";
|
|
8624
8824
|
|
|
8625
|
-
var img$
|
|
8825
|
+
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";
|
|
8626
8826
|
|
|
8627
|
-
var img$
|
|
8827
|
+
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";
|
|
8628
8828
|
|
|
8629
|
-
var img$
|
|
8829
|
+
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";
|
|
8630
8830
|
|
|
8631
|
-
var img$
|
|
8831
|
+
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";
|
|
8632
8832
|
|
|
8633
|
-
var img$
|
|
8833
|
+
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";
|
|
8634
8834
|
|
|
8635
|
-
var img$
|
|
8835
|
+
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";
|
|
8636
8836
|
|
|
8637
|
-
var img$
|
|
8837
|
+
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";
|
|
8638
8838
|
|
|
8639
|
-
var img$
|
|
8839
|
+
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";
|
|
8640
8840
|
|
|
8641
|
-
var img$
|
|
8841
|
+
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";
|
|
8642
8842
|
|
|
8643
|
-
var img$
|
|
8843
|
+
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";
|
|
8644
8844
|
|
|
8645
8845
|
const RootContext = /*#__PURE__*/React__default.createContext({
|
|
8646
8846
|
drawingId: -1,
|
|
@@ -8848,7 +9048,7 @@ const RectPattern = () => {
|
|
|
8848
9048
|
ccAPI.sketcher.copyRectangularPattern(drawingId, sketchId, rigidSetOrObjId, originIndex, translate, numX - 1, numY - 1).then(() => {
|
|
8849
9049
|
getDrawing(drawingId).api.selection.setItems(rgSetSelId, []);
|
|
8850
9050
|
getDrawing(drawingId).api.selection.setItems(originSelId, []);
|
|
8851
|
-
}).catch();
|
|
9051
|
+
}).catch(console.warn);
|
|
8852
9052
|
}, [drawingId, numX, numY, offsetX, offsetY, originSelId, rgSetSelId, sketchId, rigidSetOrObjId]);
|
|
8853
9053
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Wrapper, {
|
|
8854
9054
|
caption: "Num X"
|
|
@@ -8941,7 +9141,7 @@ const CircPattern = () => {
|
|
|
8941
9141
|
ccAPI.sketcher.copyCircularPattern(drawingId, sketchId, rigidSetId, rotationOriginPoint, angleStep, numSteps - 1).then(() => {
|
|
8942
9142
|
getDrawing(drawingId).api.selection.setItems(rgSetSelId, []);
|
|
8943
9143
|
getDrawing(drawingId).api.selection.setItems(originSelId, []);
|
|
8944
|
-
}).catch();
|
|
9144
|
+
}).catch(console.warn);
|
|
8945
9145
|
}, [drawingId, sketchId, angle, numSteps, rgSetSelId, originSelId]);
|
|
8946
9146
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Wrapper, {
|
|
8947
9147
|
caption: "Num"
|
|
@@ -9005,7 +9205,7 @@ const MirrorPattern = () => {
|
|
|
9005
9205
|
return;
|
|
9006
9206
|
}
|
|
9007
9207
|
|
|
9008
|
-
ccAPI.sketcher.copyMirrorPattern(drawingId, sketchId, rigidSetId, lineId);
|
|
9208
|
+
ccAPI.sketcher.copyMirrorPattern(drawingId, sketchId, rigidSetId, lineId).catch(console.warn);
|
|
9009
9209
|
}, [drawingId, sketchId, rgSetSelId, lineSelId]);
|
|
9010
9210
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Wrapper, {
|
|
9011
9211
|
caption: "Rigidset/Object"
|
|
@@ -9029,44 +9229,44 @@ const MirrorPattern = () => {
|
|
|
9029
9229
|
};
|
|
9030
9230
|
|
|
9031
9231
|
const resources = {
|
|
9032
|
-
[CCClasses.CC2DFixationConstraint]: img$
|
|
9033
|
-
[CCClasses.CC2DHorizontalConstraint]: img$
|
|
9034
|
-
[CCClasses.CC2DVerticalConstraint]: img$
|
|
9035
|
-
[CCClasses.CC2DCoincidentConstraint]: img$
|
|
9036
|
-
[CCClasses.CC2DTangentSketchConstraint]: img$
|
|
9037
|
-
[CCClasses.CC2DParallelConstraint]: img$
|
|
9038
|
-
[CCClasses.CC2DPerpendicularConstraint]: img$
|
|
9039
|
-
[CCClasses.CC2DColinearConstraint]: img$
|
|
9040
|
-
[CCClasses.CC2DConcentricConstraint]: img$
|
|
9041
|
-
[CCClasses.CC2DMidpointConstraint]: img$
|
|
9042
|
-
[CCClasses.CC2DSymmetryConstraint]: img$
|
|
9043
|
-
[CCClasses.CC2DEqualLengthConstraint]: img$
|
|
9044
|
-
[CCClasses.CC2DEqualRadiusConstraint]: img$
|
|
9045
|
-
[CCClasses.CC2DHorizontalDistanceConstraint]: img$
|
|
9046
|
-
[CCClasses.CC2DVerticalDistanceConstraint]: img$
|
|
9047
|
-
[CCClasses.CC2DOffsetConstraint]: img$
|
|
9048
|
-
[CCClasses.CC2DRadiusConstraint]: img$
|
|
9049
|
-
[CCClasses.CC2DDiameterConstraint]: img$
|
|
9050
|
-
[CCClasses.CC2DAngleConstraint]: img$
|
|
9051
|
-
[CCClasses.CC2DAngleOXConstraint]: img$
|
|
9052
|
-
[CCClasses.CCRigidSet]: img$
|
|
9053
|
-
[CCClasses.CCUse]: img$
|
|
9054
|
-
[CCClasses.CCExtrusion]: img$
|
|
9055
|
-
[CCClasses.CCRevolve]: img$
|
|
9056
|
-
[CCClasses.CCRevolve]: img$
|
|
9057
|
-
[HandlersList.DRAWPOINT]: img$
|
|
9058
|
-
[HandlersList.DRAWLINE]: img$
|
|
9059
|
-
[HandlersList.DRAWRECTANGLE]: img$
|
|
9060
|
-
[HandlersList.DRAWARCTANGENT]: img$
|
|
9061
|
-
[HandlersList.DRAWARCCENTER]: img$
|
|
9062
|
-
[HandlersList.DRAWARCMIDDLE]: img$
|
|
9063
|
-
[HandlersList.DRAWCIRCLE]: img$
|
|
9064
|
-
[HandlersList.FILLET]: img$
|
|
9065
|
-
[HandlersList.TRIM]: img$
|
|
9066
|
-
[HandlersList.USEREF]: img$
|
|
9067
|
-
[Patterns.RECTANGULAR]: img$
|
|
9068
|
-
[Patterns.CIRCULAR]: img$
|
|
9069
|
-
[Patterns.MIRROR]: img$
|
|
9232
|
+
[CCClasses.CC2DFixationConstraint]: img$_,
|
|
9233
|
+
[CCClasses.CC2DHorizontalConstraint]: img$Z,
|
|
9234
|
+
[CCClasses.CC2DVerticalConstraint]: img$Y,
|
|
9235
|
+
[CCClasses.CC2DCoincidentConstraint]: img$X,
|
|
9236
|
+
[CCClasses.CC2DTangentSketchConstraint]: img$W,
|
|
9237
|
+
[CCClasses.CC2DParallelConstraint]: img$V,
|
|
9238
|
+
[CCClasses.CC2DPerpendicularConstraint]: img$U,
|
|
9239
|
+
[CCClasses.CC2DColinearConstraint]: img$T,
|
|
9240
|
+
[CCClasses.CC2DConcentricConstraint]: img$S,
|
|
9241
|
+
[CCClasses.CC2DMidpointConstraint]: img$R,
|
|
9242
|
+
[CCClasses.CC2DSymmetryConstraint]: img$Q,
|
|
9243
|
+
[CCClasses.CC2DEqualLengthConstraint]: img$P,
|
|
9244
|
+
[CCClasses.CC2DEqualRadiusConstraint]: img$P,
|
|
9245
|
+
[CCClasses.CC2DHorizontalDistanceConstraint]: img$O,
|
|
9246
|
+
[CCClasses.CC2DVerticalDistanceConstraint]: img$N,
|
|
9247
|
+
[CCClasses.CC2DOffsetConstraint]: img$M,
|
|
9248
|
+
[CCClasses.CC2DRadiusConstraint]: img$L,
|
|
9249
|
+
[CCClasses.CC2DDiameterConstraint]: img$M,
|
|
9250
|
+
[CCClasses.CC2DAngleConstraint]: img$K,
|
|
9251
|
+
[CCClasses.CC2DAngleOXConstraint]: img$J,
|
|
9252
|
+
[CCClasses.CCRigidSet]: img$I,
|
|
9253
|
+
[CCClasses.CCUse]: img$t,
|
|
9254
|
+
[CCClasses.CCExtrusion]: img$H,
|
|
9255
|
+
[CCClasses.CCRevolve]: img$G,
|
|
9256
|
+
[CCClasses.CCRevolve]: img$G,
|
|
9257
|
+
[HandlersList.DRAWPOINT]: img$F,
|
|
9258
|
+
[HandlersList.DRAWLINE]: img$E,
|
|
9259
|
+
[HandlersList.DRAWRECTANGLE]: img$D,
|
|
9260
|
+
[HandlersList.DRAWARCTANGENT]: img$C,
|
|
9261
|
+
[HandlersList.DRAWARCCENTER]: img$B,
|
|
9262
|
+
[HandlersList.DRAWARCMIDDLE]: img$A,
|
|
9263
|
+
[HandlersList.DRAWCIRCLE]: img$z,
|
|
9264
|
+
[HandlersList.FILLET]: img$y,
|
|
9265
|
+
[HandlersList.TRIM]: img$x,
|
|
9266
|
+
[HandlersList.USEREF]: img$t,
|
|
9267
|
+
[Patterns.RECTANGULAR]: img$w,
|
|
9268
|
+
[Patterns.CIRCULAR]: img$v,
|
|
9269
|
+
[Patterns.MIRROR]: img$u
|
|
9070
9270
|
};
|
|
9071
9271
|
const textures = {};
|
|
9072
9272
|
const textureLoader = new THREE.TextureLoader();
|
|
@@ -9074,55 +9274,87 @@ Object.entries(resources).forEach(([key, value]) => {
|
|
|
9074
9274
|
textures[key] = textureLoader.load(value);
|
|
9075
9275
|
});
|
|
9076
9276
|
|
|
9077
|
-
|
|
9078
|
-
|
|
9277
|
+
// Checker functions return either 0, if check failed, or an index otherwise.
|
|
9278
|
+
// The index is set on creation; it determines the order of entities for constraint creation.
|
|
9279
|
+
// Index should be a number if the entity should be constrainted directly, or an array of numbers, if its children should be constrainted.
|
|
9280
|
+
// In a single input-describing array for n-sized output, indices should be in range [1, n], without spaces and unique.
|
|
9281
|
+
// 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:
|
|
9282
|
+
// [line([1, 3]), point(2)], [point(2), line([1, 3])]
|
|
9283
|
+
|
|
9284
|
+
function point(index) {
|
|
9285
|
+
return object => {
|
|
9286
|
+
return object.class === CCClasses.CCPoint ? index : 0;
|
|
9287
|
+
};
|
|
9079
9288
|
}
|
|
9080
9289
|
|
|
9081
|
-
function line(
|
|
9082
|
-
return object
|
|
9290
|
+
function line(index) {
|
|
9291
|
+
return object => {
|
|
9292
|
+
return object.class === CCClasses.CCLine ? index : 0;
|
|
9293
|
+
};
|
|
9083
9294
|
}
|
|
9084
9295
|
|
|
9085
|
-
function notLine(
|
|
9086
|
-
return
|
|
9296
|
+
function notLine(index) {
|
|
9297
|
+
return object => {
|
|
9298
|
+
return object.class === CCClasses.CCPoint || object.class === CCClasses.CCArc || object.class === CCClasses.CCCircle ? index : 0;
|
|
9299
|
+
};
|
|
9087
9300
|
}
|
|
9088
9301
|
|
|
9089
|
-
function arc(
|
|
9090
|
-
return object
|
|
9302
|
+
function arc(index) {
|
|
9303
|
+
return object => {
|
|
9304
|
+
return object.class === CCClasses.CCArc || object.class === CCClasses.CCCircle ? index : 0;
|
|
9305
|
+
};
|
|
9091
9306
|
}
|
|
9092
9307
|
|
|
9093
|
-
function curve(
|
|
9094
|
-
return
|
|
9308
|
+
function curve(index) {
|
|
9309
|
+
return object => {
|
|
9310
|
+
return object.class === CCClasses.CCLine || object.class === CCClasses.CCArc || object.class === CCClasses.CCCircle ? index : 0;
|
|
9311
|
+
};
|
|
9095
9312
|
}
|
|
9096
9313
|
|
|
9097
|
-
function any(
|
|
9098
|
-
return
|
|
9314
|
+
function any(index) {
|
|
9315
|
+
return object => {
|
|
9316
|
+
return object.class === CCClasses.CCPoint || object.class === CCClasses.CCLine || object.class === CCClasses.CCArc || object.class === CCClasses.CCCircle ? index : 0;
|
|
9317
|
+
};
|
|
9318
|
+
} // Entity adapters.
|
|
9319
|
+
// Some constraints should support multi-creation if entity selection allows so.
|
|
9320
|
+
// These are entity-remapping functions, which take the original entity array and create an array of combinations of entities.
|
|
9321
|
+
// These combinations, if further checks are successful, can be used as entities for creating separate constraints
|
|
9322
|
+
|
|
9323
|
+
|
|
9324
|
+
function singular(entities) {
|
|
9325
|
+
return [entities];
|
|
9326
|
+
}
|
|
9327
|
+
|
|
9328
|
+
function multipleUnary(entities) {
|
|
9329
|
+
return entities.map(entity => [entity]);
|
|
9330
|
+
}
|
|
9331
|
+
|
|
9332
|
+
function multipleBinary(entities) {
|
|
9333
|
+
const entities1ToN = entities.slice(1);
|
|
9334
|
+
return entities1ToN.map(entity => [entities[0], entity]);
|
|
9099
9335
|
}
|
|
9100
9336
|
|
|
9101
9337
|
function createHelper(type, name, ...constraintGeometryCombinations) {
|
|
9102
|
-
const isParametric = constraintGeometryCombinations[0].desc.includes('p');
|
|
9103
|
-
const isCommutative = constraintGeometryCombinations[0].desc.includes('c');
|
|
9104
9338
|
return {
|
|
9105
9339
|
type,
|
|
9106
9340
|
name,
|
|
9107
|
-
isParametric,
|
|
9108
|
-
isCommutative,
|
|
9109
9341
|
|
|
9110
9342
|
adapt(entities, tree) {
|
|
9111
9343
|
entities = [...entities];
|
|
9112
9344
|
|
|
9113
|
-
const
|
|
9114
|
-
if (this.type !== CCClasses.CCRigidSet &&
|
|
9345
|
+
const checkInput = (input, formattedEntities) => {
|
|
9346
|
+
if (this.type !== CCClasses.CCRigidSet && input.length !== formattedEntities.length) return false;
|
|
9115
9347
|
let entityIdx = 0; // eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
9116
9348
|
|
|
9117
|
-
for (let i = 0; i <
|
|
9349
|
+
for (let i = 0; i < input.length; i++) {
|
|
9118
9350
|
if (entityIdx >= formattedEntities.length) {
|
|
9119
9351
|
return false;
|
|
9120
9352
|
}
|
|
9121
9353
|
|
|
9122
|
-
const
|
|
9354
|
+
const checker = input[i];
|
|
9123
9355
|
const entity = tree[formattedEntities[entityIdx++]];
|
|
9124
9356
|
|
|
9125
|
-
if (!entity || !
|
|
9357
|
+
if (!entity || !checker(entity)) {
|
|
9126
9358
|
return false;
|
|
9127
9359
|
}
|
|
9128
9360
|
}
|
|
@@ -9138,179 +9370,176 @@ function createHelper(type, name, ...constraintGeometryCombinations) {
|
|
|
9138
9370
|
}
|
|
9139
9371
|
|
|
9140
9372
|
info = [{
|
|
9141
|
-
|
|
9142
|
-
|
|
9373
|
+
entityAdapter: singular,
|
|
9374
|
+
input: entities.map((entity, i) => any(i + 1))
|
|
9143
9375
|
}];
|
|
9144
|
-
} //
|
|
9376
|
+
} // Process specified combinations until a suitable one is found, or there are no combinations left...
|
|
9377
|
+
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
9145
9378
|
|
|
9146
9379
|
|
|
9147
9380
|
for (let i = 0; i < info.length; i++) {
|
|
9148
|
-
const
|
|
9149
|
-
|
|
9150
|
-
const isStrictlyLenient = info[i].desc.includes('L'); // must select lines instead of endpoints
|
|
9151
|
-
|
|
9152
|
-
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
|
|
9153
|
-
|
|
9154
|
-
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
|
|
9155
|
-
|
|
9156
|
-
if (isMultySelU) {
|
|
9157
|
-
if (entities.length > 0 && entities.every(entity => checkPredicates(info[i].predicates, [entity]))) {
|
|
9158
|
-
return entities.map(entity => [entity]);
|
|
9159
|
-
}
|
|
9160
|
-
} // TODO: refactor into a more linear, less intertwined solution?
|
|
9381
|
+
const input = info[i].input;
|
|
9382
|
+
const entityGroups = info[i].entityAdapter(entities);
|
|
9161
9383
|
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
const entities1ToN = entities.slice(1);
|
|
9165
|
-
|
|
9166
|
-
if (entities1ToN.length > 0 && entities1ToN.every(entity => checkPredicates(info[i].predicates, [entities[0], entity]))) {
|
|
9167
|
-
const entity0 = tree[entities[0]];
|
|
9168
|
-
const entities0 = isStrictlyLenient && entity0 && line(entity0) ? entity0.children || [] : [entities[0]];
|
|
9169
|
-
return entities1ToN.map(entityId => {
|
|
9170
|
-
const entity = tree[entityId];
|
|
9171
|
-
const entities_ = isStrictlyLenient && entity && line(entity) ? entity.children || [] : [entityId];
|
|
9172
|
-
return [...entities0, ...entities_];
|
|
9173
|
-
});
|
|
9174
|
-
}
|
|
9175
|
-
}
|
|
9176
|
-
|
|
9177
|
-
for (let j = 0; j < entities.length; j++) {
|
|
9178
|
-
const entity = tree[entities[j]];
|
|
9179
|
-
if (isLenient && entity && line(entity)) entities.splice(j, 1, ...(entity.children || []));
|
|
9384
|
+
if (entityGroups.length === 0 || entityGroups.some(entityGroup => !checkInput(input, entityGroup))) {
|
|
9385
|
+
continue;
|
|
9180
9386
|
}
|
|
9181
9387
|
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9388
|
+
const output = entityGroups.map(entityGroup => {
|
|
9389
|
+
// Assume there are no index spaces in input checkers...
|
|
9390
|
+
const output_ = [];
|
|
9391
|
+
entityGroup.forEach((entityId, j) => {
|
|
9392
|
+
const checker = input[j];
|
|
9393
|
+
const entity = tree[entityId];
|
|
9394
|
+
const index = checker(entity);
|
|
9395
|
+
|
|
9396
|
+
if (Array.isArray(index)) {
|
|
9397
|
+
index.forEach((index_, k) => {
|
|
9398
|
+
var _entity$children;
|
|
9399
|
+
|
|
9400
|
+
const childId = ((_entity$children = entity.children) == null ? void 0 : _entity$children[k]) || -1;
|
|
9401
|
+
output_[index_ - 1] = childId;
|
|
9402
|
+
});
|
|
9403
|
+
} else {
|
|
9404
|
+
output_[index - 1] = entityId;
|
|
9188
9405
|
}
|
|
9189
|
-
}
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9406
|
+
});
|
|
9407
|
+
return output_;
|
|
9408
|
+
});
|
|
9409
|
+
return output.every(output_ => output_.every(id => id !== -1)) ? output : undefined;
|
|
9193
9410
|
}
|
|
9194
9411
|
|
|
9195
9412
|
return undefined;
|
|
9196
9413
|
}
|
|
9197
9414
|
|
|
9198
9415
|
};
|
|
9199
|
-
}
|
|
9416
|
+
} // TODO: describe in comments how this helpers works
|
|
9417
|
+
|
|
9200
9418
|
|
|
9201
|
-
// TODO: describe in comments how this helpers works
|
|
9202
9419
|
const constraintsHelpers = {
|
|
9203
9420
|
angle: createHelper(CCClasses.CC2DAngleConstraint, 'Ang', {
|
|
9204
|
-
|
|
9205
|
-
|
|
9421
|
+
entityAdapter: singular,
|
|
9422
|
+
input: [line(1), line(2)]
|
|
9206
9423
|
}),
|
|
9207
9424
|
angleox: createHelper(CCClasses.CC2DAngleOXConstraint, 'AngOX', {
|
|
9208
|
-
|
|
9209
|
-
|
|
9425
|
+
entityAdapter: singular,
|
|
9426
|
+
input: [line(1)]
|
|
9210
9427
|
}),
|
|
9211
9428
|
colinear: createHelper(CCClasses.CC2DCoincidentConstraint, 'Colin', {
|
|
9212
|
-
|
|
9213
|
-
|
|
9429
|
+
entityAdapter: multipleBinary,
|
|
9430
|
+
input: [line(1), line(2)]
|
|
9214
9431
|
}, {
|
|
9215
|
-
|
|
9216
|
-
|
|
9432
|
+
entityAdapter: singular,
|
|
9433
|
+
input: [line(1), point(2)]
|
|
9217
9434
|
}, {
|
|
9218
|
-
|
|
9219
|
-
|
|
9435
|
+
entityAdapter: singular,
|
|
9436
|
+
input: [point(2), line(1)]
|
|
9220
9437
|
}),
|
|
9221
9438
|
concentric: createHelper(CCClasses.CC2DConcentricConstraint, 'Ccntr', {
|
|
9222
|
-
|
|
9223
|
-
|
|
9439
|
+
entityAdapter: multipleBinary,
|
|
9440
|
+
input: [arc(1), arc(2)]
|
|
9224
9441
|
}),
|
|
9225
9442
|
distance: createHelper(CCClasses.CC2DOffsetConstraint, 'Offset', {
|
|
9226
|
-
|
|
9227
|
-
|
|
9443
|
+
entityAdapter: singular,
|
|
9444
|
+
input: [any(1), any(2)]
|
|
9228
9445
|
}, {
|
|
9229
|
-
|
|
9230
|
-
|
|
9446
|
+
entityAdapter: singular,
|
|
9447
|
+
input: [line([1, 2])]
|
|
9231
9448
|
}),
|
|
9232
9449
|
equalDistance: createHelper(CCClasses.CC2DEqualLengthConstraint, 'EL', {
|
|
9233
|
-
|
|
9234
|
-
|
|
9450
|
+
entityAdapter: multipleBinary,
|
|
9451
|
+
input: [line([1, 2]), line([3, 4])]
|
|
9235
9452
|
}),
|
|
9236
9453
|
equalRadius: createHelper(CCClasses.CC2DEqualRadiusConstraint, 'ER', {
|
|
9237
|
-
|
|
9238
|
-
|
|
9454
|
+
entityAdapter: multipleBinary,
|
|
9455
|
+
input: [arc(1), arc(2)]
|
|
9239
9456
|
}),
|
|
9240
9457
|
fixation: createHelper(CCClasses.CC2DFixationConstraint, 'Fix', {
|
|
9241
|
-
|
|
9242
|
-
|
|
9458
|
+
entityAdapter: multipleUnary,
|
|
9459
|
+
input: [any(1)]
|
|
9243
9460
|
}),
|
|
9244
9461
|
horizontalDistance: createHelper(CCClasses.CC2DHorizontalDistanceConstraint, 'HD', {
|
|
9245
|
-
|
|
9246
|
-
|
|
9462
|
+
entityAdapter: singular,
|
|
9463
|
+
input: [point(1), point(2)]
|
|
9464
|
+
}, {
|
|
9465
|
+
entityAdapter: singular,
|
|
9466
|
+
input: [line([1, 2])]
|
|
9247
9467
|
}),
|
|
9248
9468
|
horizontality: createHelper(CCClasses.CC2DHorizontalConstraint, 'H', {
|
|
9249
|
-
|
|
9250
|
-
|
|
9469
|
+
entityAdapter: multipleUnary,
|
|
9470
|
+
input: [line(1)]
|
|
9251
9471
|
}, {
|
|
9252
|
-
|
|
9253
|
-
|
|
9472
|
+
entityAdapter: singular,
|
|
9473
|
+
input: [point(1), point(2)]
|
|
9254
9474
|
}),
|
|
9255
9475
|
incidence: createHelper(CCClasses.CC2DCoincidentConstraint, 'Coinc', {
|
|
9256
|
-
|
|
9257
|
-
|
|
9476
|
+
entityAdapter: multipleBinary,
|
|
9477
|
+
input: [notLine(1), notLine(2)]
|
|
9258
9478
|
}),
|
|
9259
9479
|
midpoint: createHelper(CCClasses.CC2DMidpointConstraint, 'MP', {
|
|
9260
|
-
|
|
9261
|
-
|
|
9480
|
+
entityAdapter: singular,
|
|
9481
|
+
input: [point(1), point(2), point(3)]
|
|
9482
|
+
}, {
|
|
9483
|
+
entityAdapter: singular,
|
|
9484
|
+
input: [line([1, 3]), point(2)]
|
|
9485
|
+
}, {
|
|
9486
|
+
entityAdapter: singular,
|
|
9487
|
+
input: [point(2), line([1, 3])]
|
|
9262
9488
|
}),
|
|
9263
9489
|
parallelity: createHelper(CCClasses.CC2DParallelConstraint, 'Par', {
|
|
9264
|
-
|
|
9265
|
-
|
|
9490
|
+
entityAdapter: multipleBinary,
|
|
9491
|
+
input: [line(1), line(2)]
|
|
9266
9492
|
}),
|
|
9267
9493
|
perpendicularity: createHelper(CCClasses.CC2DPerpendicularConstraint, 'Perp', {
|
|
9268
|
-
|
|
9269
|
-
|
|
9494
|
+
entityAdapter: singular,
|
|
9495
|
+
input: [line(1), line(2)]
|
|
9270
9496
|
}),
|
|
9271
9497
|
radius: createHelper(CCClasses.CC2DRadiusConstraint, 'R', {
|
|
9272
|
-
|
|
9273
|
-
|
|
9498
|
+
entityAdapter: singular,
|
|
9499
|
+
input: [arc(1)]
|
|
9274
9500
|
}),
|
|
9275
9501
|
diameter: createHelper(CCClasses.CC2DDiameterConstraint, 'D', {
|
|
9276
|
-
|
|
9277
|
-
|
|
9502
|
+
entityAdapter: singular,
|
|
9503
|
+
input: [arc(1)]
|
|
9278
9504
|
}),
|
|
9279
9505
|
symmetric: createHelper(CCClasses.CC2DSymmetryConstraint, 'Symm', {
|
|
9280
|
-
|
|
9281
|
-
|
|
9506
|
+
entityAdapter: singular,
|
|
9507
|
+
input: [line(1), point(2), point(3)]
|
|
9282
9508
|
}, {
|
|
9283
|
-
|
|
9284
|
-
|
|
9509
|
+
entityAdapter: singular,
|
|
9510
|
+
input: [line(1), line(2), line(3)]
|
|
9285
9511
|
}, {
|
|
9286
|
-
|
|
9287
|
-
|
|
9512
|
+
entityAdapter: singular,
|
|
9513
|
+
input: [line(1), arc(2), arc(3)]
|
|
9288
9514
|
}),
|
|
9289
9515
|
tangency: createHelper(CCClasses.CC2DTangentSketchConstraint, 'Tan', {
|
|
9290
|
-
|
|
9291
|
-
|
|
9516
|
+
entityAdapter: singular,
|
|
9517
|
+
input: [arc(1), curve(2)]
|
|
9292
9518
|
}, {
|
|
9293
|
-
|
|
9294
|
-
|
|
9519
|
+
entityAdapter: singular,
|
|
9520
|
+
input: [curve(2), arc(1)]
|
|
9295
9521
|
}),
|
|
9296
9522
|
verticalDistance: createHelper(CCClasses.CC2DVerticalDistanceConstraint, 'VD', {
|
|
9297
|
-
|
|
9298
|
-
|
|
9523
|
+
entityAdapter: singular,
|
|
9524
|
+
input: [point(1), point(2)]
|
|
9525
|
+
}, {
|
|
9526
|
+
entityAdapter: singular,
|
|
9527
|
+
input: [line([1, 2])]
|
|
9299
9528
|
}),
|
|
9300
9529
|
verticality: createHelper(CCClasses.CC2DVerticalConstraint, 'V', {
|
|
9301
|
-
|
|
9302
|
-
|
|
9530
|
+
entityAdapter: multipleUnary,
|
|
9531
|
+
input: [line(1)]
|
|
9303
9532
|
}, {
|
|
9304
|
-
|
|
9305
|
-
|
|
9533
|
+
entityAdapter: singular,
|
|
9534
|
+
input: [point(1), point(2)]
|
|
9306
9535
|
}),
|
|
9307
9536
|
rigidSet: createHelper(CCClasses.CCRigidSet, 'RS', {
|
|
9308
|
-
|
|
9309
|
-
|
|
9537
|
+
entityAdapter: singular,
|
|
9538
|
+
input: []
|
|
9310
9539
|
}),
|
|
9311
9540
|
use: createHelper(CCClasses.CCUse, 'Use', {
|
|
9312
|
-
|
|
9313
|
-
|
|
9541
|
+
entityAdapter: singular,
|
|
9542
|
+
input: [any(1)]
|
|
9314
9543
|
})
|
|
9315
9544
|
};
|
|
9316
9545
|
|
|
@@ -9437,7 +9666,7 @@ const ConstrBtn = ({
|
|
|
9437
9666
|
|
|
9438
9667
|
if (constrClass === CCClasses.CCRigidSet) {
|
|
9439
9668
|
if (selected.length === 0) return;
|
|
9440
|
-
ccAPI.sketcher.createRigidSet(drawingId, sketchId, selected);
|
|
9669
|
+
ccAPI.sketcher.createRigidSet(drawingId, sketchId, selected).catch(console.warn);
|
|
9441
9670
|
} else {
|
|
9442
9671
|
const tree = getDrawing(drawingId).structure.tree;
|
|
9443
9672
|
const ct = constraintsHelpers[classNameMap[constrClass]];
|
|
@@ -9452,7 +9681,7 @@ const ConstrBtn = ({
|
|
|
9452
9681
|
set({
|
|
9453
9682
|
selected: []
|
|
9454
9683
|
});
|
|
9455
|
-
ccAPI.sketcher.addConstraints(drawingId, sketchId, entities.map(() => ct.name), entities.map(() => ct.type), entities);
|
|
9684
|
+
ccAPI.sketcher.addConstraints(drawingId, sketchId, entities.map(() => ct.name), entities.map(() => ct.type), entities).catch(console.warn);
|
|
9456
9685
|
}
|
|
9457
9686
|
}
|
|
9458
9687
|
}, [drawingId, set, sketchId, pluginId, constrClass]);
|
|
@@ -9915,7 +10144,7 @@ function Fillet(drawingId, pluginId, camControls) {
|
|
|
9915
10144
|
|
|
9916
10145
|
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), {}, {
|
|
9917
10146
|
radius: 1
|
|
9918
|
-
})).mid, data.params.end);
|
|
10147
|
+
})).mid, data.params.end).catch(console.warn);
|
|
9919
10148
|
set({
|
|
9920
10149
|
tmpObjects: {},
|
|
9921
10150
|
cursor: null
|
|
@@ -9935,7 +10164,7 @@ function Fillet(drawingId, pluginId, camControls) {
|
|
|
9935
10164
|
|
|
9936
10165
|
return ((_tree$id$members = tree[id].members) == null ? void 0 : _tree$id$members.entities).members.some(entity => entity.value === filletRelatedObjectId);
|
|
9937
10166
|
}));
|
|
9938
|
-
ccAPI.sketcher.deleteFillet(drawingId, sketchId, info.object.id, info.filletPoint.id, info.lineStarts.map(lineStart => lineStart.id), unrelatedConstraintIds);
|
|
10167
|
+
ccAPI.sketcher.deleteFillet(drawingId, sketchId, info.object.id, info.filletPoint.id, info.lineStarts.map(lineStart => lineStart.id), unrelatedConstraintIds).catch(console.warn);
|
|
9939
10168
|
set({
|
|
9940
10169
|
tmpObjects: {},
|
|
9941
10170
|
cursor: null
|
|
@@ -9973,14 +10202,14 @@ function Trim(drawingId, pluginId) {
|
|
|
9973
10202
|
};
|
|
9974
10203
|
|
|
9975
10204
|
const onActivate = () => {
|
|
9976
|
-
ccAPI.sketcher.splitAllCurves(drawingId, sketchId);
|
|
10205
|
+
ccAPI.sketcher.splitAllCurves(drawingId, sketchId).catch(console.warn);
|
|
9977
10206
|
};
|
|
9978
10207
|
|
|
9979
10208
|
const onDeactivate = () => {
|
|
9980
10209
|
set({
|
|
9981
10210
|
cursor: null
|
|
9982
10211
|
});
|
|
9983
|
-
ccAPI.sketcher.splitCurvesMergeBack(drawingId, sketchId);
|
|
10212
|
+
ccAPI.sketcher.splitCurvesMergeBack(drawingId, sketchId).catch(console.warn);
|
|
9984
10213
|
};
|
|
9985
10214
|
|
|
9986
10215
|
const onPointerOver = e => {
|
|
@@ -10011,7 +10240,7 @@ function Trim(drawingId, pluginId) {
|
|
|
10011
10240
|
const tree = getDrawing(drawingId).structure.tree;
|
|
10012
10241
|
|
|
10013
10242
|
if (((_tree2 = tree[tree[e.object.userData.objId].parent || NOCCID]) == null ? void 0 : _tree2.class) === CCClasses.CCContainer) {
|
|
10014
|
-
ccAPI.sketcher.removeObjects(drawingId, sketchId, [e.object.userData.objId]);
|
|
10243
|
+
ccAPI.sketcher.removeObjects(drawingId, sketchId, [e.object.userData.objId]).catch(console.warn);
|
|
10015
10244
|
}
|
|
10016
10245
|
|
|
10017
10246
|
e.stopPropagation();
|
|
@@ -10075,36 +10304,11 @@ const HandlersConstructors = {
|
|
|
10075
10304
|
|
|
10076
10305
|
const orderStep = 2;
|
|
10077
10306
|
const unitsBase = 0;
|
|
10078
|
-
const orderBase = 1000;
|
|
10079
|
-
|
|
10080
|
-
function getPriority(object) {
|
|
10081
|
-
if (is2DConstraint(object)) {
|
|
10082
|
-
// Since constraints are drawn on separate HUD it base might be 1.
|
|
10083
|
-
// If constraints will be drawn on common canvas it should be 4.
|
|
10084
|
-
return 1;
|
|
10085
|
-
}
|
|
10086
|
-
|
|
10087
|
-
switch (object.class) {
|
|
10088
|
-
case CCClasses.CCLine:
|
|
10089
|
-
return 1;
|
|
10090
|
-
|
|
10091
|
-
case CCClasses.CCArc:
|
|
10092
|
-
return 2;
|
|
10093
|
-
|
|
10094
|
-
case CCClasses.CCCircle:
|
|
10095
|
-
return 3;
|
|
10096
|
-
|
|
10097
|
-
case CCClasses.CCPoint:
|
|
10098
|
-
return 5;
|
|
10099
|
-
}
|
|
10100
|
-
|
|
10101
|
-
return -1;
|
|
10102
|
-
} // If there are two faces with the same depth, face with smaller offsetUnits will be drawn on top of plane with bigger offsetUnits
|
|
10307
|
+
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
|
|
10103
10308
|
// renderOrder means object idx in intersections array. Object with the highest renderOrder goes first.
|
|
10104
10309
|
|
|
10105
|
-
|
|
10106
10310
|
function getUnitsAndOrder(object) {
|
|
10107
|
-
const priority =
|
|
10311
|
+
const priority = getGeometryPriority(object);
|
|
10108
10312
|
|
|
10109
10313
|
if (priority === -1) {
|
|
10110
10314
|
return {
|
|
@@ -11722,7 +11926,7 @@ function useUseRef(drawingId, sketchId) {
|
|
|
11722
11926
|
const selApi = getDrawing(drawingId).api.selection;
|
|
11723
11927
|
selApi.setItems('UseRef', []);
|
|
11724
11928
|
const ids = itemsUseRef.map(item => item.data.graphicId);
|
|
11725
|
-
ccAPI.sketcher.createReferenceGeometry(drawingId, sketchId, ids);
|
|
11929
|
+
ccAPI.sketcher.createReferenceGeometry(drawingId, sketchId, ids).catch(console.warn);
|
|
11726
11930
|
}
|
|
11727
11931
|
}, [drawingId, sketchId, itemsUseRef]);
|
|
11728
11932
|
}
|
|
@@ -11740,7 +11944,8 @@ function useInteractionReset(drawingId, pluginId) {
|
|
|
11740
11944
|
const {
|
|
11741
11945
|
hovered,
|
|
11742
11946
|
selected,
|
|
11743
|
-
highlighted
|
|
11947
|
+
highlighted,
|
|
11948
|
+
interaction
|
|
11744
11949
|
} = getSketchState(drawingId, pluginId);
|
|
11745
11950
|
const state_ = {};
|
|
11746
11951
|
const hoveredValid = tree[hovered] !== undefined ? hovered : NOCCID;
|
|
@@ -11761,7 +11966,16 @@ function useInteractionReset(drawingId, pluginId) {
|
|
|
11761
11966
|
state_.highlighted = [];
|
|
11762
11967
|
}
|
|
11763
11968
|
|
|
11764
|
-
|
|
11969
|
+
const cursorOverValid = interaction.objects.filter(id => tree[id] !== undefined);
|
|
11970
|
+
|
|
11971
|
+
if (cursorOverValid.length !== interaction.objects.length) {
|
|
11972
|
+
state_.interaction = {
|
|
11973
|
+
cycle: 0,
|
|
11974
|
+
objects: cursorOverValid
|
|
11975
|
+
};
|
|
11976
|
+
}
|
|
11977
|
+
|
|
11978
|
+
if (state_.hovered || state_.selected || state_.highlighted || state_.interaction) {
|
|
11765
11979
|
getPlugin(drawingId, pluginId).set(state_);
|
|
11766
11980
|
}
|
|
11767
11981
|
}, [drawingId, pluginId, children]);
|
|
@@ -12276,7 +12490,7 @@ function useMenuItems$4(drawingId, featureId, isActive, setEditName) {
|
|
|
12276
12490
|
callback: () => {
|
|
12277
12491
|
const pluginAPI = getDrawing(drawingId).api.plugin;
|
|
12278
12492
|
if (isActive) pluginAPI.setActiveFeature(null);
|
|
12279
|
-
ccAPI.baseModeler.deleteObject(drawingId, featureId);
|
|
12493
|
+
ccAPI.baseModeler.deleteObject(drawingId, featureId).catch(console.warn);
|
|
12280
12494
|
}
|
|
12281
12495
|
}
|
|
12282
12496
|
};
|
|
@@ -12418,9 +12632,9 @@ const PlaneSelection = ({
|
|
|
12418
12632
|
const onChange = React__default.useCallback(items => {
|
|
12419
12633
|
if (items.length !== 0) {
|
|
12420
12634
|
if (items[0].scope === TreeObjScope) {
|
|
12421
|
-
ccAPI.sketcher.setWorkPlane(drawingId, sketchId, items[0].data.object.id);
|
|
12635
|
+
ccAPI.sketcher.setWorkPlane(drawingId, sketchId, items[0].data.object.id).catch(console.warn);
|
|
12422
12636
|
} else {
|
|
12423
|
-
ccAPI.sketcher.createAndSetWorkPlane(drawingId, sketchId, items[0].data.graphicId);
|
|
12637
|
+
ccAPI.sketcher.createAndSetWorkPlane(drawingId, sketchId, items[0].data.graphicId).catch(console.warn);
|
|
12424
12638
|
}
|
|
12425
12639
|
}
|
|
12426
12640
|
}, [drawingId, sketchId]);
|
|
@@ -12516,7 +12730,7 @@ const NameEdit = ({
|
|
|
12516
12730
|
const ref = React__default.useRef(null);
|
|
12517
12731
|
const onEnter = React__default.useCallback(async e => {
|
|
12518
12732
|
if (e.target.value !== '') {
|
|
12519
|
-
await ccAPI.common.setObjectName(drawingId, objId, e.target.value);
|
|
12733
|
+
await ccAPI.common.setObjectName(drawingId, objId, e.target.value).catch(console.warn);
|
|
12520
12734
|
}
|
|
12521
12735
|
|
|
12522
12736
|
setEditName(false);
|
|
@@ -12651,7 +12865,7 @@ function useMenuItems$3(drawingId, pluginId, objectId, setRename) {
|
|
|
12651
12865
|
caption: 'delete',
|
|
12652
12866
|
icon: /*#__PURE__*/React__default.createElement(DeleteOutlined, null),
|
|
12653
12867
|
callback: () => {
|
|
12654
|
-
ccAPI.sketcher.removeObjects(drawingId, sketchId, [objectId]);
|
|
12868
|
+
ccAPI.sketcher.removeObjects(drawingId, sketchId, [objectId]).catch(console.warn);
|
|
12655
12869
|
const tree = getDrawing(drawingId).structure.tree;
|
|
12656
12870
|
set(state_ => {
|
|
12657
12871
|
const selected = state_.selected.filter(id => id !== objectId && tree[id].parent !== objectId);
|
|
@@ -12730,7 +12944,7 @@ const RefTag = ({
|
|
|
12730
12944
|
remove.current = undefined;
|
|
12731
12945
|
} else if (itemsRefChange && itemsRefChange.length > 0) {
|
|
12732
12946
|
const newRefId = itemsRefChange[0].data.graphicId;
|
|
12733
|
-
ccAPI.sketcher.changeReferenceGeometry(drawingId, sketchId, objId, newRefId);
|
|
12947
|
+
ccAPI.sketcher.changeReferenceGeometry(drawingId, sketchId, objId, newRefId).catch(console.warn);
|
|
12734
12948
|
remove.current && remove.current();
|
|
12735
12949
|
remove.current = undefined;
|
|
12736
12950
|
}
|
|
@@ -12911,10 +13125,7 @@ const Details = () => {
|
|
|
12911
13125
|
return /*#__PURE__*/React__default.createElement(Collapse, {
|
|
12912
13126
|
header: "Details",
|
|
12913
13127
|
isActive: false
|
|
12914
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
12915
|
-
drawingId: drawingId,
|
|
12916
|
-
sketchId: sketchId
|
|
12917
|
-
}), !hasGeometry && /*#__PURE__*/React__default.createElement(Text$2, {
|
|
13128
|
+
}, !hasGeometry && /*#__PURE__*/React__default.createElement(Text$2, {
|
|
12918
13129
|
strong: true
|
|
12919
13130
|
}, "The sketch is empty"), hasGeometry && isTrimActive && /*#__PURE__*/React__default.createElement(Text$2, {
|
|
12920
13131
|
strong: true
|
|
@@ -12946,6 +13157,161 @@ const Details = () => {
|
|
|
12946
13157
|
}))));
|
|
12947
13158
|
};
|
|
12948
13159
|
|
|
13160
|
+
var img$s = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAB9SURBVEhL7ZFBCsAgDAT7HP//l77HCrsHCbaJiUKFDHtJgjsHr7qZFKikQOV/gruUFg4GnAK7JiSwOKIChLcRFIgHvqBKsFLQgraexQIEnWCLAEHzmQJ0gqM+GVUCCuyIUoS3EVEBt++EBFx94hRwMDAtmCUFKilQ2Syo9QGcSz3H8BHMoQAAAABJRU5ErkJggg==";
|
|
13161
|
+
|
|
13162
|
+
var img$r = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABzSURBVEhL7Y1BCsAwCAT7nLy837SFLCFsY0woQQ8OexF155LDBBOUu7zBsEYkQW3fdYQR9O01WFgsCai6BespAQRUSsGRjreA6obBqYKrgIomwcMIVUAVZvD2wU/QQ10tWE9JgUkKTFJgkgKTGII/HBaIPHzTFiPbxQ1UAAAAAElFTkSuQmCC";
|
|
13163
|
+
|
|
13164
|
+
const noSameSketchFilter = (drawingId, sketchId, objectId) => {
|
|
13165
|
+
const parentSketchId = getAncestorIdByClass(drawingId, objectId, CCClasses.CCSketch);
|
|
13166
|
+
return parentSketchId !== sketchId;
|
|
13167
|
+
};
|
|
13168
|
+
|
|
13169
|
+
function usePositionParam(drawingId, objId, memberName) {
|
|
13170
|
+
var _getDrawing$structure;
|
|
13171
|
+
|
|
13172
|
+
const member = (_getDrawing$structure = getDrawing(drawingId).structure.tree[objId].members) == null ? void 0 : _getDrawing$structure[memberName];
|
|
13173
|
+
const defaultValue = React__default.useMemo(() => {
|
|
13174
|
+
const obj = findObject(drawingId, member.value, true);
|
|
13175
|
+
return (obj == null ? void 0 : obj.graphicId) || (obj == null ? void 0 : obj.id) || 0; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13176
|
+
}, []);
|
|
13177
|
+
const [value, setValue] = React__default.useState(defaultValue);
|
|
13178
|
+
return {
|
|
13179
|
+
value,
|
|
13180
|
+
setValue
|
|
13181
|
+
};
|
|
13182
|
+
}
|
|
13183
|
+
|
|
13184
|
+
const PositionSelection = ({
|
|
13185
|
+
children,
|
|
13186
|
+
drawingId,
|
|
13187
|
+
param,
|
|
13188
|
+
caption,
|
|
13189
|
+
onChange,
|
|
13190
|
+
filter,
|
|
13191
|
+
noDeselect = false
|
|
13192
|
+
}) => {
|
|
13193
|
+
const {
|
|
13194
|
+
Selection
|
|
13195
|
+
} = useBuerli(buerli => buerli.options.elements);
|
|
13196
|
+
const objSelection = React__default.useMemo(() => {
|
|
13197
|
+
if (param.value !== 0) {
|
|
13198
|
+
const prodId = getDrawing(drawingId).structure.currentProduct;
|
|
13199
|
+
const obj = findObject(drawingId, param.value, true);
|
|
13200
|
+
|
|
13201
|
+
if (obj != null && obj.graphicId) {
|
|
13202
|
+
return [createGraphicItem(prodId, obj)];
|
|
13203
|
+
} else {
|
|
13204
|
+
return [createTreeObjSelItem(prodId, obj)];
|
|
13205
|
+
}
|
|
13206
|
+
}
|
|
13207
|
+
|
|
13208
|
+
return []; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13209
|
+
}, []);
|
|
13210
|
+
const onChange_ = React__default.useCallback(items => {
|
|
13211
|
+
var _items$, _items$$data$object, _items$2;
|
|
13212
|
+
|
|
13213
|
+
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;
|
|
13214
|
+
param.setValue(value);
|
|
13215
|
+
|
|
13216
|
+
if (param.value !== value) {
|
|
13217
|
+
onChange(value);
|
|
13218
|
+
}
|
|
13219
|
+
}, [param, onChange]);
|
|
13220
|
+
return /*#__PURE__*/React__default.createElement(Wrapper, {
|
|
13221
|
+
caption: caption
|
|
13222
|
+
}, /*#__PURE__*/React__default.createElement(Selection, {
|
|
13223
|
+
drawingId: drawingId,
|
|
13224
|
+
maxLen: 1,
|
|
13225
|
+
initialItems: objSelection,
|
|
13226
|
+
defaultActive: false,
|
|
13227
|
+
autoDisable: true,
|
|
13228
|
+
filter: filter,
|
|
13229
|
+
onChange: onChange_ // Is this a good solution from the user perspective? To just disallow deselection of plane...
|
|
13230
|
+
,
|
|
13231
|
+
customUnSelect: noDeselect ? () => void {} : undefined
|
|
13232
|
+
}), children);
|
|
13233
|
+
};
|
|
13234
|
+
|
|
13235
|
+
var Members$b;
|
|
13236
|
+
|
|
13237
|
+
(function (Members) {
|
|
13238
|
+
Members["PlaneReference"] = "planeReference";
|
|
13239
|
+
Members["AxisReference"] = "axisReference";
|
|
13240
|
+
Members["OriginReference"] = "originReference";
|
|
13241
|
+
Members["AxisIsX"] = "axisIsX";
|
|
13242
|
+
Members["PlaneInverted"] = "planeInverted";
|
|
13243
|
+
Members["AxisInverted"] = "axisInverted";
|
|
13244
|
+
})(Members$b || (Members$b = {}));
|
|
13245
|
+
|
|
13246
|
+
const Position = () => {
|
|
13247
|
+
const {
|
|
13248
|
+
Collapse
|
|
13249
|
+
} = useBuerli(buerli => buerli.options.elements);
|
|
13250
|
+
const {
|
|
13251
|
+
drawingId,
|
|
13252
|
+
pluginId
|
|
13253
|
+
} = React__default.useContext(RootContext);
|
|
13254
|
+
const sketchId = usePlugin(drawingId, pluginId, plugin => plugin.objectId);
|
|
13255
|
+
const planeId = usePositionParam(drawingId, sketchId, Members$b.PlaneReference);
|
|
13256
|
+
const axisId = usePositionParam(drawingId, sketchId, Members$b.AxisReference);
|
|
13257
|
+
const originId = usePositionParam(drawingId, sketchId, Members$b.OriginReference);
|
|
13258
|
+
const isXAxis = useBoolParam(drawingId, sketchId, Members$b.AxisIsX);
|
|
13259
|
+
const planeInverted = useBoolParam(drawingId, sketchId, Members$b.PlaneInverted);
|
|
13260
|
+
const axisInverted = useBoolParam(drawingId, sketchId, Members$b.AxisInverted);
|
|
13261
|
+
const onPlaneChange = React__default.useCallback(value => {
|
|
13262
|
+
ccAPI.sketcher.setSketchRefs(drawingId, sketchId, value || null, Boolean(planeInverted.serverValue), axisId.value || null, Boolean(isXAxis.serverValue), Boolean(axisInverted.serverValue), originId.value || null);
|
|
13263
|
+
}, [drawingId, sketchId, planeInverted, axisId, isXAxis, axisInverted, originId]);
|
|
13264
|
+
const onAxisChange = React__default.useCallback(value => {
|
|
13265
|
+
ccAPI.sketcher.setSketchRefs(drawingId, sketchId, null, Boolean(planeInverted.serverValue), value || null, Boolean(isXAxis.serverValue), Boolean(axisInverted.serverValue), originId.value || null);
|
|
13266
|
+
}, [drawingId, sketchId, planeInverted, isXAxis, axisInverted, originId]);
|
|
13267
|
+
const onOriginChange = React__default.useCallback(value => {
|
|
13268
|
+
ccAPI.sketcher.setSketchRefs(drawingId, sketchId, null, Boolean(planeInverted.serverValue), axisId.value || null, Boolean(isXAxis.serverValue), Boolean(axisInverted.serverValue), value || null);
|
|
13269
|
+
}, [drawingId, sketchId, planeInverted, axisId, isXAxis, axisInverted]);
|
|
13270
|
+
React__default.useEffect(() => {
|
|
13271
|
+
const params = [isXAxis, planeInverted, axisInverted];
|
|
13272
|
+
|
|
13273
|
+
if (params.some(param => param.isChanged())) {
|
|
13274
|
+
ccAPI.sketcher.setSketchRefs(drawingId, sketchId, null, Boolean(planeInverted.serverValue), axisId.value || null, Boolean(isXAxis.serverValue), Boolean(axisInverted.serverValue), originId.value || null);
|
|
13275
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13276
|
+
|
|
13277
|
+
}, [planeInverted.userValue, isXAxis.userValue, axisInverted.userValue]);
|
|
13278
|
+
const planeFilter_ = React__default.useCallback((scope, data) => planeFilter(scope, data) || workPlaneFilter(scope, data), []);
|
|
13279
|
+
const axisFilter_ = React__default.useCallback((scope, data) => lineFilter(scope, data) || workAxisFilter(scope, data) || ccLineFilter(scope, data) && noSameSketchFilter(drawingId, sketchId, data.object.id), [drawingId, sketchId]);
|
|
13280
|
+
const originFilter_ = React__default.useCallback((scope, data) => pointFilter(scope, data) || workPointFilter(scope, data) || ccPointFilter(scope, data) && noSameSketchFilter(drawingId, sketchId, data.object.id), [drawingId, sketchId]);
|
|
13281
|
+
return /*#__PURE__*/React__default.createElement(Collapse, {
|
|
13282
|
+
header: "Position",
|
|
13283
|
+
isActive: false
|
|
13284
|
+
}, /*#__PURE__*/React__default.createElement(PositionSelection, {
|
|
13285
|
+
drawingId: drawingId,
|
|
13286
|
+
param: planeId,
|
|
13287
|
+
caption: "Plane",
|
|
13288
|
+
onChange: onPlaneChange,
|
|
13289
|
+
filter: planeFilter_,
|
|
13290
|
+
noDeselect: true
|
|
13291
|
+
}, /*#__PURE__*/React__default.createElement(BooleanEditor, {
|
|
13292
|
+
param: planeInverted,
|
|
13293
|
+
icon: true
|
|
13294
|
+
})), /*#__PURE__*/React__default.createElement(PositionSelection, {
|
|
13295
|
+
drawingId: drawingId,
|
|
13296
|
+
param: axisId,
|
|
13297
|
+
caption: "Axis",
|
|
13298
|
+
onChange: onAxisChange,
|
|
13299
|
+
filter: axisFilter_
|
|
13300
|
+
}, /*#__PURE__*/React__default.createElement(BooleanEditor, {
|
|
13301
|
+
param: isXAxis,
|
|
13302
|
+
icon: [img$r, img$s]
|
|
13303
|
+
}), /*#__PURE__*/React__default.createElement(BooleanEditor, {
|
|
13304
|
+
param: axisInverted,
|
|
13305
|
+
icon: true
|
|
13306
|
+
})), /*#__PURE__*/React__default.createElement(PositionSelection, {
|
|
13307
|
+
drawingId: drawingId,
|
|
13308
|
+
param: originId,
|
|
13309
|
+
caption: "Origin",
|
|
13310
|
+
onChange: onOriginChange,
|
|
13311
|
+
filter: originFilter_
|
|
13312
|
+
}));
|
|
13313
|
+
};
|
|
13314
|
+
|
|
12949
13315
|
const PlaneSelectionMode = ({
|
|
12950
13316
|
drawingId,
|
|
12951
13317
|
pluginId
|
|
@@ -13143,7 +13509,7 @@ const SketchMode = ({
|
|
|
13143
13509
|
tooltip: "Mirror copy pattern."
|
|
13144
13510
|
}),
|
|
13145
13511
|
key: "Mirror"
|
|
13146
|
-
}, /*#__PURE__*/React__default.createElement(MirrorPattern, null)))), /*#__PURE__*/React__default.createElement(Details, null)));
|
|
13512
|
+
}, /*#__PURE__*/React__default.createElement(MirrorPattern, null)))), /*#__PURE__*/React__default.createElement(Details, null), /*#__PURE__*/React__default.createElement(Position, null)));
|
|
13147
13513
|
};
|
|
13148
13514
|
|
|
13149
13515
|
const RootImpl$f = ({
|
|
@@ -14767,9 +15133,9 @@ function ViewImpl$8({
|
|
|
14767
15133
|
const zMax = origin.clone().setComponent(2, max.z);
|
|
14768
15134
|
|
|
14769
15135
|
const CreateBoundaryLineGeometry = (point1, point2, componentIndex) => {
|
|
14770
|
-
const
|
|
14771
|
-
|
|
14772
|
-
return
|
|
15136
|
+
const start = point1.clone();
|
|
15137
|
+
const end = point1.clone().setComponent(componentIndex, point2.getComponent(componentIndex));
|
|
15138
|
+
return new THREE.BufferGeometry().setFromPoints([start, end]);
|
|
14773
15139
|
};
|
|
14774
15140
|
|
|
14775
15141
|
return /*#__PURE__*/React__default.createElement("group", null, /*#__PURE__*/React__default.createElement(Arrow, {
|
|
@@ -15260,7 +15626,7 @@ const RootImpl$9 = ({
|
|
|
15260
15626
|
}, type]];
|
|
15261
15627
|
setName(undefined);
|
|
15262
15628
|
setExpression(undefined);
|
|
15263
|
-
return ccAPI.feature.updateExpressionSet(drawingId, productId, toAddMembers, [], []);
|
|
15629
|
+
return ccAPI.feature.updateExpressionSet(drawingId, productId, toAddMembers, [], []).catch(console.warn);
|
|
15264
15630
|
}, [drawingId, productId, name, expression, type]);
|
|
15265
15631
|
const deleteExpression = React__default.useCallback(name_ => {
|
|
15266
15632
|
const {
|
|
@@ -15448,7 +15814,7 @@ function RootImpl$8({
|
|
|
15448
15814
|
|
|
15449
15815
|
const update = React__default.useCallback(async () => {
|
|
15450
15816
|
/* stopPreview.current() */
|
|
15451
|
-
return ccAPI.assemblyBuilder.updateFastenedOriginConstraint(drawingId, objectId, mateRef.serverValue, xOffset.serverValue, yOffset.serverValue, zOffset.serverValue)
|
|
15817
|
+
return ccAPI.assemblyBuilder.updateFastenedOriginConstraint(drawingId, objectId, mateRef.serverValue, xOffset.serverValue, yOffset.serverValue, zOffset.serverValue);
|
|
15452
15818
|
}, [drawingId, objectId, mateRef, xOffset, yOffset, zOffset]);
|
|
15453
15819
|
return /*#__PURE__*/React__default.createElement(PluginForm, {
|
|
15454
15820
|
drawingId: drawingId,
|
|
@@ -15987,10 +16353,33 @@ const CSysDisplayImpl = ({
|
|
|
15987
16353
|
|
|
15988
16354
|
return csysUDataArray_;
|
|
15989
16355
|
}, [drawingId, hoveredOnly, activeProducts, hoveredProductIds, hoveredCSysIds, selItems, activeSelItems, rigidSets, selRigidSets]);
|
|
16356
|
+
const lnTh = useThree(state => {
|
|
16357
|
+
var _state$raycaster$para;
|
|
16358
|
+
|
|
16359
|
+
return (_state$raycaster$para = state.raycaster.params.Line) == null ? void 0 : _state$raycaster$para.threshold;
|
|
16360
|
+
});
|
|
16361
|
+
const ptsTh = useThree(state => {
|
|
16362
|
+
var _state$raycaster$para2;
|
|
16363
|
+
|
|
16364
|
+
return (_state$raycaster$para2 = state.raycaster.params.Points) == null ? void 0 : _state$raycaster$para2.threshold;
|
|
16365
|
+
});
|
|
16366
|
+
const {
|
|
16367
|
+
camera,
|
|
16368
|
+
size
|
|
16369
|
+
} = useThree();
|
|
16370
|
+
const {
|
|
16371
|
+
lineThreshold,
|
|
16372
|
+
pointThreshold
|
|
16373
|
+
} = React__default.useMemo(() => {
|
|
16374
|
+
return {
|
|
16375
|
+
lineThreshold: lnTh || CameraHelper.calculateScaleFactor(camera.position, 4, camera, size),
|
|
16376
|
+
pointThreshold: ptsTh || CameraHelper.calculateScaleFactor(camera.position, 6, camera, size)
|
|
16377
|
+
};
|
|
16378
|
+
}, [camera, size, lnTh, ptsTh]);
|
|
15990
16379
|
const onInfiniteMove = React__default.useCallback(e => {
|
|
15991
|
-
const geom = findBuerliGeometry(e);
|
|
16380
|
+
const geom = findBuerliGeometry(e, lineThreshold, pointThreshold)[0];
|
|
15992
16381
|
setHoveredProductId(geom == null ? void 0 : geom.productId);
|
|
15993
|
-
}, [setHoveredProductId]);
|
|
16382
|
+
}, [setHoveredProductId, lineThreshold, pointThreshold]);
|
|
15994
16383
|
return /*#__PURE__*/React__default.createElement(HUD, null, /*#__PURE__*/React__default.createElement("infinityPlane", {
|
|
15995
16384
|
onPointerMove: onInfiniteMove
|
|
15996
16385
|
}), /*#__PURE__*/React__default.createElement("group", null, csysUDataArray.map(userData => /*#__PURE__*/React__default.createElement(CSysWrapper, {
|
|
@@ -16123,7 +16512,7 @@ function RootImpl$7({
|
|
|
16123
16512
|
|
|
16124
16513
|
const update = React__default.useCallback(async () => {
|
|
16125
16514
|
/* stopPreview.current() */
|
|
16126
|
-
return ccAPI.assemblyBuilder.updateFastenedConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, xOffset.serverValue, yOffset.serverValue, zOffset.serverValue)
|
|
16515
|
+
return ccAPI.assemblyBuilder.updateFastenedConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, xOffset.serverValue, yOffset.serverValue, zOffset.serverValue);
|
|
16127
16516
|
}, [drawingId, objectId, mate1Ref, mate2Ref, xOffset, yOffset, zOffset]);
|
|
16128
16517
|
return /*#__PURE__*/React__default.createElement(PluginForm, {
|
|
16129
16518
|
drawingId: drawingId,
|
|
@@ -16505,7 +16894,7 @@ const LimitedValue = ({
|
|
|
16505
16894
|
promise.current = onUpdate(updateTo_).then(() => {
|
|
16506
16895
|
promise.current = undefined;
|
|
16507
16896
|
sendToServer();
|
|
16508
|
-
});
|
|
16897
|
+
}).catch(console.warn);
|
|
16509
16898
|
}
|
|
16510
16899
|
}, [onUpdate]);
|
|
16511
16900
|
const commit = React__default.useCallback(value_ => {
|
|
@@ -16646,7 +17035,7 @@ function RootImpl$6({
|
|
|
16646
17035
|
const update = React__default.useCallback(async () => {
|
|
16647
17036
|
/* stopPreview.current() */
|
|
16648
17037
|
setDisableVals(true);
|
|
16649
|
-
return ccAPI.assemblyBuilder.updateSliderConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, xOffset.serverValue, yOffset.serverValue, zOffsetLimits.serverValue).then(() => setDisableVals(false))
|
|
17038
|
+
return ccAPI.assemblyBuilder.updateSliderConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, xOffset.serverValue, yOffset.serverValue, zOffsetLimits.serverValue).then(() => setDisableVals(false));
|
|
16650
17039
|
}, [drawingId, objectId, mate1Ref, mate2Ref, xOffset, yOffset, zOffsetLimits]);
|
|
16651
17040
|
const updateValue = React__default.useCallback(value => {
|
|
16652
17041
|
return ccAPI.assemblyBuilder.update3DConstraintValue(drawingId, objectId, 'zOffsetValue', value);
|
|
@@ -16806,10 +17195,10 @@ function RootImpl$5({
|
|
|
16806
17195
|
const update = React__default.useCallback(async () => {
|
|
16807
17196
|
/* stopPreview.current() */
|
|
16808
17197
|
setDisableVals(true);
|
|
16809
|
-
return ccAPI.assemblyBuilder.updateRevoluteConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, zOffset.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false))
|
|
17198
|
+
return ccAPI.assemblyBuilder.updateRevoluteConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, zOffset.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false));
|
|
16810
17199
|
}, [drawingId, objectId, mate1Ref, mate2Ref, zOffset, zRotationLimits]);
|
|
16811
17200
|
const updateValue = React__default.useCallback(value => {
|
|
16812
|
-
return ccAPI.assemblyBuilder.update3DConstraintValue(drawingId, objectId, 'zRotationValue', value)
|
|
17201
|
+
return ccAPI.assemblyBuilder.update3DConstraintValue(drawingId, objectId, 'zRotationValue', value);
|
|
16813
17202
|
}, [drawingId, objectId]);
|
|
16814
17203
|
const validate = React__default.useCallback(() => {
|
|
16815
17204
|
return validateLimits(zRotationLimits.userValue, 'Rotation Z');
|
|
@@ -16965,7 +17354,7 @@ function RootImpl$4({
|
|
|
16965
17354
|
const update = React__default.useCallback(async () => {
|
|
16966
17355
|
/* stopPreview.current() */
|
|
16967
17356
|
setDisableVals(true);
|
|
16968
|
-
return ccAPI.assemblyBuilder.updateCylindricalConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, zOffsetLimits.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false))
|
|
17357
|
+
return ccAPI.assemblyBuilder.updateCylindricalConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, zOffsetLimits.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false));
|
|
16969
17358
|
}, [drawingId, objectId, mate1Ref, mate2Ref, zOffsetLimits, zRotationLimits]);
|
|
16970
17359
|
const updateOffset = React__default.useCallback(value => {
|
|
16971
17360
|
return ccAPI.assemblyBuilder.update3DConstraintValue(drawingId, objectId, 'zOffsetValue', value);
|
|
@@ -17143,7 +17532,7 @@ function RootImpl$3({
|
|
|
17143
17532
|
const update = React__default.useCallback(async () => {
|
|
17144
17533
|
/* stopPreview.current() */
|
|
17145
17534
|
setDisableVals(true);
|
|
17146
|
-
return ccAPI.assemblyBuilder.updatePlanarConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, zOffset.serverValue, xOffsetLimits.serverValue, yOffsetLimits.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false))
|
|
17535
|
+
return ccAPI.assemblyBuilder.updatePlanarConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, zOffset.serverValue, xOffsetLimits.serverValue, yOffsetLimits.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false));
|
|
17147
17536
|
}, [drawingId, objectId, mate1Ref, mate2Ref, zOffset, xOffsetLimits, yOffsetLimits, zRotationLimits]);
|
|
17148
17537
|
const updateXOffset = React__default.useCallback(value => {
|
|
17149
17538
|
return ccAPI.assemblyBuilder.update3DConstraintValue(drawingId, objectId, 'xOffsetValue', value);
|
|
@@ -17344,7 +17733,7 @@ function RootImpl$2({
|
|
|
17344
17733
|
const update = React__default.useCallback(async () => {
|
|
17345
17734
|
/* stopPreview.current() */
|
|
17346
17735
|
setDisableVals(true);
|
|
17347
|
-
return ccAPI.assemblyBuilder.updateParallelConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, xOffsetLimits.serverValue, yOffsetLimits.serverValue, zOffsetLimits.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false))
|
|
17736
|
+
return ccAPI.assemblyBuilder.updateParallelConstraint(drawingId, objectId, mate1Ref.serverValue, mate2Ref.serverValue, xOffsetLimits.serverValue, yOffsetLimits.serverValue, zOffsetLimits.serverValue, zRotationLimits.serverValue).then(() => setDisableVals(false));
|
|
17348
17737
|
}, [drawingId, objectId, mate1Ref, mate2Ref, xOffsetLimits, yOffsetLimits, zOffsetLimits, zRotationLimits]);
|
|
17349
17738
|
const updateXOffset = React__default.useCallback(value => {
|
|
17350
17739
|
return ccAPI.assemblyBuilder.update3DConstraintValue(drawingId, objectId, 'xOffsetValue', value);
|
|
@@ -17729,7 +18118,7 @@ const FileUtils = {
|
|
|
17729
18118
|
const isRoot = objectId === structure.root;
|
|
17730
18119
|
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;
|
|
17731
18120
|
const name = tree[productId].name;
|
|
17732
|
-
const data = isRoot ? await ccAPI.baseModeler.save(drawingId, type) : await ccAPI.assemblyBuilder.exportNode(drawingId, objectId, type);
|
|
18121
|
+
const data = isRoot ? await ccAPI.baseModeler.save(drawingId, type).catch(console.warn) : await ccAPI.assemblyBuilder.exportNode(drawingId, objectId, type).catch(console.warn);
|
|
17733
18122
|
|
|
17734
18123
|
if (data) {
|
|
17735
18124
|
const link = document.createElement('a');
|
|
@@ -17780,7 +18169,7 @@ function useMenuItems$2(drawingId, prodId, setEditName, pluginId) {
|
|
|
17780
18169
|
x: 0,
|
|
17781
18170
|
y: 1,
|
|
17782
18171
|
z: 0
|
|
17783
|
-
}]);
|
|
18172
|
+
}]).catch(console.warn);
|
|
17784
18173
|
}
|
|
17785
18174
|
},
|
|
17786
18175
|
export: {
|
|
@@ -17808,7 +18197,7 @@ function useMenuItems$2(drawingId, prodId, setEditName, pluginId) {
|
|
|
17808
18197
|
caption: 'delete',
|
|
17809
18198
|
icon: /*#__PURE__*/React__default.createElement(DeleteOutlined, null),
|
|
17810
18199
|
callback: () => {
|
|
17811
|
-
ccAPI.baseModeler.deleteObject(drawingId, prodId);
|
|
18200
|
+
ccAPI.baseModeler.deleteObject(drawingId, prodId).catch(console.warn);
|
|
17812
18201
|
}
|
|
17813
18202
|
}
|
|
17814
18203
|
};
|
|
@@ -17895,7 +18284,7 @@ const NewProd = ({
|
|
|
17895
18284
|
}, []);
|
|
17896
18285
|
const createProd = React__default.useCallback(async () => {
|
|
17897
18286
|
const func = type === 'part' ? ccAPI.assemblyBuilder.createPartAsTemplate : ccAPI.assemblyBuilder.createAssemblyAsTemplate;
|
|
17898
|
-
await func(drawingId, name);
|
|
18287
|
+
await func(drawingId, name).catch(console.warn);
|
|
17899
18288
|
setCreateMode(false);
|
|
17900
18289
|
}, [name, drawingId, type, setCreateMode]);
|
|
17901
18290
|
const onKeyPress = React__default.useCallback(e => {
|
|
@@ -18151,7 +18540,7 @@ const ImportModel = ({
|
|
|
18151
18540
|
content
|
|
18152
18541
|
}) => {
|
|
18153
18542
|
const type = extname(file.name).replace('.', '');
|
|
18154
|
-
ccAPI.assemblyBuilder.loadProduct(drawingId, content, type, file.name).catch();
|
|
18543
|
+
ccAPI.assemblyBuilder.loadProduct(drawingId, content, type, file.name).catch(console.warn);
|
|
18155
18544
|
});
|
|
18156
18545
|
}, undefined, true);
|
|
18157
18546
|
}, [drawingId]);
|
|
@@ -18294,7 +18683,7 @@ const ViewImpl = ({
|
|
|
18294
18683
|
x: 0,
|
|
18295
18684
|
y: 1,
|
|
18296
18685
|
z: 0
|
|
18297
|
-
}]).catch();
|
|
18686
|
+
}]).catch(console.warn);
|
|
18298
18687
|
}
|
|
18299
18688
|
};
|
|
18300
18689
|
|
|
@@ -18356,13 +18745,13 @@ const load = (file, singleDrawingApp) => {
|
|
|
18356
18745
|
reader.onload = async () => {
|
|
18357
18746
|
const result = reader.result;
|
|
18358
18747
|
const oldDrawingId = api.getState().drawing.active;
|
|
18359
|
-
const drawingId = await ccAPI.base.createCCDrawing(file.name);
|
|
18748
|
+
const drawingId = await ccAPI.base.createCCDrawing(file.name).catch(console.warn);
|
|
18360
18749
|
|
|
18361
18750
|
if (drawingId) {
|
|
18362
18751
|
try {
|
|
18363
18752
|
api.getState().api.setActiveDrawing(drawingId);
|
|
18364
18753
|
const type = extname(file.name).replace('.', '');
|
|
18365
|
-
await ccAPI.baseModeler.load(drawingId, result, type, file.name);
|
|
18754
|
+
await ccAPI.baseModeler.load(drawingId, result, type, file.name).catch(console.warn);
|
|
18366
18755
|
|
|
18367
18756
|
if (oldDrawingId && singleDrawingApp) {
|
|
18368
18757
|
api.getState().api.removeDrawing(oldDrawingId);
|
|
@@ -18390,7 +18779,7 @@ const Readfile = /*#__PURE__*/forwardRef(({
|
|
|
18390
18779
|
const readFile = React__default.useCallback(event => {
|
|
18391
18780
|
if (event.target && event.target.files) {
|
|
18392
18781
|
const file = event.target.files[0];
|
|
18393
|
-
load(file, singleDrawingApp);
|
|
18782
|
+
load(file, singleDrawingApp).catch(console.warn);
|
|
18394
18783
|
event.target.value = '';
|
|
18395
18784
|
}
|
|
18396
18785
|
}, [singleDrawingApp]);
|
|
@@ -20600,9 +20989,9 @@ const List$1 = ({
|
|
|
20600
20989
|
const move = ccAPI.feature.rollback.calculateMovement(oldIndex, newIndex, features, offset);
|
|
20601
20990
|
|
|
20602
20991
|
if (move.moveTo === 'end') {
|
|
20603
|
-
ccAPI.feature.rollback.moveToEnd(drawingId).catch();
|
|
20992
|
+
ccAPI.feature.rollback.moveToEnd(drawingId).catch(console.warn);
|
|
20604
20993
|
} else {
|
|
20605
|
-
ccAPI.feature.rollback.moveBefore(drawingId, move.featureId).catch();
|
|
20994
|
+
ccAPI.feature.rollback.moveBefore(drawingId, move.featureId).catch(console.warn);
|
|
20606
20995
|
}
|
|
20607
20996
|
}
|
|
20608
20997
|
}, featureRefIds.map(refId => /*#__PURE__*/React__default.createElement(Item$1, {
|
|
@@ -20643,7 +21032,7 @@ function useMenuItems$1(drawingId, objectId, setRename) {
|
|
|
20643
21032
|
caption: 'delete',
|
|
20644
21033
|
icon: /*#__PURE__*/React__default.createElement(DeleteOutlined, null),
|
|
20645
21034
|
callback: () => {
|
|
20646
|
-
ccAPI.baseModeler.deleteObject(drawingId, objectId);
|
|
21035
|
+
ccAPI.baseModeler.deleteObject(drawingId, objectId).catch(console.warn);
|
|
20647
21036
|
}
|
|
20648
21037
|
}
|
|
20649
21038
|
};
|
|
@@ -20987,7 +21376,7 @@ const NameChoice = ({
|
|
|
20987
21376
|
visible: true,
|
|
20988
21377
|
onCancel: hideWindow,
|
|
20989
21378
|
onOk: () => {
|
|
20990
|
-
ccAPI.assemblyBuilder.convertToTemplate(drawingId, subName);
|
|
21379
|
+
ccAPI.assemblyBuilder.convertToTemplate(drawingId, subName).catch(console.warn);
|
|
20991
21380
|
hideWindow();
|
|
20992
21381
|
}
|
|
20993
21382
|
}, "New SubAssembly Name: ", /*#__PURE__*/React__default.createElement(Input, {
|
|
@@ -21181,8 +21570,8 @@ const ColorPicker = ({
|
|
|
21181
21570
|
});
|
|
21182
21571
|
}, [drawingId, solidId]);
|
|
21183
21572
|
const applyColor = React__default.useCallback(async () => {
|
|
21184
|
-
await ccAPI.
|
|
21185
|
-
await ccAPI.
|
|
21573
|
+
await ccAPI.baseModeler.setColor(drawingId, [solidOwner], userColor.r, userColor.g, userColor.b).catch(console.warn);
|
|
21574
|
+
await ccAPI.baseModeler.setTransparency(drawingId, [solidOwner], 1 - userColor.a).catch(console.warn); // Update color in geometry
|
|
21186
21575
|
// TODO: use 256 format directly
|
|
21187
21576
|
|
|
21188
21577
|
getDrawing(drawingId).api.geometry.setColor(solidId, userColor.r / 255, userColor.g / 255, userColor.b / 255);
|
|
@@ -21510,7 +21899,7 @@ const PartModeCmds = (drawingId, rootId) => {
|
|
|
21510
21899
|
const pluginApi = getDrawing(drawingId).api.plugin;
|
|
21511
21900
|
|
|
21512
21901
|
const wrapper = cmd => async () => {
|
|
21513
|
-
const res = await cmd();
|
|
21902
|
+
const res = await cmd().catch(console.warn);
|
|
21514
21903
|
|
|
21515
21904
|
if (res && res.errors && res.errors.length === 0 && res.results[0].result !== null) {
|
|
21516
21905
|
pluginApi.setActiveFeature(res.results[0].result);
|
|
@@ -21525,7 +21914,7 @@ const PartModeCmds = (drawingId, rootId) => {
|
|
|
21525
21914
|
Sketch: {
|
|
21526
21915
|
label: 'Sketch',
|
|
21527
21916
|
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
21528
|
-
url: img$
|
|
21917
|
+
url: img$x
|
|
21529
21918
|
}),
|
|
21530
21919
|
callback: wrapper(() => ccAPI.sketcher.createSketch(drawingId, rootId))
|
|
21531
21920
|
},
|
|
@@ -21557,13 +21946,13 @@ const PartModeCmds = (drawingId, rootId) => {
|
|
|
21557
21946
|
Solid: [{
|
|
21558
21947
|
label: 'Extrusion',
|
|
21559
21948
|
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
21560
|
-
url: img$
|
|
21949
|
+
url: img$H
|
|
21561
21950
|
}),
|
|
21562
21951
|
callback: wrapper(() => featureApi.createExtrusion(drawingId, rootId))
|
|
21563
21952
|
}, {
|
|
21564
21953
|
label: 'Revolve',
|
|
21565
21954
|
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
21566
|
-
url: img$
|
|
21955
|
+
url: img$G
|
|
21567
21956
|
}),
|
|
21568
21957
|
callback: wrapper(() => featureApi.createRevolve(drawingId, rootId))
|
|
21569
21958
|
}],
|
|
@@ -21615,7 +22004,7 @@ const PartModeCmds = (drawingId, rootId) => {
|
|
|
21615
22004
|
}, {
|
|
21616
22005
|
label: 'Mirror',
|
|
21617
22006
|
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
21618
|
-
url: img$
|
|
22007
|
+
url: img$u
|
|
21619
22008
|
}),
|
|
21620
22009
|
callback: wrapper(() => featureApi.createFeature(drawingId, rootId, CCClasses.CCMirror, 'Mirror'))
|
|
21621
22010
|
}],
|
|
@@ -21692,7 +22081,7 @@ const AssemblyModeCmds = (drawingId, rootId) => {
|
|
|
21692
22081
|
const pluginApi = getDrawing(drawingId).api.plugin;
|
|
21693
22082
|
|
|
21694
22083
|
const wrapper = cmd => async () => {
|
|
21695
|
-
const res = await cmd();
|
|
22084
|
+
const res = await cmd().catch(console.warn);
|
|
21696
22085
|
|
|
21697
22086
|
if (res && res.errors && res.errors.length === 0 && res.results[0].result !== null) {
|
|
21698
22087
|
pluginApi.setActiveFeature(res.results[0].result);
|
|
@@ -21952,7 +22341,7 @@ const useOptionCommands = () => {
|
|
|
21952
22341
|
}, {
|
|
21953
22342
|
label: 'Vertices',
|
|
21954
22343
|
icon: /*#__PURE__*/React__default.createElement(Icon, {
|
|
21955
|
-
url: img$
|
|
22344
|
+
url: img$F
|
|
21956
22345
|
}),
|
|
21957
22346
|
isChecked: showVertices,
|
|
21958
22347
|
command: () => setShowVertices(!showVertices)
|