build-dxf 0.1.125 → 0.1.127
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 +48 -31
- package/src/index.css +4 -4
- package/src/index3.js +13 -8
- package/src/utils/algorithms/PointSpatialHash.d.ts +15 -3
package/package.json
CHANGED
package/src/build.js
CHANGED
|
@@ -684,54 +684,71 @@ class PointSpatialHash {
|
|
|
684
684
|
}
|
|
685
685
|
return null;
|
|
686
686
|
}
|
|
687
|
-
/**
|
|
688
|
-
*
|
|
687
|
+
/** 通过点,从近到远按圈层搜索
|
|
688
|
+
* 同一圈内不保证距离顺序
|
|
689
|
+
* 返回第一个满足条件的圈层
|
|
689
690
|
*/
|
|
690
|
-
|
|
691
|
+
searchByRing(point2, fn2, maxRing = 1e3) {
|
|
692
|
+
let gridCount = this.map.size;
|
|
691
693
|
const centerI = Math.floor(point2.x / this.gridSize);
|
|
692
694
|
const centerJ = Math.floor(point2.y / this.gridSize);
|
|
693
|
-
const
|
|
694
|
-
|
|
695
|
+
const currentCircle = [];
|
|
696
|
+
const appendGrid = (i, j) => {
|
|
697
|
+
const set2 = this.map.get(this.getGridId(i, j));
|
|
698
|
+
if (!set2) return;
|
|
699
|
+
gridCount--;
|
|
695
700
|
for (const target of set2) {
|
|
696
|
-
|
|
701
|
+
currentCircle.push({
|
|
702
|
+
point: target.point,
|
|
703
|
+
userData: target.userData,
|
|
704
|
+
distanceSq: point2.distanceSquared(target.point)
|
|
705
|
+
});
|
|
697
706
|
}
|
|
707
|
+
};
|
|
708
|
+
appendGrid(centerI, centerJ);
|
|
709
|
+
if (fn2(currentCircle, 0)) {
|
|
710
|
+
return currentCircle;
|
|
698
711
|
}
|
|
712
|
+
if (gridCount === 0) return null;
|
|
699
713
|
for (let r2 = 1; r2 <= maxRing; r2++) {
|
|
714
|
+
currentCircle.length = 0;
|
|
700
715
|
const minI = centerI - r2;
|
|
701
716
|
const maxI = centerI + r2;
|
|
702
717
|
const minJ = centerJ - r2;
|
|
703
718
|
const maxJ = centerJ + r2;
|
|
704
719
|
for (let i = minI; i <= maxI; i++) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
for (const target of set22) {
|
|
708
|
-
if (fn2(target)) return target;
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
set22 = this.map.get(this.getGridId(i, maxJ));
|
|
712
|
-
if (set22) {
|
|
713
|
-
for (const target of set22) {
|
|
714
|
-
if (fn2(target)) return target;
|
|
715
|
-
}
|
|
716
|
-
}
|
|
720
|
+
appendGrid(i, minJ);
|
|
721
|
+
appendGrid(i, maxJ);
|
|
717
722
|
}
|
|
718
723
|
for (let j = minJ + 1; j < maxJ; j++) {
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}
|
|
725
|
-
set22 = this.map.get(this.getGridId(maxI, j));
|
|
726
|
-
if (set22) {
|
|
727
|
-
for (const target of set22) {
|
|
728
|
-
if (fn2(target)) return target;
|
|
729
|
-
}
|
|
730
|
-
}
|
|
724
|
+
appendGrid(minI, j);
|
|
725
|
+
appendGrid(maxI, j);
|
|
726
|
+
}
|
|
727
|
+
if (fn2(currentCircle, r2)) {
|
|
728
|
+
return currentCircle;
|
|
731
729
|
}
|
|
730
|
+
if (gridCount === 0) return null;
|
|
732
731
|
}
|
|
733
732
|
return null;
|
|
734
733
|
}
|
|
734
|
+
/**
|
|
735
|
+
* @param point
|
|
736
|
+
* @param excludeSelf
|
|
737
|
+
* @returns
|
|
738
|
+
*/
|
|
739
|
+
findNearest(point2, excludeSelf = true) {
|
|
740
|
+
let nearest = null;
|
|
741
|
+
this.searchByRing(point2, (circle) => {
|
|
742
|
+
for (const item of circle) {
|
|
743
|
+
if (excludeSelf && item.point === point2) continue;
|
|
744
|
+
if (!nearest || item.distanceSq < nearest.distanceSq) {
|
|
745
|
+
nearest = item;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
return nearest !== null;
|
|
749
|
+
});
|
|
750
|
+
return nearest;
|
|
751
|
+
}
|
|
735
752
|
/**
|
|
736
753
|
* @param point
|
|
737
754
|
*/
|
|
@@ -11080,7 +11097,7 @@ function innerWallLine(lines, trajectory2) {
|
|
|
11080
11097
|
lud.forEachPathLine((start, end, line, index2, endType, indxeList) => {
|
|
11081
11098
|
temLine.start.copy(start);
|
|
11082
11099
|
temLine.end.copy(end);
|
|
11083
|
-
const wallWidth =
|
|
11100
|
+
const wallWidth = DEFAULT_WALL_WIDTH;
|
|
11084
11101
|
wallWidths[index2] = wallWidth;
|
|
11085
11102
|
const hw = indxeList.length ? Math.max(...indxeList.map((i) => wallWidths[i])) * 0.5 : wallWidth * 0.5;
|
|
11086
11103
|
if (index2 !== 0) {
|
package/src/index.css
CHANGED
|
@@ -1248,17 +1248,17 @@ button[data-v-7a78abcb]:active {
|
|
|
1248
1248
|
}
|
|
1249
1249
|
}
|
|
1250
1250
|
|
|
1251
|
-
[data-v-
|
|
1251
|
+
[data-v-48eb568f] {
|
|
1252
1252
|
font-family: 微软雅黑;
|
|
1253
1253
|
}
|
|
1254
|
-
.number[data-v-
|
|
1254
|
+
.number[data-v-48eb568f] {
|
|
1255
1255
|
color: #a7a7a7
|
|
1256
1256
|
}
|
|
1257
1257
|
|
|
1258
|
-
[data-v-
|
|
1258
|
+
[data-v-f7550a15] {
|
|
1259
1259
|
font-family: 宋体;
|
|
1260
1260
|
}
|
|
1261
|
-
.button[data-v-
|
|
1261
|
+
.button[data-v-f7550a15] {
|
|
1262
1262
|
padding: 5px 10px;
|
|
1263
1263
|
border: none;
|
|
1264
1264
|
background: var(--primary-color);
|
package/src/index3.js
CHANGED
|
@@ -18385,7 +18385,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18385
18385
|
if (!map.has(line2.uuid)) map.set(line2.uuid, reactive(line2.userData));
|
|
18386
18386
|
return map.get(line2.uuid);
|
|
18387
18387
|
});
|
|
18388
|
-
})
|
|
18388
|
+
}), holeName = {
|
|
18389
|
+
door: "门",
|
|
18390
|
+
window: "窗",
|
|
18391
|
+
beam: "梁",
|
|
18392
|
+
hole: "垭口"
|
|
18393
|
+
};
|
|
18389
18394
|
return (_ctx, _cache) => {
|
|
18390
18395
|
return openBlock(), createBlock(_sfc_main$7, {
|
|
18391
18396
|
title: "属性",
|
|
@@ -18407,7 +18412,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18407
18412
|
])) : createCommentVNode("", true),
|
|
18408
18413
|
createElementVNode("div", _hoisted_5$1, [
|
|
18409
18414
|
createElementVNode("div", null, [
|
|
18410
|
-
createElementVNode("h5", _hoisted_6$1, toDisplayString(line2.userData.isDoor ? "门线" : line2.userData.isSelectWindow ? "
|
|
18415
|
+
createElementVNode("h5", _hoisted_6$1, toDisplayString(line2.userData.isDoor ? "门线" : line2.userData.isSelectWindow ? `孔洞线( ${holeName[line2.userData.type ?? "hole"]} )` : line2.userData.isBayWindow ? "飘窗线" : "墙体线"), 1)
|
|
18411
18416
|
]),
|
|
18412
18417
|
createElementVNode("div", _hoisted_7$1, [
|
|
18413
18418
|
(openBlock(true), createElementBlock(Fragment, null, renderList(line2.points, (point, index) => {
|
|
@@ -18425,7 +18430,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18425
18430
|
]),
|
|
18426
18431
|
createElementVNode("div", _hoisted_14$1, [
|
|
18427
18432
|
userDataList.value[i].isSelectWindow ? (openBlock(), createElementBlock("p", _hoisted_15$1, [
|
|
18428
|
-
_cache[9] || (_cache[9] = createElementVNode("span", { class: "mr-[5px] w-[50px]" }, "
|
|
18433
|
+
_cache[9] || (_cache[9] = createElementVNode("span", { class: "mr-[5px] w-[50px]" }, "孔洞宽度", -1)),
|
|
18429
18434
|
createVNode(_sfc_main$3, {
|
|
18430
18435
|
onBlur: _cache[0] || (_cache[0] = ($event) => emits("update")),
|
|
18431
18436
|
modelValue: userDataList.value[i].width,
|
|
@@ -18435,7 +18440,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18435
18440
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
18436
18441
|
])) : createCommentVNode("", true),
|
|
18437
18442
|
createElementVNode("p", _hoisted_16$1, [
|
|
18438
|
-
createElementVNode("span", _hoisted_17$1, toDisplayString(line2.userData.isSelectWindow ? "
|
|
18443
|
+
createElementVNode("span", _hoisted_17$1, toDisplayString(line2.userData.isSelectWindow ? "孔洞" : "墙体") + "高度", 1),
|
|
18439
18444
|
createVNode(_sfc_main$3, {
|
|
18440
18445
|
onBlur: _cache[1] || (_cache[1] = ($event) => emits("update")),
|
|
18441
18446
|
modelValue: userDataList.value[i].height,
|
|
@@ -18453,7 +18458,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18453
18458
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
18454
18459
|
])) : createCommentVNode("", true),
|
|
18455
18460
|
userDataList.value[i].isSelectWindow ? (openBlock(), createElementBlock("p", _hoisted_19$1, [
|
|
18456
|
-
_cache[11] || (_cache[11] = createElementVNode("span", { class: "mr-[5px] w-[50px]" }, "
|
|
18461
|
+
_cache[11] || (_cache[11] = createElementVNode("span", { class: "mr-[5px] w-[50px]" }, "孔洞高度", -1)),
|
|
18457
18462
|
createVNode(_sfc_main$3, {
|
|
18458
18463
|
onBlur: _cache[3] || (_cache[3] = ($event) => emits("update")),
|
|
18459
18464
|
modelValue: userDataList.value[i].groundClearance,
|
|
@@ -18474,7 +18479,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18474
18479
|
};
|
|
18475
18480
|
}
|
|
18476
18481
|
});
|
|
18477
|
-
const PropertiesPanelView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
18482
|
+
const PropertiesPanelView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-48eb568f"]]);
|
|
18478
18483
|
class PropertiesPanel extends Command {
|
|
18479
18484
|
static name = "PropertiesPanel";
|
|
18480
18485
|
container = new THREE.Group();
|
|
@@ -18734,7 +18739,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
18734
18739
|
},
|
|
18735
18740
|
{
|
|
18736
18741
|
command: DrawHole.commandName,
|
|
18737
|
-
name: "
|
|
18742
|
+
name: "绘制垭口",
|
|
18738
18743
|
show: true,
|
|
18739
18744
|
src: images["../assets/images/垭口.svg"].default,
|
|
18740
18745
|
shortcut: DrawHole.shortcutKeys.join(" + ")
|
|
@@ -19326,7 +19331,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
19326
19331
|
};
|
|
19327
19332
|
}
|
|
19328
19333
|
});
|
|
19329
|
-
const EditorToolContent = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
19334
|
+
const EditorToolContent = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-f7550a15"]]);
|
|
19330
19335
|
class StorageHelper {
|
|
19331
19336
|
static get(key, defaultValue = void 0) {
|
|
19332
19337
|
const value = localStorage.getItem(key);
|
|
@@ -10,6 +10,11 @@ type Target<T> = {
|
|
|
10
10
|
type NodeSet<T> = Set<Target<T>>;
|
|
11
11
|
export type PvgTarget<T> = Target<T>;
|
|
12
12
|
export type ResultList<T = any> = Array<Target<T>>;
|
|
13
|
+
export type CircleResult<T = any> = {
|
|
14
|
+
point: Point;
|
|
15
|
+
distanceSq: number;
|
|
16
|
+
userData?: T;
|
|
17
|
+
};
|
|
13
18
|
export declare class PointSpatialHash<T = Record<string, any>> {
|
|
14
19
|
map: Map<string, NodeSet<T>>;
|
|
15
20
|
gridSize: number;
|
|
@@ -109,10 +114,17 @@ export declare class PointSpatialHash<T = Record<string, any>> {
|
|
|
109
114
|
point: Point;
|
|
110
115
|
userData: T;
|
|
111
116
|
} | null;
|
|
112
|
-
/**
|
|
113
|
-
*
|
|
117
|
+
/** 通过点,从近到远按圈层搜索
|
|
118
|
+
* 同一圈内不保证距离顺序
|
|
119
|
+
* 返回第一个满足条件的圈层
|
|
120
|
+
*/
|
|
121
|
+
searchByRing(point: Point, fn: (circle: CircleResult<T>[], circleNum: number) => boolean, maxRing?: number): CircleResult<T>[] | null;
|
|
122
|
+
/**
|
|
123
|
+
* @param point
|
|
124
|
+
* @param excludeSelf
|
|
125
|
+
* @returns
|
|
114
126
|
*/
|
|
115
|
-
|
|
127
|
+
findNearest(point: Point, excludeSelf?: boolean): CircleResult<T> | null;
|
|
116
128
|
/**
|
|
117
129
|
* @param point
|
|
118
130
|
*/
|