build-dxf 0.1.10 → 0.1.11
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/build.js
CHANGED
|
@@ -2992,7 +2992,8 @@ class LineGroupType {
|
|
|
2992
2992
|
*/
|
|
2993
2993
|
static getGroupsByType(lines, type) {
|
|
2994
2994
|
return lines.reduce((map, line) => {
|
|
2995
|
-
|
|
2995
|
+
const id = LineGroupType.getIdByType(line, type);
|
|
2996
|
+
if (id) map.append(id, line);
|
|
2996
2997
|
return map;
|
|
2997
2998
|
}, new ArrayMap()).valueArray;
|
|
2998
2999
|
}
|
|
@@ -3143,23 +3144,43 @@ class LineGroupType {
|
|
|
3143
3144
|
* @returns
|
|
3144
3145
|
*/
|
|
3145
3146
|
static removeByType(line, type) {
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
if (
|
|
3154
|
-
for (let i = 0; i <
|
|
3155
|
-
const element =
|
|
3147
|
+
let is2 = false;
|
|
3148
|
+
if (line.userData?.groupType === type) {
|
|
3149
|
+
delete line.userData.groupId;
|
|
3150
|
+
delete line.userData.groupType;
|
|
3151
|
+
is2 = true;
|
|
3152
|
+
}
|
|
3153
|
+
const groups = line.userData?.groups;
|
|
3154
|
+
if (groups) {
|
|
3155
|
+
for (let i = 0; i < groups.length; i++) {
|
|
3156
|
+
const element = groups[i];
|
|
3156
3157
|
if (element.type === type) {
|
|
3157
|
-
|
|
3158
|
-
|
|
3158
|
+
groups.splice(i, 1);
|
|
3159
|
+
is2 = true;
|
|
3159
3160
|
}
|
|
3160
3161
|
}
|
|
3161
3162
|
}
|
|
3162
|
-
return
|
|
3163
|
+
return is2;
|
|
3164
|
+
}
|
|
3165
|
+
/**
|
|
3166
|
+
* 通过类型移除
|
|
3167
|
+
* @param line
|
|
3168
|
+
* @param id
|
|
3169
|
+
* @returns
|
|
3170
|
+
*/
|
|
3171
|
+
static removeByTypes(line, types) {
|
|
3172
|
+
if (!line.userData) return;
|
|
3173
|
+
const typeSet = new Set(types);
|
|
3174
|
+
if (line.userData.groupType && typeSet.has(line.userData.groupType)) {
|
|
3175
|
+
delete line.userData.groupType;
|
|
3176
|
+
delete line.userData.groupId;
|
|
3177
|
+
}
|
|
3178
|
+
const groups = line.userData.groups;
|
|
3179
|
+
if (Array.isArray(groups) && groups.length > 0) {
|
|
3180
|
+
line.userData.groups = groups.filter(
|
|
3181
|
+
(element) => !element?.type || !typeSet.has(element.type)
|
|
3182
|
+
);
|
|
3183
|
+
}
|
|
3163
3184
|
}
|
|
3164
3185
|
/**
|
|
3165
3186
|
* 清空线段的所有分组信息
|
|
@@ -3562,8 +3583,11 @@ function doubleWinDrawLine(lines) {
|
|
|
3562
3583
|
const point = Point.from(p), direct = newLine.direction();
|
|
3563
3584
|
if (full) width = newLine.length();
|
|
3564
3585
|
const winLine2 = point.expandAsLine(direct, width).directionMove(direct, -width * 0.5);
|
|
3565
|
-
|
|
3566
|
-
|
|
3586
|
+
try {
|
|
3587
|
+
winLine2.start.copy(newLine.projectPoint(winLine2.start, false));
|
|
3588
|
+
winLine2.end.copy(newLine.projectPoint(winLine2.end, false));
|
|
3589
|
+
} catch (error) {
|
|
3590
|
+
}
|
|
3567
3591
|
winLine2.userData = { wallWidth, height, groundClearance };
|
|
3568
3592
|
return winLine2;
|
|
3569
3593
|
}) ?? []).filter((line) => line.length() > defaultWallWidth$1);
|
|
@@ -3858,7 +3882,7 @@ class CAD {
|
|
|
3858
3882
|
* 转为绘制数据
|
|
3859
3883
|
*/
|
|
3860
3884
|
_cachedDrawData = null;
|
|
3861
|
-
toDrawData(unit = "
|
|
3885
|
+
toDrawData(unit = "Centimeters") {
|
|
3862
3886
|
if (!this.needUpdate && this._cachedDrawData) return this._cachedDrawData;
|
|
3863
3887
|
this.needUpdate = false;
|
|
3864
3888
|
const lines = this.groups.flatMap((group2) => group2.lines), s = units[unit], expansionWidth = 2, box = Box2.fromByLineSegment(...lines).expansion(expansionWidth), center = box.center, data = {
|
|
@@ -3926,7 +3950,7 @@ class CAD {
|
|
|
3926
3950
|
drawDottedLine(p2C, p2, 0.04, 0.05, "line2");
|
|
3927
3951
|
drawLine2(p1C, p2C);
|
|
3928
3952
|
color = "white";
|
|
3929
|
-
drawText2((length
|
|
3953
|
+
drawText2((length * 10).toFixed(2) + "cm", line.center);
|
|
3930
3954
|
}
|
|
3931
3955
|
function drawArc(pos, radius, startAngle, endAngle) {
|
|
3932
3956
|
data.arcs.push([
|
|
@@ -3954,16 +3978,16 @@ class CAD {
|
|
|
3954
3978
|
*/
|
|
3955
3979
|
async toDxfImageBlob(unit = "Centimeters", type = "image/jpeg", background = "#000") {
|
|
3956
3980
|
const data = this.toDrawData(unit);
|
|
3981
|
+
const margin = 0 * data.scale;
|
|
3957
3982
|
let canvas;
|
|
3958
3983
|
if (typeof window !== "undefined") {
|
|
3959
3984
|
canvas = document.createElement("canvas");
|
|
3960
3985
|
} else if (typeof global !== "undefined") {
|
|
3961
3986
|
const { createCanvas } = await include("canvas");
|
|
3962
|
-
canvas = createCanvas();
|
|
3987
|
+
canvas = createCanvas(data.width + margin * 2, data.height + margin * 2);
|
|
3963
3988
|
} else {
|
|
3964
3989
|
throw new Error("创建画布失败");
|
|
3965
3990
|
}
|
|
3966
|
-
const margin = 0 * data.scale;
|
|
3967
3991
|
const colors = {
|
|
3968
3992
|
cyan: "cyan",
|
|
3969
3993
|
yellow: "yellow",
|
|
@@ -4058,7 +4082,7 @@ class CAD {
|
|
|
4058
4082
|
d.addLayer("layer", Drawing.ACI.LAYER, "DOTTED");
|
|
4059
4083
|
d.addLayer("magenta", Drawing.ACI.MAGENTA, "DOTTED");
|
|
4060
4084
|
d.addLayer("red", Drawing.ACI.RED, "DOTTED");
|
|
4061
|
-
const data = this.toDrawData();
|
|
4085
|
+
const data = this.toDrawData(unit);
|
|
4062
4086
|
data.lines.forEach((item) => {
|
|
4063
4087
|
let [p1x, p1y, p2x, p2y, color] = item;
|
|
4064
4088
|
d.setActiveLayer(color);
|
|
@@ -4646,10 +4670,7 @@ function buildDoubleWallGroup(lines, doorLines = [], grouped = true, clearIntern
|
|
|
4646
4670
|
let { newLines, rings } = findLargestCircle(lines), ringsSet = new Set(rings.flat());
|
|
4647
4671
|
if (grouped) {
|
|
4648
4672
|
const grid = new PointVirtualGrid(), internalEdges = /* @__PURE__ */ new Set();
|
|
4649
|
-
|
|
4650
|
-
LineGroupType.removeByType(line, "doubleWall");
|
|
4651
|
-
LineGroupType.removeByType(line, "wall");
|
|
4652
|
-
});
|
|
4673
|
+
newLines.forEach((line) => LineGroupType.removeByTypes(line, ["doubleWall", "wall"]));
|
|
4653
4674
|
newLines.forEach((line) => !ringsSet.has(line) && grid.insert(line.center, line));
|
|
4654
4675
|
doorLines.forEach((line) => grid.insert(line.center, line));
|
|
4655
4676
|
const id = uuid();
|
|
@@ -6308,7 +6329,7 @@ class CorrectionDxf extends Dxf {
|
|
|
6308
6329
|
lines = lines.filter((line) => !line.userData.isDoor);
|
|
6309
6330
|
lines = buildDoubleWallGroup(lines, doors);
|
|
6310
6331
|
lines.push(...doors);
|
|
6311
|
-
this.cad = new CAD().usePlugin(new DxfDataPlugin(
|
|
6332
|
+
this.cad = new CAD().usePlugin(new DxfDataPlugin(lines)).usePlugin(new DxfDrawPlugin());
|
|
6312
6333
|
const { angle, referenceLine } = CAD.obliquity(this.cad);
|
|
6313
6334
|
this.cad.rotateAndResetOrigin(angle);
|
|
6314
6335
|
this.cad.addGroup([referenceLine], "ruler");
|
|
@@ -15016,25 +15037,6 @@ class SceneAutoGenerat {
|
|
|
15016
15037
|
}
|
|
15017
15038
|
const exporter = new OBJExporter();
|
|
15018
15039
|
let glbExporter;
|
|
15019
|
-
function lineSqueezing(p1, p2, width = 0.1) {
|
|
15020
|
-
const normal = p2.normal(p1);
|
|
15021
|
-
const pDirect = p2.direction(p1).mutiplyScalar(width * 0.5);
|
|
15022
|
-
const nDirect = p1.direction(p2).mutiplyScalar(width * 0.5);
|
|
15023
|
-
const offsetX = normal.x * width * 0.5;
|
|
15024
|
-
const offsetY = normal.y * width * 0.5;
|
|
15025
|
-
return {
|
|
15026
|
-
points: [
|
|
15027
|
-
// 第一条线
|
|
15028
|
-
new Point(p1.x + offsetX, p1.y + offsetY).add(nDirect),
|
|
15029
|
-
new Point(p2.x + offsetX, p2.y + offsetY).add(pDirect),
|
|
15030
|
-
// 第二条线
|
|
15031
|
-
new Point(p1.x - offsetX, p1.y - offsetY).add(nDirect),
|
|
15032
|
-
new Point(p2.x - offsetX, p2.y - offsetY).add(pDirect)
|
|
15033
|
-
],
|
|
15034
|
-
indices: [0, 1, 1, 3, 3, 2, 2, 0],
|
|
15035
|
-
rectIndices: [0, 1, 3, 2, 0]
|
|
15036
|
-
};
|
|
15037
|
-
}
|
|
15038
15040
|
class WhiteModel extends Component {
|
|
15039
15041
|
static name = "WhiteModel";
|
|
15040
15042
|
Dxf = null;
|
|
@@ -15075,28 +15077,6 @@ class WhiteModel extends Component {
|
|
|
15075
15077
|
if (group2) {
|
|
15076
15078
|
this.whiteModelLineGroup.add(group2.clone(true));
|
|
15077
15079
|
}
|
|
15078
|
-
const walls = dxf.originalData.map(({ start, end, insetionArr }) => {
|
|
15079
|
-
const startVec3 = new Point(start.x, start.y), endVec3 = new Point(end.x, end.y), { points, indices, rectIndices } = lineSqueezing(startVec3, endVec3, dxf.width);
|
|
15080
|
-
return {
|
|
15081
|
-
points,
|
|
15082
|
-
indices,
|
|
15083
|
-
rectIndices,
|
|
15084
|
-
insetions: (insetionArr ?? []).map((insetion) => insetion.index)
|
|
15085
|
-
};
|
|
15086
|
-
});
|
|
15087
|
-
walls.forEach((wall) => {
|
|
15088
|
-
const shape = new THREE.Shape();
|
|
15089
|
-
wall.rectIndices.forEach((index2, i) => {
|
|
15090
|
-
const p = wall.points[index2];
|
|
15091
|
-
if (i === 0) shape.moveTo(p.x, p.y);
|
|
15092
|
-
else shape.lineTo(p.x, p.y);
|
|
15093
|
-
});
|
|
15094
|
-
const geometry = new THREE.ExtrudeGeometry(shape, {
|
|
15095
|
-
depth: 2.8,
|
|
15096
|
-
bevelSize: 0
|
|
15097
|
-
});
|
|
15098
|
-
if (geometry.attributes.position.array.filter((num) => Number.isNaN(num)).length) return;
|
|
15099
|
-
});
|
|
15100
15080
|
this.dispatchEvent({
|
|
15101
15081
|
type: "updateModel",
|
|
15102
15082
|
whiteModelGroup: this.whiteModelGroup
|
package/src/index.css
CHANGED
|
@@ -574,6 +574,10 @@
|
|
|
574
574
|
filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
|
|
575
575
|
}
|
|
576
576
|
|
|
577
|
+
.filter {
|
|
578
|
+
filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
|
|
579
|
+
}
|
|
580
|
+
|
|
577
581
|
.transition {
|
|
578
582
|
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events;
|
|
579
583
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
@@ -806,7 +810,7 @@
|
|
|
806
810
|
inherits: false
|
|
807
811
|
}
|
|
808
812
|
|
|
809
|
-
[data-v-
|
|
813
|
+
[data-v-18ae0c97] {
|
|
810
814
|
font-family: 宋体;
|
|
811
815
|
}
|
|
812
816
|
|
package/src/index3.js
CHANGED
|
@@ -7688,7 +7688,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
7688
7688
|
localStorage.setItem("lines", JSON.stringify(lines));
|
|
7689
7689
|
try {
|
|
7690
7690
|
dxfSystem.Dxf.set(lines);
|
|
7691
|
-
dxfSystem.Dxf.lineOffset();
|
|
7692
7691
|
} catch (error) {
|
|
7693
7692
|
console.log(error);
|
|
7694
7693
|
}
|
|
@@ -7908,7 +7907,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
7908
7907
|
drawLine.addEventListener("start", () => drawLineCount.value = 0);
|
|
7909
7908
|
drawLine.addEventListener("appendLine", (e) => drawLineCount.value = e.points.length);
|
|
7910
7909
|
drawLine.addEventListener("revoke", (e) => drawLineCount.value = e.points.length);
|
|
7911
|
-
dxfSystem.Dxf.addEventListener("
|
|
7910
|
+
dxfSystem.Dxf.addEventListener("dataChange", () => {
|
|
7912
7911
|
z.value = dxfSystem.Dxf.originalZAverage;
|
|
7913
7912
|
});
|
|
7914
7913
|
const startedEventCancel = editor.commandManager.addEventListener("started", (e) => {
|
|
@@ -7989,7 +7988,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
7989
7988
|
onMousedown: dragMoveHelper,
|
|
7990
7989
|
class: normalizeClass([{ "border-b-[#eee] border-b-1": toolBarExpand.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
|
|
7991
7990
|
}, [
|
|
7992
|
-
_cache[13] || (_cache[13] = createStaticVNode('<div class="flex flex-row" data-v-
|
|
7991
|
+
_cache[13] || (_cache[13] = createStaticVNode('<div class="flex flex-row" data-v-18ae0c97><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-18ae0c97><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-18ae0c97><path d="M341.333333 298.666667a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0 298.666666a85.333333 85.333333 0 1 0 0-170.666666 85.333333 85.333333 0 0 0 0 170.666666z m85.333334 213.333334a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m256-512a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m85.333333 213.333333a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m-85.333333 384a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z" data-v-18ae0c97></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-18ae0c97>绘制工具</h5></div>', 1)),
|
|
7993
7992
|
createElementVNode("div", {
|
|
7994
7993
|
onMousedown: _cache[0] || (_cache[0] = (e) => e.stopPropagation()),
|
|
7995
7994
|
onClick: _cache[1] || (_cache[1] = ($event) => toolBarExpand.value = !toolBarExpand.value),
|
|
@@ -8229,7 +8228,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
8229
8228
|
}
|
|
8230
8229
|
return target;
|
|
8231
8230
|
};
|
|
8232
|
-
const EditorTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
8231
|
+
const EditorTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-18ae0c97"]]);
|
|
8233
8232
|
class Editor extends Component {
|
|
8234
8233
|
static name = "Editor";
|
|
8235
8234
|
container = new THREE.Group();
|
|
@@ -95,6 +95,13 @@ export declare class LineGroupType {
|
|
|
95
95
|
* @returns
|
|
96
96
|
*/
|
|
97
97
|
static removeByType(line: LineSegment<LineUserData>, type: string): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* 通过类型移除
|
|
100
|
+
* @param line
|
|
101
|
+
* @param id
|
|
102
|
+
* @returns
|
|
103
|
+
*/
|
|
104
|
+
static removeByTypes(line: LineSegment<LineUserData>, types: string[]): void;
|
|
98
105
|
/**
|
|
99
106
|
* 清空线段的所有分组信息
|
|
100
107
|
* @param line
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { Component } from '../../ComponentManager';
|
|
2
|
-
import { Point } from '../../Point';
|
|
3
|
-
import { Box2 } from '../../Box2';
|
|
4
|
-
import { LineSegment } from '../../LineSegment';
|
|
5
|
-
import { Quadtree } from '../../Quadtree';
|
|
6
|
-
import { SetDataOption, DataItem, DrawData, LineUserData, OriginalDataItem, Unit } from '../type';
|
|
7
|
-
/**
|
|
8
|
-
* 将点云结构转换为DXF格式
|
|
9
|
-
*/
|
|
10
|
-
export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
11
|
-
setDta: {
|
|
12
|
-
originalData: OriginalDataItem[];
|
|
13
|
-
data: DataItem[];
|
|
14
|
-
};
|
|
15
|
-
lineOffset: {
|
|
16
|
-
wallsGroup: Point[][];
|
|
17
|
-
};
|
|
18
|
-
createGroup: {
|
|
19
|
-
groups: Point[][][];
|
|
20
|
-
};
|
|
21
|
-
preprocessing: {
|
|
22
|
-
data: OriginalDataItem[];
|
|
23
|
-
setData(data: OriginalDataItem[]): void;
|
|
24
|
-
};
|
|
25
|
-
} & TEventMap> {
|
|
26
|
-
static name: string;
|
|
27
|
-
shortLine: number;
|
|
28
|
-
width: number;
|
|
29
|
-
scale: number;
|
|
30
|
-
originalData: OriginalDataItem[];
|
|
31
|
-
data: DataItem[];
|
|
32
|
-
originalBox: Box2;
|
|
33
|
-
box: Box2;
|
|
34
|
-
pointsGroups: Point[][][];
|
|
35
|
-
wallsGroup: Point[][];
|
|
36
|
-
doors: DataItem[];
|
|
37
|
-
doorLineSegment: LineSegment[];
|
|
38
|
-
verticalReferenceLine?: LineSegment<LineUserData>;
|
|
39
|
-
lineSegments: LineSegment<LineUserData>[];
|
|
40
|
-
originalZAverage: number;
|
|
41
|
-
static EndType: {
|
|
42
|
-
etOpenSquare: number;
|
|
43
|
-
etOpenRound: number;
|
|
44
|
-
etOpenButt: number;
|
|
45
|
-
};
|
|
46
|
-
static JoinType: {
|
|
47
|
-
jtSquare: number;
|
|
48
|
-
jtRound: number;
|
|
49
|
-
jtMiter: number;
|
|
50
|
-
};
|
|
51
|
-
/** 原始数据组
|
|
52
|
-
*/
|
|
53
|
-
get lines(): LineSegment<LineUserData>[];
|
|
54
|
-
/**初始化
|
|
55
|
-
* @param width 墙体宽度
|
|
56
|
-
* @param scale 缩放比例
|
|
57
|
-
*/
|
|
58
|
-
constructor(width?: number, scale?: number);
|
|
59
|
-
/** 预处理数据
|
|
60
|
-
* @param data
|
|
61
|
-
*/
|
|
62
|
-
preprocessing(data: OriginalDataItem[]): {
|
|
63
|
-
lineSegments: LineSegment<LineUserData>[];
|
|
64
|
-
data: OriginalDataItem[];
|
|
65
|
-
};
|
|
66
|
-
/** 设置
|
|
67
|
-
* @param data 房屋结构数据,node环境可以为路径
|
|
68
|
-
* @param width 墙体宽度
|
|
69
|
-
* @param scale 缩放比例
|
|
70
|
-
* @param axisAlignmentCorrection 需要执行轴对称垂直纠正
|
|
71
|
-
* @param option
|
|
72
|
-
* @returns
|
|
73
|
-
*/
|
|
74
|
-
set(data: OriginalDataItem[] | string, width?: number, scale?: number): Promise<any>;
|
|
75
|
-
/** 创建分组
|
|
76
|
-
* @description 根据相交数组insetionArr, 把相交的线段,划分到一组内,方便后续路径查找合并使用
|
|
77
|
-
* @returns
|
|
78
|
-
*/
|
|
79
|
-
private createGroups;
|
|
80
|
-
/** 计算当前墙体数据的边界框
|
|
81
|
-
* @description 根据分组数据pointsGroups,计算包围盒, pointsGroups数据为缩放后数据。
|
|
82
|
-
* @description 可通过box属性查看计算结果。
|
|
83
|
-
* @returns
|
|
84
|
-
*/
|
|
85
|
-
computedSize(): Box2;
|
|
86
|
-
/** 线路拓扑
|
|
87
|
-
* @description 处理线路拓扑,使线路有序链接,形成长路径
|
|
88
|
-
* @param lines
|
|
89
|
-
*/
|
|
90
|
-
lineTopology(lines: Point[][]): Point<Record<string, any>>[][];
|
|
91
|
-
/** 合并方向相同的线段
|
|
92
|
-
* @param lines
|
|
93
|
-
* @param errAngle
|
|
94
|
-
*/
|
|
95
|
-
private mergeSameDirectionLine;
|
|
96
|
-
/** etOpenRound 去除毛刺
|
|
97
|
-
* @description 检查连续的短线段数量,去除合并后产生的毛刺
|
|
98
|
-
*/
|
|
99
|
-
private squareRemoveBurr;
|
|
100
|
-
/**
|
|
101
|
-
* 线段矫直, 线段中心突刺
|
|
102
|
-
* @description 突变长度小于墙体宽度,该线段可能为突起线段,
|
|
103
|
-
* @description 判断后续第2线段与上一条线段是否方向相同,相同就为突刺
|
|
104
|
-
*/
|
|
105
|
-
lineSegmentStraightening(path: Point[]): Point<Record<string, any>>[];
|
|
106
|
-
/**
|
|
107
|
-
* 移除短线段
|
|
108
|
-
* @todo 根据线段两端线段长度,选取参照物_|▔▔
|
|
109
|
-
* @param path
|
|
110
|
-
*/
|
|
111
|
-
removeShortLine(path: Point[], shortLine?: number): Point<Record<string, any>>[];
|
|
112
|
-
/** 线偏移
|
|
113
|
-
* @description 使用 ClipperLib 对每个点组进行线偏移处理,生成具有指定宽度的墙体路径
|
|
114
|
-
*/
|
|
115
|
-
lineOffset(endType?: number, joinType?: number, scale?: number): Point<Record<string, any>>[][];
|
|
116
|
-
/** 垂直纠正
|
|
117
|
-
* @param option
|
|
118
|
-
*/
|
|
119
|
-
axisAlignCorr(option?: SetDataOption): Promise<void>;
|
|
120
|
-
/** 完整线段数据
|
|
121
|
-
* @returns
|
|
122
|
-
*/
|
|
123
|
-
getLineSegments(clone?: boolean): LineSegment<LineUserData>[];
|
|
124
|
-
/**
|
|
125
|
-
* 将点云结构转换为Float32Array
|
|
126
|
-
*/
|
|
127
|
-
to3DArray(scale: number, z?: number): Float32Array<ArrayBuffer>;
|
|
128
|
-
/** 获取角度范围
|
|
129
|
-
* @param center
|
|
130
|
-
* @param p1
|
|
131
|
-
* @param p2
|
|
132
|
-
* @returns
|
|
133
|
-
*/
|
|
134
|
-
private getArcAngleRange;
|
|
135
|
-
/**
|
|
136
|
-
* 线段数据转为原始json数据
|
|
137
|
-
*/
|
|
138
|
-
lineDataToOriginalData(lines: LineSegment<LineUserData>[], quadtree?: Quadtree): OriginalDataItem[];
|
|
139
|
-
/**
|
|
140
|
-
* 转为绘制数据
|
|
141
|
-
*/
|
|
142
|
-
toDrawDataJson(unit?: Unit): DrawData;
|
|
143
|
-
/**
|
|
144
|
-
* @param type
|
|
145
|
-
*/
|
|
146
|
-
toDxfImageBlob(unit?: Unit, type?: string, background?: string): Promise<any>;
|
|
147
|
-
/**
|
|
148
|
-
* 将点json结构转换为Dxf string
|
|
149
|
-
*/
|
|
150
|
-
toDxfString(unit?: Unit): string;
|
|
151
|
-
/**
|
|
152
|
-
* 将点云结构转换为DXF格式
|
|
153
|
-
* @returns
|
|
154
|
-
*/
|
|
155
|
-
toDxfBlob(unit?: Unit): Blob;
|
|
156
|
-
/**
|
|
157
|
-
* 下载原始json
|
|
158
|
-
* @param filename
|
|
159
|
-
*/
|
|
160
|
-
downloadOriginalData(filename: string): Promise<void>;
|
|
161
|
-
/**
|
|
162
|
-
* 下载
|
|
163
|
-
* @param filename
|
|
164
|
-
*/
|
|
165
|
-
download(filename: string, unit?: Unit): Promise<void>;
|
|
166
|
-
/**
|
|
167
|
-
* 下载
|
|
168
|
-
* @param filename
|
|
169
|
-
*/
|
|
170
|
-
downloadImage(filename: string, unit?: Unit, type?: string): Promise<boolean>;
|
|
171
|
-
/**
|
|
172
|
-
* 计算原始数据的边界框
|
|
173
|
-
* @description 计算所有线段的起点和终点的最小最大值,形成一个边界框
|
|
174
|
-
* @returns
|
|
175
|
-
*/
|
|
176
|
-
private computedOriginalSize;
|
|
177
|
-
/**
|
|
178
|
-
* 创建数据
|
|
179
|
-
* @param pointsGroups
|
|
180
|
-
* @returns
|
|
181
|
-
*/
|
|
182
|
-
static createData(pointsGroups: Point[][], sealed?: boolean): OriginalDataItem[];
|
|
183
|
-
}
|