build-dxf 0.0.20-2 → 0.0.20-23
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 +1 -1
- package/src/build.js +21 -16
- package/src/index.css +0 -4
- package/src/index2.js +1 -12
package/package.json
CHANGED
package/src/build.js
CHANGED
|
@@ -1475,7 +1475,7 @@ class Dxf extends Component {
|
|
|
1475
1475
|
filterLines.push(line2);
|
|
1476
1476
|
} else filterLines.push(line);
|
|
1477
1477
|
}
|
|
1478
|
-
return filterLines.length >
|
|
1478
|
+
return filterLines.length > 3 ? linesToPath(this.mergeSameDirectionLine(filterLines)) : [];
|
|
1479
1479
|
}
|
|
1480
1480
|
/**
|
|
1481
1481
|
* 移除短线段
|
|
@@ -1485,7 +1485,7 @@ class Dxf extends Component {
|
|
|
1485
1485
|
removeShortLine(path, shortLine = this.shortLine) {
|
|
1486
1486
|
const lines = pathToLines(path), filterLines = [], PI_1 = Math.PI / 180;
|
|
1487
1487
|
for (let i = 0; i < lines.length; i++) {
|
|
1488
|
-
const line = lines[i], len = line.length();
|
|
1488
|
+
const line = lines[i], len = line.length(), currentIndex = i;
|
|
1489
1489
|
if (len > shortLine || filterLines.length === 0) {
|
|
1490
1490
|
filterLines.push(line);
|
|
1491
1491
|
continue;
|
|
@@ -1499,24 +1499,29 @@ class Dxf extends Component {
|
|
|
1499
1499
|
} else break;
|
|
1500
1500
|
}
|
|
1501
1501
|
if (!nextline) continue;
|
|
1502
|
-
const
|
|
1503
|
-
if (
|
|
1504
|
-
const
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
nextline.
|
|
1502
|
+
const targetLine = lines[i - 1];
|
|
1503
|
+
if (preLine.length() > targetLine.length()) {
|
|
1504
|
+
const intersectPoint = preLine.getIntersection(nextline);
|
|
1505
|
+
if (intersectPoint) {
|
|
1506
|
+
const p0 = preLine.points[1].clone(), p1 = nextline.points[0].clone();
|
|
1507
|
+
preLine.points[1].copy(intersectPoint);
|
|
1508
|
+
nextline.points[0].copy(intersectPoint);
|
|
1509
|
+
if (preLine.length() < this.width) {
|
|
1510
|
+
preLine.points[1].copy(p0);
|
|
1511
|
+
nextline.points[0].copy(p0);
|
|
1512
|
+
} else if (nextline.length() < this.width) {
|
|
1513
|
+
preLine.points[1].copy(p1);
|
|
1514
|
+
nextline.points[0].copy(p1);
|
|
1515
|
+
}
|
|
1516
|
+
} else {
|
|
1517
|
+
preLine.points[1].copy(nextline.points[0]);
|
|
1513
1518
|
}
|
|
1519
|
+
filterLines.push(nextline);
|
|
1514
1520
|
} else {
|
|
1515
|
-
|
|
1521
|
+
i = currentIndex;
|
|
1516
1522
|
}
|
|
1517
|
-
filterLines.push(nextline);
|
|
1518
1523
|
}
|
|
1519
|
-
return filterLines.length >
|
|
1524
|
+
return filterLines.length > 3 ? linesToPath(filterLines) : [];
|
|
1520
1525
|
}
|
|
1521
1526
|
/** 线偏移
|
|
1522
1527
|
* @description 使用 ClipperLib 对每个点组进行线偏移处理,生成具有指定宽度的墙体路径
|
package/src/index.css
CHANGED
package/src/index2.js
CHANGED
|
@@ -644,17 +644,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
644
644
|
])),
|
|
645
645
|
_: 1,
|
|
646
646
|
__: [9]
|
|
647
|
-
}),
|
|
648
|
-
createVNode(unref(ElButton), {
|
|
649
|
-
size: "small",
|
|
650
|
-
type: "success",
|
|
651
|
-
onClick: selectDetailsPointFile
|
|
652
|
-
}, {
|
|
653
|
-
default: withCtx(() => _cache[10] || (_cache[10] = [
|
|
654
|
-
createTextVNode(" 编辑模式 ", -1)
|
|
655
|
-
])),
|
|
656
|
-
_: 1,
|
|
657
|
-
__: [10]
|
|
658
647
|
})
|
|
659
648
|
]),
|
|
660
649
|
isLook.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -680,7 +669,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
680
669
|
label: "墙体(E)"
|
|
681
670
|
}, null, 8, ["modelValue"])
|
|
682
671
|
]),
|
|
683
|
-
_cache[
|
|
672
|
+
_cache[10] || (_cache[10] = createStaticVNode('<div class="mt-[5px] text-[#c9c9c9] text-[10px]"><p class="text-right">详情点射线辅助线快捷键:R</p><p class="text-right">墙壁合并追加线快捷键:A</p><p class="text-right">线段序号快捷键:T</p><p class="text-right">线段端点标示快捷键:P</p><p class="text-right">线段长度(单位米)快捷键:L</p></div>', 1))
|
|
684
673
|
])
|
|
685
674
|
])
|
|
686
675
|
], 512);
|