@buerli.io/react-cad 0.5.0-beta.1 → 0.5.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/UI/CAD/ModelTree/ModelTreeHeader.d.ts +2 -1
- package/build/components/UI/CAD/ToolBar/ToolBar.d.ts +1 -0
- package/build/components/UI/CAD/common/NameEdit.d.ts +1 -0
- package/build/components/UI/editors/RefsEditors/index.d.ts +1 -0
- package/build/components/UI/editors/RefsEditors/useModes.d.ts +7 -0
- package/build/components/graphics/Outlines/OutlineMaterial.d.ts +1 -1
- package/build/index.cjs.js +812 -486
- package/build/index.js +813 -487
- package/build/plugins/Sketch/Root/Handlers.d.ts +1 -0
- package/build/plugins/Sketch/Root/Regions.d.ts +2 -0
- package/build/utils/FileUtils.d.ts +1 -1
- package/package.json +15 -21
- package/build/plugins/HLConstraints/components/PreviewButton.d.ts +0 -8
package/build/index.cjs.js
CHANGED
|
@@ -56,8 +56,8 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
|
56
56
|
var THREE__namespace = /*#__PURE__*/_interopNamespaceDefault(THREE);
|
|
57
57
|
var deepmerge__namespace = /*#__PURE__*/_interopNamespaceDefault(deepmerge);
|
|
58
58
|
|
|
59
|
-
function ownKeys$
|
|
60
|
-
function _objectSpread$
|
|
59
|
+
function ownKeys$p(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
60
|
+
function _objectSpread$p(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$p(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$p(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
61
61
|
function getGraphicId(tree, refOrObjId) {
|
|
62
62
|
const res = {
|
|
63
63
|
graphicId: refOrObjId,
|
|
@@ -120,7 +120,7 @@ function useSelectedItems(drawingId, refOrObjIds) {
|
|
|
120
120
|
window.console.error('Product is not a CC_Part. Assembly is not supported now');
|
|
121
121
|
}
|
|
122
122
|
const createSelItem = React.useCallback(element => {
|
|
123
|
-
return core.createGraphicItem(prodId, _objectSpread$
|
|
123
|
+
return core.createGraphicItem(prodId, _objectSpread$p(_objectSpread$p({}, element), {}, {
|
|
124
124
|
productId: prodId
|
|
125
125
|
}));
|
|
126
126
|
}, [prodId]);
|
|
@@ -145,7 +145,7 @@ function useSelectedItems(drawingId, refOrObjIds) {
|
|
|
145
145
|
if (grIds && grIds.length > 0) {
|
|
146
146
|
const elem = cont.map[Number(grIds[0])];
|
|
147
147
|
if (elem) {
|
|
148
|
-
elems.push(_objectSpread$
|
|
148
|
+
elems.push(_objectSpread$p(_objectSpread$p({}, elem), {}, {
|
|
149
149
|
graphicId: contId,
|
|
150
150
|
type: cont.type
|
|
151
151
|
}));
|
|
@@ -181,8 +181,8 @@ function useSelectedItems(drawingId, refOrObjIds) {
|
|
|
181
181
|
return selectedItems;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
function ownKeys$
|
|
185
|
-
function _objectSpread$
|
|
184
|
+
function ownKeys$o(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
185
|
+
function _objectSpread$o(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$o(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$o(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
186
186
|
function addMembers(drawingId, ccObjId) {
|
|
187
187
|
const drawingState = core.getDrawing(drawingId);
|
|
188
188
|
const objInTree = drawingState.structure.tree[ccObjId];
|
|
@@ -193,7 +193,7 @@ function addMembers(drawingId, ccObjId) {
|
|
|
193
193
|
const members = {};
|
|
194
194
|
Object.keys(curMembers).forEach(memberName => {
|
|
195
195
|
const curMember = curMembers[memberName];
|
|
196
|
-
members[memberName] = _objectSpread$
|
|
196
|
+
members[memberName] = _objectSpread$o(_objectSpread$o({}, curMember), {}, {
|
|
197
197
|
name: memberName
|
|
198
198
|
});
|
|
199
199
|
if (curMember.type === core.MemberType.POINT && Array.isArray(curMember.value)) {
|
|
@@ -1083,8 +1083,8 @@ const isAngular = dim => {
|
|
|
1083
1083
|
return dim.class === classcad.CCClasses.CCAngularDimension || dim.class === classcad.CCClasses.CCAngularFeatureDimension || dim.class === classcad.CCClasses.CCAngularRefDimension;
|
|
1084
1084
|
};
|
|
1085
1085
|
|
|
1086
|
-
function ownKeys$
|
|
1087
|
-
function _objectSpread$
|
|
1086
|
+
function ownKeys$n(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1087
|
+
function _objectSpread$n(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$n(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1088
1088
|
const appApi = (set, get) => ({
|
|
1089
1089
|
assemblyTree: {
|
|
1090
1090
|
startProdEditing: (drawingId, objId) => {
|
|
@@ -1093,7 +1093,7 @@ const appApi = (set, get) => ({
|
|
|
1093
1093
|
const curNode = core.api.getState().drawing.refs[drawingId].structure.currentNode;
|
|
1094
1094
|
res = state.assemblyTree.prodStack;
|
|
1095
1095
|
curNode && res.push(curNode);
|
|
1096
|
-
return _objectSpread$
|
|
1096
|
+
return _objectSpread$n(_objectSpread$n({}, state), {}, {
|
|
1097
1097
|
assemblyTree: {
|
|
1098
1098
|
prodStack: [...res]
|
|
1099
1099
|
}
|
|
@@ -1108,7 +1108,7 @@ const appApi = (set, get) => ({
|
|
|
1108
1108
|
set(state => {
|
|
1109
1109
|
const res = state.assemblyTree.prodStack;
|
|
1110
1110
|
res.pop();
|
|
1111
|
-
return _objectSpread$
|
|
1111
|
+
return _objectSpread$n(_objectSpread$n({}, state), {}, {
|
|
1112
1112
|
assemblyTree: {
|
|
1113
1113
|
prodStack: [...res]
|
|
1114
1114
|
}
|
|
@@ -1117,7 +1117,7 @@ const appApi = (set, get) => ({
|
|
|
1117
1117
|
classcad.ccAPI.assemblyBuilder.setCurrentNode(drawingId, prevProd).catch(console.warn);
|
|
1118
1118
|
},
|
|
1119
1119
|
clearProdStack: () => {
|
|
1120
|
-
set(state => _objectSpread$
|
|
1120
|
+
set(state => _objectSpread$n(_objectSpread$n({}, state), {}, {
|
|
1121
1121
|
assemblyTree: {
|
|
1122
1122
|
prodStack: []
|
|
1123
1123
|
}
|
|
@@ -1126,7 +1126,7 @@ const appApi = (set, get) => ({
|
|
|
1126
1126
|
},
|
|
1127
1127
|
blankDiv: {
|
|
1128
1128
|
show: callback => {
|
|
1129
|
-
set(state => _objectSpread$
|
|
1129
|
+
set(state => _objectSpread$n(_objectSpread$n({}, state), {}, {
|
|
1130
1130
|
blankDiv: {
|
|
1131
1131
|
isActive: true,
|
|
1132
1132
|
onClose: callback
|
|
@@ -1134,7 +1134,7 @@ const appApi = (set, get) => ({
|
|
|
1134
1134
|
}));
|
|
1135
1135
|
},
|
|
1136
1136
|
hide: () => {
|
|
1137
|
-
set(state => _objectSpread$
|
|
1137
|
+
set(state => _objectSpread$n(_objectSpread$n({}, state), {}, {
|
|
1138
1138
|
blankDiv: {
|
|
1139
1139
|
isActive: false,
|
|
1140
1140
|
onClose: undefined
|
|
@@ -2293,13 +2293,13 @@ function refIdChanged(refId, defId, tree) {
|
|
|
2293
2293
|
}
|
|
2294
2294
|
}
|
|
2295
2295
|
function useRefsParam(drawingId, objId, memberName) {
|
|
2296
|
-
const
|
|
2297
|
-
var _d$structure$tree$obj, _d$structure$tree$obj2;
|
|
2298
|
-
return (_d$structure$tree$obj = d.structure.tree[objId]) == null ? void 0 : (_d$structure$tree$obj2 = _d$structure$tree$obj.members) == null ? void 0 : _d$structure$tree$obj2[memberName];
|
|
2296
|
+
const members = useDrawingArr(drawingId, d => {
|
|
2297
|
+
var _d$structure$tree$obj, _d$structure$tree$obj2, _d$structure$tree$obj3;
|
|
2298
|
+
return (_d$structure$tree$obj = d.structure.tree[objId]) == null ? void 0 : (_d$structure$tree$obj2 = _d$structure$tree$obj.members) == null ? void 0 : (_d$structure$tree$obj3 = _d$structure$tree$obj2[memberName]) == null ? void 0 : _d$structure$tree$obj3.members;
|
|
2299
2299
|
});
|
|
2300
2300
|
const defaults = React.useMemo(() => {
|
|
2301
|
-
return
|
|
2302
|
-
}, [
|
|
2301
|
+
return members.map(m => m.value);
|
|
2302
|
+
}, [members]);
|
|
2303
2303
|
const [userValue, setUserValue] = React.useState(defaults);
|
|
2304
2304
|
const validateFns = React.useRef([]);
|
|
2305
2305
|
React.useEffect(() => {
|
|
@@ -2346,8 +2346,8 @@ function useRefsParam(drawingId, objId, memberName) {
|
|
|
2346
2346
|
});
|
|
2347
2347
|
}
|
|
2348
2348
|
|
|
2349
|
-
function ownKeys$
|
|
2350
|
-
function _objectSpread$
|
|
2349
|
+
function ownKeys$m(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2350
|
+
function _objectSpread$m(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$m(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$m(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2351
2351
|
|
|
2352
2352
|
/**
|
|
2353
2353
|
* Implies the following data structure:
|
|
@@ -2475,7 +2475,7 @@ function useTreeObjSelection(drawingId, objId) {
|
|
|
2475
2475
|
const isSelected = useIsSelected$1(drawingId, objId);
|
|
2476
2476
|
const handlers = React.useMemo(() => {
|
|
2477
2477
|
if (isSelectable) {
|
|
2478
|
-
return _objectSpread$
|
|
2478
|
+
return _objectSpread$m(_objectSpread$m({}, hHandlers), sHandlers);
|
|
2479
2479
|
}
|
|
2480
2480
|
return {};
|
|
2481
2481
|
}, [isSelectable, hHandlers, sHandlers]);
|
|
@@ -2787,7 +2787,7 @@ function getSketchGrItems(drawingId, childId) {
|
|
|
2787
2787
|
}
|
|
2788
2788
|
function useModes(drawingId, sketchLines, setParamRefs, selectorsOrder) {
|
|
2789
2789
|
const defCustomSelect = React.useCallback((selId, items) => {
|
|
2790
|
-
setParamRefs(items);
|
|
2790
|
+
setParamRefs(selId, items);
|
|
2791
2791
|
const maxLen = core.getDrawing(drawingId).selection.refs[selId].maxLen;
|
|
2792
2792
|
// If items len === 0 selector should not be switched
|
|
2793
2793
|
if (maxLen > 0 && items.length >= maxLen) {
|
|
@@ -2838,6 +2838,7 @@ function useModes(drawingId, sketchLines, setParamRefs, selectorsOrder) {
|
|
|
2838
2838
|
}), [defCustomSelect, drawingId]);
|
|
2839
2839
|
return sketchLines ? [chainMode, allMode, singleMode] : [singleMode];
|
|
2840
2840
|
}
|
|
2841
|
+
|
|
2841
2842
|
const RefsEditor = ({
|
|
2842
2843
|
children,
|
|
2843
2844
|
param,
|
|
@@ -2859,7 +2860,7 @@ const RefsEditor = ({
|
|
|
2859
2860
|
} = param;
|
|
2860
2861
|
const picker = React.useRef(customIdPicker);
|
|
2861
2862
|
const [selectorId, setSelectorId] = React.useState();
|
|
2862
|
-
const setRefsFromItems = React.useCallback(selItems => {
|
|
2863
|
+
const setRefsFromItems = React.useCallback((selId, selItems) => {
|
|
2863
2864
|
const newRefs = selItems.map(item => picker.current(item.data));
|
|
2864
2865
|
setUserValue(newRefs);
|
|
2865
2866
|
}, [setUserValue]);
|
|
@@ -2941,15 +2942,15 @@ const SelectionRestorer = ({
|
|
|
2941
2942
|
const selector = core.getDrawing(drawingId).selection.refs[selectorId];
|
|
2942
2943
|
const selApi = core.getDrawing(drawingId).api.selection;
|
|
2943
2944
|
if (!selApi.areItemsSelected(res, selectorId) || selItems.length !== selector.items.length) {
|
|
2944
|
-
setParamRefs(res);
|
|
2945
|
+
setParamRefs(selectorId, res);
|
|
2945
2946
|
selApi.setItems(selectorId, res);
|
|
2946
2947
|
}
|
|
2947
2948
|
}, [graphicSelItems, grItemsIds, selectorId, drawingId, setParamRefs, selItems]);
|
|
2948
2949
|
return null;
|
|
2949
2950
|
};
|
|
2950
2951
|
|
|
2951
|
-
function ownKeys$
|
|
2952
|
-
function _objectSpread$
|
|
2952
|
+
function ownKeys$l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2953
|
+
function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$l(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2953
2954
|
|
|
2954
2955
|
/**
|
|
2955
2956
|
* Implies the following data structure:
|
|
@@ -3043,7 +3044,7 @@ function useMateSelection(drawingId, matePath, csysId) {
|
|
|
3043
3044
|
}));
|
|
3044
3045
|
const handlers = React.useMemo(() => {
|
|
3045
3046
|
if (isSelectable) {
|
|
3046
|
-
return _objectSpread$
|
|
3047
|
+
return _objectSpread$l(_objectSpread$l({}, hHandlers), sHandlers);
|
|
3047
3048
|
}
|
|
3048
3049
|
return {};
|
|
3049
3050
|
}, [isSelectable, hHandlers, sHandlers]);
|
|
@@ -3213,10 +3214,10 @@ const MateRestorer = ({
|
|
|
3213
3214
|
setMateParam
|
|
3214
3215
|
}) => {
|
|
3215
3216
|
const selItems = React.useMemo(() => {
|
|
3216
|
-
|
|
3217
|
+
const tree = core.getDrawing(drawingId).structure.tree;
|
|
3218
|
+
if (!matePath || !csysId || !tree[csysId] || matePath.some(id => !tree[id])) {
|
|
3217
3219
|
return [];
|
|
3218
3220
|
}
|
|
3219
|
-
const tree = core.getDrawing(drawingId).structure.tree;
|
|
3220
3221
|
const mate = tree[csysId];
|
|
3221
3222
|
return [createMateItem(matePath, mate, flip, reoriented)];
|
|
3222
3223
|
}, [drawingId, matePath, csysId, flip, reoriented]);
|
|
@@ -3703,8 +3704,8 @@ var index$x = /*#__PURE__*/Object.freeze({
|
|
|
3703
3704
|
description: description$x
|
|
3704
3705
|
});
|
|
3705
3706
|
|
|
3706
|
-
function ownKeys$
|
|
3707
|
-
function _objectSpread$
|
|
3707
|
+
function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3708
|
+
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$k(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3708
3709
|
function parseVal(val) {
|
|
3709
3710
|
const float = Number(val);
|
|
3710
3711
|
if (!isNaN(float)) {
|
|
@@ -3927,11 +3928,11 @@ const PointEditor = ({
|
|
|
3927
3928
|
const curProdId = core.getDrawing(drawingId).structure.currentProduct;
|
|
3928
3929
|
const tree = core.getDrawing(drawingId).structure.tree;
|
|
3929
3930
|
const exprSetId = tree[curProdId].expressionSet;
|
|
3930
|
-
classcad.ccAPI.common.evaluateExpression(drawingId, exprSetId, userValue.value).then(res => setDisplayState(state => _objectSpread$
|
|
3931
|
+
classcad.ccAPI.common.evaluateExpression(drawingId, exprSetId, userValue.value).then(res => setDisplayState(state => _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
3931
3932
|
displayVals: res !== null ? res : state.displayVals
|
|
3932
3933
|
}))).catch();
|
|
3933
3934
|
} else {
|
|
3934
|
-
setDisplayState(state => _objectSpread$
|
|
3935
|
+
setDisplayState(state => _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
3935
3936
|
displayVals: userValue.value
|
|
3936
3937
|
}));
|
|
3937
3938
|
}
|
|
@@ -3945,7 +3946,7 @@ const PointEditor = ({
|
|
|
3945
3946
|
classcad.ccAPI.common.evaluateExpression(drawingId, exprSetId, userValue.value).then(res => setDisplayState(state => ({
|
|
3946
3947
|
editMode: false,
|
|
3947
3948
|
displayVals: res !== null ? res : state.displayVals
|
|
3948
|
-
}))).catch(() => setDisplayState(state => _objectSpread$
|
|
3949
|
+
}))).catch(() => setDisplayState(state => _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
3949
3950
|
editMode: false
|
|
3950
3951
|
})));
|
|
3951
3952
|
} else {
|
|
@@ -3963,7 +3964,7 @@ const PointEditor = ({
|
|
|
3963
3964
|
caption: caption,
|
|
3964
3965
|
highlighted: param.isChanged()
|
|
3965
3966
|
}, !editMode && /*#__PURE__*/React.createElement(DisplayBase, {
|
|
3966
|
-
onClick: () => setDisplayState(state => _objectSpread$
|
|
3967
|
+
onClick: () => setDisplayState(state => _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
3967
3968
|
editMode: true
|
|
3968
3969
|
}))
|
|
3969
3970
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -4209,10 +4210,10 @@ var Members$r;
|
|
|
4209
4210
|
Members["taperAngle"] = "taperAngle";
|
|
4210
4211
|
Members["capEnds"] = "capEnds";
|
|
4211
4212
|
})(Members$r || (Members$r = {}));
|
|
4212
|
-
var RegionMembers$
|
|
4213
|
+
var RegionMembers$2;
|
|
4213
4214
|
(function (RegionMembers) {
|
|
4214
4215
|
RegionMembers["Curves"] = "curves";
|
|
4215
|
-
})(RegionMembers$
|
|
4216
|
+
})(RegionMembers$2 || (RegionMembers$2 = {}));
|
|
4216
4217
|
const typesCaptions$4 = {
|
|
4217
4218
|
[classcad.ExtrusionType.CUSTOM]: 'Custom',
|
|
4218
4219
|
[classcad.ExtrusionType.DOWN]: 'Down',
|
|
@@ -4230,7 +4231,7 @@ const RootImpl$w = ({
|
|
|
4230
4231
|
var _drawing$structure$tr, _drawing$structure$tr2;
|
|
4231
4232
|
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;
|
|
4232
4233
|
});
|
|
4233
|
-
const region = useRefsParam(drawingId, sketchRegionId, RegionMembers$
|
|
4234
|
+
const region = useRefsParam(drawingId, sketchRegionId, RegionMembers$2.Curves);
|
|
4234
4235
|
const type = useTypeParam(drawingId, objectId, Members$r.Type);
|
|
4235
4236
|
const limit1 = useNumParam(drawingId, objectId, Members$r.Limit1);
|
|
4236
4237
|
const limit2 = useNumParam(drawingId, objectId, Members$r.Limit2);
|
|
@@ -4353,10 +4354,10 @@ var Members$q;
|
|
|
4353
4354
|
Members["StartAngle"] = "startAngle";
|
|
4354
4355
|
Members["EndAngle"] = "endAngle";
|
|
4355
4356
|
})(Members$q || (Members$q = {}));
|
|
4356
|
-
var RegionMembers;
|
|
4357
|
+
var RegionMembers$1;
|
|
4357
4358
|
(function (RegionMembers) {
|
|
4358
4359
|
RegionMembers["Curves"] = "curves";
|
|
4359
|
-
})(RegionMembers || (RegionMembers = {}));
|
|
4360
|
+
})(RegionMembers$1 || (RegionMembers$1 = {}));
|
|
4360
4361
|
const RootImpl$v = ({
|
|
4361
4362
|
drawingId,
|
|
4362
4363
|
pluginId
|
|
@@ -4368,7 +4369,7 @@ const RootImpl$v = ({
|
|
|
4368
4369
|
var _drawing$structure$tr, _drawing$structure$tr2;
|
|
4369
4370
|
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;
|
|
4370
4371
|
});
|
|
4371
|
-
const region = useRefsParam(drawingId, sketchRegionId, RegionMembers.Curves);
|
|
4372
|
+
const region = useRefsParam(drawingId, sketchRegionId, RegionMembers$1.Curves);
|
|
4372
4373
|
const axis = useRefsParam(drawingId, objectId, Members$q.Axis);
|
|
4373
4374
|
const startAngle = useNumParam(drawingId, objectId, Members$q.StartAngle, {
|
|
4374
4375
|
angle: true
|
|
@@ -5712,8 +5713,8 @@ const Digits = ({
|
|
|
5712
5713
|
|
|
5713
5714
|
const vectorToString = (point, digits) => `${point.toArray().map(n => core.MathUtils.round(n, digits)).join(', ')}`;
|
|
5714
5715
|
|
|
5715
|
-
function ownKeys$
|
|
5716
|
-
function _objectSpread$
|
|
5716
|
+
function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5717
|
+
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$j(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5717
5718
|
const Excluded = [core.GraphicType.LOOP].concat(core.EntityTypes);
|
|
5718
5719
|
const RootImpl$g = ({
|
|
5719
5720
|
drawingId,
|
|
@@ -5784,7 +5785,7 @@ const Output = ({
|
|
|
5784
5785
|
const {
|
|
5785
5786
|
value
|
|
5786
5787
|
} = res.measureData;
|
|
5787
|
-
return _objectSpread$
|
|
5788
|
+
return _objectSpread$j(_objectSpread$j({}, res), {}, {
|
|
5788
5789
|
asString: core.MathUtils.round(value, digits)
|
|
5789
5790
|
});
|
|
5790
5791
|
}
|
|
@@ -5794,13 +5795,13 @@ const Output = ({
|
|
|
5794
5795
|
const {
|
|
5795
5796
|
value
|
|
5796
5797
|
} = res.measureData;
|
|
5797
|
-
return _objectSpread$
|
|
5798
|
+
return _objectSpread$j(_objectSpread$j({}, res), {}, {
|
|
5798
5799
|
asString: vectorToString(value, digits)
|
|
5799
5800
|
});
|
|
5800
5801
|
}
|
|
5801
5802
|
}
|
|
5802
5803
|
}
|
|
5803
|
-
return _objectSpread$
|
|
5804
|
+
return _objectSpread$j(_objectSpread$j({}, res), {}, {
|
|
5804
5805
|
asString: ''
|
|
5805
5806
|
});
|
|
5806
5807
|
});
|
|
@@ -6571,8 +6572,8 @@ function getSketchState(drawingId, pluginId) {
|
|
|
6571
6572
|
return plugin.state;
|
|
6572
6573
|
}
|
|
6573
6574
|
|
|
6574
|
-
function ownKeys$
|
|
6575
|
-
function _objectSpread$
|
|
6575
|
+
function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6576
|
+
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$i(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6576
6577
|
function CreateAngle(drawingId, pluginId) {
|
|
6577
6578
|
const {
|
|
6578
6579
|
set
|
|
@@ -6615,8 +6616,8 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
6615
6616
|
set(state_ => {
|
|
6616
6617
|
const tmpAngularDimension = state_.tmpObjects[tmpDimensionId];
|
|
6617
6618
|
return {
|
|
6618
|
-
tmpObjects: _objectSpread$
|
|
6619
|
-
[tmpDimensionId]: _objectSpread$
|
|
6619
|
+
tmpObjects: _objectSpread$i(_objectSpread$i({}, state_.tmpObjects), {}, {
|
|
6620
|
+
[tmpDimensionId]: _objectSpread$i(_objectSpread$i({}, tmpAngularDimension), params)
|
|
6620
6621
|
})
|
|
6621
6622
|
};
|
|
6622
6623
|
});
|
|
@@ -6642,7 +6643,7 @@ function CreateAngle(drawingId, pluginId) {
|
|
|
6642
6643
|
const dir1 = linesInfo.dir1;
|
|
6643
6644
|
const center = linesInfo.center;
|
|
6644
6645
|
const dimPos = center.clone().addScaledVector(dir0.clone().add(dir1).normalize(), 10);
|
|
6645
|
-
const tmpAngularDimension = _objectSpread$
|
|
6646
|
+
const tmpAngularDimension = _objectSpread$i(_objectSpread$i({
|
|
6646
6647
|
class: TmpObjClasses.AngularDimension,
|
|
6647
6648
|
id: tmpDimensionId
|
|
6648
6649
|
}, linesInfo), {}, {
|
|
@@ -6747,8 +6748,8 @@ function getGeometryPriority(object) {
|
|
|
6747
6748
|
return -1;
|
|
6748
6749
|
}
|
|
6749
6750
|
|
|
6750
|
-
function ownKeys$
|
|
6751
|
-
function _objectSpread$
|
|
6751
|
+
function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6752
|
+
function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$h(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6752
6753
|
let timerId;
|
|
6753
6754
|
const setHoverState = (drawingId, pluginId, cycle, objects) => {
|
|
6754
6755
|
const {
|
|
@@ -6786,7 +6787,7 @@ const setHoverState = (drawingId, pluginId, cycle, objects) => {
|
|
|
6786
6787
|
return {
|
|
6787
6788
|
hovered: hoveredId,
|
|
6788
6789
|
highlighted: [hoveredId, ...linkedConstraints],
|
|
6789
|
-
constraintsToGeometry: _objectSpread$
|
|
6790
|
+
constraintsToGeometry: _objectSpread$h(_objectSpread$h({}, state_.constraintsToGeometry), constraintsToGeometry),
|
|
6790
6791
|
interaction: {
|
|
6791
6792
|
cycle,
|
|
6792
6793
|
objects
|
|
@@ -7242,8 +7243,8 @@ const MergedWrapper = ({
|
|
|
7242
7243
|
);
|
|
7243
7244
|
};
|
|
7244
7245
|
|
|
7245
|
-
function ownKeys$
|
|
7246
|
-
function _objectSpread$
|
|
7246
|
+
function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7247
|
+
function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$g(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7247
7248
|
|
|
7248
7249
|
// Artificial delay in 16 ms.
|
|
7249
7250
|
const artifDelay = 16;
|
|
@@ -7507,7 +7508,7 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7507
7508
|
name: HandlersList.DRAG,
|
|
7508
7509
|
filter,
|
|
7509
7510
|
onDeactivate,
|
|
7510
|
-
pointerHandlers: _objectSpread$
|
|
7511
|
+
pointerHandlers: _objectSpread$g({
|
|
7511
7512
|
onPointerDown,
|
|
7512
7513
|
onPointerUp,
|
|
7513
7514
|
onPointerMove
|
|
@@ -7519,8 +7520,8 @@ function Drag(drawingId, pluginId, camControls) {
|
|
|
7519
7520
|
};
|
|
7520
7521
|
}
|
|
7521
7522
|
|
|
7522
|
-
function ownKeys$
|
|
7523
|
-
function _objectSpread$
|
|
7523
|
+
function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7524
|
+
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$f(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7524
7525
|
function DrawPoint(drawingId, pluginId) {
|
|
7525
7526
|
const {
|
|
7526
7527
|
set
|
|
@@ -7585,8 +7586,8 @@ function DrawPoint(drawingId, pluginId) {
|
|
|
7585
7586
|
const tmpPoint = state.tmpObjects[tmpPointId];
|
|
7586
7587
|
return {
|
|
7587
7588
|
mousePos,
|
|
7588
|
-
tmpObjects: _objectSpread$
|
|
7589
|
-
[tmpPointId]: _objectSpread$
|
|
7589
|
+
tmpObjects: _objectSpread$f(_objectSpread$f({}, state.tmpObjects), {}, {
|
|
7590
|
+
[tmpPointId]: _objectSpread$f(_objectSpread$f({}, tmpPoint), {}, {
|
|
7590
7591
|
position: mousePos
|
|
7591
7592
|
})
|
|
7592
7593
|
})
|
|
@@ -7607,8 +7608,8 @@ function DrawPoint(drawingId, pluginId) {
|
|
|
7607
7608
|
};
|
|
7608
7609
|
}
|
|
7609
7610
|
|
|
7610
|
-
function ownKeys$
|
|
7611
|
-
function _objectSpread$
|
|
7611
|
+
function ownKeys$e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7612
|
+
function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$e(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7612
7613
|
function DrawLine(drawingId, pluginId) {
|
|
7613
7614
|
// Global hooks:
|
|
7614
7615
|
const {
|
|
@@ -7691,7 +7692,7 @@ function DrawLine(drawingId, pluginId) {
|
|
|
7691
7692
|
endPId: tmpEndP.id
|
|
7692
7693
|
};
|
|
7693
7694
|
return {
|
|
7694
|
-
tmpObjects: _objectSpread$
|
|
7695
|
+
tmpObjects: _objectSpread$e(_objectSpread$e({}, state.tmpObjects), {}, {
|
|
7695
7696
|
[tmpStartP.id]: tmpStartP,
|
|
7696
7697
|
[tmpLine.id]: tmpLine
|
|
7697
7698
|
})
|
|
@@ -7734,8 +7735,8 @@ function DrawLine(drawingId, pluginId) {
|
|
|
7734
7735
|
const tmpStartP = state.tmpObjects[tmpStartPId];
|
|
7735
7736
|
const tmpEndP = state.tmpObjects[tmpEndPId];
|
|
7736
7737
|
return {
|
|
7737
|
-
tmpObjects: _objectSpread$
|
|
7738
|
-
[tmpStartPId]: _objectSpread$
|
|
7738
|
+
tmpObjects: _objectSpread$e(_objectSpread$e({}, state.tmpObjects), {}, {
|
|
7739
|
+
[tmpStartPId]: _objectSpread$e(_objectSpread$e({}, tmpStartP), {}, {
|
|
7739
7740
|
position: tmpEndP.position.clone()
|
|
7740
7741
|
})
|
|
7741
7742
|
})
|
|
@@ -7753,8 +7754,8 @@ function DrawLine(drawingId, pluginId) {
|
|
|
7753
7754
|
const tmpEndP = state.tmpObjects[tmpEndPId];
|
|
7754
7755
|
return {
|
|
7755
7756
|
mousePos,
|
|
7756
|
-
tmpObjects: _objectSpread$
|
|
7757
|
-
[tmpEndPId]: _objectSpread$
|
|
7757
|
+
tmpObjects: _objectSpread$e(_objectSpread$e({}, state.tmpObjects), {}, {
|
|
7758
|
+
[tmpEndPId]: _objectSpread$e(_objectSpread$e({}, tmpEndP), {}, {
|
|
7758
7759
|
position: mousePos
|
|
7759
7760
|
})
|
|
7760
7761
|
})
|
|
@@ -7778,8 +7779,8 @@ function DrawLine(drawingId, pluginId) {
|
|
|
7778
7779
|
};
|
|
7779
7780
|
}
|
|
7780
7781
|
|
|
7781
|
-
function ownKeys$
|
|
7782
|
-
function _objectSpread$
|
|
7782
|
+
function ownKeys$d(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7783
|
+
function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$d(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7783
7784
|
function DrawRectangle(drawingId, pluginId) {
|
|
7784
7785
|
const {
|
|
7785
7786
|
set
|
|
@@ -7860,7 +7861,7 @@ function DrawRectangle(drawingId, pluginId) {
|
|
|
7860
7861
|
isSquare: false,
|
|
7861
7862
|
isCentered: false
|
|
7862
7863
|
};
|
|
7863
|
-
const newTmpObjects = _objectSpread$
|
|
7864
|
+
const newTmpObjects = _objectSpread$d(_objectSpread$d({}, state.tmpObjects), {}, {
|
|
7864
7865
|
[tmpRect.id]: tmpRect
|
|
7865
7866
|
});
|
|
7866
7867
|
delete newTmpObjects[tmpPointId];
|
|
@@ -7920,19 +7921,19 @@ function DrawRectangle(drawingId, pluginId) {
|
|
|
7920
7921
|
let newTmpObjs = null;
|
|
7921
7922
|
if (additionIndex === 0) {
|
|
7922
7923
|
const tmpPoint = state.tmpObjects[tmpPointId];
|
|
7923
|
-
newTmpObjs = _objectSpread$
|
|
7924
|
-
[tmpPointId]: _objectSpread$
|
|
7924
|
+
newTmpObjs = _objectSpread$d(_objectSpread$d({}, state.tmpObjects), {}, {
|
|
7925
|
+
[tmpPointId]: _objectSpread$d(_objectSpread$d({}, tmpPoint), {}, {
|
|
7925
7926
|
position: snappedPos
|
|
7926
7927
|
})
|
|
7927
7928
|
});
|
|
7928
7929
|
} else {
|
|
7929
|
-
newTmpObjs = _objectSpread$
|
|
7930
|
-
[tmpRectId]: _objectSpread$
|
|
7930
|
+
newTmpObjs = _objectSpread$d(_objectSpread$d({}, state.tmpObjects), {}, {
|
|
7931
|
+
[tmpRectId]: _objectSpread$d(_objectSpread$d({}, state.tmpObjects[tmpRectId]), {}, {
|
|
7931
7932
|
end: new THREE__namespace.Vector3(snappedPos.x, snappedPos.y, 0)
|
|
7932
7933
|
})
|
|
7933
7934
|
});
|
|
7934
7935
|
}
|
|
7935
|
-
return _objectSpread$
|
|
7936
|
+
return _objectSpread$d(_objectSpread$d({}, state), {}, {
|
|
7936
7937
|
tmpObjects: newTmpObjs,
|
|
7937
7938
|
mousePos: snappedPos
|
|
7938
7939
|
});
|
|
@@ -7941,18 +7942,18 @@ function DrawRectangle(drawingId, pluginId) {
|
|
|
7941
7942
|
};
|
|
7942
7943
|
const keydown = e => {
|
|
7943
7944
|
if (e.code === 'ShiftLeft' || e.code === 'ShiftRight') {
|
|
7944
|
-
set(state => _objectSpread$
|
|
7945
|
-
tmpObjects: _objectSpread$
|
|
7946
|
-
[tmpRectId]: _objectSpread$
|
|
7945
|
+
set(state => _objectSpread$d(_objectSpread$d({}, state), {}, {
|
|
7946
|
+
tmpObjects: _objectSpread$d(_objectSpread$d({}, state.tmpObjects), {}, {
|
|
7947
|
+
[tmpRectId]: _objectSpread$d(_objectSpread$d({}, state.tmpObjects[tmpRectId]), {}, {
|
|
7947
7948
|
isSquare: true
|
|
7948
7949
|
})
|
|
7949
7950
|
})
|
|
7950
7951
|
}));
|
|
7951
7952
|
} else if (e.code === 'AltLeft' || e.code === 'AltRight') {
|
|
7952
7953
|
e.preventDefault();
|
|
7953
|
-
set(state => _objectSpread$
|
|
7954
|
-
tmpObjects: _objectSpread$
|
|
7955
|
-
[tmpRectId]: _objectSpread$
|
|
7954
|
+
set(state => _objectSpread$d(_objectSpread$d({}, state), {}, {
|
|
7955
|
+
tmpObjects: _objectSpread$d(_objectSpread$d({}, state.tmpObjects), {}, {
|
|
7956
|
+
[tmpRectId]: _objectSpread$d(_objectSpread$d({}, state.tmpObjects[tmpRectId]), {}, {
|
|
7956
7957
|
isCentered: true
|
|
7957
7958
|
})
|
|
7958
7959
|
})
|
|
@@ -7961,18 +7962,18 @@ function DrawRectangle(drawingId, pluginId) {
|
|
|
7961
7962
|
};
|
|
7962
7963
|
const keyup = e => {
|
|
7963
7964
|
if (e.code === 'ShiftLeft' || e.code === 'ShiftRight') {
|
|
7964
|
-
set(state => _objectSpread$
|
|
7965
|
-
tmpObjects: _objectSpread$
|
|
7966
|
-
[tmpRectId]: _objectSpread$
|
|
7965
|
+
set(state => _objectSpread$d(_objectSpread$d({}, state), {}, {
|
|
7966
|
+
tmpObjects: _objectSpread$d(_objectSpread$d({}, state.tmpObjects), {}, {
|
|
7967
|
+
[tmpRectId]: _objectSpread$d(_objectSpread$d({}, state.tmpObjects[tmpRectId]), {}, {
|
|
7967
7968
|
isSquare: false
|
|
7968
7969
|
})
|
|
7969
7970
|
})
|
|
7970
7971
|
}));
|
|
7971
7972
|
} else if (e.code === 'AltLeft' || e.code === 'AltRight') {
|
|
7972
7973
|
e.preventDefault();
|
|
7973
|
-
set(state => _objectSpread$
|
|
7974
|
-
tmpObjects: _objectSpread$
|
|
7975
|
-
[tmpRectId]: _objectSpread$
|
|
7974
|
+
set(state => _objectSpread$d(_objectSpread$d({}, state), {}, {
|
|
7975
|
+
tmpObjects: _objectSpread$d(_objectSpread$d({}, state.tmpObjects), {}, {
|
|
7976
|
+
[tmpRectId]: _objectSpread$d(_objectSpread$d({}, state.tmpObjects[tmpRectId]), {}, {
|
|
7976
7977
|
isCentered: false
|
|
7977
7978
|
})
|
|
7978
7979
|
})
|
|
@@ -8155,8 +8156,8 @@ const Circle$1 = ({
|
|
|
8155
8156
|
}), /*#__PURE__*/React.createElement("meshBasicMaterial", materialProps));
|
|
8156
8157
|
};
|
|
8157
8158
|
|
|
8158
|
-
function ownKeys$
|
|
8159
|
-
function _objectSpread$
|
|
8159
|
+
function ownKeys$c(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8160
|
+
function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$c(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8160
8161
|
function DrawArc(drawingId, pluginId, arcType) {
|
|
8161
8162
|
// Global hooks:
|
|
8162
8163
|
const {
|
|
@@ -8210,7 +8211,7 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
8210
8211
|
additionIndex = 0;
|
|
8211
8212
|
lastAddedEndPointId = NOCCID;
|
|
8212
8213
|
set(state => {
|
|
8213
|
-
const tmpStartP = _objectSpread$
|
|
8214
|
+
const tmpStartP = _objectSpread$c(_objectSpread$c({}, state.tmpObjects[tmpStartPId]), {}, {
|
|
8214
8215
|
position: lastMousePos.clone()
|
|
8215
8216
|
});
|
|
8216
8217
|
return {
|
|
@@ -8223,20 +8224,20 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
8223
8224
|
additionIndex = 1;
|
|
8224
8225
|
set(state => {
|
|
8225
8226
|
const tmpStartP = state.tmpObjects[tmpStartPId];
|
|
8226
|
-
const tmpEndP = _objectSpread$
|
|
8227
|
+
const tmpEndP = _objectSpread$c(_objectSpread$c({}, state.tmpObjects[tmpEndPId]), {}, {
|
|
8227
8228
|
position: lastMousePos.clone()
|
|
8228
8229
|
});
|
|
8229
8230
|
const centerPos = calculateCenterPoint(tmpStartP.position, lastMousePos, lastMousePos);
|
|
8230
|
-
const tmpCenterP = _objectSpread$
|
|
8231
|
+
const tmpCenterP = _objectSpread$c(_objectSpread$c({}, state.tmpObjects[tmpCenterPId]), {}, {
|
|
8231
8232
|
position: centerPos ? centerPos : lastMousePos.clone()
|
|
8232
8233
|
});
|
|
8233
|
-
const tmpArc = _objectSpread$
|
|
8234
|
+
const tmpArc = _objectSpread$c(_objectSpread$c({}, state.tmpObjects[tmpArcId]), {}, {
|
|
8234
8235
|
// In case centerPos couldn't be calculated, the arc should be drawn as a line
|
|
8235
8236
|
drawAsLine: centerPos === undefined,
|
|
8236
8237
|
clockwise: false
|
|
8237
8238
|
});
|
|
8238
8239
|
return {
|
|
8239
|
-
tmpObjects: _objectSpread$
|
|
8240
|
+
tmpObjects: _objectSpread$c(_objectSpread$c({}, state.tmpObjects), {}, {
|
|
8240
8241
|
[tmpEndP.id]: tmpEndP,
|
|
8241
8242
|
[tmpCenterP.id]: tmpCenterP,
|
|
8242
8243
|
[tmpArc.id]: tmpArc
|
|
@@ -8349,7 +8350,7 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
8349
8350
|
clockwise: false
|
|
8350
8351
|
};
|
|
8351
8352
|
return {
|
|
8352
|
-
tmpObjects: _objectSpread$
|
|
8353
|
+
tmpObjects: _objectSpread$c(_objectSpread$c({}, state.tmpObjects), {}, {
|
|
8353
8354
|
[tmpEndP.id]: tmpEndP,
|
|
8354
8355
|
[tmpCenterP.id]: tmpCenterP,
|
|
8355
8356
|
[tmpArc.id]: tmpArc
|
|
@@ -8378,7 +8379,7 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
8378
8379
|
clockwise: false
|
|
8379
8380
|
};
|
|
8380
8381
|
return {
|
|
8381
|
-
tmpObjects: _objectSpread$
|
|
8382
|
+
tmpObjects: _objectSpread$c(_objectSpread$c({}, state.tmpObjects), {}, {
|
|
8382
8383
|
[tmpCenterP.id]: tmpCenterP,
|
|
8383
8384
|
[tmpArc.id]: tmpArc
|
|
8384
8385
|
})
|
|
@@ -8440,11 +8441,11 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
8440
8441
|
const tmpEndP = state.tmpObjects[tmpEndPId];
|
|
8441
8442
|
const tmpCenterP = state.tmpObjects[tmpCenterPId];
|
|
8442
8443
|
return {
|
|
8443
|
-
tmpObjects: _objectSpread$
|
|
8444
|
-
[tmpStartPId]: _objectSpread$
|
|
8444
|
+
tmpObjects: _objectSpread$c(_objectSpread$c({}, state.tmpObjects), {}, {
|
|
8445
|
+
[tmpStartPId]: _objectSpread$c(_objectSpread$c({}, tmpStartP), {}, {
|
|
8445
8446
|
position: tmpEndP.position.clone()
|
|
8446
8447
|
}),
|
|
8447
|
-
[tmpCenterPId]: _objectSpread$
|
|
8448
|
+
[tmpCenterPId]: _objectSpread$c(_objectSpread$c({}, tmpCenterP), {}, {
|
|
8448
8449
|
position: tmpEndP.position.clone()
|
|
8449
8450
|
})
|
|
8450
8451
|
})
|
|
@@ -8464,8 +8465,8 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
8464
8465
|
const tmpStartP = state.tmpObjects[tmpStartPId];
|
|
8465
8466
|
return {
|
|
8466
8467
|
mousePos: lastMousePos,
|
|
8467
|
-
tmpObjects: _objectSpread$
|
|
8468
|
-
[tmpStartPId]: _objectSpread$
|
|
8468
|
+
tmpObjects: _objectSpread$c(_objectSpread$c({}, state.tmpObjects), {}, {
|
|
8469
|
+
[tmpStartPId]: _objectSpread$c(_objectSpread$c({}, tmpStartP), {}, {
|
|
8469
8470
|
position: lastMousePos.clone()
|
|
8470
8471
|
})
|
|
8471
8472
|
})
|
|
@@ -8478,14 +8479,14 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
8478
8479
|
const centerPos = calculateCenterPoint(tmpStartP.position, lastMousePos, lastMousePos);
|
|
8479
8480
|
return {
|
|
8480
8481
|
mousePos: lastMousePos,
|
|
8481
|
-
tmpObjects: _objectSpread$
|
|
8482
|
-
[tmpEndPId]: _objectSpread$
|
|
8482
|
+
tmpObjects: _objectSpread$c(_objectSpread$c({}, state.tmpObjects), {}, {
|
|
8483
|
+
[tmpEndPId]: _objectSpread$c(_objectSpread$c({}, tmpEndP), {}, {
|
|
8483
8484
|
position: lastMousePos.clone()
|
|
8484
8485
|
}),
|
|
8485
|
-
[tmpCenterPId]: _objectSpread$
|
|
8486
|
+
[tmpCenterPId]: _objectSpread$c(_objectSpread$c({}, tmpCenterP), {}, {
|
|
8486
8487
|
position: centerPos ? centerPos : lastMousePos.clone()
|
|
8487
8488
|
}),
|
|
8488
|
-
[tmpArcId]: _objectSpread$
|
|
8489
|
+
[tmpArcId]: _objectSpread$c(_objectSpread$c({}, tmpArc), {}, {
|
|
8489
8490
|
// In case centerPos couldn't be calculated, the arc should be drawn as a line
|
|
8490
8491
|
drawAsLine: centerPos === undefined,
|
|
8491
8492
|
clockwise: false
|
|
@@ -8500,14 +8501,14 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
8500
8501
|
const centerPos = calculateCenterPoint(tmpStartP.position, tmpEndP.position, lastMousePos);
|
|
8501
8502
|
return {
|
|
8502
8503
|
mousePos: lastMousePos,
|
|
8503
|
-
tmpObjects: _objectSpread$
|
|
8504
|
-
[tmpEndPId]: _objectSpread$
|
|
8504
|
+
tmpObjects: _objectSpread$c(_objectSpread$c({}, state.tmpObjects), {}, {
|
|
8505
|
+
[tmpEndPId]: _objectSpread$c(_objectSpread$c({}, tmpEndP), {}, {
|
|
8505
8506
|
position: arcType === HandlersList.DRAWARCTANGENT ? lastMousePos.clone() : tmpEndP.position
|
|
8506
8507
|
}),
|
|
8507
|
-
[tmpCenterPId]: _objectSpread$
|
|
8508
|
+
[tmpCenterPId]: _objectSpread$c(_objectSpread$c({}, tmpCenterP), {}, {
|
|
8508
8509
|
position: centerPos ? centerPos : lastMousePos.clone()
|
|
8509
8510
|
}),
|
|
8510
|
-
[tmpArcId]: _objectSpread$
|
|
8511
|
+
[tmpArcId]: _objectSpread$c(_objectSpread$c({}, tmpArc), {}, {
|
|
8511
8512
|
// In case centerPos couldn't be calculated, the arc should be drawn as a line
|
|
8512
8513
|
drawAsLine: centerPos === undefined,
|
|
8513
8514
|
clockwise: evaluateClockwise(tmpStartP.position, tmpEndP.position, lastMousePos)
|
|
@@ -8534,8 +8535,8 @@ function DrawArc(drawingId, pluginId, arcType) {
|
|
|
8534
8535
|
};
|
|
8535
8536
|
}
|
|
8536
8537
|
|
|
8537
|
-
function ownKeys$
|
|
8538
|
-
function _objectSpread$
|
|
8538
|
+
function ownKeys$b(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8539
|
+
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$b(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$b(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8539
8540
|
function DrawCircle(drawingId, pluginId) {
|
|
8540
8541
|
const {
|
|
8541
8542
|
set
|
|
@@ -8580,7 +8581,7 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
8580
8581
|
} else {
|
|
8581
8582
|
additionIndex = 0;
|
|
8582
8583
|
set(state => {
|
|
8583
|
-
const tmpCenterP = _objectSpread$
|
|
8584
|
+
const tmpCenterP = _objectSpread$b(_objectSpread$b({}, state.tmpObjects[tmpCenterPId]), {}, {
|
|
8584
8585
|
position: lastMousePos.clone()
|
|
8585
8586
|
});
|
|
8586
8587
|
return {
|
|
@@ -8611,7 +8612,7 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
8611
8612
|
radius: 0.001
|
|
8612
8613
|
};
|
|
8613
8614
|
return {
|
|
8614
|
-
tmpObjects: _objectSpread$
|
|
8615
|
+
tmpObjects: _objectSpread$b(_objectSpread$b({}, state.tmpObjects), {}, {
|
|
8615
8616
|
[tmpCenterP.id]: tmpCenterP,
|
|
8616
8617
|
[tmpCircle.id]: tmpCircle
|
|
8617
8618
|
})
|
|
@@ -8635,7 +8636,7 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
8635
8636
|
const tmpCenterP = state.tmpObjects[tmpCenterPId];
|
|
8636
8637
|
return {
|
|
8637
8638
|
tmpObjects: {
|
|
8638
|
-
[tmpCenterPId]: _objectSpread$
|
|
8639
|
+
[tmpCenterPId]: _objectSpread$b(_objectSpread$b({}, tmpCenterP), {}, {
|
|
8639
8640
|
position: e.point.clone().applyMatrix4(getGlobalToLocalMatrix(drawingId, sketchId))
|
|
8640
8641
|
})
|
|
8641
8642
|
}
|
|
@@ -8655,8 +8656,8 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
8655
8656
|
const tmpCenterP = state.tmpObjects[tmpCenterPId];
|
|
8656
8657
|
return {
|
|
8657
8658
|
mousePos: lastMousePos,
|
|
8658
|
-
tmpObjects: _objectSpread$
|
|
8659
|
-
[tmpCenterPId]: _objectSpread$
|
|
8659
|
+
tmpObjects: _objectSpread$b(_objectSpread$b({}, state.tmpObjects), {}, {
|
|
8660
|
+
[tmpCenterPId]: _objectSpread$b(_objectSpread$b({}, tmpCenterP), {}, {
|
|
8660
8661
|
position: snappedPos || localPos
|
|
8661
8662
|
})
|
|
8662
8663
|
})
|
|
@@ -8666,8 +8667,8 @@ function DrawCircle(drawingId, pluginId) {
|
|
|
8666
8667
|
const tmpCircle = state.tmpObjects[tmpCircleId];
|
|
8667
8668
|
return {
|
|
8668
8669
|
mousePos: lastMousePos,
|
|
8669
|
-
tmpObjects: _objectSpread$
|
|
8670
|
-
[tmpCircleId]: _objectSpread$
|
|
8670
|
+
tmpObjects: _objectSpread$b(_objectSpread$b({}, state.tmpObjects), {}, {
|
|
8671
|
+
[tmpCircleId]: _objectSpread$b(_objectSpread$b({}, tmpCircle), {}, {
|
|
8671
8672
|
radius: Math.max(tmpCenterP.position.distanceTo(localPos), 0.001)
|
|
8672
8673
|
})
|
|
8673
8674
|
})
|
|
@@ -9336,40 +9337,42 @@ const TabIcon = ({
|
|
|
9336
9337
|
})));
|
|
9337
9338
|
};
|
|
9338
9339
|
const CopyPatternsImpl = () => {
|
|
9339
|
-
const {
|
|
9340
|
-
TabPane
|
|
9341
|
-
} = react.useBuerli(buerli => buerli.options.elements);
|
|
9342
9340
|
const ref = React.useRef(null);
|
|
9343
9341
|
const size = useLayoutSize(ref);
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
9347
|
-
sidepadding: size.sidePadding,
|
|
9348
|
-
iconmargin: 2 * size.iconMargin,
|
|
9349
|
-
tabBarGutter: 0,
|
|
9350
|
-
type: "card",
|
|
9351
|
-
style: {
|
|
9352
|
-
paddingRight: '4px'
|
|
9353
|
-
}
|
|
9354
|
-
}, /*#__PURE__*/React.createElement(TabPane, {
|
|
9355
|
-
tab: /*#__PURE__*/React.createElement(TabIcon, {
|
|
9342
|
+
const tabItems = [{
|
|
9343
|
+
label: /*#__PURE__*/React.createElement(TabIcon, {
|
|
9356
9344
|
url: resources[Patterns.RECTANGULAR],
|
|
9357
9345
|
tooltip: "Rectangular copy pattern."
|
|
9358
9346
|
}),
|
|
9359
|
-
key:
|
|
9360
|
-
|
|
9361
|
-
|
|
9347
|
+
key: 'Rectangle',
|
|
9348
|
+
children: /*#__PURE__*/React.createElement(RectPattern, null)
|
|
9349
|
+
}, {
|
|
9350
|
+
label: /*#__PURE__*/React.createElement(TabIcon, {
|
|
9362
9351
|
url: resources[Patterns.CIRCULAR],
|
|
9363
9352
|
tooltip: "Circular copy pattern."
|
|
9364
9353
|
}),
|
|
9365
|
-
key:
|
|
9366
|
-
|
|
9367
|
-
|
|
9354
|
+
key: 'Circular',
|
|
9355
|
+
children: /*#__PURE__*/React.createElement(CircPattern, null)
|
|
9356
|
+
}, {
|
|
9357
|
+
label: /*#__PURE__*/React.createElement(TabIcon, {
|
|
9368
9358
|
url: resources[Patterns.MIRROR],
|
|
9369
9359
|
tooltip: "Mirror copy pattern."
|
|
9370
9360
|
}),
|
|
9371
|
-
key:
|
|
9372
|
-
|
|
9361
|
+
key: 'Mirror',
|
|
9362
|
+
children: /*#__PURE__*/React.createElement(MirrorPattern, null)
|
|
9363
|
+
}];
|
|
9364
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
9365
|
+
ref: ref
|
|
9366
|
+
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
9367
|
+
sidepadding: size.sidePadding,
|
|
9368
|
+
iconmargin: 2 * size.iconMargin,
|
|
9369
|
+
tabBarGutter: 0,
|
|
9370
|
+
type: "card",
|
|
9371
|
+
style: {
|
|
9372
|
+
paddingRight: '4px'
|
|
9373
|
+
},
|
|
9374
|
+
items: tabItems
|
|
9375
|
+
}));
|
|
9373
9376
|
};
|
|
9374
9377
|
const CopyPatterns = () => {
|
|
9375
9378
|
return /*#__PURE__*/React.createElement(SketchGroup, {
|
|
@@ -10157,8 +10160,8 @@ function recognizeFilletByArc(object, tree, sketchId) {
|
|
|
10157
10160
|
};
|
|
10158
10161
|
}
|
|
10159
10162
|
|
|
10160
|
-
function ownKeys$
|
|
10161
|
-
function _objectSpread$
|
|
10163
|
+
function ownKeys$a(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10164
|
+
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$a(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10162
10165
|
function Fillet(drawingId, pluginId, camControls) {
|
|
10163
10166
|
const plugin = core.getPlugin(drawingId, pluginId);
|
|
10164
10167
|
const set = plugin.set;
|
|
@@ -10297,7 +10300,7 @@ function Fillet(drawingId, pluginId, camControls) {
|
|
|
10297
10300
|
if (!data) {
|
|
10298
10301
|
return;
|
|
10299
10302
|
}
|
|
10300
|
-
classcad.ccAPI.sketcher.createFillet(drawingId, sketchId, data.info.lines.map(line => line.id), data.info.lineStarts.map(lineStart => lineStart.id), data.info.incidence, data.info.control, data.params.start, getArcAngles(_objectSpread$
|
|
10303
|
+
classcad.ccAPI.sketcher.createFillet(drawingId, sketchId, data.info.lines.map(line => line.id), data.info.lineStarts.map(lineStart => lineStart.id), data.info.incidence, data.info.control, data.params.start, getArcAngles(_objectSpread$a(_objectSpread$a({}, data.params), {}, {
|
|
10301
10304
|
radius: 1
|
|
10302
10305
|
})).mid, data.params.end).catch(console.warn);
|
|
10303
10306
|
set({
|
|
@@ -11297,8 +11300,8 @@ const Circle = ({
|
|
|
11297
11300
|
}));
|
|
11298
11301
|
};
|
|
11299
11302
|
|
|
11300
|
-
function ownKeys$
|
|
11301
|
-
function _objectSpread$
|
|
11303
|
+
function ownKeys$9(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11304
|
+
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$9(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$9(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11302
11305
|
|
|
11303
11306
|
/*
|
|
11304
11307
|
* !polygonOffset!
|
|
@@ -11345,7 +11348,7 @@ const CCLine = props => {
|
|
|
11345
11348
|
start: start,
|
|
11346
11349
|
end: end,
|
|
11347
11350
|
scalePlus: isHovered || isSelected,
|
|
11348
|
-
meshProps: _objectSpread$
|
|
11351
|
+
meshProps: _objectSpread$9(_objectSpread$9({
|
|
11349
11352
|
renderOrder
|
|
11350
11353
|
}, handlers), {}, {
|
|
11351
11354
|
userData
|
|
@@ -11394,7 +11397,7 @@ const CCPoint = props => {
|
|
|
11394
11397
|
// so we have to increase size of hovered or selected point to make the point not occluded buy other ones
|
|
11395
11398
|
,
|
|
11396
11399
|
scalePlus: isHovered || isSelected,
|
|
11397
|
-
meshProps: _objectSpread$
|
|
11400
|
+
meshProps: _objectSpread$9(_objectSpread$9({
|
|
11398
11401
|
renderOrder
|
|
11399
11402
|
}, handlers), {}, {
|
|
11400
11403
|
userData
|
|
@@ -11448,7 +11451,7 @@ const CCArc = props => {
|
|
|
11448
11451
|
center: centerPoint,
|
|
11449
11452
|
clockwise: clockwise,
|
|
11450
11453
|
scalePlus: isHovered || isSelected,
|
|
11451
|
-
meshProps: _objectSpread$
|
|
11454
|
+
meshProps: _objectSpread$9({
|
|
11452
11455
|
renderOrder,
|
|
11453
11456
|
userData
|
|
11454
11457
|
}, handlers),
|
|
@@ -11490,7 +11493,7 @@ const CCCircle = props => {
|
|
|
11490
11493
|
center: center,
|
|
11491
11494
|
radius: radius,
|
|
11492
11495
|
scalePlus: isHovered || isSelected,
|
|
11493
|
-
meshProps: _objectSpread$
|
|
11496
|
+
meshProps: _objectSpread$9({
|
|
11494
11497
|
renderOrder,
|
|
11495
11498
|
userData
|
|
11496
11499
|
}, handlers),
|
|
@@ -12348,6 +12351,36 @@ const View$d = ({
|
|
|
12348
12351
|
}));
|
|
12349
12352
|
};
|
|
12350
12353
|
|
|
12354
|
+
function styleInject(css, ref) {
|
|
12355
|
+
if ( ref === void 0 ) ref = {};
|
|
12356
|
+
var insertAt = ref.insertAt;
|
|
12357
|
+
|
|
12358
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
12359
|
+
|
|
12360
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
12361
|
+
var style = document.createElement('style');
|
|
12362
|
+
style.type = 'text/css';
|
|
12363
|
+
|
|
12364
|
+
if (insertAt === 'top') {
|
|
12365
|
+
if (head.firstChild) {
|
|
12366
|
+
head.insertBefore(style, head.firstChild);
|
|
12367
|
+
} else {
|
|
12368
|
+
head.appendChild(style);
|
|
12369
|
+
}
|
|
12370
|
+
} else {
|
|
12371
|
+
head.appendChild(style);
|
|
12372
|
+
}
|
|
12373
|
+
|
|
12374
|
+
if (style.styleSheet) {
|
|
12375
|
+
style.styleSheet.cssText = css;
|
|
12376
|
+
} else {
|
|
12377
|
+
style.appendChild(document.createTextNode(css));
|
|
12378
|
+
}
|
|
12379
|
+
}
|
|
12380
|
+
|
|
12381
|
+
var css_248z$4 = ".handlers-dropdown .ant-dropdown-menu-root {\n border: 1px solid rgba(127, 127, 127, 1);\n border-top: 1px solid rgba(255, 255, 255, 1);\n border-radius: 0px;\n padding: 0px;\n margin-top: -2px;\n margin-left: -3px;\n}\n\n.handlers-dropdown .ant-dropdown-menu-root .ant-dropdown-menu-item {\n background-color: initial;\n padding: 0px;\n margin-top: 0px;\n}\n";
|
|
12382
|
+
styleInject(css_248z$4);
|
|
12383
|
+
|
|
12351
12384
|
const _excluded$4 = ["handlerName", "sideEffect"];
|
|
12352
12385
|
const HandlerIcon = styled(RadioButtonImpl)`
|
|
12353
12386
|
width: 30px;
|
|
@@ -12424,8 +12457,6 @@ const SubGroup$1 = ({
|
|
|
12424
12457
|
iconMargin
|
|
12425
12458
|
}) => {
|
|
12426
12459
|
const {
|
|
12427
|
-
Menu,
|
|
12428
|
-
MenuItem,
|
|
12429
12460
|
Dropdown
|
|
12430
12461
|
} = react.useBuerli(buerli => buerli.options.elements);
|
|
12431
12462
|
const {
|
|
@@ -12434,33 +12465,24 @@ const SubGroup$1 = ({
|
|
|
12434
12465
|
} = React.useContext(RootContext);
|
|
12435
12466
|
const activeHandler = useSketchState(drawingId, pluginId, state => state.activeHandler);
|
|
12436
12467
|
const [lastHandler, setLastHandler] = React.useState(handlers[0]);
|
|
12437
|
-
const
|
|
12438
|
-
|
|
12439
|
-
|
|
12440
|
-
|
|
12441
|
-
|
|
12442
|
-
|
|
12443
|
-
|
|
12444
|
-
|
|
12445
|
-
|
|
12446
|
-
|
|
12447
|
-
key:
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12451
|
-
|
|
12452
|
-
}
|
|
12453
|
-
}, /*#__PURE__*/React.createElement(HandlerRadioGroup, {
|
|
12454
|
-
iconmargin: iconMargin,
|
|
12455
|
-
value: activeHandler,
|
|
12456
|
-
size: "small"
|
|
12457
|
-
}, handlers.map(hName => /*#__PURE__*/React.createElement(HButton, {
|
|
12458
|
-
key: hName,
|
|
12459
|
-
handlerName: hName,
|
|
12460
|
-
sideEffect: () => setLastHandler(hName)
|
|
12461
|
-
})))));
|
|
12468
|
+
const menuItems = [{
|
|
12469
|
+
label: /*#__PURE__*/React.createElement(HandlerRadioGroup, {
|
|
12470
|
+
iconmargin: iconMargin,
|
|
12471
|
+
value: activeHandler,
|
|
12472
|
+
size: "small"
|
|
12473
|
+
}, handlers.map(hName => /*#__PURE__*/React.createElement(HButton, {
|
|
12474
|
+
key: hName,
|
|
12475
|
+
handlerName: hName,
|
|
12476
|
+
sideEffect: () => setLastHandler(hName)
|
|
12477
|
+
}))),
|
|
12478
|
+
key: 'menuItem'
|
|
12479
|
+
}];
|
|
12480
|
+
const menuProps = {
|
|
12481
|
+
items: menuItems
|
|
12482
|
+
};
|
|
12462
12483
|
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
12463
|
-
|
|
12484
|
+
overlayClassName: "handlers-dropdown",
|
|
12485
|
+
menu: menuProps
|
|
12464
12486
|
}, /*#__PURE__*/React.createElement(HButton, {
|
|
12465
12487
|
handlerName: lastHandler
|
|
12466
12488
|
}));
|
|
@@ -12580,7 +12602,7 @@ function useMenuItems$4(drawingId, featureId, isActive, setEditName) {
|
|
|
12580
12602
|
callback: () => {
|
|
12581
12603
|
const pluginAPI = core.getDrawing(drawingId).api.plugin;
|
|
12582
12604
|
if (isActive) pluginAPI.setActiveFeature(null);
|
|
12583
|
-
classcad.ccAPI.baseModeler.
|
|
12605
|
+
classcad.ccAPI.baseModeler.deleteObjects(drawingId, [featureId]).catch(console.warn);
|
|
12584
12606
|
}
|
|
12585
12607
|
}
|
|
12586
12608
|
};
|
|
@@ -12747,7 +12769,7 @@ const Menu = _ref => {
|
|
|
12747
12769
|
children
|
|
12748
12770
|
} = _ref,
|
|
12749
12771
|
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
12750
|
-
const
|
|
12772
|
+
const onClick = React.useCallback(e => {
|
|
12751
12773
|
e.domEvent.stopPropagation();
|
|
12752
12774
|
let item = items[e.keyPath.pop()];
|
|
12753
12775
|
if (item.children) {
|
|
@@ -12755,33 +12777,28 @@ const Menu = _ref => {
|
|
|
12755
12777
|
}
|
|
12756
12778
|
item.callback(e.domEvent);
|
|
12757
12779
|
}, [items]);
|
|
12758
|
-
const
|
|
12759
|
-
onClick: onItemClick
|
|
12760
|
-
}, Object.keys(items).map(key => {
|
|
12780
|
+
const menuItems = Object.keys(items).map(key => {
|
|
12761
12781
|
const item = items[key];
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
|
|
12775
|
-
|
|
12776
|
-
|
|
12777
|
-
|
|
12778
|
-
|
|
12779
|
-
|
|
12780
|
-
}, item_.caption);
|
|
12781
|
-
}
|
|
12782
|
-
}));
|
|
12782
|
+
return {
|
|
12783
|
+
label: item.caption,
|
|
12784
|
+
key,
|
|
12785
|
+
icon: item.icon,
|
|
12786
|
+
children: item.children && Object.keys(item.children).map(key_ => {
|
|
12787
|
+
const smItem = item.children[key_];
|
|
12788
|
+
return {
|
|
12789
|
+
label: smItem.caption,
|
|
12790
|
+
key: key_,
|
|
12791
|
+
icon: smItem.icon
|
|
12792
|
+
};
|
|
12793
|
+
})
|
|
12794
|
+
};
|
|
12795
|
+
});
|
|
12796
|
+
const menuProps = {
|
|
12797
|
+
items: menuItems,
|
|
12798
|
+
onClick
|
|
12799
|
+
};
|
|
12783
12800
|
return /*#__PURE__*/React.createElement(antd.Dropdown, _extends({
|
|
12784
|
-
|
|
12801
|
+
menu: menuProps,
|
|
12785
12802
|
placement: "bottom"
|
|
12786
12803
|
}, props), children ? children : /*#__PURE__*/React.createElement("div", {
|
|
12787
12804
|
style: {
|
|
@@ -12793,7 +12810,10 @@ const Menu = _ref => {
|
|
|
12793
12810
|
}, "..."));
|
|
12794
12811
|
};
|
|
12795
12812
|
|
|
12813
|
+
function ownKeys$8(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12814
|
+
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$8(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12796
12815
|
const NameEdit = ({
|
|
12816
|
+
style,
|
|
12797
12817
|
drawingId,
|
|
12798
12818
|
objId,
|
|
12799
12819
|
setEditName,
|
|
@@ -12826,9 +12846,9 @@ const NameEdit = ({
|
|
|
12826
12846
|
const showBlankDiv = useCADStore(s => s.blankDiv.isActive);
|
|
12827
12847
|
const zIndex = showBlankDiv ? blankZIndex + 1 : 0;
|
|
12828
12848
|
return /*#__PURE__*/React.createElement(antd.Input, {
|
|
12829
|
-
style: {
|
|
12849
|
+
style: _objectSpread$8(_objectSpread$8({}, style), {}, {
|
|
12830
12850
|
zIndex
|
|
12831
|
-
},
|
|
12851
|
+
}),
|
|
12832
12852
|
ref: ref,
|
|
12833
12853
|
onPressEnter: onEnter,
|
|
12834
12854
|
onClick: onClick,
|
|
@@ -13018,7 +13038,7 @@ const RefTag = ({
|
|
|
13018
13038
|
React.useEffect(() => {
|
|
13019
13039
|
return () => remove.current && remove.current();
|
|
13020
13040
|
}, []);
|
|
13021
|
-
const error = !
|
|
13041
|
+
const error = !refGraphics;
|
|
13022
13042
|
const reselection = activeSelection === selectionName;
|
|
13023
13043
|
const color = reselection ? '#e36b7c' : error ? 'red' : 'gold';
|
|
13024
13044
|
return /*#__PURE__*/React.createElement(antd.Tag, {
|
|
@@ -13042,9 +13062,14 @@ const ObjTitle = ({
|
|
|
13042
13062
|
} = React.useContext(RootContext);
|
|
13043
13063
|
const name = useDrawingStr(drawingId, d => d.structure.tree[objId].name);
|
|
13044
13064
|
const objClass = useDrawingStr(drawingId, d => d.structure.tree[objId].class);
|
|
13065
|
+
const activeHandler = useSketchState(drawingId, pluginId, state => state.activeHandler);
|
|
13066
|
+
const globalSelection = useTreeObjSelection(drawingId, objId);
|
|
13067
|
+
const isGHovered = globalSelection.isHovered;
|
|
13068
|
+
const isGSelected = globalSelection.isSelected;
|
|
13069
|
+
const onClickSel = globalSelection.handlers.onClick;
|
|
13045
13070
|
const isHovered = useSketchState(drawingId, pluginId, s => s.hovered === objId);
|
|
13046
13071
|
const isSelected = useSketchState(drawingId, pluginId, s => s.selected.indexOf(objId) !== -1);
|
|
13047
|
-
const color = isSelected ? '#ffa500' : isHovered ? '#28d79f' : undefined;
|
|
13072
|
+
const color = isSelected || isGSelected ? '#ffa500' : isHovered || isGHovered ? '#28d79f' : undefined;
|
|
13048
13073
|
|
|
13049
13074
|
// TODO: Rename resources so that they have more generic names, i.e. 'CC_Point' instead of 'drawPoint', etc
|
|
13050
13075
|
const imgName = React.useMemo(() => {
|
|
@@ -13063,17 +13088,14 @@ const ObjTitle = ({
|
|
|
13063
13088
|
}, [objClass]);
|
|
13064
13089
|
const [rename, setRename] = React.useState(false);
|
|
13065
13090
|
const menuItems = useMenuItems$3(drawingId, pluginId, objId, setRename);
|
|
13066
|
-
const activeHandler = useSketchState(drawingId, pluginId, state => state.activeHandler);
|
|
13067
|
-
const globalSelection = useTreeObjSelection(drawingId, objId);
|
|
13068
|
-
const onClickSel = globalSelection.handlers.onClick;
|
|
13069
13091
|
|
|
13070
13092
|
// TODO: Implement global selection in onClick? Not sure if needed...
|
|
13071
|
-
const onClick = React.useCallback(
|
|
13093
|
+
const onClick = React.useCallback(e => {
|
|
13072
13094
|
if (activeHandler === HandlersList.DRAG) {
|
|
13073
13095
|
select(drawingId, pluginId, objId);
|
|
13074
13096
|
} else if (!activeHandler) {
|
|
13075
13097
|
// if no handler is active, some selector should be active
|
|
13076
|
-
onClickSel && onClickSel();
|
|
13098
|
+
onClickSel && onClickSel(e);
|
|
13077
13099
|
}
|
|
13078
13100
|
}, [drawingId, pluginId, objId, activeHandler, onClickSel]);
|
|
13079
13101
|
const onMouseEnter = React.useCallback(() => {
|
|
@@ -13198,6 +13220,8 @@ const Details = () => {
|
|
|
13198
13220
|
}, [drawingId, sketchChildren, ccUseGeometry]);
|
|
13199
13221
|
const hasGeometry = geometry.length > 0 || refGeometry.length > 0;
|
|
13200
13222
|
const hasConstraints = constraints.length > 0;
|
|
13223
|
+
const [geomCollapsed, setGeomCollapsed] = React.useState(false);
|
|
13224
|
+
const [constrCollapsed, setConstrCollapsed] = React.useState(false);
|
|
13201
13225
|
return /*#__PURE__*/React.createElement(SketchGroup, {
|
|
13202
13226
|
caption: "Details",
|
|
13203
13227
|
collapse: true
|
|
@@ -13215,9 +13239,20 @@ const Details = () => {
|
|
|
13215
13239
|
style: {
|
|
13216
13240
|
paddingLeft: '2px'
|
|
13217
13241
|
}
|
|
13218
|
-
}, /*#__PURE__*/React.createElement(
|
|
13242
|
+
}, /*#__PURE__*/React.createElement(FlexRow, {
|
|
13243
|
+
style: {
|
|
13244
|
+
marginLeft: '-5px'
|
|
13245
|
+
}
|
|
13246
|
+
}, /*#__PURE__*/React.createElement(CollapseButton, {
|
|
13247
|
+
collapsed: geomCollapsed,
|
|
13248
|
+
onClick: () => setGeomCollapsed(x => !x)
|
|
13249
|
+
}), /*#__PURE__*/React.createElement(Text$2, {
|
|
13219
13250
|
strong: true
|
|
13220
|
-
}, "Geometry"),
|
|
13251
|
+
}, "Geometry")), /*#__PURE__*/React.createElement("div", {
|
|
13252
|
+
style: {
|
|
13253
|
+
display: geomCollapsed ? 'none' : 'block'
|
|
13254
|
+
}
|
|
13255
|
+
}, refGeometry.map(([id, refId]) => /*#__PURE__*/React.createElement(SketchObj, {
|
|
13221
13256
|
objId: id,
|
|
13222
13257
|
refId: refId,
|
|
13223
13258
|
key: id,
|
|
@@ -13226,17 +13261,29 @@ const Details = () => {
|
|
|
13226
13261
|
objId: id,
|
|
13227
13262
|
key: id,
|
|
13228
13263
|
level: 0
|
|
13229
|
-
}))), hasConstraints && !isTrimActive && /*#__PURE__*/React.createElement("div", {
|
|
13264
|
+
})))), hasConstraints && !isTrimActive && /*#__PURE__*/React.createElement("div", {
|
|
13230
13265
|
style: {
|
|
13231
|
-
paddingLeft: '2px'
|
|
13266
|
+
paddingLeft: '2px',
|
|
13267
|
+
marginTop: '2px'
|
|
13268
|
+
}
|
|
13269
|
+
}, /*#__PURE__*/React.createElement(FlexRow, {
|
|
13270
|
+
style: {
|
|
13271
|
+
marginLeft: '-5px'
|
|
13232
13272
|
}
|
|
13233
|
-
}, /*#__PURE__*/React.createElement(
|
|
13273
|
+
}, /*#__PURE__*/React.createElement(CollapseButton, {
|
|
13274
|
+
collapsed: constrCollapsed,
|
|
13275
|
+
onClick: () => setConstrCollapsed(x => !x)
|
|
13276
|
+
}), /*#__PURE__*/React.createElement(Text$2, {
|
|
13234
13277
|
strong: true
|
|
13235
|
-
}, "Constraints"),
|
|
13278
|
+
}, "Constraints")), /*#__PURE__*/React.createElement("div", {
|
|
13279
|
+
style: {
|
|
13280
|
+
display: constrCollapsed ? 'none' : 'block'
|
|
13281
|
+
}
|
|
13282
|
+
}, constraints.map(id => /*#__PURE__*/React.createElement(SketchObj, {
|
|
13236
13283
|
objId: id,
|
|
13237
13284
|
key: id,
|
|
13238
13285
|
level: 0
|
|
13239
|
-
}))));
|
|
13286
|
+
})))));
|
|
13240
13287
|
};
|
|
13241
13288
|
|
|
13242
13289
|
const useRetainVisibility = (drawingId, pluginId) => {
|
|
@@ -13399,22 +13446,285 @@ const Position = () => {
|
|
|
13399
13446
|
})));
|
|
13400
13447
|
};
|
|
13401
13448
|
|
|
13402
|
-
|
|
13403
|
-
|
|
13404
|
-
|
|
13405
|
-
}
|
|
13449
|
+
function useEditedRegionsParam() {
|
|
13450
|
+
const {
|
|
13451
|
+
drawingId
|
|
13452
|
+
} = React.useContext(RootContext);
|
|
13453
|
+
const [value, setValue] = React.useState([]);
|
|
13454
|
+
const isChanged = React.useCallback(() => {
|
|
13455
|
+
const tree = core.getDrawing(drawingId).structure.tree;
|
|
13456
|
+
return value.some(region => {
|
|
13457
|
+
var _tree$region$objId, _tree$region$objId$me, _tree$region$objId$me2;
|
|
13458
|
+
const members = ((_tree$region$objId = tree[region.objId]) == null ? void 0 : (_tree$region$objId$me = _tree$region$objId.members) == null ? void 0 : (_tree$region$objId$me2 = _tree$region$objId$me.curves) == null ? void 0 : _tree$region$objId$me2.members) || EMPTYARRAY;
|
|
13459
|
+
return members.length !== region.curves.length || members.some((curve, i) => curve.value !== region.curves[i]);
|
|
13460
|
+
});
|
|
13461
|
+
}, [drawingId, value]);
|
|
13462
|
+
return {
|
|
13463
|
+
value,
|
|
13464
|
+
setValue,
|
|
13465
|
+
isChanged
|
|
13466
|
+
};
|
|
13467
|
+
}
|
|
13468
|
+
const nameRegex$1 = /[a-zA-Z_][a-zA-Z0-9_]*/g;
|
|
13469
|
+
const AddRegion = () => {
|
|
13470
|
+
const {
|
|
13471
|
+
Input,
|
|
13472
|
+
Selection,
|
|
13473
|
+
Button
|
|
13474
|
+
} = react.useBuerli(buerli => buerli.options.elements);
|
|
13475
|
+
const {
|
|
13476
|
+
drawingId,
|
|
13477
|
+
pluginId
|
|
13478
|
+
} = React.useContext(RootContext);
|
|
13406
13479
|
const sketchId = react.usePlugin(drawingId, pluginId, plugin => plugin.objectId);
|
|
13407
|
-
const
|
|
13408
|
-
const
|
|
13409
|
-
const
|
|
13410
|
-
|
|
13411
|
-
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
|
|
13415
|
-
|
|
13480
|
+
const [name, setName] = React.useState('');
|
|
13481
|
+
const [selectorId, setSelectorId] = React.useState();
|
|
13482
|
+
const selected = useDrawingArr(drawingId, d => {
|
|
13483
|
+
var _d$selection$refs;
|
|
13484
|
+
return (_d$selection$refs = d.selection.refs[selectorId || EMPTYSTR]) == null ? void 0 : _d$selection$refs.items;
|
|
13485
|
+
});
|
|
13486
|
+
const onNameChange = React.useCallback(e => {
|
|
13487
|
+
const value = e.target.value;
|
|
13488
|
+
const match = value.match(nameRegex$1);
|
|
13489
|
+
if (value.length === 0 || (match == null ? void 0 : match.length) === 1 && match[0].length === value.length) {
|
|
13490
|
+
setName(value);
|
|
13416
13491
|
}
|
|
13417
|
-
|
|
13492
|
+
}, []);
|
|
13493
|
+
const regionFilter = React.useCallback((scope, data) => {
|
|
13494
|
+
if (scope !== TreeObjScope) {
|
|
13495
|
+
return false;
|
|
13496
|
+
}
|
|
13497
|
+
const pSketchId = getAncestorIdByClass(drawingId, data.object.id, classcad.CCClasses.CCSketch);
|
|
13498
|
+
if (!pSketchId) {
|
|
13499
|
+
return false;
|
|
13500
|
+
}
|
|
13501
|
+
return pSketchId === sketchId && (data.object.class === classcad.CCClasses.CCLine || data.object.class === classcad.CCClasses.CCArc || data.object.class === classcad.CCClasses.CCCircle);
|
|
13502
|
+
}, [drawingId, sketchId]);
|
|
13503
|
+
const addRegion = React.useCallback(() => {
|
|
13504
|
+
if (name.length === 0 || selected.length === 0) return;
|
|
13505
|
+
const curves = selected.map(item => item.data.object.id);
|
|
13506
|
+
setName('');
|
|
13507
|
+
core.getDrawing(drawingId).api.selection.unselectAll(selectorId);
|
|
13508
|
+
core.getDrawing(drawingId).api.selection.activateSelector(null);
|
|
13509
|
+
return classcad.ccAPI.sketcher.addSketchRegion(drawingId, sketchId, name, curves).catch(console.warn);
|
|
13510
|
+
}, [drawingId, sketchId, name, selectorId, selected]);
|
|
13511
|
+
const setRefsFromItems = React.useCallback((selId, selItems) => {
|
|
13512
|
+
core.getDrawing(drawingId).api.selection.setItems(selId, selItems);
|
|
13513
|
+
}, [drawingId]);
|
|
13514
|
+
const modes = useModes(drawingId, true, setRefsFromItems, undefined);
|
|
13515
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
13516
|
+
style: {
|
|
13517
|
+
display: 'flex',
|
|
13518
|
+
width: '100%'
|
|
13519
|
+
}
|
|
13520
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
13521
|
+
style: {
|
|
13522
|
+
flex: 4,
|
|
13523
|
+
minWidth: '0px'
|
|
13524
|
+
}
|
|
13525
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
13526
|
+
placeholder: "Name...",
|
|
13527
|
+
value: name,
|
|
13528
|
+
onChange: onNameChange
|
|
13529
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
13530
|
+
style: {
|
|
13531
|
+
flex: 7,
|
|
13532
|
+
minWidth: '0px',
|
|
13533
|
+
margin: '0px 1px'
|
|
13534
|
+
}
|
|
13535
|
+
}, /*#__PURE__*/React.createElement(Selection, {
|
|
13536
|
+
drawingId: drawingId,
|
|
13537
|
+
onCreated: setSelectorId,
|
|
13538
|
+
filter: regionFilter,
|
|
13539
|
+
modes: modes
|
|
13540
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
13541
|
+
style: {
|
|
13542
|
+
width: '25px',
|
|
13543
|
+
height: '25px',
|
|
13544
|
+
margin: '2px -1px 2px 1px'
|
|
13545
|
+
},
|
|
13546
|
+
tabIndex: -1,
|
|
13547
|
+
icon: /*#__PURE__*/React.createElement(icons.PlusOutlined, null),
|
|
13548
|
+
size: "small",
|
|
13549
|
+
onClick: addRegion,
|
|
13550
|
+
title: 'Add new sketch region'
|
|
13551
|
+
}));
|
|
13552
|
+
};
|
|
13553
|
+
var RegionMembers;
|
|
13554
|
+
(function (RegionMembers) {
|
|
13555
|
+
RegionMembers["Curves"] = "curves";
|
|
13556
|
+
})(RegionMembers || (RegionMembers = {}));
|
|
13557
|
+
const EditRegion = ({
|
|
13558
|
+
sketchId,
|
|
13559
|
+
regionId,
|
|
13560
|
+
editedRegions
|
|
13561
|
+
}) => {
|
|
13562
|
+
const {
|
|
13563
|
+
Label
|
|
13564
|
+
} = react.useBuerli(buerli => buerli.options.elements);
|
|
13565
|
+
const {
|
|
13566
|
+
drawingId
|
|
13567
|
+
} = React.useContext(RootContext);
|
|
13568
|
+
const curves = useRefsParam(drawingId, regionId, RegionMembers.Curves);
|
|
13569
|
+
const name = useDrawingStr(drawingId, d => {
|
|
13570
|
+
var _d$structure$tree$reg;
|
|
13571
|
+
return (_d$structure$tree$reg = d.structure.tree[regionId]) == null ? void 0 : _d$structure$tree$reg.name;
|
|
13572
|
+
});
|
|
13573
|
+
const [rename, setRename] = React.useState(false);
|
|
13574
|
+
const menuItems = useMenuItems$4(drawingId, regionId, false, setRename);
|
|
13575
|
+
|
|
13576
|
+
// Remove region from edited in case of deletion
|
|
13577
|
+
React.useEffect(() => {
|
|
13578
|
+
return () => editedRegions.setValue(value_ => value_.filter(region => region.objId !== regionId));
|
|
13579
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13580
|
+
}, []);
|
|
13581
|
+
React.useEffect(() => {
|
|
13582
|
+
editedRegions.setValue(value_ => {
|
|
13583
|
+
const res = value_.filter(region => region.objId !== regionId);
|
|
13584
|
+
if (curves.isChanged()) {
|
|
13585
|
+
res.push({
|
|
13586
|
+
objId: regionId,
|
|
13587
|
+
curves: [...curves.userValue]
|
|
13588
|
+
});
|
|
13589
|
+
}
|
|
13590
|
+
return res;
|
|
13591
|
+
});
|
|
13592
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13593
|
+
}, [curves.userValue]);
|
|
13594
|
+
const regionFilter = React.useCallback((scope, data) => {
|
|
13595
|
+
if (scope !== TreeObjScope) {
|
|
13596
|
+
return false;
|
|
13597
|
+
}
|
|
13598
|
+
const pSketchId = getAncestorIdByClass(drawingId, data.object.id, classcad.CCClasses.CCSketch);
|
|
13599
|
+
if (!pSketchId) {
|
|
13600
|
+
return false;
|
|
13601
|
+
}
|
|
13602
|
+
return pSketchId === sketchId && (data.object.class === classcad.CCClasses.CCLine || data.object.class === classcad.CCClasses.CCArc || data.object.class === classcad.CCClasses.CCCircle);
|
|
13603
|
+
}, [drawingId, sketchId]);
|
|
13604
|
+
const nameComponent = rename ? /*#__PURE__*/React.createElement(NameEdit, {
|
|
13605
|
+
style: {
|
|
13606
|
+
width: '100%',
|
|
13607
|
+
height: '25px',
|
|
13608
|
+
minHeight: '25px',
|
|
13609
|
+
lineHeight: '22px',
|
|
13610
|
+
margin: '2px 1px'
|
|
13611
|
+
},
|
|
13612
|
+
drawingId: drawingId,
|
|
13613
|
+
objId: regionId,
|
|
13614
|
+
setEditName: setRename,
|
|
13615
|
+
name: name
|
|
13616
|
+
}) : /*#__PURE__*/React.createElement(Label, {
|
|
13617
|
+
style: {
|
|
13618
|
+
paddingLeft: '4px'
|
|
13619
|
+
},
|
|
13620
|
+
ellipsis: true
|
|
13621
|
+
}, name);
|
|
13622
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
13623
|
+
style: {
|
|
13624
|
+
display: 'flex',
|
|
13625
|
+
width: '100%'
|
|
13626
|
+
}
|
|
13627
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
13628
|
+
style: {
|
|
13629
|
+
flex: 4,
|
|
13630
|
+
width: '100%',
|
|
13631
|
+
minWidth: '0px'
|
|
13632
|
+
}
|
|
13633
|
+
}, nameComponent), /*#__PURE__*/React.createElement("div", {
|
|
13634
|
+
style: {
|
|
13635
|
+
flex: 7,
|
|
13636
|
+
width: '100%',
|
|
13637
|
+
minWidth: '0px',
|
|
13638
|
+
marginRight: '1px'
|
|
13639
|
+
}
|
|
13640
|
+
}, /*#__PURE__*/React.createElement(RefsEditor, {
|
|
13641
|
+
drawingId: drawingId,
|
|
13642
|
+
param: curves,
|
|
13643
|
+
filter: regionFilter,
|
|
13644
|
+
customIdPicker: pickObjId,
|
|
13645
|
+
sketchLines: true
|
|
13646
|
+
})), /*#__PURE__*/React.createElement(Menu, {
|
|
13647
|
+
items: menuItems
|
|
13648
|
+
}));
|
|
13649
|
+
};
|
|
13650
|
+
const Regions = () => {
|
|
13651
|
+
const {
|
|
13652
|
+
Button
|
|
13653
|
+
} = react.useBuerli(buerli => buerli.options.elements);
|
|
13654
|
+
const {
|
|
13655
|
+
drawingId,
|
|
13656
|
+
pluginId
|
|
13657
|
+
} = React.useContext(RootContext);
|
|
13658
|
+
const sketchId = react.usePlugin(drawingId, pluginId, plugin => plugin.objectId);
|
|
13659
|
+
const partId = getAncestorIdByClass(drawingId, sketchId, classcad.CCClasses.CCPart) || NOCCID;
|
|
13660
|
+
const geometrySetId = useDrawingCCId(drawingId, d => {
|
|
13661
|
+
var _d$structure$tree$par;
|
|
13662
|
+
return (_d$structure$tree$par = d.structure.tree[partId]) == null ? void 0 : _d$structure$tree$par.geometrySet;
|
|
13663
|
+
});
|
|
13664
|
+
const geometrySetChildren = useDrawingArr(drawingId, d => {
|
|
13665
|
+
var _d$structure$tree$geo;
|
|
13666
|
+
return (_d$structure$tree$geo = d.structure.tree[geometrySetId]) == null ? void 0 : _d$structure$tree$geo.children;
|
|
13667
|
+
});
|
|
13668
|
+
const regions = React.useMemo(() => {
|
|
13669
|
+
const tree = core.getDrawing(drawingId).structure.tree;
|
|
13670
|
+
const ids = geometrySetChildren.filter(child => {
|
|
13671
|
+
var _tree$child$members, _tree$child$members$s;
|
|
13672
|
+
return tree[child].class === classcad.CCClasses.CCSketchRegion && ((_tree$child$members = tree[child].members) == null ? void 0 : (_tree$child$members$s = _tree$child$members.sketch) == null ? void 0 : _tree$child$members$s.value) === sketchId;
|
|
13673
|
+
});
|
|
13674
|
+
return ids;
|
|
13675
|
+
}, [drawingId, sketchId, geometrySetChildren]);
|
|
13676
|
+
const editedRegions = useEditedRegionsParam();
|
|
13677
|
+
const updateAvailable = React.useMemo(() => {
|
|
13678
|
+
return editedRegions.value.every(region => region.curves.length > 0) && editedRegions.isChanged();
|
|
13679
|
+
}, [editedRegions]);
|
|
13680
|
+
const onClick = React.useCallback(() => {
|
|
13681
|
+
core.getDrawing(drawingId).api.selection.activateSelector(null);
|
|
13682
|
+
const regionIds = editedRegions.value.map(region => region.objId);
|
|
13683
|
+
const curvesArr = editedRegions.value.map(region => region.curves);
|
|
13684
|
+
classcad.ccAPI.sketcher.updateSketchRegions(drawingId, regionIds, curvesArr).catch(console.warn);
|
|
13685
|
+
}, [drawingId, editedRegions]);
|
|
13686
|
+
return /*#__PURE__*/React.createElement(SketchGroup, {
|
|
13687
|
+
caption: "Regions",
|
|
13688
|
+
collapse: true
|
|
13689
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
13690
|
+
style: {
|
|
13691
|
+
margin: '0px 3px 0px 1px'
|
|
13692
|
+
}
|
|
13693
|
+
}, /*#__PURE__*/React.createElement(AddRegion, null), regions.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
13694
|
+
style: {
|
|
13695
|
+
marginTop: '10px'
|
|
13696
|
+
}
|
|
13697
|
+
}, regions.map(regionId => /*#__PURE__*/React.createElement(EditRegion, {
|
|
13698
|
+
key: regionId,
|
|
13699
|
+
sketchId: sketchId,
|
|
13700
|
+
regionId: regionId,
|
|
13701
|
+
editedRegions: editedRegions
|
|
13702
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
13703
|
+
style: {
|
|
13704
|
+
marginTop: '10px'
|
|
13705
|
+
},
|
|
13706
|
+
type: "primary",
|
|
13707
|
+
disabled: !updateAvailable,
|
|
13708
|
+
onClick: onClick
|
|
13709
|
+
}, "Update regions"))));
|
|
13710
|
+
};
|
|
13711
|
+
|
|
13712
|
+
const PlaneSelectionMode = ({
|
|
13713
|
+
drawingId,
|
|
13714
|
+
pluginId
|
|
13715
|
+
}) => {
|
|
13716
|
+
const sketchId = react.usePlugin(drawingId, pluginId, plugin => plugin.objectId);
|
|
13717
|
+
const curProduct = react.useDrawing(drawingId, d => d.structure.currentProduct);
|
|
13718
|
+
const opSeqId = useOperationSequence(drawingId, curProduct) || NOCCID;
|
|
13719
|
+
const opSeqChildren = useDrawingArr(drawingId, d => d.structure.tree[opSeqId].children);
|
|
13720
|
+
|
|
13721
|
+
// Makes base planes visible when just created, and turns them off after initialization (i.e. selecting a plane)
|
|
13722
|
+
React.useEffect(() => {
|
|
13723
|
+
if (opSeqChildren.length < 7) {
|
|
13724
|
+
// Should probably never happen, but just in case...
|
|
13725
|
+
return;
|
|
13726
|
+
}
|
|
13727
|
+
const drawing = core.getDrawing(drawingId);
|
|
13418
13728
|
const tree = drawing.structure.tree;
|
|
13419
13729
|
const pluginApi = drawing.api.plugin;
|
|
13420
13730
|
|
|
@@ -13465,7 +13775,7 @@ const SketchMode = ({
|
|
|
13465
13775
|
}), [drawingId, pluginId]);
|
|
13466
13776
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(RootContext.Provider, {
|
|
13467
13777
|
value: contextValue
|
|
13468
|
-
}, /*#__PURE__*/React.createElement(Handlers, null), /*#__PURE__*/React.createElement(Constraints$2, null), /*#__PURE__*/React.createElement(CopyPatterns, null), /*#__PURE__*/React.createElement(Details, null), /*#__PURE__*/React.createElement(Position, null)));
|
|
13778
|
+
}, /*#__PURE__*/React.createElement(Handlers, null), /*#__PURE__*/React.createElement(Constraints$2, null), /*#__PURE__*/React.createElement(CopyPatterns, null), /*#__PURE__*/React.createElement(Details, null), /*#__PURE__*/React.createElement(Regions, null), /*#__PURE__*/React.createElement(Position, null)));
|
|
13469
13779
|
};
|
|
13470
13780
|
const RootImpl$f = ({
|
|
13471
13781
|
drawingId,
|
|
@@ -13830,26 +14140,22 @@ function linePlaneAngle(drawingId, refsParam) {
|
|
|
13830
14140
|
lineStart = gLine.start;
|
|
13831
14141
|
lineEnd = gLine.end;
|
|
13832
14142
|
}
|
|
13833
|
-
let pointOnPlane = new THREE__namespace.Vector3();
|
|
13834
14143
|
let normal = new THREE__namespace.Vector3();
|
|
13835
14144
|
if (plane.class === classcad.CCClasses.CCWorkPlane) {
|
|
13836
|
-
var _ccPlane$members
|
|
14145
|
+
var _ccPlane$members;
|
|
13837
14146
|
const ccPlane = plane;
|
|
13838
|
-
|
|
13839
|
-
normal = convertToVector((_ccPlane$members2 = ccPlane.members) == null ? void 0 : _ccPlane$members2.Normal);
|
|
14147
|
+
normal = convertToVector((_ccPlane$members = ccPlane.members) == null ? void 0 : _ccPlane$members.Normal);
|
|
13840
14148
|
} else {
|
|
13841
14149
|
const gPlane = plane;
|
|
13842
|
-
pointOnPlane = gPlane.pointOnPlane;
|
|
13843
14150
|
normal = gPlane.normal;
|
|
13844
14151
|
}
|
|
13845
|
-
const
|
|
13846
|
-
const pointEndVec = pointOnPlane.clone().sub(lineEnd);
|
|
14152
|
+
const lineDir = lineEnd.clone().sub(lineStart);
|
|
13847
14153
|
|
|
13848
14154
|
// compare calculated normals with a tolerance, because the sent normal from server is rounded to 3 decimal places.
|
|
13849
14155
|
const tolerance = 0.01;
|
|
13850
|
-
const
|
|
13851
|
-
if (!
|
|
13852
|
-
return ['The line should
|
|
14156
|
+
const isPerpendicular = Math.abs(normal.dot(lineDir)) <= tolerance;
|
|
14157
|
+
if (!isPerpendicular) {
|
|
14158
|
+
return ['The line should be perpendicular to the normal of the plane'];
|
|
13853
14159
|
}
|
|
13854
14160
|
}
|
|
13855
14161
|
return [];
|
|
@@ -15402,7 +15708,7 @@ const RootImpl$9 = ({
|
|
|
15402
15708
|
const [expression, setExpression] = React.useState();
|
|
15403
15709
|
const [showHidden, setShowHidden] = React.useState(false);
|
|
15404
15710
|
const [searchStr, setSearchStr] = React.useState();
|
|
15405
|
-
const isUpdateable = !
|
|
15711
|
+
const isUpdateable = !activeFeature;
|
|
15406
15712
|
const editedExpressions = useEditedExpressionsParam();
|
|
15407
15713
|
const deletedExpressions = useDeletedExpressionsParam();
|
|
15408
15714
|
|
|
@@ -15431,7 +15737,12 @@ const RootImpl$9 = ({
|
|
|
15431
15737
|
}];
|
|
15432
15738
|
setName(undefined);
|
|
15433
15739
|
setExpression(undefined);
|
|
15434
|
-
return classcad.ccAPI.feature.
|
|
15740
|
+
return classcad.ccAPI.feature.updateExpressionSets(drawingId, [{
|
|
15741
|
+
productId: productId,
|
|
15742
|
+
toAddMembers: toAddMembers,
|
|
15743
|
+
toModifyMembers: [],
|
|
15744
|
+
toDeleteList: []
|
|
15745
|
+
}]).catch(console.warn);
|
|
15435
15746
|
}, [drawingId, productId, name, expression]);
|
|
15436
15747
|
const deleteExpression = React.useCallback(name_ => {
|
|
15437
15748
|
const {
|
|
@@ -15444,7 +15755,12 @@ const RootImpl$9 = ({
|
|
|
15444
15755
|
}
|
|
15445
15756
|
}, [deletedExpressions]);
|
|
15446
15757
|
const update = React.useCallback(() => {
|
|
15447
|
-
return classcad.ccAPI.feature.
|
|
15758
|
+
return classcad.ccAPI.feature.updateExpressionSets(drawingId, [{
|
|
15759
|
+
productId: productId,
|
|
15760
|
+
toAddMembers: [],
|
|
15761
|
+
toModifyMembers: editedExpressions.serverValue,
|
|
15762
|
+
toDeleteList: deletedExpressions.serverValue
|
|
15763
|
+
}]).then(() => {
|
|
15448
15764
|
editedExpressions.setUserValue([]);
|
|
15449
15765
|
deletedExpressions.setUserValue([]);
|
|
15450
15766
|
});
|
|
@@ -15589,25 +15905,14 @@ function RootImpl$8({
|
|
|
15589
15905
|
const xOffset = useNumParam(drawingId, objectId, Members$6.XOffset);
|
|
15590
15906
|
const yOffset = useNumParam(drawingId, objectId, Members$6.YOffset);
|
|
15591
15907
|
const zOffset = useNumParam(drawingId, objectId, Members$6.ZOffset);
|
|
15592
|
-
|
|
15593
|
-
/* const preview = React.useCallback(() => {
|
|
15594
|
-
return ccAPI.assemblyBuilder
|
|
15595
|
-
.previewFastenedOriginConstraint(
|
|
15596
|
-
drawingId,
|
|
15597
|
-
objectId,
|
|
15598
|
-
mateRef.serverValue as MateParam,
|
|
15599
|
-
xOffset.serverValue,
|
|
15600
|
-
yOffset.serverValue,
|
|
15601
|
-
zOffset.serverValue,
|
|
15602
|
-
)
|
|
15603
|
-
.catch()
|
|
15604
|
-
}, [drawingId, objectId, mateRef, xOffset, yOffset, zOffset]) */
|
|
15605
|
-
|
|
15606
|
-
/* const stopPreview = React.useRef<() => void>(() => void {}) */
|
|
15607
|
-
|
|
15608
15908
|
const update = React.useCallback(async () => {
|
|
15609
|
-
|
|
15610
|
-
|
|
15909
|
+
return classcad.ccAPI.assemblyBuilder.updateFastenedOriginConstraints(drawingId, [{
|
|
15910
|
+
constrId: objectId,
|
|
15911
|
+
mate1: mateRef.serverValue,
|
|
15912
|
+
xOffset: xOffset.serverValue,
|
|
15913
|
+
yOffset: yOffset.serverValue,
|
|
15914
|
+
zOffset: zOffset.serverValue
|
|
15915
|
+
}]);
|
|
15611
15916
|
}, [drawingId, objectId, mateRef, xOffset, yOffset, zOffset]);
|
|
15612
15917
|
return /*#__PURE__*/React.createElement(PluginForm, {
|
|
15613
15918
|
drawingId: drawingId,
|
|
@@ -15769,7 +16074,10 @@ const getReorientedMatrix = (reoriented, zAxis) => {
|
|
|
15769
16074
|
const useCsysMatrix = (drawingId, csysId, flip, reoriented) => {
|
|
15770
16075
|
const csys = react.useDrawing(drawingId, drawing => drawing.structure.tree[csysId]);
|
|
15771
16076
|
const tree = core.getDrawing(drawingId).structure.tree;
|
|
15772
|
-
const [xAxisId, yAxisId, zAxisId] = ['xAxis', 'yAxis', 'zAxis'].map(name =>
|
|
16077
|
+
const [xAxisId, yAxisId, zAxisId] = ['xAxis', 'yAxis', 'zAxis'].map(name => {
|
|
16078
|
+
var _csys$children;
|
|
16079
|
+
return (csys == null ? void 0 : (_csys$children = csys.children) == null ? void 0 : _csys$children.find(childId => tree[childId].name === name)) || NOCCID;
|
|
16080
|
+
});
|
|
15773
16081
|
const xAxis = react.useDrawing(drawingId, drawing => {
|
|
15774
16082
|
var _drawing$structure$tr, _drawing$structure$tr2;
|
|
15775
16083
|
return (_drawing$structure$tr = drawing.structure.tree[xAxisId]) == null ? void 0 : (_drawing$structure$tr2 = _drawing$structure$tr.members) == null ? void 0 : _drawing$structure$tr2.Direction;
|
|
@@ -15783,16 +16091,17 @@ const useCsysMatrix = (drawingId, csysId, flip, reoriented) => {
|
|
|
15783
16091
|
return (_drawing$structure$tr5 = drawing.structure.tree[zAxisId]) == null ? void 0 : (_drawing$structure$tr6 = _drawing$structure$tr5.members) == null ? void 0 : _drawing$structure$tr6.Direction;
|
|
15784
16092
|
});
|
|
15785
16093
|
const matrix = React.useMemo(() => {
|
|
15786
|
-
|
|
16094
|
+
var _csys$members;
|
|
16095
|
+
if (!csys || !xAxis || !yAxis || !zAxis) {
|
|
15787
16096
|
return new THREE__namespace.Matrix4();
|
|
15788
16097
|
}
|
|
15789
|
-
const pos = convertToVector(csys.members.Position);
|
|
16098
|
+
const pos = convertToVector((_csys$members = csys.members) == null ? void 0 : _csys$members.Position);
|
|
15790
16099
|
const [xDir, yDir, zDir] = [xAxis, yAxis, zAxis].map(axis => convertToVector(axis));
|
|
15791
16100
|
const baseMatrix = new THREE__namespace.Matrix4().makeBasis(xDir, yDir, zDir);
|
|
15792
16101
|
const flipMatrix = flip !== undefined ? getFlipMatrix(flip, xDir, yDir) : new THREE__namespace.Matrix4();
|
|
15793
16102
|
const reorientedMatrix = reoriented !== undefined ? getReorientedMatrix(reoriented, zDir.clone().transformDirection(flipMatrix)) : new THREE__namespace.Matrix4();
|
|
15794
16103
|
return reorientedMatrix.multiply(flipMatrix).multiply(baseMatrix).setPosition(pos);
|
|
15795
|
-
}, [csys
|
|
16104
|
+
}, [csys, xAxis, yAxis, zAxis, flip, reoriented]);
|
|
15796
16105
|
return matrix;
|
|
15797
16106
|
};
|
|
15798
16107
|
|
|
@@ -16218,26 +16527,15 @@ function RootImpl$7({
|
|
|
16218
16527
|
const yOffset = useNumParam(drawingId, objectId, Members$5.YOffset);
|
|
16219
16528
|
const zOffset = useNumParam(drawingId, objectId, Members$5.ZOffset);
|
|
16220
16529
|
const selOrder = useSelectorsOrder(drawingId);
|
|
16221
|
-
|
|
16222
|
-
/* const preview = React.useCallback(() => {
|
|
16223
|
-
return ccAPI.assemblyBuilder
|
|
16224
|
-
.previewFastenedConstraint(
|
|
16225
|
-
drawingId,
|
|
16226
|
-
objectId,
|
|
16227
|
-
mate1Ref.serverValue as MateParam,
|
|
16228
|
-
mate2Ref.serverValue as MateParam,
|
|
16229
|
-
xOffset.serverValue,
|
|
16230
|
-
yOffset.serverValue,
|
|
16231
|
-
zOffset.serverValue,
|
|
16232
|
-
)
|
|
16233
|
-
.catch()
|
|
16234
|
-
}, [drawingId, objectId, mate1Ref, mate2Ref, xOffset, yOffset, zOffset]) */
|
|
16235
|
-
|
|
16236
|
-
/* const stopPreview = React.useRef<() => void>(() => void {}) */
|
|
16237
|
-
|
|
16238
16530
|
const update = React.useCallback(async () => {
|
|
16239
|
-
|
|
16240
|
-
|
|
16531
|
+
return classcad.ccAPI.assemblyBuilder.updateFastenedConstraints(drawingId, [{
|
|
16532
|
+
constrId: objectId,
|
|
16533
|
+
mate1: mate1Ref.serverValue,
|
|
16534
|
+
mate2: mate2Ref.serverValue,
|
|
16535
|
+
xOffset: xOffset.serverValue,
|
|
16536
|
+
yOffset: yOffset.serverValue,
|
|
16537
|
+
zOffset: zOffset.serverValue
|
|
16538
|
+
}]);
|
|
16241
16539
|
}, [drawingId, objectId, mate1Ref, mate2Ref, xOffset, yOffset, zOffset]);
|
|
16242
16540
|
return /*#__PURE__*/React.createElement(PluginForm, {
|
|
16243
16541
|
drawingId: drawingId,
|
|
@@ -16738,28 +17036,24 @@ function RootImpl$6({
|
|
|
16738
17036
|
forceNoLimits: limitsCollapsed
|
|
16739
17037
|
});
|
|
16740
17038
|
const selOrder = useSelectorsOrder(drawingId);
|
|
16741
|
-
|
|
16742
|
-
/* const preview = React.useCallback(() => {
|
|
16743
|
-
return ccAPI.assemblyBuilder.previewSliderConstraint(
|
|
16744
|
-
drawingId,
|
|
16745
|
-
objectId,
|
|
16746
|
-
mate1Ref.serverValue as MateParam,
|
|
16747
|
-
mate2Ref.serverValue as MateParam,
|
|
16748
|
-
xOffset.serverValue,
|
|
16749
|
-
yOffset.serverValue,
|
|
16750
|
-
zOffsetLimits.serverValue,
|
|
16751
|
-
)
|
|
16752
|
-
}, [drawingId, objectId, mate1Ref, mate2Ref, xOffset, yOffset, zOffsetLimits]) */
|
|
16753
|
-
|
|
16754
|
-
/* const stopPreview = React.useRef<() => void>(() => void {}) */
|
|
16755
17039
|
const [disableVals, setDisableVals] = React.useState(false);
|
|
16756
17040
|
const update = React.useCallback(async () => {
|
|
16757
|
-
/* stopPreview.current() */
|
|
16758
17041
|
setDisableVals(true);
|
|
16759
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17042
|
+
return classcad.ccAPI.assemblyBuilder.updateSliderConstraints(drawingId, [{
|
|
17043
|
+
constrId: objectId,
|
|
17044
|
+
mate1: mate1Ref.serverValue,
|
|
17045
|
+
mate2: mate2Ref.serverValue,
|
|
17046
|
+
xOffset: xOffset.serverValue,
|
|
17047
|
+
yOffset: yOffset.serverValue,
|
|
17048
|
+
zOffsetLimits: zOffsetLimits.serverValue
|
|
17049
|
+
}]).then(() => setDisableVals(false));
|
|
16760
17050
|
}, [drawingId, objectId, mate1Ref, mate2Ref, xOffset, yOffset, zOffsetLimits]);
|
|
16761
17051
|
const updateValue = React.useCallback(value => {
|
|
16762
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17052
|
+
return classcad.ccAPI.assemblyBuilder.update3DConstraintValues(drawingId, [{
|
|
17053
|
+
constrId: objectId,
|
|
17054
|
+
paramName: 'zOffsetValue',
|
|
17055
|
+
value
|
|
17056
|
+
}]);
|
|
16763
17057
|
}, [drawingId, objectId]);
|
|
16764
17058
|
const validate = React.useCallback(() => {
|
|
16765
17059
|
return validateLimits(zOffsetLimits.userValue, 'Offset Z');
|
|
@@ -16893,29 +17187,23 @@ function RootImpl$5({
|
|
|
16893
17187
|
forceNoLimits: limitsCollapsed
|
|
16894
17188
|
});
|
|
16895
17189
|
const selOrder = useSelectorsOrder(drawingId);
|
|
16896
|
-
|
|
16897
|
-
/* const preview = React.useCallback(() => {
|
|
16898
|
-
return ccAPI.assemblyBuilder
|
|
16899
|
-
.previewRevoluteConstraint(
|
|
16900
|
-
drawingId,
|
|
16901
|
-
objectId,
|
|
16902
|
-
mate1Ref.serverValue as MateParam,
|
|
16903
|
-
mate2Ref.serverValue as MateParam,
|
|
16904
|
-
zOffset.serverValue,
|
|
16905
|
-
zRotationLimits.serverValue,
|
|
16906
|
-
)
|
|
16907
|
-
.catch()
|
|
16908
|
-
}, [drawingId, objectId, mate1Ref, mate2Ref, zOffset, zRotationLimits]) */
|
|
16909
|
-
|
|
16910
|
-
/* const stopPreview = React.useRef<() => void>(() => void {}) */
|
|
16911
17190
|
const [disableVals, setDisableVals] = React.useState(false);
|
|
16912
17191
|
const update = React.useCallback(async () => {
|
|
16913
|
-
/* stopPreview.current() */
|
|
16914
17192
|
setDisableVals(true);
|
|
16915
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17193
|
+
return classcad.ccAPI.assemblyBuilder.updateRevoluteConstraints(drawingId, [{
|
|
17194
|
+
constrId: objectId,
|
|
17195
|
+
mate1: mate1Ref.serverValue,
|
|
17196
|
+
mate2: mate2Ref.serverValue,
|
|
17197
|
+
zOffset: zOffset.serverValue,
|
|
17198
|
+
zRotationLimits: zRotationLimits.serverValue
|
|
17199
|
+
}]).then(() => setDisableVals(false));
|
|
16916
17200
|
}, [drawingId, objectId, mate1Ref, mate2Ref, zOffset, zRotationLimits]);
|
|
16917
17201
|
const updateValue = React.useCallback(value => {
|
|
16918
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17202
|
+
return classcad.ccAPI.assemblyBuilder.update3DConstraintValues(drawingId, [{
|
|
17203
|
+
constrId: objectId,
|
|
17204
|
+
paramName: 'zRotationValue',
|
|
17205
|
+
value
|
|
17206
|
+
}]);
|
|
16919
17207
|
}, [drawingId, objectId]);
|
|
16920
17208
|
const validate = React.useCallback(() => {
|
|
16921
17209
|
return validateLimits(zRotationLimits.userValue, 'Rotation Z');
|
|
@@ -17048,32 +17336,30 @@ function RootImpl$4({
|
|
|
17048
17336
|
forceNoLimits: limitsCollapsed
|
|
17049
17337
|
});
|
|
17050
17338
|
const selOrder = useSelectorsOrder(drawingId);
|
|
17051
|
-
|
|
17052
|
-
/* const preview = React.useCallback(() => {
|
|
17053
|
-
return ccAPI.assemblyBuilder
|
|
17054
|
-
.previewCylindricalConstraint(
|
|
17055
|
-
drawingId,
|
|
17056
|
-
objectId,
|
|
17057
|
-
mate1Ref.serverValue as MateParam,
|
|
17058
|
-
mate2Ref.serverValue as MateParam,
|
|
17059
|
-
zOffsetLimits.serverValue,
|
|
17060
|
-
zRotationLimits.serverValue,
|
|
17061
|
-
)
|
|
17062
|
-
.catch()
|
|
17063
|
-
}, [drawingId, objectId, mate1Ref, mate2Ref, zOffsetLimits, zRotationLimits]) */
|
|
17064
|
-
|
|
17065
|
-
/* const stopPreview = React.useRef<() => void>(() => void {}) */
|
|
17066
17339
|
const [disableVals, setDisableVals] = React.useState(false);
|
|
17067
17340
|
const update = React.useCallback(async () => {
|
|
17068
|
-
/* stopPreview.current() */
|
|
17069
17341
|
setDisableVals(true);
|
|
17070
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17342
|
+
return classcad.ccAPI.assemblyBuilder.updateCylindricalConstraints(drawingId, [{
|
|
17343
|
+
constrId: objectId,
|
|
17344
|
+
mate1: mate1Ref.serverValue,
|
|
17345
|
+
mate2: mate2Ref.serverValue,
|
|
17346
|
+
zOffsetLimits: zOffsetLimits.serverValue,
|
|
17347
|
+
zRotationLimits: zRotationLimits.serverValue
|
|
17348
|
+
}]).then(() => setDisableVals(false));
|
|
17071
17349
|
}, [drawingId, objectId, mate1Ref, mate2Ref, zOffsetLimits, zRotationLimits]);
|
|
17072
17350
|
const updateOffset = React.useCallback(value => {
|
|
17073
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17351
|
+
return classcad.ccAPI.assemblyBuilder.update3DConstraintValues(drawingId, [{
|
|
17352
|
+
constrId: objectId,
|
|
17353
|
+
paramName: 'zOffsetValue',
|
|
17354
|
+
value
|
|
17355
|
+
}]);
|
|
17074
17356
|
}, [drawingId, objectId]);
|
|
17075
17357
|
const updateRotation = React.useCallback(value => {
|
|
17076
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17358
|
+
return classcad.ccAPI.assemblyBuilder.update3DConstraintValues(drawingId, [{
|
|
17359
|
+
constrId: objectId,
|
|
17360
|
+
paramName: 'zRotationValue',
|
|
17361
|
+
value
|
|
17362
|
+
}]);
|
|
17077
17363
|
}, [drawingId, objectId]);
|
|
17078
17364
|
const validate = React.useCallback(() => {
|
|
17079
17365
|
return [...validateLimits(zOffsetLimits.userValue, 'Offset Z'), ...validateLimits(zRotationLimits.userValue, 'Rotation Z')];
|
|
@@ -17220,37 +17506,39 @@ function RootImpl$3({
|
|
|
17220
17506
|
forceNoLimits: limitsCollapsed
|
|
17221
17507
|
});
|
|
17222
17508
|
const selOrder = useSelectorsOrder(drawingId);
|
|
17223
|
-
|
|
17224
|
-
/* const preview = React.useCallback(() => {
|
|
17225
|
-
return ccAPI.assemblyBuilder
|
|
17226
|
-
.previewPlanarConstraint(
|
|
17227
|
-
drawingId,
|
|
17228
|
-
objectId,
|
|
17229
|
-
mate1Ref.serverValue as MateParam,
|
|
17230
|
-
mate2Ref.serverValue as MateParam,
|
|
17231
|
-
zOffset.serverValue,
|
|
17232
|
-
xOffsetLimits.serverValue,
|
|
17233
|
-
yOffsetLimits.serverValue,
|
|
17234
|
-
zRotationLimits.serverValue,
|
|
17235
|
-
)
|
|
17236
|
-
.catch()
|
|
17237
|
-
}, [drawingId, objectId, mate1Ref, mate2Ref, zOffset, xOffsetLimits, yOffsetLimits, zRotationLimits]) */
|
|
17238
|
-
|
|
17239
|
-
/* const stopPreview = React.useRef<() => void>(() => void {}) */
|
|
17240
17509
|
const [disableVals, setDisableVals] = React.useState(false);
|
|
17241
17510
|
const update = React.useCallback(async () => {
|
|
17242
|
-
/* stopPreview.current() */
|
|
17243
17511
|
setDisableVals(true);
|
|
17244
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17512
|
+
return classcad.ccAPI.assemblyBuilder.updatePlanarConstraints(drawingId, [{
|
|
17513
|
+
constrId: objectId,
|
|
17514
|
+
mate1: mate1Ref.serverValue,
|
|
17515
|
+
mate2: mate2Ref.serverValue,
|
|
17516
|
+
zOffset: zOffset.serverValue,
|
|
17517
|
+
xOffsetLimits: xOffsetLimits.serverValue,
|
|
17518
|
+
yOffsetLimits: yOffsetLimits.serverValue,
|
|
17519
|
+
zRotationLimits: zRotationLimits.serverValue
|
|
17520
|
+
}]).then(() => setDisableVals(false));
|
|
17245
17521
|
}, [drawingId, objectId, mate1Ref, mate2Ref, zOffset, xOffsetLimits, yOffsetLimits, zRotationLimits]);
|
|
17246
17522
|
const updateXOffset = React.useCallback(value => {
|
|
17247
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17523
|
+
return classcad.ccAPI.assemblyBuilder.update3DConstraintValues(drawingId, [{
|
|
17524
|
+
constrId: objectId,
|
|
17525
|
+
paramName: 'xOffsetValue',
|
|
17526
|
+
value
|
|
17527
|
+
}]);
|
|
17248
17528
|
}, [drawingId, objectId]);
|
|
17249
17529
|
const updateYOffset = React.useCallback(value => {
|
|
17250
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17530
|
+
return classcad.ccAPI.assemblyBuilder.update3DConstraintValues(drawingId, [{
|
|
17531
|
+
constrId: objectId,
|
|
17532
|
+
paramName: 'yOffsetValue',
|
|
17533
|
+
value
|
|
17534
|
+
}]);
|
|
17251
17535
|
}, [drawingId, objectId]);
|
|
17252
17536
|
const updateRotation = React.useCallback(value => {
|
|
17253
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17537
|
+
return classcad.ccAPI.assemblyBuilder.update3DConstraintValues(drawingId, [{
|
|
17538
|
+
constrId: objectId,
|
|
17539
|
+
paramName: 'zRotationValue',
|
|
17540
|
+
value
|
|
17541
|
+
}]);
|
|
17254
17542
|
}, [drawingId, objectId]);
|
|
17255
17543
|
const validate = React.useCallback(() => {
|
|
17256
17544
|
return [...validateLimits(xOffsetLimits.userValue, 'Offset X'), ...validateLimits(yOffsetLimits.userValue, 'Offset Y'), ...validateLimits(zRotationLimits.userValue, 'Rotation Z')];
|
|
@@ -17417,40 +17705,46 @@ function RootImpl$2({
|
|
|
17417
17705
|
forceNoLimits: limitsCollapsed
|
|
17418
17706
|
});
|
|
17419
17707
|
const selOrder = useSelectorsOrder(drawingId);
|
|
17420
|
-
|
|
17421
|
-
/* const preview = React.useCallback(() => {
|
|
17422
|
-
return ccAPI.assemblyBuilder
|
|
17423
|
-
.previewParallelConstraint(
|
|
17424
|
-
drawingId,
|
|
17425
|
-
objectId,
|
|
17426
|
-
mate1Ref.serverValue as MateParam,
|
|
17427
|
-
mate2Ref.serverValue as MateParam,
|
|
17428
|
-
xOffsetLimits.serverValue,
|
|
17429
|
-
yOffsetLimits.serverValue,
|
|
17430
|
-
zOffsetLimits.serverValue,
|
|
17431
|
-
zRotationLimits.serverValue,
|
|
17432
|
-
)
|
|
17433
|
-
.catch()
|
|
17434
|
-
}, [drawingId, objectId, mate1Ref, mate2Ref, xOffsetLimits, yOffsetLimits, zOffsetLimits, zRotationLimits]) */
|
|
17435
|
-
|
|
17436
|
-
/* const stopPreview = React.useRef<() => void>(() => void {}) */
|
|
17437
17708
|
const [disableVals, setDisableVals] = React.useState(false);
|
|
17438
17709
|
const update = React.useCallback(async () => {
|
|
17439
|
-
/* stopPreview.current() */
|
|
17440
17710
|
setDisableVals(true);
|
|
17441
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17711
|
+
return classcad.ccAPI.assemblyBuilder.updateParallelConstraints(drawingId, [{
|
|
17712
|
+
constrId: objectId,
|
|
17713
|
+
mate1: mate1Ref.serverValue,
|
|
17714
|
+
mate2: mate2Ref.serverValue,
|
|
17715
|
+
xOffsetLimits: xOffsetLimits.serverValue,
|
|
17716
|
+
yOffsetLimits: yOffsetLimits.serverValue,
|
|
17717
|
+
zOffsetLimits: zOffsetLimits.serverValue,
|
|
17718
|
+
zRotationLimits: zRotationLimits.serverValue
|
|
17719
|
+
}]).then(() => setDisableVals(false));
|
|
17442
17720
|
}, [drawingId, objectId, mate1Ref, mate2Ref, xOffsetLimits, yOffsetLimits, zOffsetLimits, zRotationLimits]);
|
|
17443
17721
|
const updateXOffset = React.useCallback(value => {
|
|
17444
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17722
|
+
return classcad.ccAPI.assemblyBuilder.update3DConstraintValues(drawingId, [{
|
|
17723
|
+
constrId: objectId,
|
|
17724
|
+
paramName: 'xOffsetValue',
|
|
17725
|
+
value
|
|
17726
|
+
}]);
|
|
17445
17727
|
}, [drawingId, objectId]);
|
|
17446
17728
|
const updateYOffset = React.useCallback(value => {
|
|
17447
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17729
|
+
return classcad.ccAPI.assemblyBuilder.update3DConstraintValues(drawingId, [{
|
|
17730
|
+
constrId: objectId,
|
|
17731
|
+
paramName: 'yOffsetValue',
|
|
17732
|
+
value
|
|
17733
|
+
}]);
|
|
17448
17734
|
}, [drawingId, objectId]);
|
|
17449
17735
|
const updateZOffset = React.useCallback(value => {
|
|
17450
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17736
|
+
return classcad.ccAPI.assemblyBuilder.update3DConstraintValues(drawingId, [{
|
|
17737
|
+
constrId: objectId,
|
|
17738
|
+
paramName: 'zOffsetValue',
|
|
17739
|
+
value
|
|
17740
|
+
}]);
|
|
17451
17741
|
}, [drawingId, objectId]);
|
|
17452
17742
|
const updateRotation = React.useCallback(value => {
|
|
17453
|
-
return classcad.ccAPI.assemblyBuilder.
|
|
17743
|
+
return classcad.ccAPI.assemblyBuilder.update3DConstraintValues(drawingId, [{
|
|
17744
|
+
constrId: objectId,
|
|
17745
|
+
paramName: 'zRotationValue',
|
|
17746
|
+
value
|
|
17747
|
+
}]);
|
|
17454
17748
|
}, [drawingId, objectId]);
|
|
17455
17749
|
const validate = React.useCallback(() => {
|
|
17456
17750
|
return [...validateLimits(xOffsetLimits.userValue, 'Offset X'), ...validateLimits(yOffsetLimits.userValue, 'Offset Y'), ...validateLimits(zOffsetLimits.userValue, 'Offset Z'), ...validateLimits(zRotationLimits.userValue, 'Rotation Z')];
|
|
@@ -17839,18 +18133,22 @@ function useMenuItems$2(drawingId, prodId, setEditName, pluginId) {
|
|
|
17839
18133
|
icon: /*#__PURE__*/React.createElement(icons.PlusSquareOutlined, null),
|
|
17840
18134
|
callback: () => {
|
|
17841
18135
|
const curNodeId = core.getDrawing(drawingId).structure.currentNode;
|
|
17842
|
-
classcad.ccAPI.assemblyBuilder.
|
|
17843
|
-
|
|
17844
|
-
|
|
17845
|
-
|
|
17846
|
-
|
|
17847
|
-
|
|
17848
|
-
|
|
17849
|
-
|
|
17850
|
-
|
|
17851
|
-
|
|
17852
|
-
|
|
17853
|
-
|
|
18136
|
+
classcad.ccAPI.assemblyBuilder.addNodes(drawingId, [{
|
|
18137
|
+
referenceId: prodId,
|
|
18138
|
+
ownerId: curNodeId,
|
|
18139
|
+
transformation: [{
|
|
18140
|
+
x: 0,
|
|
18141
|
+
y: 0,
|
|
18142
|
+
z: 0
|
|
18143
|
+
}, {
|
|
18144
|
+
x: 1,
|
|
18145
|
+
y: 0,
|
|
18146
|
+
z: 0
|
|
18147
|
+
}, {
|
|
18148
|
+
x: 0,
|
|
18149
|
+
y: 1,
|
|
18150
|
+
z: 0
|
|
18151
|
+
}]
|
|
17854
18152
|
}]).catch(console.warn);
|
|
17855
18153
|
}
|
|
17856
18154
|
},
|
|
@@ -17879,7 +18177,7 @@ function useMenuItems$2(drawingId, prodId, setEditName, pluginId) {
|
|
|
17879
18177
|
caption: 'delete',
|
|
17880
18178
|
icon: /*#__PURE__*/React.createElement(icons.DeleteOutlined, null),
|
|
17881
18179
|
callback: () => {
|
|
17882
|
-
classcad.ccAPI.baseModeler.
|
|
18180
|
+
classcad.ccAPI.baseModeler.deleteObjects(drawingId, [prodId]).catch(console.warn);
|
|
17883
18181
|
}
|
|
17884
18182
|
}
|
|
17885
18183
|
};
|
|
@@ -18336,14 +18634,18 @@ const ViewImpl = ({
|
|
|
18336
18634
|
y: pos.y,
|
|
18337
18635
|
z: pos.z
|
|
18338
18636
|
};
|
|
18339
|
-
classcad.ccAPI.assemblyBuilder.
|
|
18340
|
-
|
|
18341
|
-
|
|
18342
|
-
|
|
18343
|
-
|
|
18344
|
-
|
|
18345
|
-
|
|
18346
|
-
|
|
18637
|
+
classcad.ccAPI.assemblyBuilder.addNodes(drawingId, [{
|
|
18638
|
+
referenceId: prodId,
|
|
18639
|
+
ownerId: currNodeId,
|
|
18640
|
+
transformation: [pos1, {
|
|
18641
|
+
x: 1,
|
|
18642
|
+
y: 0,
|
|
18643
|
+
z: 0
|
|
18644
|
+
}, {
|
|
18645
|
+
x: 0,
|
|
18646
|
+
y: 1,
|
|
18647
|
+
z: 0
|
|
18648
|
+
}]
|
|
18347
18649
|
}]).catch(console.warn);
|
|
18348
18650
|
}
|
|
18349
18651
|
};
|
|
@@ -18396,7 +18698,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
18396
18698
|
});
|
|
18397
18699
|
|
|
18398
18700
|
const load = (file, singleDrawingApp) => {
|
|
18399
|
-
return new Promise(
|
|
18701
|
+
return new Promise((resolve, reject) => {
|
|
18400
18702
|
try {
|
|
18401
18703
|
const reader = new FileReader();
|
|
18402
18704
|
reader.onload = async () => {
|
|
@@ -18584,6 +18886,7 @@ const HoveredConstraintDisplay = ({
|
|
|
18584
18886
|
const csysUDataArray_ = [];
|
|
18585
18887
|
const members = (_getDrawing = core.getDrawing(drawingId)) == null ? void 0 : (_getDrawing$structure = _getDrawing.structure.tree[hoveredConstrId]) == null ? void 0 : _getDrawing$structure.members;
|
|
18586
18888
|
if (members && members[mateNames$1[0]]) {
|
|
18889
|
+
const tree = core.getDrawing(drawingId).structure.tree;
|
|
18587
18890
|
mateNames$1.forEach(mateName => {
|
|
18588
18891
|
const member = members[mateName];
|
|
18589
18892
|
if (member && member.members.length > 2) {
|
|
@@ -18592,14 +18895,16 @@ const HoveredConstraintDisplay = ({
|
|
|
18592
18895
|
const csysId = member.members[1].value;
|
|
18593
18896
|
const flip = ((_member$members$ = member.members[2]) == null ? void 0 : _member$members$.value) !== undefined ? member.members[2].value : classcad.FlipType.FLIP_Z;
|
|
18594
18897
|
const reoriented = ((_member$members$2 = member.members[3]) == null ? void 0 : _member$members$2.value) !== undefined ? member.members[3].value : classcad.ReorientedType.REORIENTED_0;
|
|
18595
|
-
|
|
18596
|
-
|
|
18597
|
-
|
|
18598
|
-
|
|
18599
|
-
|
|
18600
|
-
|
|
18601
|
-
|
|
18602
|
-
|
|
18898
|
+
if (matePath.every(id => tree[id]) && tree[csysId]) {
|
|
18899
|
+
csysUDataArray_.push({
|
|
18900
|
+
matePath,
|
|
18901
|
+
csysId,
|
|
18902
|
+
flip,
|
|
18903
|
+
reoriented,
|
|
18904
|
+
isSelected: true,
|
|
18905
|
+
onHUD: true
|
|
18906
|
+
});
|
|
18907
|
+
}
|
|
18603
18908
|
}
|
|
18604
18909
|
});
|
|
18605
18910
|
}
|
|
@@ -18753,7 +19058,7 @@ const fragmentCode$1 = `
|
|
|
18753
19058
|
class OutlineMaterial extends THREE__namespace.ShaderMaterial {
|
|
18754
19059
|
constructor(texelSize = new THREE__namespace.Vector2()) {
|
|
18755
19060
|
super({
|
|
18756
|
-
name:
|
|
19061
|
+
name: 'OutlineMaterial',
|
|
18757
19062
|
uniforms: {
|
|
18758
19063
|
inputBuffer: new THREE__namespace.Uniform(null),
|
|
18759
19064
|
texelSize: new THREE__namespace.Uniform(new THREE__namespace.Vector2()),
|
|
@@ -19034,16 +19339,20 @@ const Outline = /*#__PURE__*/React.forwardRef(function Outline(_ref, forwardRef)
|
|
|
19034
19339
|
|
|
19035
19340
|
const mateNames = ['firstRefMate', 'secondRefMate'];
|
|
19036
19341
|
const getMateRefIds = (drawingId, constrId) => {
|
|
19037
|
-
var
|
|
19342
|
+
var _tree$constrId;
|
|
19038
19343
|
const drawing = core.getDrawing(drawingId);
|
|
19039
|
-
const
|
|
19344
|
+
const tree = drawing.structure.tree;
|
|
19345
|
+
const members = (_tree$constrId = tree[constrId]) == null ? void 0 : _tree$constrId.members;
|
|
19040
19346
|
const pRefIds = [];
|
|
19041
19347
|
if (members && members[mateNames[0]]) {
|
|
19042
19348
|
mateNames.forEach(mateName => {
|
|
19043
|
-
var _member$members
|
|
19349
|
+
var _member$members$, _member$members$2;
|
|
19044
19350
|
const member = members[mateName];
|
|
19045
19351
|
const matePath = member == null ? void 0 : (_member$members$ = member.members[0]) == null ? void 0 : _member$members$.members;
|
|
19046
|
-
|
|
19352
|
+
const csysId = member == null ? void 0 : (_member$members$2 = member.members[1]) == null ? void 0 : _member$members$2.value;
|
|
19353
|
+
|
|
19354
|
+
// Only add a product ref id if every other id of this mate is valid
|
|
19355
|
+
if (matePath && matePath.length > 0 && matePath.every(mem => tree[mem.value]) && csysId && tree[csysId]) {
|
|
19047
19356
|
pRefIds.push(matePath[matePath.length - 1].value);
|
|
19048
19357
|
}
|
|
19049
19358
|
});
|
|
@@ -19052,12 +19361,12 @@ const getMateRefIds = (drawingId, constrId) => {
|
|
|
19052
19361
|
return;
|
|
19053
19362
|
}
|
|
19054
19363
|
const curNodeId = drawing.structure.currentNode;
|
|
19055
|
-
const curNode =
|
|
19364
|
+
const curNode = tree[curNodeId];
|
|
19056
19365
|
const curRefIds = (curNode == null ? void 0 : curNode.instances) || (curNode == null ? void 0 : curNode.children) || [];
|
|
19057
19366
|
const mateRefIds = [];
|
|
19058
19367
|
curRefIds.forEach(id => {
|
|
19059
|
-
var
|
|
19060
|
-
const productRefId = ((
|
|
19368
|
+
var _tree$id$members, _tree$id$members$prod;
|
|
19369
|
+
const productRefId = ((_tree$id$members = tree[id].members) == null ? void 0 : (_tree$id$members$prod = _tree$id$members.productRef) == null ? void 0 : _tree$id$members$prod.value) || id;
|
|
19061
19370
|
if (pRefIds.indexOf(productRefId) !== -1) {
|
|
19062
19371
|
mateRefIds.push(id);
|
|
19063
19372
|
}
|
|
@@ -19084,6 +19393,17 @@ const SectionHeader = ({
|
|
|
19084
19393
|
}, children);
|
|
19085
19394
|
};
|
|
19086
19395
|
|
|
19396
|
+
function usePrecheckErrorId$1(drawingId, constraintId) {
|
|
19397
|
+
const constraintChildren = useDrawingArr(drawingId, d => {
|
|
19398
|
+
var _d$structure$tree$con;
|
|
19399
|
+
return (_d$structure$tree$con = d.structure.tree[constraintId]) == null ? void 0 : _d$structure$tree$con.children;
|
|
19400
|
+
});
|
|
19401
|
+
const errorId = constraintChildren.find(chId => {
|
|
19402
|
+
var _getDrawing$structure;
|
|
19403
|
+
return ((_getDrawing$structure = core.getDrawing(drawingId).structure.tree[chId]) == null ? void 0 : _getDrawing$structure.class) === classcad.CCClasses.BMError;
|
|
19404
|
+
}) || null;
|
|
19405
|
+
return errorId;
|
|
19406
|
+
}
|
|
19087
19407
|
const SolverState = ({
|
|
19088
19408
|
drawingId
|
|
19089
19409
|
}) => {
|
|
@@ -19141,6 +19461,23 @@ const Constraints = ({
|
|
|
19141
19461
|
constrIds: constrIds
|
|
19142
19462
|
})));
|
|
19143
19463
|
};
|
|
19464
|
+
const ErrorWrapper$1 = styled.div`
|
|
19465
|
+
cursor: pointer;
|
|
19466
|
+
margin-right: 4px;
|
|
19467
|
+
`;
|
|
19468
|
+
const PrecheckError$1 = ({
|
|
19469
|
+
drawingId,
|
|
19470
|
+
errorId
|
|
19471
|
+
}) => {
|
|
19472
|
+
var _error$members;
|
|
19473
|
+
const error = react.useDrawing(drawingId, d => d.structure.tree[errorId]);
|
|
19474
|
+
const title = (error == null ? void 0 : (_error$members = error.members) == null ? void 0 : _error$members.errorMessage.value) || '';
|
|
19475
|
+
return /*#__PURE__*/React.createElement(ErrorWrapper$1, null, /*#__PURE__*/React.createElement(antd.Tooltip, {
|
|
19476
|
+
title: title
|
|
19477
|
+
}, /*#__PURE__*/React.createElement(icons.ExclamationCircleTwoTone, {
|
|
19478
|
+
twoToneColor: "#ff5f5f"
|
|
19479
|
+
})));
|
|
19480
|
+
};
|
|
19144
19481
|
const Constraint = ({
|
|
19145
19482
|
drawingId,
|
|
19146
19483
|
constraintId
|
|
@@ -19150,13 +19487,14 @@ const Constraint = ({
|
|
|
19150
19487
|
return (_d$interaction$hovere = d.interaction.hovered) == null ? void 0 : _d$interaction$hovere.objectId;
|
|
19151
19488
|
});
|
|
19152
19489
|
const name = react.useDrawing(drawingId, d => {
|
|
19153
|
-
var _d$structure$tree$
|
|
19154
|
-
return (_d$structure$tree$
|
|
19490
|
+
var _d$structure$tree$con2;
|
|
19491
|
+
return (_d$structure$tree$con2 = d.structure.tree[constraintId]) == null ? void 0 : _d$structure$tree$con2.name;
|
|
19155
19492
|
});
|
|
19156
19493
|
const isActive = react.useDrawing(drawingId, d => d.plugin.active.feature === constraintId);
|
|
19157
19494
|
const isHovered = hoveredId === constraintId;
|
|
19158
19495
|
const [rename, setRename] = React.useState(false);
|
|
19159
19496
|
const menuItems = useMenuItems$4(drawingId, constraintId, isActive, setRename);
|
|
19497
|
+
const errorId = usePrecheckErrorId$1(drawingId, constraintId);
|
|
19160
19498
|
const onDoubleClick = React.useCallback(() => {
|
|
19161
19499
|
core.getDrawing(drawingId).api.plugin.setActiveFeature(constraintId);
|
|
19162
19500
|
}, [drawingId, constraintId]);
|
|
@@ -19188,7 +19526,14 @@ const Constraint = ({
|
|
|
19188
19526
|
onDoubleClick: onDoubleClick,
|
|
19189
19527
|
onMouseEnter: onMouseEnter,
|
|
19190
19528
|
onMouseLeave: onMouseLeave
|
|
19191
|
-
}, /*#__PURE__*/React.createElement(antd.Space,
|
|
19529
|
+
}, /*#__PURE__*/React.createElement(antd.Space, {
|
|
19530
|
+
style: {
|
|
19531
|
+
flex: 1
|
|
19532
|
+
}
|
|
19533
|
+
}, nameComponent), errorId && /*#__PURE__*/React.createElement(PrecheckError$1, {
|
|
19534
|
+
drawingId: drawingId,
|
|
19535
|
+
errorId: errorId
|
|
19536
|
+
}), /*#__PURE__*/React.createElement(Menu, {
|
|
19192
19537
|
items: menuItems
|
|
19193
19538
|
}));
|
|
19194
19539
|
};
|
|
@@ -20013,35 +20358,8 @@ const draggableModalReducer = (state, action) => {
|
|
|
20013
20358
|
}
|
|
20014
20359
|
};
|
|
20015
20360
|
|
|
20016
|
-
|
|
20017
|
-
|
|
20018
|
-
var insertAt = ref.insertAt;
|
|
20019
|
-
|
|
20020
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
20021
|
-
|
|
20022
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
20023
|
-
var style = document.createElement('style');
|
|
20024
|
-
style.type = 'text/css';
|
|
20025
|
-
|
|
20026
|
-
if (insertAt === 'top') {
|
|
20027
|
-
if (head.firstChild) {
|
|
20028
|
-
head.insertBefore(style, head.firstChild);
|
|
20029
|
-
} else {
|
|
20030
|
-
head.appendChild(style);
|
|
20031
|
-
}
|
|
20032
|
-
} else {
|
|
20033
|
-
head.appendChild(style);
|
|
20034
|
-
}
|
|
20035
|
-
|
|
20036
|
-
if (style.styleSheet) {
|
|
20037
|
-
style.styleSheet.cssText = css;
|
|
20038
|
-
} else {
|
|
20039
|
-
style.appendChild(document.createTextNode(css));
|
|
20040
|
-
}
|
|
20041
|
-
}
|
|
20042
|
-
|
|
20043
|
-
var css_248z$1 = "/**\n * NOTE: This is not compiled.\n */\n\n.ant-design-draggable-modal {\n pointer-events: none;\n overflow: hidden !important;\n}\n\n.ant-design-draggable-modal .ant-modal {\n display: flex;\n max-width: none;\n transform-origin: 50% 50% !important;\n}\n\n.ant-design-draggable-modal .ant-modal-content {\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n\n.ant-design-draggable-modal .ant-modal-header {\n flex: 0;\n padding: 0;\n}\n\n.ant-design-draggable-modal .ant-modal-footer {\n flex: 0;\n padding: 16px;\n}\n\n.ant-design-draggable-modal .ant-design-draggable-modal-title {\n cursor: move;\n padding: 16px;\n}\n\n.ant-design-draggable-modal .ant-design-draggable-modal-title::before {\n content: '\\00a0';\n}\n\n.ant-design-draggable-modal .ant-modal-body {\n flex: 1;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 16px;\n}\n\n.ant-design-draggable-modal-resize-handle-inner {\n width: 12px;\n right: 14px;\n border: 2px solid grey;\n height: 12px;\n bottom: 14px;\n position: absolute;\n border-top: 0;\n border-left: 0;\n}\n\n.ant-design-draggable-modal-resize-handle {\n right: -10px;\n width: 44px;\n bottom: -10px;\n cursor: se-resize;\n height: 44px;\n position: absolute;\n}\n";
|
|
20044
|
-
styleInject(css_248z$1);
|
|
20361
|
+
var css_248z$3 = "/**\n * NOTE: This is not compiled.\n */\n\n.ant-design-draggable-modal {\n pointer-events: none;\n overflow: hidden !important;\n}\n\n.ant-design-draggable-modal .ant-modal {\n display: flex;\n max-width: none;\n transform-origin: 50% 50% !important;\n}\n\n.ant-design-draggable-modal .ant-modal-content {\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n\n.ant-design-draggable-modal .ant-modal-header {\n flex: 0;\n padding: 0;\n}\n\n.ant-design-draggable-modal .ant-modal-footer {\n flex: 0;\n padding: 16px;\n}\n\n.ant-design-draggable-modal .ant-design-draggable-modal-title {\n cursor: move;\n padding: 16px;\n}\n\n.ant-design-draggable-modal .ant-design-draggable-modal-title::before {\n content: '\\00a0';\n}\n\n.ant-design-draggable-modal .ant-modal-body {\n flex: 1;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 16px;\n}\n\n.ant-design-draggable-modal-resize-handle-inner {\n width: 12px;\n right: 14px;\n border: 2px solid grey;\n height: 12px;\n bottom: 14px;\n position: absolute;\n border-top: 0;\n border-left: 0;\n}\n\n.ant-design-draggable-modal-resize-handle {\n right: -10px;\n width: 44px;\n bottom: -10px;\n cursor: se-resize;\n height: 44px;\n position: absolute;\n}\n";
|
|
20362
|
+
styleInject(css_248z$3);
|
|
20045
20363
|
|
|
20046
20364
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20047
20365
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -20545,7 +20863,7 @@ function useMenuItems$1(drawingId, objectId, setRename) {
|
|
|
20545
20863
|
caption: 'delete',
|
|
20546
20864
|
icon: /*#__PURE__*/React.createElement(icons.DeleteOutlined, null),
|
|
20547
20865
|
callback: () => {
|
|
20548
|
-
classcad.ccAPI.baseModeler.
|
|
20866
|
+
classcad.ccAPI.baseModeler.deleteObjects(drawingId, [objectId]).catch(console.warn);
|
|
20549
20867
|
}
|
|
20550
20868
|
}
|
|
20551
20869
|
};
|
|
@@ -20758,6 +21076,9 @@ const ListPlaceholder = () => {
|
|
|
20758
21076
|
})));
|
|
20759
21077
|
};
|
|
20760
21078
|
|
|
21079
|
+
var css_248z$2 = ".header-dropdown .ant-dropdown-menu-root {\n margin-left: -10px;\n}\n";
|
|
21080
|
+
styleInject(css_248z$2);
|
|
21081
|
+
|
|
20761
21082
|
const fileTypes = ['ofb', 'stp', 'stl'];
|
|
20762
21083
|
|
|
20763
21084
|
/**
|
|
@@ -20811,13 +21132,10 @@ const ModelTreeHeader = ({
|
|
|
20811
21132
|
}, type),
|
|
20812
21133
|
key: type
|
|
20813
21134
|
}));
|
|
20814
|
-
const
|
|
20815
|
-
style: {
|
|
20816
|
-
marginLeft: '-10px'
|
|
20817
|
-
},
|
|
21135
|
+
const menuProps = {
|
|
20818
21136
|
items: menuItems,
|
|
20819
|
-
onClick
|
|
20820
|
-
}
|
|
21137
|
+
onClick
|
|
21138
|
+
};
|
|
20821
21139
|
const exportComponent = isFeatureActive ? /*#__PURE__*/React.createElement(antd.Tooltip, {
|
|
20822
21140
|
title: "All features should be closed before exporting",
|
|
20823
21141
|
placement: "left"
|
|
@@ -20826,7 +21144,8 @@ const ModelTreeHeader = ({
|
|
|
20826
21144
|
size: "small",
|
|
20827
21145
|
disabled: true
|
|
20828
21146
|
})) : /*#__PURE__*/React.createElement(antd.Dropdown, {
|
|
20829
|
-
|
|
21147
|
+
overlayClassName: "header-dropdown",
|
|
21148
|
+
menu: menuProps
|
|
20830
21149
|
}, /*#__PURE__*/React.createElement(antd.Button, {
|
|
20831
21150
|
icon: /*#__PURE__*/React.createElement(icons.ExportOutlined, null),
|
|
20832
21151
|
size: "small"
|
|
@@ -20999,8 +21318,8 @@ function useMenuItems(setEditName) {
|
|
|
20999
21318
|
}, [setEditName]);
|
|
21000
21319
|
}
|
|
21001
21320
|
|
|
21002
|
-
var css_248z = "/*\n The only way to customize color picker from react-colorful is using css classes, so we need this file here.\n*/\n.colorPicker .react-colorful {\n width: 100px;\n height: 100px;\n}\n.colorPicker .react-colorful__hue {\n height: 16px;\n}\n.colorPicker .react-colorful__pointer {\n width: 20px;\n height: 20px;\n}\n.colorPicker .react-colorful__saturation {\n border-radius: 4px 4px 0 0;\n}\n.colorPicker .react-colorful__last-control {\n border-radius: 0 0 4px 4px;\n}\n";
|
|
21003
|
-
styleInject(css_248z);
|
|
21321
|
+
var css_248z$1 = "/*\n The only way to customize color picker from react-colorful is using css classes, so we need this file here.\n*/\n.colorPicker .react-colorful {\n width: 100px;\n height: 100px;\n}\n\n.colorPicker .react-colorful__hue {\n height: 16px;\n}\n\n.colorPicker .react-colorful__pointer {\n width: 20px;\n height: 20px;\n}\n\n.colorPicker .react-colorful__saturation {\n border-radius: 4px 4px 0 0;\n}\n\n.colorPicker .react-colorful__last-control {\n border-radius: 0 0 4px 4px;\n}\n\n.colorPicker-dropdown {\n color: transparent;\n}\n\n.colorPicker-dropdown .ant-dropdown-menu-root {\n padding: 0px;\n background-color: transparent;\n box-shadow: none;\n}\n\n.colorPicker-dropdown .ant-dropdown-menu-root .ant-dropdown-menu-item {\n padding: 0px;\n color: transparent;\n}\n";
|
|
21322
|
+
styleInject(css_248z$1);
|
|
21004
21323
|
|
|
21005
21324
|
function get256Color(color) {
|
|
21006
21325
|
if (!color) return {
|
|
@@ -21099,8 +21418,8 @@ const ColorPicker = ({
|
|
|
21099
21418
|
});
|
|
21100
21419
|
setShowPicker(false);
|
|
21101
21420
|
}, [drawingId, solidId, r, g, b, opacity]);
|
|
21102
|
-
|
|
21103
|
-
|
|
21421
|
+
const menuItems = [{
|
|
21422
|
+
label: /*#__PURE__*/React.createElement("div", {
|
|
21104
21423
|
className: "colorPicker"
|
|
21105
21424
|
}, /*#__PURE__*/React.createElement(reactColorful.RgbaColorPicker, {
|
|
21106
21425
|
color: userColor,
|
|
@@ -21126,6 +21445,14 @@ const ColorPicker = ({
|
|
|
21126
21445
|
size: "small",
|
|
21127
21446
|
onClick: cancel
|
|
21128
21447
|
}))),
|
|
21448
|
+
key: 'colorPicker'
|
|
21449
|
+
}];
|
|
21450
|
+
const menuProps = {
|
|
21451
|
+
items: menuItems
|
|
21452
|
+
};
|
|
21453
|
+
return /*#__PURE__*/React.createElement(antd.Dropdown, {
|
|
21454
|
+
overlayClassName: "colorPicker-dropdown",
|
|
21455
|
+
menu: menuProps,
|
|
21129
21456
|
placement: "bottom",
|
|
21130
21457
|
open: showPicker
|
|
21131
21458
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -21336,6 +21663,9 @@ const SideBar = ({
|
|
|
21336
21663
|
}));
|
|
21337
21664
|
};
|
|
21338
21665
|
|
|
21666
|
+
var css_248z = ".toolbar-dropdown .ant-dropdown-menu-root {\n margin-left: -24px;\n}\n";
|
|
21667
|
+
styleInject(css_248z);
|
|
21668
|
+
|
|
21339
21669
|
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='M54.59 49.2615V54.9931H48.7075H42.8251V49.2615V43.5299H48.7075H54.59V49.2615Z' fill='%23C4C4C4'/%3e%3cpath d='M42.8251 43.5299L34.0767 35.0832M42.8251 43.5299V49.2615M42.8251 43.5299H48.7075M42.8251 54.9931L34.0767 64.1437M42.8251 54.9931V49.2615M42.8251 54.9931H48.7075M54.59 54.9931L63.0366 64.1437M54.59 54.9931V49.2615M54.59 54.9931H48.7075M54.59 43.5299L63.0366 35.0832M54.59 43.5299V49.2615M54.59 43.5299H48.7075M54.59 49.2615H79.1254M42.8251 49.2615H17.9879M48.7075 43.5299L48.7075 18.9944M48.7075 54.9931L48.7075 79.8303' stroke='black' stroke-width='4'/%3e%3c/svg%3e";
|
|
21340
21670
|
|
|
21341
21671
|
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%3cg clip-path='url(%23clip0)'%3e%3cpath d='M23.3951 -18.3953C26.7929 -27.63 31.0227 -40.7314 31.0227 -40.7314L38.6065 -18.3796L31.0008 -18.3874L23.3951 -18.3953Z' fill='%23C4C4C4'/%3e%3cpath d='M30.9497 33.7484L31.0008 -18.3874M31.0008 -18.3874L23.3951 -18.3953C26.7929 -27.63 31.0227 -40.7314 31.0227 -40.7314L38.6065 -18.3796L31.0008 -18.3874Z' stroke='%23C4C4C4' stroke-width='5'/%3e%3cpath d='M-19.6068 58.8999C-29.4464 58.8234 -43.2064 59.2709 -43.2064 59.2709L-24.7335 44.5785L-22.1701 51.7392L-19.6068 58.8999Z' fill='%23C4C4C4'/%3e%3cpath d='M26.9146 34.1651L-22.1701 51.7392M-22.1701 51.7392L-19.6068 58.8999C-29.4464 58.8234 -43.2064 59.2709 -43.2064 59.2709L-24.7335 44.5785L-22.1701 51.7392Z' stroke='%23C4C4C4' stroke-width='5'/%3e%3cpath d='M71.7906 62.6511C76.2149 71.4403 82.8953 83.4781 82.8953 83.4781L61.3896 73.7508L66.5901 68.201L71.7906 62.6511Z' fill='black'/%3e%3cpath d='M28.5445 32.5543L66.5901 68.201M66.5901 68.201L71.7906 62.6511C76.2149 71.4403 82.8953 83.4781 82.8953 83.4781L61.3896 73.7508L66.5901 68.201Z' stroke='black' stroke-width='5'/%3e%3ccircle cx='30.9862' cy='33.7406' r='14.6466' transform='rotate(10.304 30.9862 33.7406)' fill='%23C4C4C4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0'%3e%3crect width='100' height='100' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
@@ -21408,25 +21738,25 @@ const PartModeCmds = (drawingId, rootId) => {
|
|
|
21408
21738
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
21409
21739
|
url: img$p
|
|
21410
21740
|
}),
|
|
21411
|
-
callback: wrapper(() => featureApi.
|
|
21741
|
+
callback: wrapper(() => featureApi.createWorkGeometry(drawingId, rootId, classcad.CCClasses.CCWorkPoint, 'WorkPoint'))
|
|
21412
21742
|
}, {
|
|
21413
21743
|
label: 'Workaxis',
|
|
21414
21744
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
21415
21745
|
url: img$o
|
|
21416
21746
|
}),
|
|
21417
|
-
callback: wrapper(() => featureApi.
|
|
21747
|
+
callback: wrapper(() => featureApi.createWorkGeometry(drawingId, rootId, classcad.CCClasses.CCWorkAxis, 'WorkAxis'))
|
|
21418
21748
|
}, {
|
|
21419
21749
|
label: 'Workplane',
|
|
21420
21750
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
21421
21751
|
url: img$n
|
|
21422
21752
|
}),
|
|
21423
|
-
callback: wrapper(() => featureApi.
|
|
21753
|
+
callback: wrapper(() => featureApi.createWorkGeometry(drawingId, rootId, classcad.CCClasses.CCWorkPlane, 'WorkPlane'))
|
|
21424
21754
|
}, {
|
|
21425
21755
|
label: 'WCsys',
|
|
21426
21756
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
21427
21757
|
url: img$m
|
|
21428
21758
|
}),
|
|
21429
|
-
callback: wrapper(() => featureApi.
|
|
21759
|
+
callback: wrapper(() => featureApi.createWorkGeometry(drawingId, rootId, classcad.CCClasses.CCWorkCoordSystem, 'WorkCoordSystem'))
|
|
21430
21760
|
}],
|
|
21431
21761
|
Solid: [{
|
|
21432
21762
|
label: 'Extrusion',
|
|
@@ -21688,15 +22018,10 @@ const SubGroup = ({
|
|
|
21688
22018
|
}, command.icon),
|
|
21689
22019
|
key: command.label
|
|
21690
22020
|
}));
|
|
21691
|
-
|
|
21692
|
-
// Menu appears right under arrow button, but it should be under feature button, so it's shifter for feature button width to the left
|
|
21693
|
-
const menu = /*#__PURE__*/React.createElement(antd.Menu, {
|
|
22021
|
+
const menuProps = {
|
|
21694
22022
|
items: menuItems,
|
|
21695
|
-
onClick
|
|
21696
|
-
|
|
21697
|
-
marginLeft: '-24px'
|
|
21698
|
-
}
|
|
21699
|
-
});
|
|
22023
|
+
onClick
|
|
22024
|
+
};
|
|
21700
22025
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(antd.Button.Group, {
|
|
21701
22026
|
style: {
|
|
21702
22027
|
top: '1px'
|
|
@@ -21704,7 +22029,8 @@ const SubGroup = ({
|
|
|
21704
22029
|
}, /*#__PURE__*/React.createElement(FButton, {
|
|
21705
22030
|
command: commands[curCmdIdx]
|
|
21706
22031
|
}), /*#__PURE__*/React.createElement(antd.Dropdown, {
|
|
21707
|
-
|
|
22032
|
+
overlayClassName: "toolbar-dropdown",
|
|
22033
|
+
menu: menuProps
|
|
21708
22034
|
}, /*#__PURE__*/React.createElement(antd.Button, {
|
|
21709
22035
|
icon: /*#__PURE__*/React.createElement(icons.DownOutlined, null),
|
|
21710
22036
|
size: "small",
|