build-dxf 0.1.36 → 0.1.38
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/package.json
CHANGED
package/src/index.css
CHANGED
|
@@ -1169,10 +1169,10 @@ button[data-v-f2bc3db4]:active {
|
|
|
1169
1169
|
color: #a7a7a7
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
1172
|
-
[data-v-
|
|
1172
|
+
[data-v-b369d5e1] {
|
|
1173
1173
|
font-family: 宋体;
|
|
1174
1174
|
}
|
|
1175
|
-
.button[data-v-
|
|
1175
|
+
.button[data-v-b369d5e1] {
|
|
1176
1176
|
padding: 5px 10px;
|
|
1177
1177
|
border: none;
|
|
1178
1178
|
background: var(--primary-color);
|
package/src/index3.js
CHANGED
|
@@ -9707,37 +9707,43 @@ class RenderManager extends Component {
|
|
|
9707
9707
|
radius = radius ?? isMobileRef.value ? 0.08 : 0.06;
|
|
9708
9708
|
quadtree = quadtree ?? this.quadtree;
|
|
9709
9709
|
const editor = this.parent?.findComponentByName("Editor"), point = Point.from(editor.pointerPosition);
|
|
9710
|
-
let result =
|
|
9711
|
-
|
|
9712
|
-
|
|
9710
|
+
let result = {
|
|
9711
|
+
point: new THREE.Vector3(editor.pointerPosition.x, editor.pointerPosition.y, 0),
|
|
9712
|
+
find: false,
|
|
9713
|
+
line: void 0,
|
|
9714
|
+
mode: void 0
|
|
9715
|
+
};
|
|
9716
|
+
let queryResult = this.lineAdsorption.value ? quadtree.queryCircle(point, radius) : [];
|
|
9717
|
+
if (queryResult.length) {
|
|
9718
|
+
let projectList = queryResult.map((res) => ({
|
|
9713
9719
|
point: res.line.projectPoint(point),
|
|
9714
9720
|
line: res.line
|
|
9715
9721
|
})).filter((item) => !!item.point);
|
|
9716
9722
|
projectList.sort((a, b) => a.point.distance(point) - b.point.distance(point));
|
|
9717
9723
|
if (projectList.length) {
|
|
9718
|
-
const line2 = projectList[0].line, projectPoint = projectList[0].point
|
|
9724
|
+
const line2 = projectList[0].line, projectPoint = projectList[0].point;
|
|
9725
|
+
result = {
|
|
9719
9726
|
point: new THREE.Vector3(projectPoint.x, projectPoint.y, 0),
|
|
9720
9727
|
find: true,
|
|
9721
9728
|
mode: "line",
|
|
9722
9729
|
line: line2
|
|
9723
9730
|
};
|
|
9724
|
-
if (
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
+
if (this.pointAdsorption.value) {
|
|
9732
|
+
if (line2.start.distance(point) < radius * 1.5) {
|
|
9733
|
+
result.point.set(line2.start.x, line2.start.y, 0);
|
|
9734
|
+
result.mode = "point";
|
|
9735
|
+
} else if (line2.end.distance(point) < radius * 1.5) {
|
|
9736
|
+
result.point.set(line2.end.x, line2.end.y, 0);
|
|
9737
|
+
result.mode = "point";
|
|
9738
|
+
}
|
|
9731
9739
|
}
|
|
9732
|
-
return opt;
|
|
9733
9740
|
}
|
|
9734
9741
|
}
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
};
|
|
9742
|
+
this.dispatchEvent({
|
|
9743
|
+
type: "adsorptionPointChange",
|
|
9744
|
+
...result
|
|
9745
|
+
});
|
|
9746
|
+
return result;
|
|
9741
9747
|
}
|
|
9742
9748
|
/**
|
|
9743
9749
|
* 辅助线吸附
|
|
@@ -10641,6 +10647,7 @@ class CommandFlowComponent extends Component {
|
|
|
10641
10647
|
point.copy(pos);
|
|
10642
10648
|
onChange && onChange(point, opt2);
|
|
10643
10649
|
debouncing.cancle();
|
|
10650
|
+
e?.stopPropagation();
|
|
10644
10651
|
};
|
|
10645
10652
|
const mouseup = (e) => {
|
|
10646
10653
|
object3D.element.style.pointerEvents = "all";
|
|
@@ -11075,7 +11082,7 @@ class CommandFlowComponent extends Component {
|
|
|
11075
11082
|
`;
|
|
11076
11083
|
}
|
|
11077
11084
|
});
|
|
11078
|
-
textMesh.setText();
|
|
11085
|
+
textMesh.setText(opt?.text);
|
|
11079
11086
|
return textMesh;
|
|
11080
11087
|
}
|
|
11081
11088
|
/** 创建关闭按钮
|
|
@@ -11100,7 +11107,7 @@ class CommandFlowComponent extends Component {
|
|
|
11100
11107
|
`;
|
|
11101
11108
|
}
|
|
11102
11109
|
});
|
|
11103
|
-
textMesh.setText();
|
|
11110
|
+
textMesh.setText(opt?.text);
|
|
11104
11111
|
return textMesh;
|
|
11105
11112
|
}
|
|
11106
11113
|
/** 创建确认按钮
|
|
@@ -11125,7 +11132,7 @@ class CommandFlowComponent extends Component {
|
|
|
11125
11132
|
`;
|
|
11126
11133
|
}
|
|
11127
11134
|
});
|
|
11128
|
-
textMesh.setText();
|
|
11135
|
+
textMesh.setText(opt?.text);
|
|
11129
11136
|
return textMesh;
|
|
11130
11137
|
}
|
|
11131
11138
|
}
|
|
@@ -12722,7 +12729,7 @@ class DrawDoorLine extends CommandFlowComponent {
|
|
|
12722
12729
|
return data;
|
|
12723
12730
|
}
|
|
12724
12731
|
}
|
|
12725
|
-
function createPage$
|
|
12732
|
+
function createPage$1(drawLine) {
|
|
12726
12733
|
function View() {
|
|
12727
12734
|
return createVNode("div", {
|
|
12728
12735
|
"class": " z-20 absolute left-0 top-[50%] translate-y-[-50%] flex flex-col p-[10px] gap-[16px]",
|
|
@@ -12819,7 +12826,7 @@ class DrawLine extends CommandFlowComponent {
|
|
|
12819
12826
|
this.container.add(auxiliaryLine);
|
|
12820
12827
|
this.container.add(lineObj3D);
|
|
12821
12828
|
this.container.add(lineDashed);
|
|
12822
|
-
this.
|
|
12829
|
+
this.addCommandEndHandle(() => {
|
|
12823
12830
|
pointSelector.end();
|
|
12824
12831
|
auxiliaryLine.removeFromParent();
|
|
12825
12832
|
lineDashed.removeFromParent();
|
|
@@ -12876,7 +12883,7 @@ class DrawLine extends CommandFlowComponent {
|
|
|
12876
12883
|
const {
|
|
12877
12884
|
destroy: destroy1,
|
|
12878
12885
|
directionLock
|
|
12879
|
-
} = createPage$
|
|
12886
|
+
} = createPage$1(this);
|
|
12880
12887
|
const {
|
|
12881
12888
|
destroy: destroy2,
|
|
12882
12889
|
setPoint: setDragPoint
|
|
@@ -12902,7 +12909,7 @@ class DrawLine extends CommandFlowComponent {
|
|
|
12902
12909
|
updateData();
|
|
12903
12910
|
}
|
|
12904
12911
|
});
|
|
12905
|
-
this.
|
|
12912
|
+
this.addCommandEndHandle(destroy1, destroy2);
|
|
12906
12913
|
}
|
|
12907
12914
|
}
|
|
12908
12915
|
}
|
|
@@ -14138,61 +14145,48 @@ class ClippingLine extends CommandFlowComponent {
|
|
|
14138
14145
|
onAddFromParent(parent) {
|
|
14139
14146
|
super.onAddFromParent(parent);
|
|
14140
14147
|
this.editor.container.add(this.container);
|
|
14141
|
-
const commandFlow = this.
|
|
14142
|
-
|
|
14143
|
-
|
|
14144
|
-
this.
|
|
14145
|
-
this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName));
|
|
14146
|
-
this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
14148
|
+
const commandFlow = this.initCommandFlow({
|
|
14149
|
+
shortcutKeys: this.shortcutKeys
|
|
14150
|
+
});
|
|
14151
|
+
commandFlow.add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this)).add(this.selectPointEnd.bind(this)).add(this.end.bind(this));
|
|
14147
14152
|
}
|
|
14148
14153
|
/** 选择开始点
|
|
14149
14154
|
* @param next
|
|
14150
14155
|
*/
|
|
14151
|
-
selectPointStart(next) {
|
|
14152
|
-
let
|
|
14153
|
-
this.
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
this.container.add(circle);
|
|
14162
|
-
} else {
|
|
14163
|
-
this.domElement.style.cursor = "no-drop";
|
|
14164
|
-
currentPoint = null;
|
|
14165
|
-
circle.removeFromParent();
|
|
14166
|
-
}
|
|
14167
|
-
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
14168
|
-
if (this.eventInput.isKeyDown("mouse_0") && currentPoint) {
|
|
14169
|
-
this.cancelEventRecord("selectPointStart");
|
|
14170
|
-
next({ point: currentPoint, line: currentLine });
|
|
14156
|
+
async selectPointStart(next) {
|
|
14157
|
+
let circle = this.renderer.createCircle(Point.zero(), { color: 16711935 }, this.container);
|
|
14158
|
+
const pointSelector = this.createPointSelector({
|
|
14159
|
+
onMove(point2) {
|
|
14160
|
+
if (point2) {
|
|
14161
|
+
circle.position.set(point2?.x, point2?.y, 0);
|
|
14162
|
+
circle.visible = true;
|
|
14163
|
+
} else {
|
|
14164
|
+
circle.visible = false;
|
|
14165
|
+
}
|
|
14171
14166
|
}
|
|
14172
|
-
})
|
|
14173
|
-
this.addEventRecord("clear").add(() =>
|
|
14167
|
+
});
|
|
14168
|
+
this.addEventRecord("clear").add(() => {
|
|
14169
|
+
circle.removeFromParent();
|
|
14170
|
+
pointSelector.end();
|
|
14171
|
+
});
|
|
14172
|
+
const { point, line: line2 } = await pointSelector.next("line_point") ?? {};
|
|
14173
|
+
if (!point) return;
|
|
14174
|
+
circle.visible = true;
|
|
14175
|
+
pointSelector.end();
|
|
14176
|
+
next({ point, line: line2 });
|
|
14174
14177
|
}
|
|
14175
14178
|
/** 选择结束点
|
|
14176
14179
|
* @param next
|
|
14177
14180
|
*/
|
|
14178
|
-
selectPointEnd(next, { point, line: line2 }) {
|
|
14179
|
-
|
|
14180
|
-
this.addEventRecord("clear").add(() =>
|
|
14181
|
-
|
|
14182
|
-
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
this.container.add(circle);
|
|
14188
|
-
} else {
|
|
14189
|
-
this.domElement.style.cursor = "no-drop";
|
|
14190
|
-
currentPoint = null;
|
|
14191
|
-
circle.removeFromParent();
|
|
14192
|
-
}
|
|
14193
|
-
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
14194
|
-
if (this.eventInput.isKeyDown("mouse_0") && currentPoint) next({ line: line2, start: point, end: currentPoint });
|
|
14195
|
-
}));
|
|
14181
|
+
async selectPointEnd(next, { point, line: line2 }) {
|
|
14182
|
+
const pointSelector = this.createPointSelector({ targetLines: [line2] });
|
|
14183
|
+
this.addEventRecord("clear").add(() => {
|
|
14184
|
+
pointSelector.end();
|
|
14185
|
+
});
|
|
14186
|
+
const { point: p1 } = await pointSelector.next("line_point") ?? {};
|
|
14187
|
+
if (!point) return;
|
|
14188
|
+
pointSelector.end();
|
|
14189
|
+
next({ line: line2, start: point, end: p1 });
|
|
14196
14190
|
}
|
|
14197
14191
|
/**
|
|
14198
14192
|
* 结束处理
|
|
@@ -14200,7 +14194,7 @@ class ClippingLine extends CommandFlowComponent {
|
|
|
14200
14194
|
* @param points
|
|
14201
14195
|
*/
|
|
14202
14196
|
end(next, { start, end, line: line2 }) {
|
|
14203
|
-
const lines = LineSegment.clippingByLine(line2, new LineSegment(
|
|
14197
|
+
const lines = LineSegment.clippingByLine(line2, new LineSegment(start, end), (newLine) => {
|
|
14204
14198
|
recomputedWindowCenter(newLine);
|
|
14205
14199
|
});
|
|
14206
14200
|
next({
|
|
@@ -14210,7 +14204,7 @@ class ClippingLine extends CommandFlowComponent {
|
|
|
14210
14204
|
}
|
|
14211
14205
|
/** 执行完成
|
|
14212
14206
|
*/
|
|
14213
|
-
|
|
14207
|
+
onCompleted(data) {
|
|
14214
14208
|
this.renderManager.removeLine(data.oldLine);
|
|
14215
14209
|
this.renderManager.addLines(data.newLines);
|
|
14216
14210
|
this.renderManager.draw();
|
|
@@ -14218,7 +14212,7 @@ class ClippingLine extends CommandFlowComponent {
|
|
|
14218
14212
|
/** 回滚操作
|
|
14219
14213
|
* @param data
|
|
14220
14214
|
*/
|
|
14221
|
-
|
|
14215
|
+
onRollback(data) {
|
|
14222
14216
|
this.renderManager.addLine(data.oldLine);
|
|
14223
14217
|
this.renderManager.removeLines(data.newLines);
|
|
14224
14218
|
return data;
|
|
@@ -14227,8 +14221,8 @@ class ClippingLine extends CommandFlowComponent {
|
|
|
14227
14221
|
* @param data
|
|
14228
14222
|
* @returns
|
|
14229
14223
|
*/
|
|
14230
|
-
|
|
14231
|
-
this.
|
|
14224
|
+
onRevokeRollback(data) {
|
|
14225
|
+
this.onCompleted(data);
|
|
14232
14226
|
return data;
|
|
14233
14227
|
}
|
|
14234
14228
|
}
|
|
@@ -14506,194 +14500,6 @@ function modifyWindow(context, winLine, line2, index2) {
|
|
|
14506
14500
|
});
|
|
14507
14501
|
return promise;
|
|
14508
14502
|
}
|
|
14509
|
-
function createPage$1(context) {
|
|
14510
|
-
function View() {
|
|
14511
|
-
return createVNode("div", {
|
|
14512
|
-
"class": " z-20 absolute left-0 top-[50%] translate-y-[-50%] flex flex-col p-[10px] gap-[16px]",
|
|
14513
|
-
"onClick": (e) => e.stopPropagation(),
|
|
14514
|
-
"onPointerdown": (e) => e.stopPropagation()
|
|
14515
|
-
}, [createVNode("div", {
|
|
14516
|
-
"onClick": () => directionLock.value = !directionLock.value,
|
|
14517
|
-
"class": {
|
|
14518
|
-
"rounded-[100px] size-[40px] bg-[#717171] flex justify-center items-center transition-colors": true,
|
|
14519
|
-
"!bg-[var(--primary-color)]": directionLock.value
|
|
14520
|
-
}
|
|
14521
|
-
}, [createVNode("svg", {
|
|
14522
|
-
"fill": "#fff",
|
|
14523
|
-
"viewBox": "0 0 1109 1024",
|
|
14524
|
-
"version": "1.1",
|
|
14525
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
14526
|
-
"width": "26",
|
|
14527
|
-
"height": "26"
|
|
14528
|
-
}, [createVNode("path", {
|
|
14529
|
-
"d": "M988.06258 639.599977l121.007826-209.599699h-92.511867a31.551955 31.551955 0 0 0-0.367999-7.439989A510.943266 510.943266 0 0 0 511.999265 0.000896c-282.303594 0-511.999264 229.67967-511.999264 511.999264s229.67967 511.999264 511.999264 511.999264a510.015267 510.015267 0 0 0 350.399496-138.703801 32.479953 32.479953 0 0 0-44.463936-47.359932 445.35936 445.35936 0 0 1-305.95156 121.103826c-246.399646 0-447.023357-200.527712-447.023358-447.007357s200.559712-447.039357 447.039358-447.039357a445.967359 445.967359 0 0 1 439.359368 365.023475h-84.367879z",
|
|
14530
|
-
"p-id": "6529"
|
|
14531
|
-
}, null), createVNode("path", {
|
|
14532
|
-
"d": "M688.719011 469.456221H669.775038v-79.647885a156.223775 156.223775 0 0 0-312.447551 0v79.647885h-12.799981a29.103958 29.103958 0 0 0-29.007959 29.007958v195.663719a29.103958 29.103958 0 0 0 29.007959 29.007958h344.159505a29.087958 29.087958 0 0 0 28.975958-29.007958V498.464179a29.087958 29.087958 0 0 0-28.943958-29.007958z m-266.431617-79.647885a91.255869 91.255869 0 1 1 182.511737 0v79.647885H422.287394z"
|
|
14533
|
-
}, null)])])]);
|
|
14534
|
-
}
|
|
14535
|
-
const directionLock = ref(false);
|
|
14536
|
-
const destroy = context.createVueApp(View);
|
|
14537
|
-
return {
|
|
14538
|
-
directionLock,
|
|
14539
|
-
destroy
|
|
14540
|
-
};
|
|
14541
|
-
}
|
|
14542
|
-
function modifyDoor(context, line2) {
|
|
14543
|
-
function update() {
|
|
14544
|
-
lineMesh.setPoint(line2.start.toVector3(), line2.end.toVector3());
|
|
14545
|
-
group.position.copy(line2.center.toJson(0));
|
|
14546
|
-
width.value = mToMm(line2.length());
|
|
14547
|
-
}
|
|
14548
|
-
function end() {
|
|
14549
|
-
if (ended.value) return;
|
|
14550
|
-
ended.value = true;
|
|
14551
|
-
context.renderManager.addLine(oldLine);
|
|
14552
|
-
context.renderManager.draw();
|
|
14553
|
-
group.clear();
|
|
14554
|
-
group.removeFromParent();
|
|
14555
|
-
lineMesh.removeFromParent();
|
|
14556
|
-
destroy();
|
|
14557
|
-
}
|
|
14558
|
-
const {
|
|
14559
|
-
promise,
|
|
14560
|
-
resolve
|
|
14561
|
-
} = createPromise(), lineMesh = new (isMobileRef.value ? Lines : Lines2)([line2.start.toVector3(), line2.end.toVector3()], 16776960, {
|
|
14562
|
-
linewidth: 4
|
|
14563
|
-
}), group = new THREE.Group(), {
|
|
14564
|
-
destroy,
|
|
14565
|
-
directionLock
|
|
14566
|
-
} = createPage$1(context), lines = [], width = ref(0), dragging = ref(false), ended = ref(false), oldLine = line2;
|
|
14567
|
-
line2 = line2.clone();
|
|
14568
|
-
let baseLine = null;
|
|
14569
|
-
context.renderManager.removeLine(oldLine);
|
|
14570
|
-
lineMesh.position.z = 5e-3;
|
|
14571
|
-
context.container.add(lineMesh);
|
|
14572
|
-
context.container.add(group);
|
|
14573
|
-
line2.points.forEach((point, index2) => {
|
|
14574
|
-
const {
|
|
14575
|
-
dragPointMesh,
|
|
14576
|
-
setPoint
|
|
14577
|
-
} = context.createDragPoint(point, {
|
|
14578
|
-
size: 20,
|
|
14579
|
-
auxiliaryLine: true,
|
|
14580
|
-
onStart() {
|
|
14581
|
-
baseLine = line2.clone();
|
|
14582
|
-
dragging.value = true;
|
|
14583
|
-
},
|
|
14584
|
-
onEnd() {
|
|
14585
|
-
setPoint(point);
|
|
14586
|
-
dragging.value = false;
|
|
14587
|
-
},
|
|
14588
|
-
onChange(p, {
|
|
14589
|
-
line: sl
|
|
14590
|
-
}) {
|
|
14591
|
-
if (directionLock.value && baseLine) context.pointLineConstraint(p, baseLine, index2 === 0 ? baseLine.points[1] : baseLine.points[0]);
|
|
14592
|
-
point.copy(p);
|
|
14593
|
-
if (sl && sl.parallel(line2, 10) && line2.length() > 0.2) lines[index2] = sl;
|
|
14594
|
-
update();
|
|
14595
|
-
}
|
|
14596
|
-
});
|
|
14597
|
-
const btn = context.createEditButton({
|
|
14598
|
-
text: `L: ${mToMm(line2.length())}mm`,
|
|
14599
|
-
parent: dragPointMesh,
|
|
14600
|
-
style: {
|
|
14601
|
-
marginLeft: "20px",
|
|
14602
|
-
transform: "translateY(-50%)"
|
|
14603
|
-
},
|
|
14604
|
-
position: Point.zero(),
|
|
14605
|
-
freedom: true,
|
|
14606
|
-
async onClick() {
|
|
14607
|
-
const {
|
|
14608
|
-
promise: promise2,
|
|
14609
|
-
close: close2
|
|
14610
|
-
} = context.openWidthEditor({
|
|
14611
|
-
defaultWidth: width.value,
|
|
14612
|
-
showCancel: true,
|
|
14613
|
-
minWidth: 200
|
|
14614
|
-
});
|
|
14615
|
-
context.addCommandEndHandle(close2);
|
|
14616
|
-
const w = mmTom(await promise2), otherPoint = line2.getAnotherPoint(point), dir = point.direction(otherPoint);
|
|
14617
|
-
point.copy(otherPoint).add(dir.multiplyScalar(w));
|
|
14618
|
-
setPoint(point);
|
|
14619
|
-
update();
|
|
14620
|
-
}
|
|
14621
|
-
});
|
|
14622
|
-
watch(width, () => {
|
|
14623
|
-
btn.setText(width.value + "mm");
|
|
14624
|
-
});
|
|
14625
|
-
watch(dragging, () => {
|
|
14626
|
-
btn.visible = !dragging.value;
|
|
14627
|
-
});
|
|
14628
|
-
watch(ended, () => {
|
|
14629
|
-
btn.removeFromParent();
|
|
14630
|
-
dragPointMesh.removeFromParent();
|
|
14631
|
-
});
|
|
14632
|
-
});
|
|
14633
|
-
line2.points.forEach((point, i) => {
|
|
14634
|
-
const list1 = context.renderManager.quadtree.queryPoint(point).filter((item) => item.line !== line2);
|
|
14635
|
-
if (list1.length === 1) lines[i] = list1[0].line;
|
|
14636
|
-
else lines[i] = null;
|
|
14637
|
-
});
|
|
14638
|
-
context.addCommandEndHandle(end);
|
|
14639
|
-
update();
|
|
14640
|
-
context.showConfirm.value = true;
|
|
14641
|
-
context.awaitOnlyKeys(["enter"]).then(() => {
|
|
14642
|
-
end();
|
|
14643
|
-
const list = [{
|
|
14644
|
-
line: oldLine,
|
|
14645
|
-
old: {
|
|
14646
|
-
start: oldLine.start.toJson(0),
|
|
14647
|
-
end: oldLine.end.toJson(0)
|
|
14648
|
-
},
|
|
14649
|
-
new: {
|
|
14650
|
-
start: line2.start.toJson(0),
|
|
14651
|
-
end: line2.end.toJson(0)
|
|
14652
|
-
}
|
|
14653
|
-
}];
|
|
14654
|
-
lines.forEach((line22, i) => {
|
|
14655
|
-
if (!line22) return;
|
|
14656
|
-
if (line22 && line22.parallel(line2, 10)) {
|
|
14657
|
-
const pLine = line22.projectLineSegment(line2);
|
|
14658
|
-
if (!pLine || pLine.length() < 1e-3) {
|
|
14659
|
-
const line_ = line22.clone();
|
|
14660
|
-
if (line22.start.distance(line2.points[i]) < line22.end.distance(line2.points[i])) line_.start.copy(line2.points[i]);
|
|
14661
|
-
else line_.end.copy(line2.points[i]);
|
|
14662
|
-
list.push({
|
|
14663
|
-
line: line22,
|
|
14664
|
-
old: {
|
|
14665
|
-
start: line22.start.toJson(0),
|
|
14666
|
-
end: line22.end.toJson(0)
|
|
14667
|
-
},
|
|
14668
|
-
new: {
|
|
14669
|
-
start: line_.start.toJson(0),
|
|
14670
|
-
end: line_.end.toJson(0)
|
|
14671
|
-
}
|
|
14672
|
-
});
|
|
14673
|
-
return;
|
|
14674
|
-
}
|
|
14675
|
-
const results = LineSegment.clippingByLine(line22, pLine);
|
|
14676
|
-
if (!results.length) return;
|
|
14677
|
-
list.push({
|
|
14678
|
-
line: line22,
|
|
14679
|
-
old: {
|
|
14680
|
-
start: line22.start.toJson(0),
|
|
14681
|
-
end: line22.end.toJson(0)
|
|
14682
|
-
},
|
|
14683
|
-
new: {
|
|
14684
|
-
start: results[0].start.toJson(0),
|
|
14685
|
-
end: results[0].end.toJson(0)
|
|
14686
|
-
}
|
|
14687
|
-
});
|
|
14688
|
-
}
|
|
14689
|
-
});
|
|
14690
|
-
resolve({
|
|
14691
|
-
type: "door",
|
|
14692
|
-
list
|
|
14693
|
-
});
|
|
14694
|
-
});
|
|
14695
|
-
return promise;
|
|
14696
|
-
}
|
|
14697
14503
|
function createPage(context, opt) {
|
|
14698
14504
|
function View() {
|
|
14699
14505
|
return createVNode("div", {
|
|
@@ -14742,7 +14548,7 @@ function createPage(context, opt) {
|
|
|
14742
14548
|
}, null)])]), createVNode("div", {
|
|
14743
14549
|
"onClick": opt.onResetClick,
|
|
14744
14550
|
"class": {
|
|
14745
|
-
"rounded-[
|
|
14551
|
+
"rounded-[6px] size-[32px] bg-[#717171] flex justify-center items-center transition-colors": true,
|
|
14746
14552
|
"!bg-[var(--primary-color)] button": true
|
|
14747
14553
|
}
|
|
14748
14554
|
}, [createVNode("svg", {
|
|
@@ -14755,26 +14561,7 @@ function createPage(context, opt) {
|
|
|
14755
14561
|
"height": "20"
|
|
14756
14562
|
}, [createVNode("path", {
|
|
14757
14563
|
"d": "M502.714987 58.258904l-126.531056-54.617723a52.797131 52.797131 0 0 0-41.873587 96.855428A447.865322 447.865322 0 0 0 392.02307 946.707184a61.535967 61.535967 0 0 0 13.83649 1.820591 52.797131 52.797131 0 0 0 13.65443-103.773672 342.453118 342.453118 0 0 1-31.678278-651.771485l-8.374718 19.480321a52.615072 52.615072 0 0 0 27.855039 69.182448 51.522718 51.522718 0 0 0 20.572675 4.369418A52.797131 52.797131 0 0 0 476.498481 254.882703L530.205907 127.441352a52.979191 52.979191 0 0 0-27.49092-69.182448zM962.960326 509.765407A448.775617 448.775617 0 0 0 643.992829 68.090094a52.797131 52.797131 0 1 0-30.403866 101.042786A342.635177 342.635177 0 0 1 674.578753 801.059925a52.615072 52.615072 0 0 0-92.30395-50.612422l-71.913335 117.246043a52.433013 52.433013 0 0 0 17.295612 72.82363l117.063985 72.823629a52.797131 52.797131 0 1 0 54.617722-89.755123l-16.021198-10.013249A448.593558 448.593558 0 0 0 962.960326 509.765407z"
|
|
14758
|
-
}, null)])])
|
|
14759
|
-
"onClick": opt.onRevokeClick,
|
|
14760
|
-
"class": {
|
|
14761
|
-
"rounded-[100px] size-[32px] bg-[#717171] flex justify-center items-center transition-colors": true,
|
|
14762
|
-
"!bg-[var(--primary-color)] button": true
|
|
14763
|
-
}
|
|
14764
|
-
}, [createVNode("svg", {
|
|
14765
|
-
"fill": "#fff",
|
|
14766
|
-
"viewBox": "0 0 1024 1024",
|
|
14767
|
-
"version": "1.1",
|
|
14768
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
14769
|
-
"p-id": "44557",
|
|
14770
|
-
"width": "20",
|
|
14771
|
-
"height": "20"
|
|
14772
|
-
}, [createVNode("path", {
|
|
14773
|
-
"d": "M64 347.552L320 128v448z",
|
|
14774
|
-
"p-id": "44558"
|
|
14775
|
-
}, null), createVNode("path", {
|
|
14776
|
-
"d": "M265.472 896V784h377.824a200 200 0 1 0 0-400H240V272h403.296c172.32 0 312 139.68 312 312s-139.68 312-312 312H265.472z"
|
|
14777
|
-
}, null)])]) : ""]);
|
|
14564
|
+
}, null)])])]);
|
|
14778
14565
|
}
|
|
14779
14566
|
const directionLock = ref(false);
|
|
14780
14567
|
const follow = ref(true);
|
|
@@ -14807,6 +14594,7 @@ async function modifyLine(context, line2) {
|
|
|
14807
14594
|
value: newValue
|
|
14808
14595
|
}];
|
|
14809
14596
|
point.copy(newPoint);
|
|
14597
|
+
width.value = mToMm(line2.length());
|
|
14810
14598
|
if (follow.value) list.forEach((item) => {
|
|
14811
14599
|
if (item.point === point) item.list.forEach((item2) => {
|
|
14812
14600
|
records.push({
|
|
@@ -14857,14 +14645,13 @@ async function modifyLine(context, line2) {
|
|
|
14857
14645
|
setPoint(line2.end, oldLine.end.clone());
|
|
14858
14646
|
list[0].setDragPos(line2.start);
|
|
14859
14647
|
list[1].setDragPos(line2.end);
|
|
14860
|
-
}
|
|
14861
|
-
onRevokeClick: revoke
|
|
14648
|
+
}
|
|
14862
14649
|
}), {
|
|
14863
14650
|
promise,
|
|
14864
14651
|
resolve
|
|
14865
|
-
} = createPromise(), oldLine = line2, group = new Group(), linesMesh = new Lines([], 65280), linesMesh2 = new LineDashed([], 5745151),
|
|
14652
|
+
} = createPromise(), oldLine = line2, group = new Group(), linesMesh = new Lines([], 65280), linesMesh2 = new LineDashed([], 5745151), width = ref(mToMm(line2.length())), dragging = ref(false), ended = ref(false), ControlZ = context.awaitOnlyKeys(["Control", "Z"], {
|
|
14866
14653
|
once: false
|
|
14867
|
-
});
|
|
14654
|
+
}), recordsList = [];
|
|
14868
14655
|
context.renderManager.removeLine(line2);
|
|
14869
14656
|
group.add(linesMesh);
|
|
14870
14657
|
group.add(linesMesh2);
|
|
@@ -14879,8 +14666,7 @@ async function modifyLine(context, line2) {
|
|
|
14879
14666
|
const list2 = context.renderManager.pointVirtualGrid.queryPoint(point).map((item) => ({
|
|
14880
14667
|
line: item.userData,
|
|
14881
14668
|
point: item.point
|
|
14882
|
-
}))
|
|
14883
|
-
const olds = list2.map((item) => ({
|
|
14669
|
+
})), olds = list2.map((item) => ({
|
|
14884
14670
|
line: item.line,
|
|
14885
14671
|
start: item.line.start.toJson(),
|
|
14886
14672
|
end: item.line.end.toJson()
|
|
@@ -14888,7 +14674,8 @@ async function modifyLine(context, line2) {
|
|
|
14888
14674
|
list2.forEach((item) => context.renderManager.removeLine(item.line));
|
|
14889
14675
|
const {
|
|
14890
14676
|
setPoint: setDragPos,
|
|
14891
|
-
destroy: destroy2
|
|
14677
|
+
destroy: destroy2,
|
|
14678
|
+
dragPointMesh
|
|
14892
14679
|
} = context.createDragPoint(point, {
|
|
14893
14680
|
size: 20,
|
|
14894
14681
|
auxiliaryLine: true,
|
|
@@ -14896,16 +14683,50 @@ async function modifyLine(context, line2) {
|
|
|
14896
14683
|
baseLine = line2.clone();
|
|
14897
14684
|
dragging.value = true;
|
|
14898
14685
|
writeIndex = recordsList.length;
|
|
14686
|
+
textMesh.visible = true;
|
|
14687
|
+
textMesh.setText(width.value + "mm");
|
|
14688
|
+
textMesh.setPosition(line2.center);
|
|
14899
14689
|
},
|
|
14900
14690
|
onEnd() {
|
|
14901
14691
|
setDragPos(point);
|
|
14902
14692
|
dragging.value = false;
|
|
14693
|
+
textMesh.visible = false;
|
|
14903
14694
|
},
|
|
14904
14695
|
onChange(p) {
|
|
14905
14696
|
if (directionLock.value && baseLine) context.pointLineConstraint(p, baseLine, index2 === 0 ? baseLine.points[1] : baseLine.points[0]);
|
|
14906
14697
|
setPoint(point, p);
|
|
14698
|
+
textMesh.setText(width.value + "mm");
|
|
14699
|
+
textMesh.setPosition(line2.center);
|
|
14700
|
+
}
|
|
14701
|
+
}), textMesh = context.createButton({
|
|
14702
|
+
text: ""
|
|
14703
|
+
}), btn = context.createEditButton({
|
|
14704
|
+
text: width.value + "mm",
|
|
14705
|
+
parent: dragPointMesh,
|
|
14706
|
+
style: {
|
|
14707
|
+
marginLeft: "20px",
|
|
14708
|
+
transform: "translateY(-50%)"
|
|
14709
|
+
},
|
|
14710
|
+
position: Point.zero(),
|
|
14711
|
+
freedom: true,
|
|
14712
|
+
async onClick() {
|
|
14713
|
+
const {
|
|
14714
|
+
promise: promise2,
|
|
14715
|
+
close: close2
|
|
14716
|
+
} = context.openWidthEditor({
|
|
14717
|
+
defaultWidth: width.value,
|
|
14718
|
+
showCancel: true,
|
|
14719
|
+
minWidth: 200
|
|
14720
|
+
});
|
|
14721
|
+
context.addCommandEndHandle(close2);
|
|
14722
|
+
const w = mmTom(await promise2), otherPoint = line2.getAnotherPoint(point), dir = point.direction(otherPoint);
|
|
14723
|
+
setPoint(point, otherPoint.clone().add(dir.multiplyScalar(w)));
|
|
14724
|
+
setDragPos(point);
|
|
14907
14725
|
}
|
|
14908
14726
|
});
|
|
14727
|
+
textMesh.visible = false;
|
|
14728
|
+
watch(width, () => btn.setText(width.value + "mm"));
|
|
14729
|
+
watch(dragging, () => btn.visible = !dragging.value);
|
|
14909
14730
|
watch(ended, () => destroy2());
|
|
14910
14731
|
return {
|
|
14911
14732
|
point,
|
|
@@ -14997,7 +14818,7 @@ class PointDrag extends CommandFlowComponent {
|
|
|
14997
14818
|
lineSelector.end();
|
|
14998
14819
|
if (!line2) return;
|
|
14999
14820
|
if (line2.userData.isWinLine) next(await modifyWindow(this, line2, line2.currentData.line, line2.currentData.index));
|
|
15000
|
-
else if (line2.userData.isDoor) next(await
|
|
14821
|
+
else if (line2.userData.isDoor) next(await modifyLine(this, line2));
|
|
15001
14822
|
else next(await modifyLine(this, line2));
|
|
15002
14823
|
}
|
|
15003
14824
|
async verify(next, data) {
|
|
@@ -15020,6 +14841,7 @@ class PointDrag extends CommandFlowComponent {
|
|
|
15020
14841
|
data.list.forEach(({ line: line2, new: newData }) => {
|
|
15021
14842
|
line2.start.copy(newData.start);
|
|
15022
14843
|
line2.end.copy(newData.end);
|
|
14844
|
+
recomputedWindow(line2);
|
|
15023
14845
|
});
|
|
15024
14846
|
}
|
|
15025
14847
|
this.renderManager.draw();
|
|
@@ -15037,6 +14859,7 @@ class PointDrag extends CommandFlowComponent {
|
|
|
15037
14859
|
data.list.forEach(({ line: line2, old: newData }) => {
|
|
15038
14860
|
line2.start.copy(newData.start);
|
|
15039
14861
|
line2.end.copy(newData.end);
|
|
14862
|
+
recomputedWindow(line2);
|
|
15040
14863
|
});
|
|
15041
14864
|
}
|
|
15042
14865
|
this.renderManager.draw();
|
|
@@ -15301,17 +15124,21 @@ const _hoisted_12 = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[
|
|
|
15301
15124
|
const _hoisted_13 = ["onClick", "title"];
|
|
15302
15125
|
const _hoisted_14 = ["src"];
|
|
15303
15126
|
const _hoisted_15 = {
|
|
15304
|
-
|
|
15305
|
-
class: "
|
|
15306
|
-
};
|
|
15307
|
-
const _hoisted_16 = { class: "text-[
|
|
15308
|
-
const _hoisted_17 =
|
|
15309
|
-
const _hoisted_18 = ["
|
|
15310
|
-
const _hoisted_19 =
|
|
15311
|
-
const _hoisted_20 = ["
|
|
15312
|
-
const _hoisted_21 =
|
|
15313
|
-
const _hoisted_22 = ["
|
|
15314
|
-
const _hoisted_23 =
|
|
15127
|
+
style: { "--el-color-primary": "var(--primary-color)" },
|
|
15128
|
+
class: "absolute left-0 bottom-[calc(100%+5px)] p-[0_5px] flex flex-row items-center justify-between gap-[0px] mt-[10px] text-[10px]"
|
|
15129
|
+
};
|
|
15130
|
+
const _hoisted_16 = { class: "text-[14px] flex flex-row flex-wrap gap-[10px]" };
|
|
15131
|
+
const _hoisted_17 = ["onClick"];
|
|
15132
|
+
const _hoisted_18 = { class: "flex justify-center items-center size-[30px] bg-[#f0f0f0] rounded-[2px]" };
|
|
15133
|
+
const _hoisted_19 = ["src"];
|
|
15134
|
+
const _hoisted_20 = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]" };
|
|
15135
|
+
const _hoisted_21 = ["onClick", "title"];
|
|
15136
|
+
const _hoisted_22 = ["src"];
|
|
15137
|
+
const _hoisted_23 = {
|
|
15138
|
+
key: 1,
|
|
15139
|
+
class: "items-end box-border pointer-events-none p-[0_5px] w-full absolute left-[0px] top-0 flex gap-[5px]"
|
|
15140
|
+
};
|
|
15141
|
+
const _hoisted_24 = { class: "text-[#fff] rounded-[6px] p-[5px] text-nowrap" };
|
|
15315
15142
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
15316
15143
|
__name: "EditorToolContent",
|
|
15317
15144
|
props: {
|
|
@@ -15429,6 +15256,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15429
15256
|
command: MergeLine.commandName,
|
|
15430
15257
|
name: "合并",
|
|
15431
15258
|
src: images["../assets/images/mergeLine.svg"].default,
|
|
15259
|
+
show: computed(() => !isMobileRef.value),
|
|
15432
15260
|
disabled: computed(() => selectLineCount.value >= 2),
|
|
15433
15261
|
shortcut: MergeLine.shortcutKeys.join(" + ")
|
|
15434
15262
|
},
|
|
@@ -15436,6 +15264,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15436
15264
|
command: TwoPointConnection.commandName,
|
|
15437
15265
|
name: "两点连接",
|
|
15438
15266
|
disabled: computed(() => selectLineCount.value === 2),
|
|
15267
|
+
show: computed(() => !isMobileRef.value),
|
|
15439
15268
|
src: images["../assets/images/connection.svg"].default,
|
|
15440
15269
|
shortcut: TwoPointConnection.shortcutKeys.join(" + ")
|
|
15441
15270
|
},
|
|
@@ -15443,6 +15272,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15443
15272
|
command: TwoLineConnectionLine.commandName,
|
|
15444
15273
|
name: "两线连接",
|
|
15445
15274
|
disabled: computed(() => selectLineCount.value === 2),
|
|
15275
|
+
show: computed(() => !isMobileRef.value),
|
|
15446
15276
|
src: images["../assets/images/intersectionConnection.svg"].default,
|
|
15447
15277
|
shortcut: TwoLineConnectionLine.shortcutKeys.join(" + ")
|
|
15448
15278
|
},
|
|
@@ -15472,6 +15302,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15472
15302
|
command: ViewAngle.commandName,
|
|
15473
15303
|
name: "角度显示",
|
|
15474
15304
|
disabled: computed(() => selectLineCount.value === 2 && defaultComponent.selectLines[0].sameEndpoint(defaultComponent.selectLines[1])),
|
|
15305
|
+
show: computed(() => !isMobileRef.value),
|
|
15475
15306
|
src: images["../assets/images/angle.svg"].default,
|
|
15476
15307
|
shortcut: ViewAngle.shortcutKeys.join(" + ")
|
|
15477
15308
|
},
|
|
@@ -15593,7 +15424,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15593
15424
|
title: "取消命令(Esc)",
|
|
15594
15425
|
class: "active:scale-[0.7] transition-all flex items-center justify-center",
|
|
15595
15426
|
onClick: _cache[0] || (_cache[0] = (e) => (unref(editor).cancelCommand(), e.stopPropagation()))
|
|
15596
|
-
}, _cache[
|
|
15427
|
+
}, _cache[17] || (_cache[17] = [
|
|
15597
15428
|
createElementVNode("svg", {
|
|
15598
15429
|
fill: "#fff",
|
|
15599
15430
|
width: "16",
|
|
@@ -15611,7 +15442,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15611
15442
|
onClick: commandConfirm,
|
|
15612
15443
|
title: "确认命令(Enter)",
|
|
15613
15444
|
class: "active:scale-[0.7] transition-all flex items-center justify-center"
|
|
15614
|
-
}, _cache[
|
|
15445
|
+
}, _cache[18] || (_cache[18] = [
|
|
15615
15446
|
createElementVNode("svg", {
|
|
15616
15447
|
fill: "#fff",
|
|
15617
15448
|
width: "16",
|
|
@@ -15634,22 +15465,22 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15634
15465
|
modelValue: dxfVisible.value,
|
|
15635
15466
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => dxfVisible.value = $event)
|
|
15636
15467
|
}, {
|
|
15637
|
-
default: withCtx(() => _cache[
|
|
15468
|
+
default: withCtx(() => _cache[19] || (_cache[19] = [
|
|
15638
15469
|
createTextVNode("Dxf", -1)
|
|
15639
15470
|
])),
|
|
15640
15471
|
_: 1,
|
|
15641
|
-
__: [
|
|
15472
|
+
__: [19]
|
|
15642
15473
|
}, 8, ["modelValue"]),
|
|
15643
15474
|
createVNode(unref(ElCheckbox), {
|
|
15644
15475
|
size: "small",
|
|
15645
15476
|
modelValue: unref(editor).renderManager.lineAdsorption.value,
|
|
15646
15477
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(editor).renderManager.lineAdsorption.value = $event)
|
|
15647
15478
|
}, {
|
|
15648
|
-
default: withCtx(() => _cache[
|
|
15479
|
+
default: withCtx(() => _cache[20] || (_cache[20] = [
|
|
15649
15480
|
createTextVNode("线吸附", -1)
|
|
15650
15481
|
])),
|
|
15651
15482
|
_: 1,
|
|
15652
|
-
__: [
|
|
15483
|
+
__: [20]
|
|
15653
15484
|
}, 8, ["modelValue"]),
|
|
15654
15485
|
createVNode(unref(ElCheckbox), {
|
|
15655
15486
|
disabled: !unref(editor).renderManager.lineAdsorption.value,
|
|
@@ -15657,11 +15488,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15657
15488
|
modelValue: unref(editor).renderManager.pointAdsorption.value,
|
|
15658
15489
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(editor).renderManager.pointAdsorption.value = $event)
|
|
15659
15490
|
}, {
|
|
15660
|
-
default: withCtx(() => _cache[
|
|
15491
|
+
default: withCtx(() => _cache[21] || (_cache[21] = [
|
|
15661
15492
|
createTextVNode("点吸附", -1)
|
|
15662
15493
|
])),
|
|
15663
15494
|
_: 1,
|
|
15664
|
-
__: [
|
|
15495
|
+
__: [21]
|
|
15665
15496
|
}, 8, ["disabled", "modelValue"])
|
|
15666
15497
|
]),
|
|
15667
15498
|
_ctx.permission === "admin" ? (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
@@ -15671,11 +15502,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15671
15502
|
type: "success",
|
|
15672
15503
|
onClick: selectLocalFile
|
|
15673
15504
|
}, {
|
|
15674
|
-
default: withCtx(() => _cache[
|
|
15505
|
+
default: withCtx(() => _cache[22] || (_cache[22] = [
|
|
15675
15506
|
createTextVNode(" 选择文件 ", -1)
|
|
15676
15507
|
])),
|
|
15677
15508
|
_: 1,
|
|
15678
|
-
__: [
|
|
15509
|
+
__: [22]
|
|
15679
15510
|
}),
|
|
15680
15511
|
createVNode(unref(ElButton), {
|
|
15681
15512
|
style: { "padding": "5px", "font-size": "10px" },
|
|
@@ -15683,11 +15514,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15683
15514
|
type: "primary",
|
|
15684
15515
|
onClick: _cache[4] || (_cache[4] = ($event) => unref(dxfSystem).CorrectionDxf.downloadOriginalData("json.json"))
|
|
15685
15516
|
}, {
|
|
15686
|
-
default: withCtx(() => _cache[
|
|
15517
|
+
default: withCtx(() => _cache[23] || (_cache[23] = [
|
|
15687
15518
|
createTextVNode(" 下载Json ", -1)
|
|
15688
15519
|
])),
|
|
15689
15520
|
_: 1,
|
|
15690
|
-
__: [
|
|
15521
|
+
__: [23]
|
|
15691
15522
|
}),
|
|
15692
15523
|
createVNode(unref(ElButton), {
|
|
15693
15524
|
style: { "padding": "5px", "font-size": "10px" },
|
|
@@ -15695,11 +15526,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15695
15526
|
type: "primary",
|
|
15696
15527
|
onClick: _cache[5] || (_cache[5] = ($event) => unref(dxfSystem).CorrectionDxf.downloadDxf("test.dxf"))
|
|
15697
15528
|
}, {
|
|
15698
|
-
default: withCtx(() => _cache[
|
|
15529
|
+
default: withCtx(() => _cache[24] || (_cache[24] = [
|
|
15699
15530
|
createTextVNode(" 下载DXF ", -1)
|
|
15700
15531
|
])),
|
|
15701
15532
|
_: 1,
|
|
15702
|
-
__: [
|
|
15533
|
+
__: [24]
|
|
15703
15534
|
}),
|
|
15704
15535
|
createVNode(unref(ElButton), {
|
|
15705
15536
|
style: { "padding": "5px", "font-size": "10px" },
|
|
@@ -15707,11 +15538,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15707
15538
|
type: "primary",
|
|
15708
15539
|
onClick: _cache[6] || (_cache[6] = ($event) => unref(dxfSystem).CorrectionDxf.downloadDxfImage("dxf.jpg"))
|
|
15709
15540
|
}, {
|
|
15710
|
-
default: withCtx(() => _cache[
|
|
15541
|
+
default: withCtx(() => _cache[25] || (_cache[25] = [
|
|
15711
15542
|
createTextVNode(" 下载JPG ", -1)
|
|
15712
15543
|
])),
|
|
15713
15544
|
_: 1,
|
|
15714
|
-
__: [
|
|
15545
|
+
__: [25]
|
|
15715
15546
|
}),
|
|
15716
15547
|
createVNode(unref(ElButton), {
|
|
15717
15548
|
style: { "padding": "5px", "font-size": "10px" },
|
|
@@ -15719,11 +15550,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15719
15550
|
type: "primary",
|
|
15720
15551
|
onClick: _cache[7] || (_cache[7] = ($event) => unref(whiteModel).downloadGltf("test.glb", true))
|
|
15721
15552
|
}, {
|
|
15722
|
-
default: withCtx(() => _cache[
|
|
15553
|
+
default: withCtx(() => _cache[26] || (_cache[26] = [
|
|
15723
15554
|
createTextVNode(" 下载白膜 ", -1)
|
|
15724
15555
|
])),
|
|
15725
15556
|
_: 1,
|
|
15726
|
-
__: [
|
|
15557
|
+
__: [26]
|
|
15727
15558
|
}),
|
|
15728
15559
|
createVNode(unref(ElButton), {
|
|
15729
15560
|
style: { "padding": "5px", "font-size": "10px" },
|
|
@@ -15731,11 +15562,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15731
15562
|
type: "primary",
|
|
15732
15563
|
onClick: _cache[8] || (_cache[8] = ($event) => unref(threeVJia).download())
|
|
15733
15564
|
}, {
|
|
15734
|
-
default: withCtx(() => _cache[
|
|
15565
|
+
default: withCtx(() => _cache[27] || (_cache[27] = [
|
|
15735
15566
|
createTextVNode(" 下载三维家JSON ", -1)
|
|
15736
15567
|
])),
|
|
15737
15568
|
_: 1,
|
|
15738
|
-
__: [
|
|
15569
|
+
__: [27]
|
|
15739
15570
|
}),
|
|
15740
15571
|
createVNode(unref(ElDropdown), {
|
|
15741
15572
|
class: "ml-[5px]",
|
|
@@ -15755,11 +15586,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15755
15586
|
size: "small",
|
|
15756
15587
|
type: "primary"
|
|
15757
15588
|
}, {
|
|
15758
|
-
default: withCtx(() => _cache[
|
|
15589
|
+
default: withCtx(() => _cache[28] || (_cache[28] = [
|
|
15759
15590
|
createTextVNode(" z值调整 ", -1)
|
|
15760
15591
|
])),
|
|
15761
15592
|
_: 1,
|
|
15762
|
-
__: [
|
|
15593
|
+
__: [28]
|
|
15763
15594
|
})
|
|
15764
15595
|
]),
|
|
15765
15596
|
_: 1
|
|
@@ -15798,13 +15629,46 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15798
15629
|
])) : (openBlock(), createElementBlock("div", {
|
|
15799
15630
|
key: 1,
|
|
15800
15631
|
class: normalizeClass([{ "translate-y-[100%]": isMainCommand.value }, "z-[8] absolute left-0 bottom-0 transition-transform w-[100%] bg-white p-[5px] box-border text-[14px]"]),
|
|
15801
|
-
onMousedown: _cache[
|
|
15802
|
-
onPointerdown: _cache[
|
|
15632
|
+
onMousedown: _cache[13] || (_cache[13] = (e) => e.stopPropagation()),
|
|
15633
|
+
onPointerdown: _cache[14] || (_cache[14] = (e) => e.stopPropagation())
|
|
15803
15634
|
}, [
|
|
15804
|
-
|
|
15805
|
-
|
|
15806
|
-
|
|
15807
|
-
|
|
15635
|
+
createElementVNode("div", _hoisted_15, [
|
|
15636
|
+
createVNode(unref(ElCheckbox), {
|
|
15637
|
+
size: "small",
|
|
15638
|
+
modelValue: dxfVisible.value,
|
|
15639
|
+
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => dxfVisible.value = $event)
|
|
15640
|
+
}, {
|
|
15641
|
+
default: withCtx(() => _cache[29] || (_cache[29] = [
|
|
15642
|
+
createTextVNode("Dxf", -1)
|
|
15643
|
+
])),
|
|
15644
|
+
_: 1,
|
|
15645
|
+
__: [29]
|
|
15646
|
+
}, 8, ["modelValue"]),
|
|
15647
|
+
createVNode(unref(ElCheckbox), {
|
|
15648
|
+
size: "small",
|
|
15649
|
+
modelValue: unref(editor).renderManager.lineAdsorption.value,
|
|
15650
|
+
"onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => unref(editor).renderManager.lineAdsorption.value = $event)
|
|
15651
|
+
}, {
|
|
15652
|
+
default: withCtx(() => _cache[30] || (_cache[30] = [
|
|
15653
|
+
createTextVNode("线吸附", -1)
|
|
15654
|
+
])),
|
|
15655
|
+
_: 1,
|
|
15656
|
+
__: [30]
|
|
15657
|
+
}, 8, ["modelValue"]),
|
|
15658
|
+
createVNode(unref(ElCheckbox), {
|
|
15659
|
+
disabled: !unref(editor).renderManager.lineAdsorption.value,
|
|
15660
|
+
size: "small",
|
|
15661
|
+
modelValue: unref(editor).renderManager.pointAdsorption.value,
|
|
15662
|
+
"onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => unref(editor).renderManager.pointAdsorption.value = $event)
|
|
15663
|
+
}, {
|
|
15664
|
+
default: withCtx(() => _cache[31] || (_cache[31] = [
|
|
15665
|
+
createTextVNode("点吸附", -1)
|
|
15666
|
+
])),
|
|
15667
|
+
_: 1,
|
|
15668
|
+
__: [31]
|
|
15669
|
+
}, 8, ["disabled", "modelValue"])
|
|
15670
|
+
]),
|
|
15671
|
+
createElementVNode("ul", _hoisted_16, [
|
|
15808
15672
|
(openBlock(), createElementBlock(Fragment, null, renderList(commandList, (item) => {
|
|
15809
15673
|
return openBlock(), createElementBlock(Fragment, {
|
|
15810
15674
|
key: item.command
|
|
@@ -15814,19 +15678,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15814
15678
|
onClick: ($event) => startCurrentCommandItem(item),
|
|
15815
15679
|
class: normalizeClass([{ "!bg-[var(--primary-color)] ": currentCommand.value === item.command }, "gap-[10px] relative hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
|
|
15816
15680
|
}, [
|
|
15817
|
-
createElementVNode("div",
|
|
15681
|
+
createElementVNode("div", _hoisted_18, [
|
|
15818
15682
|
createElementVNode("img", {
|
|
15819
15683
|
class: "size-[20px]",
|
|
15820
15684
|
src: item.src,
|
|
15821
15685
|
alt: "",
|
|
15822
15686
|
srcset: ""
|
|
15823
|
-
}, null, 8,
|
|
15687
|
+
}, null, 8, _hoisted_19)
|
|
15824
15688
|
])
|
|
15825
|
-
], 10,
|
|
15689
|
+
], 10, _hoisted_17)) : createCommentVNode("", true)
|
|
15826
15690
|
], 64);
|
|
15827
15691
|
}), 64))
|
|
15828
15692
|
]),
|
|
15829
|
-
createElementVNode("div",
|
|
15693
|
+
createElementVNode("div", _hoisted_20, [
|
|
15830
15694
|
createVNode(TransitionGroup, null, {
|
|
15831
15695
|
default: withCtx(() => [
|
|
15832
15696
|
(openBlock(), createElementBlock(Fragment, null, renderList(otherCommandList, (item) => {
|
|
@@ -15842,8 +15706,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15842
15706
|
createElementVNode("img", {
|
|
15843
15707
|
class: "size-[20px]",
|
|
15844
15708
|
src: item.src
|
|
15845
|
-
}, null, 8,
|
|
15846
|
-
], 10,
|
|
15709
|
+
}, null, 8, _hoisted_22)
|
|
15710
|
+
], 10, _hoisted_21), [
|
|
15847
15711
|
[vShow, !(item.show?.value === false)]
|
|
15848
15712
|
]);
|
|
15849
15713
|
}), 64))
|
|
@@ -15857,13 +15721,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15857
15721
|
}, [
|
|
15858
15722
|
isMainCommand.value ? (openBlock(), createElementBlock("div", {
|
|
15859
15723
|
key: 0,
|
|
15860
|
-
onMousemove: _cache[
|
|
15724
|
+
onMousemove: _cache[16] || (_cache[16] = (e) => e.stopPropagation()),
|
|
15861
15725
|
class: "cursor-pointer z-[8] box-border bg-[rgba(0,0,0,0.5)] rounded-[6px] p-[5px] absolute left-[50%] translate-x-[-50%] top-[20px] flex gap-[5px] items-center"
|
|
15862
15726
|
}, [
|
|
15863
15727
|
createElementVNode("button", {
|
|
15864
|
-
onClick: _cache[
|
|
15728
|
+
onClick: _cache[15] || (_cache[15] = (e) => (unref(editor).cancelCommand(), e.stopPropagation())),
|
|
15865
15729
|
class: "!bg-transparent button cursor-pointer"
|
|
15866
|
-
}, _cache[
|
|
15730
|
+
}, _cache[32] || (_cache[32] = [
|
|
15867
15731
|
createElementVNode("svg", {
|
|
15868
15732
|
fill: "#fff",
|
|
15869
15733
|
viewBox: "0 0 1024 1024",
|
|
@@ -15879,7 +15743,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15879
15743
|
key: 0,
|
|
15880
15744
|
onClick: commandConfirm,
|
|
15881
15745
|
class: "button !bg-transparent cursor-pointer"
|
|
15882
|
-
}, _cache[
|
|
15746
|
+
}, _cache[33] || (_cache[33] = [
|
|
15883
15747
|
createElementVNode("svg", {
|
|
15884
15748
|
fill: "#28c932",
|
|
15885
15749
|
viewBox: "0 0 1026 1024",
|
|
@@ -15891,13 +15755,16 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
15891
15755
|
createElementVNode("path", { d: "M79.288 400c19.2 0 38.4 9.6 54.4 25.6l240 249.6c12.8 16 19.2 16 35.2 0 147.2-153.6 294.4-304 441.6-457.6 16-16 32-35.2 48-51.2 28.8-28.8 70.4-32 99.2-6.4 32 25.6 38.4 73.6 9.6 105.6-32 38.4-67.2 73.6-102.4 108.8-150.4 156.8-300.8 313.6-454.4 470.4-38.4 38.4-80 41.6-115.2 6.4-105.6-108.8-211.2-217.6-313.6-326.4-22.4-25.6-28.8-54.4-12.8-83.2 12.8-25.6 35.2-41.6 70.4-41.6z" })
|
|
15892
15756
|
], -1)
|
|
15893
15757
|
]))) : createCommentVNode("", true)
|
|
15894
|
-
], 32)) : createCommentVNode("", true)
|
|
15758
|
+
], 32)) : createCommentVNode("", true),
|
|
15759
|
+
isMainCommand.value && currentMainCommand.value ? (openBlock(), createElementBlock("div", _hoisted_23, [
|
|
15760
|
+
createElementVNode("div", _hoisted_24, toDisplayString(currentMainCommand.value.name), 1)
|
|
15761
|
+
])) : createCommentVNode("", true)
|
|
15895
15762
|
], 8, ["to"]))
|
|
15896
15763
|
], 64);
|
|
15897
15764
|
};
|
|
15898
15765
|
}
|
|
15899
15766
|
});
|
|
15900
|
-
const EditorToolContent = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
15767
|
+
const EditorToolContent = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-b369d5e1"]]);
|
|
15901
15768
|
class StorageHelper {
|
|
15902
15769
|
static get(key, defaultValue = void 0) {
|
|
15903
15770
|
const value = localStorage.getItem(key);
|
|
@@ -16042,7 +15909,7 @@ class Editor extends Component {
|
|
|
16042
15909
|
this.plane.visible = false;
|
|
16043
15910
|
const cancelEvent = this.addEventListener("update", () => {
|
|
16044
15911
|
this.domContainer.dialogLayer.appendChild(this.domElement);
|
|
16045
|
-
this.domContainer.dialogLayer.appendChild(this.imgEl);
|
|
15912
|
+
isMobileRef.value || this.domContainer.dialogLayer.appendChild(this.imgEl);
|
|
16046
15913
|
cancelEvent();
|
|
16047
15914
|
});
|
|
16048
15915
|
setTimeout(() => {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
2
|
import { LineSegment } from '../../../../../LineSegment';
|
|
3
3
|
import { ComponentManager } from '../../../../../ComponentManager';
|
|
4
|
+
import { Point } from '../../../../../Point';
|
|
5
|
+
import { LineUserData } from '../../../../type';
|
|
4
6
|
import * as THREE from "three";
|
|
5
7
|
export declare class ClippingLine extends CommandFlowComponent<{
|
|
6
8
|
pointerMove: {
|
|
@@ -15,14 +17,14 @@ export declare class ClippingLine extends CommandFlowComponent<{
|
|
|
15
17
|
/** 选择开始点
|
|
16
18
|
* @param next
|
|
17
19
|
*/
|
|
18
|
-
selectPointStart(next: any): void
|
|
20
|
+
selectPointStart(next: any): Promise<void>;
|
|
19
21
|
/** 选择结束点
|
|
20
22
|
* @param next
|
|
21
23
|
*/
|
|
22
24
|
selectPointEnd(next: any, { point, line }: {
|
|
23
|
-
point:
|
|
25
|
+
point: Point;
|
|
24
26
|
line: LineSegment;
|
|
25
|
-
}): void
|
|
27
|
+
}): Promise<void>;
|
|
26
28
|
/**
|
|
27
29
|
* 结束处理
|
|
28
30
|
* @param next
|
|
@@ -31,14 +33,20 @@ export declare class ClippingLine extends CommandFlowComponent<{
|
|
|
31
33
|
private end;
|
|
32
34
|
/** 执行完成
|
|
33
35
|
*/
|
|
34
|
-
|
|
36
|
+
protected onCompleted(data: any): void;
|
|
35
37
|
/** 回滚操作
|
|
36
38
|
* @param data
|
|
37
39
|
*/
|
|
38
|
-
|
|
40
|
+
protected onRollback(data: any): any;
|
|
39
41
|
/** 撤回回滚
|
|
40
42
|
* @param data
|
|
41
43
|
* @returns
|
|
42
44
|
*/
|
|
43
|
-
|
|
45
|
+
protected onRevokeRollback(data: {
|
|
46
|
+
doorDataItem: any;
|
|
47
|
+
line: LineSegment<LineUserData>;
|
|
48
|
+
}): {
|
|
49
|
+
doorDataItem: any;
|
|
50
|
+
line: LineSegment<LineUserData>;
|
|
51
|
+
};
|
|
44
52
|
}
|
|
@@ -20,7 +20,9 @@ export type AdsorptionResult = {
|
|
|
20
20
|
line: undefined;
|
|
21
21
|
mode: undefined;
|
|
22
22
|
};
|
|
23
|
-
export declare class RenderManager extends Component<{
|
|
23
|
+
export declare class RenderManager extends Component<{
|
|
24
|
+
adsorptionPointChange: AdsorptionResult;
|
|
25
|
+
}> {
|
|
24
26
|
static name: string;
|
|
25
27
|
container: THREE.Group<THREE.Object3DEventMap>;
|
|
26
28
|
lines: LineSegment<LineUserData>[];
|