build-dxf 0.1.79 → 0.1.80

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.1.79",
3
+ "version": "0.1.80",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/build.js CHANGED
@@ -3107,7 +3107,9 @@ class WallInsertObject {
3107
3107
  return item.id ?? item.doorId;
3108
3108
  }
3109
3109
  static getNearId(item) {
3110
- return item.nearId ?? item.nearDoorId;
3110
+ let nearId = item.nearId ?? item.nearDoorId;
3111
+ if (nearId === -1) nearId = void 0;
3112
+ return nearId;
3111
3113
  }
3112
3114
  /** 遍历孔洞
3113
3115
  * @param line
@@ -6571,6 +6573,39 @@ class MaxiCircles extends MiniCircles {
6571
6573
  };
6572
6574
  }
6573
6575
  }
6576
+ const maxiCircles$1 = new MaxiCircles();
6577
+ function buildBayWindowGroup(lines, clear = true) {
6578
+ const bayWindowLines = lines.filter((line) => line.userData.isBayWindow), groupedLineSet = /* @__PURE__ */ new Set();
6579
+ const removeSet = findDiscretePointLine2(lines, null, true);
6580
+ const lines_ = lines.filter((line) => !removeSet.has(line));
6581
+ lines.forEach((line) => {
6582
+ if (LineGroupType.hasType(line, "bayWindow")) {
6583
+ if (line.userData.isWindow) line.currentData.isBayWindowLine = true;
6584
+ LineGroupType.removeByType(line, "bayWindow");
6585
+ }
6586
+ });
6587
+ const grid = createPointVirtualGrid(lines);
6588
+ removeSet.clear();
6589
+ bayWindowLines.forEach((bayWindowLine) => {
6590
+ let { circles } = maxiCircles$1.miniCircle(lines_, { circleEdges: [bayWindowLine] });
6591
+ circles = circles.filter((group) => group.some((line) => line.userData.isWindow && line.currentData.isBayWindowLine));
6592
+ if (circles.length) {
6593
+ grid.queryPolygon(Polygon.fromByLines(circles[0]), "inside").forEach((res) => removeSet.add(res.userData));
6594
+ }
6595
+ const id = uuid();
6596
+ if (circles.length) {
6597
+ const group = circles[0];
6598
+ group.forEach((line) => {
6599
+ clear && LineGroupType.clear(line);
6600
+ LineGroupType.set(line, id, "bayWindow", true);
6601
+ groupedLineSet.add(line);
6602
+ });
6603
+ } else clear && LineGroupType.clear(bayWindowLine);
6604
+ });
6605
+ lines = lines.filter((line) => !removeSet.has(line));
6606
+ clear && lines.forEach((line) => groupedLineSet.has(line) || LineGroupType.clear(line));
6607
+ return lines;
6608
+ }
6574
6609
  const maxiCircles = new MaxiCircles();
6575
6610
  let trajectory;
6576
6611
  function isDoublePeDoorCircle(circle) {
@@ -6588,7 +6623,6 @@ function isDoublePeDoorCircle(circle) {
6588
6623
  return matching.length > 0;
6589
6624
  }
6590
6625
  function isPolyHasTrajectoryPoint(lines) {
6591
- if (isDoublePeDoorCircle(lines)) return true;
6592
6626
  if (!trajectory) return true;
6593
6627
  const ploy = Polygon.fromByLines2(lines);
6594
6628
  const box = ploy.getBox2();
@@ -6599,29 +6633,56 @@ function isPolyHasTrajectoryPoint(lines) {
6599
6633
  }
6600
6634
  return true;
6601
6635
  }
6602
- function buildDoubleWallGroup_(lines_, clearInternalLine = false) {
6603
- const doorLines = [], otherLines = [], peDoubleDoors = [];
6604
- for (let i = 0; i < lines_.length; i++) {
6605
- const line = lines_[i];
6636
+ function initData(lines) {
6637
+ const doorLines = [], otherLines = [], bayWindowLines = [], peDoors = [], peDoubleDoors = [];
6638
+ for (let i = 0; i < lines.length; i++) {
6639
+ const line = lines[i];
6606
6640
  if (line.userData.isDoor) {
6607
6641
  doorLines.push(line);
6608
6642
  continue;
6609
6643
  }
6610
6644
  if (line.userData.isBayWindow) {
6645
+ bayWindowLines.push(line);
6611
6646
  continue;
6612
6647
  }
6613
6648
  if (line.userData.isPassageEntrance && line.userData.passageEntrance?.length) {
6614
- const isDoubleDoor = line.userData.passageEntrance.some((item) => typeof WIO.getId(item) === "number");
6649
+ const isDoubleDoor = line.userData.passageEntrance.some((item) => typeof WIO.getNearId(item) === "number");
6615
6650
  if (isDoubleDoor) peDoubleDoors.push(line);
6651
+ else peDoors.push(line);
6616
6652
  continue;
6617
6653
  }
6618
6654
  otherLines.push(line);
6619
6655
  }
6620
- otherLines.push(...peDoubleDoors);
6621
- let { internalEdges, circles } = maxiCircles.maxiCircles(otherLines, (circles2) => {
6622
- return circles2.filter(isPolyHasTrajectoryPoint);
6623
- });
6624
- const finalCircles = circles.filter((circle) => circle.length > 3);
6656
+ return { doorLines, otherLines, bayWindowLines, peDoors, peDoubleDoors };
6657
+ }
6658
+ function getPeDoubleDoorCircles(lines, peDoubleDoorLines) {
6659
+ let allLines = [...lines, ...peDoubleDoorLines];
6660
+ const notFoundLines = [];
6661
+ const circlesList = [];
6662
+ for (let i = 0; i < peDoubleDoorLines.length; i++) {
6663
+ const line = peDoubleDoorLines[i];
6664
+ let { circles } = maxiCircles.miniCircle(allLines, { circleEdges: [line] });
6665
+ const finalCircles = circles.filter(isDoublePeDoorCircle);
6666
+ if (finalCircles.length) circlesList.push(...finalCircles);
6667
+ else notFoundLines.push(line);
6668
+ }
6669
+ return {
6670
+ circlesList,
6671
+ notFoundLines
6672
+ };
6673
+ }
6674
+ function buildDoubleWallGroup_(lines_, clearInternalLine = false) {
6675
+ const {
6676
+ doorLines,
6677
+ otherLines,
6678
+ // bayWindowLines,
6679
+ // peDoors,
6680
+ peDoubleDoors
6681
+ } = initData(lines_);
6682
+ const { notFoundLines, circlesList } = getPeDoubleDoorCircles(otherLines, peDoubleDoors);
6683
+ otherLines.push(...notFoundLines);
6684
+ let { internalEdges, circles } = maxiCircles.maxiCircles(otherLines, (circles2) => circles2.filter(isPolyHasTrajectoryPoint));
6685
+ const { circles: finalCircles } = maxiCircles.mergeCircles([...circlesList, ...circles], internalEdges);
6625
6686
  lines_.forEach((line) => LineGroupType.removeByTypes(line, ["doubleWall", "wall"]));
6626
6687
  const grid = new PointVirtualGrid(), finalCirclesSet = new Set(finalCircles.flat(2));
6627
6688
  otherLines.forEach((line) => !finalCirclesSet.has(line) && grid.insert(line.center, line));
@@ -6650,38 +6711,6 @@ const buildDoubleWallGroup = Object.assign(buildDoubleWallGroup_, {
6650
6711
  else trajectory = void 0;
6651
6712
  }
6652
6713
  });
6653
- function buildBayWindowGroup(lines, clear = true) {
6654
- const bayWindowLines = lines.filter((line) => line.userData.isBayWindow), groupedLineSet = /* @__PURE__ */ new Set();
6655
- const removeSet = findDiscretePointLine2(lines, null, true);
6656
- const lines_ = lines.filter((line) => !removeSet.has(line));
6657
- lines.forEach((line) => {
6658
- if (LineGroupType.hasType(line, "bayWindow")) {
6659
- if (line.userData.isWindow) line.currentData.isBayWindowLine = true;
6660
- LineGroupType.removeByType(line, "bayWindow");
6661
- }
6662
- });
6663
- const grid = createPointVirtualGrid(lines);
6664
- removeSet.clear();
6665
- bayWindowLines.forEach((bayWindowLine) => {
6666
- let { circles } = maxiCircles.miniCircle(lines_, { circleEdges: [bayWindowLine] });
6667
- circles = circles.filter((group) => group.some((line) => line.userData.isWindow && line.currentData.isBayWindowLine));
6668
- if (circles.length) {
6669
- grid.queryPolygon(Polygon.fromByLines(circles[0]), "inside").forEach((res) => removeSet.add(res.userData));
6670
- }
6671
- const id = uuid();
6672
- if (circles.length) {
6673
- const group = circles[0];
6674
- group.forEach((line) => {
6675
- clear && LineGroupType.clear(line);
6676
- LineGroupType.set(line, id, "bayWindow", true);
6677
- groupedLineSet.add(line);
6678
- });
6679
- } else clear && LineGroupType.clear(bayWindowLine);
6680
- });
6681
- lines = lines.filter((line) => !removeSet.has(line));
6682
- clear && lines.forEach((line) => groupedLineSet.has(line) || LineGroupType.clear(line));
6683
- return lines;
6684
- }
6685
6714
  class DoubleWallHelper {
6686
6715
  static errorAngle = 4;
6687
6716
  /** 线段投影分析
@@ -8484,7 +8513,7 @@ class AxisAlignCorr {
8484
8513
  }
8485
8514
  }
8486
8515
  function shortDistanceLink(lines, radius = 0.1) {
8487
- const dpLines = [...findDiscretePointLine2(lines.filter((line) => !line.userData.isDoor), void 0, false)], pointVirtualGrid = createPointVirtualGrid(dpLines), appendLines = [], visited = /* @__PURE__ */ new Set();
8516
+ const dpSet = findDiscretePoint(lines.filter((line) => !line.userData.isDoor)), pointVirtualGrid = createPointVirtualGrid(dpSet.map((v2) => v2)), appendLines = [], visited = /* @__PURE__ */ new Set();
8488
8517
  const getWeight2 = (target, point2, line) => {
8489
8518
  if (target.weight) return target.weight;
8490
8519
  const targetLine = target.userData, targetPoint = target.point;
@@ -8492,24 +8521,21 @@ function shortDistanceLink(lines, radius = 0.1) {
8492
8521
  target.weight = weight;
8493
8522
  return weight;
8494
8523
  };
8495
- for (let i = 0; i < dpLines.length; i++) {
8496
- const line = dpLines[i];
8524
+ for (const [point2, line] of dpSet) {
8497
8525
  if (line.userData.isDoor) continue;
8498
- line.points.forEach((point2) => {
8499
- if (visited.has(point2)) return false;
8500
- const list = pointVirtualGrid.queryCircle(point2, radius, true).map((item) => Object.assign({}, item)).filter((item) => {
8501
- const targetLine2 = item.userData, targetPoint2 = item.point, direct1 = line.getAnotherPoint(point2).directionFrom(point2), direct2 = targetLine2.getAnotherPoint(targetPoint2).directionFrom(targetPoint2), angle = direct1.angleBetween(direct2, "angle");
8502
- return angle > 90;
8503
- }).sort((a2, b4) => getWeight2(b4, point2, line) - getWeight2(a2, point2, line));
8504
- if (list.length === 0) return;
8505
- const { point: targetPoint } = list[0];
8506
- const targetLine = list[0].userData;
8507
- visited.add(point2);
8508
- visited.add(targetPoint);
8509
- const projectLine1 = line.projectLineSegment(targetLine), projectLine2 = targetLine.projectLineSegment(line), len1 = projectLine1.length(), len2 = projectLine2.length();
8510
- if (len1 === 0 && len2 === 0) appendLines.push(new LineSegment(point2.clone(), list[0].point.clone()));
8511
- else appendLines.push(new LineSegment(projectLine1.center, projectLine2.center));
8512
- });
8526
+ if (visited.has(point2)) continue;
8527
+ const list = pointVirtualGrid.queryCircle(point2, radius, true).map((item) => Object.assign({}, item)).filter((item) => {
8528
+ const targetLine2 = item.userData, targetPoint2 = item.point, direct1 = line.getAnotherPoint(point2).directionFrom(point2), direct2 = targetLine2.getAnotherPoint(targetPoint2).directionFrom(targetPoint2), angle = direct1.angleBetween(direct2, "angle");
8529
+ return angle > 90;
8530
+ }).sort((a2, b4) => getWeight2(b4, point2, line) - getWeight2(a2, point2, line));
8531
+ if (list.length === 0) continue;
8532
+ const { point: targetPoint } = list[0];
8533
+ const targetLine = list[0].userData;
8534
+ visited.add(point2);
8535
+ visited.add(targetPoint);
8536
+ const projectLine1 = line.projectLineSegment(targetLine), projectLine2 = targetLine.projectLineSegment(line), len1 = projectLine1.length(), len2 = projectLine2.length();
8537
+ if (len1 === 0 && len2 === 0) appendLines.push(new LineSegment(point2.clone(), list[0].point.clone()));
8538
+ else appendLines.push(new LineSegment(projectLine1.center, projectLine2.center));
8513
8539
  }
8514
8540
  return [...lines, ...appendLines];
8515
8541
  }
@@ -8645,9 +8671,7 @@ function axisAlignCorr$1(lines, targettLine, option) {
8645
8671
  if (wallGroup) {
8646
8672
  newLines = DoubleWallHelper.complementSide(newLines);
8647
8673
  WallInsertObject.recomputed(newLines);
8648
- TEST = true;
8649
8674
  newLines = buildDoubleWallGroup(newLines, true);
8650
- TEST = false;
8651
8675
  newLines = buildBayWindowGroup(newLines, false);
8652
8676
  }
8653
8677
  new WallInsertObject(lines).recomputed().merge();
@@ -19267,19 +19291,16 @@ function removeShortDoubleWall(lineSegments) {
19267
19291
  const doubleWalls = LineGroupType.getGroupsByType(lineSegments, "doubleWall"), freePointLines = [...findDiscretePointLine2(lineSegments)].filter((line) => line.length() < 0.3), grid = createPointVirtualGrid(doubleWalls.flat(4)), lines = freePointLines.filter((line) => grid.queryPoint(line.start).length > 0 || grid.queryPoint(line.end).length > 0), removeSet = new Set(lines);
19268
19292
  return lineSegments.filter((line) => !removeSet.has(line));
19269
19293
  }
19270
- function connectionCorr(point2, next, line, width) {
19294
+ function getNextPoint(point2, line, next, width) {
19271
19295
  if (next.length === 0) {
19272
19296
  const direct = point2.directionFrom(line.getAnotherPoint(point2));
19273
- point2.add(direct.multiplyScalar(width));
19274
- return true;
19297
+ return direct.multiplyScalar(width);
19275
19298
  }
19276
19299
  const p2 = next[0].userData.projectPoint(point2, false);
19277
19300
  if (!p2) return false;
19278
- point2.copy(p2);
19279
- next.forEach((d2) => d2.point.copy(p2));
19280
- return true;
19301
+ return p2;
19281
19302
  }
19282
- function stepElimination$1(lineSegments, callBack) {
19303
+ function stepElimination(lineSegments, onMerge) {
19283
19304
  const grid = createPointVirtualGrid(lineSegments);
19284
19305
  const minWidth = 0.1;
19285
19306
  function getIntersInfo(line, point2) {
@@ -19300,7 +19321,6 @@ function stepElimination$1(lineSegments, callBack) {
19300
19321
  }
19301
19322
  if (count !== 1) return;
19302
19323
  if (!firstLine || !firstPoint) return;
19303
- if (parallel2.length !== 0) return;
19304
19324
  const firstOtherPoint = firstLine.getAnotherPoint(firstPoint);
19305
19325
  const nextResult = grid.queryPoint(firstOtherPoint, true);
19306
19326
  return {
@@ -19336,16 +19356,22 @@ function stepElimination$1(lineSegments, callBack) {
19336
19356
  mainInfo = endInfo;
19337
19357
  secondaryInfo = startInfo;
19338
19358
  }
19339
- const oldLine = mainInfo.firstLine.clone();
19340
- if (!connectionCorr(mainInfo.firstPoint, secondaryInfo.next, mainInfo.firstLine, secondaryInfo.length)) continue;
19341
- removeLines.push(secondaryInfo.firstLine, line);
19342
- secondaryInfo.firstLine.points.forEach((p2) => grid.remove(p2));
19343
- line.points.forEach((p2) => grid.remove(p2));
19344
- mainInfo.firstLine.points.forEach((p2) => grid.update(p2));
19345
- if (typeof callBack === "function") callBack(mainInfo.firstLine, line, secondaryInfo.firstLine, oldLine);
19359
+ const parallel2 = startInfo.parallel.concat(endInfo.parallel);
19360
+ const newPoint = getNextPoint(mainInfo.firstPoint, mainInfo.firstLine, secondaryInfo.next, secondaryInfo.length);
19361
+ if (!newPoint) continue;
19362
+ if (parallel2.length === 0) {
19363
+ const oldLine = mainInfo.firstLine.clone();
19364
+ mainInfo.firstPoint.copy(newPoint);
19365
+ secondaryInfo.next.forEach((d2) => d2.point.copy(newPoint));
19366
+ removeLines.push(secondaryInfo.firstLine, line);
19367
+ line.points.concat(secondaryInfo.firstLine.points).forEach((p2) => grid.remove(p2));
19368
+ mainInfo.firstLine.points.forEach((p2) => grid.update(p2));
19369
+ if (typeof onMerge === "function") onMerge(mainInfo.firstLine, line, secondaryInfo.firstLine, oldLine);
19370
+ }
19346
19371
  }
19347
19372
  const removeLinesSet = new Set(removeLines);
19348
19373
  lineSegments = lineSegments.filter((line) => !removeLinesSet.has(line));
19374
+ lineSegments = lineSegmentClipping(lineSegments, 0);
19349
19375
  return lineSegments;
19350
19376
  }
19351
19377
  function repetitiveTask(count, callfun) {
@@ -19353,32 +19379,31 @@ function repetitiveTask(count, callfun) {
19353
19379
  callfun(i);
19354
19380
  }
19355
19381
  }
19356
- function stepElimination(lines, opt) {
19357
- repetitiveTask(2, () => {
19358
- lines = stepElimination$1(lines, (target, _, source, oldLine) => {
19359
- if (source.userData.isDoor) WallInsertObject.addInsertObject(target, {
19360
- p: source.center.toJson(opt?.originalZ),
19361
- width: source.length(),
19362
- full: false,
19363
- type: "door",
19364
- height: source.userData.drawDoorData.height,
19365
- groundClearance: source.userData.drawDoorData.groundClearance
19366
- });
19367
- if (target.userData.isDoor) {
19368
- delete target.userData.isDoor;
19369
- WallInsertObject.addInsertObject(target, {
19370
- p: oldLine.center.toJson(opt?.originalZ),
19371
- width: oldLine.length(),
19372
- full: false,
19373
- type: "door",
19374
- height: target.userData.drawDoorData?.height,
19375
- groundClearance: target.userData.drawDoorData?.groundClearance ?? 0
19376
- });
19377
- }
19378
- WallInsertObject.copyInsertObject(target, source);
19379
- WallInsertObject.recomputed([target]);
19380
- });
19382
+ function stepEliminationMerge(target, _, source, oldLine) {
19383
+ if (source.userData.isDoor) WallInsertObject.addInsertObject(target, {
19384
+ p: source.center.toJson(),
19385
+ width: source.length(),
19386
+ full: false,
19387
+ type: "door",
19388
+ height: source.userData.drawDoorData.height,
19389
+ groundClearance: source.userData.drawDoorData.groundClearance
19381
19390
  });
19391
+ if (target.userData.isDoor) {
19392
+ delete target.userData.isDoor;
19393
+ WallInsertObject.addInsertObject(target, {
19394
+ p: oldLine.center.toJson(),
19395
+ width: oldLine.length(),
19396
+ full: false,
19397
+ type: "door",
19398
+ height: target.userData.drawDoorData?.height,
19399
+ groundClearance: target.userData.drawDoorData?.groundClearance ?? 0
19400
+ });
19401
+ }
19402
+ WallInsertObject.copyInsertObject(target, source);
19403
+ WallInsertObject.recomputed([target]);
19404
+ }
19405
+ function linesSmoothing(lines, _) {
19406
+ repetitiveTask(1, () => lines = stepElimination(lines, stepEliminationMerge));
19382
19407
  return lines;
19383
19408
  }
19384
19409
  const PRE_PROCESSOR = {
@@ -19399,9 +19424,9 @@ const PRE_PROCESSOR = {
19399
19424
  /** 处理门线垂直方向有其他线段遮挡的情况
19400
19425
  */
19401
19426
  DoorSpaceHandle: doorSpaceHandle,
19402
- /** 阶梯合并
19427
+ /** 线段平滑处理
19403
19428
  */
19404
- StepElimination: stepElimination,
19429
+ LinesSmoothing: linesSmoothing,
19405
19430
  /** 移除与双线墙链接的短线段
19406
19431
  */
19407
19432
  RemoveShortDoubleWall: removeShortDoubleWall
@@ -22142,7 +22167,7 @@ async function buildJson(opt) {
22142
22167
  doorFind && (dxfSystem.Dxf.addPreProcessor(PRE_PROCESSOR.DoorSpaceHandle), dxfSystem.Dxf.addPreProcessor(PRE_PROCESSOR.DoorFind), dxfSystem.Dxf.addPreProcessor(PRE_PROCESSOR.DoorSpaceHandle));
22143
22168
  if (opt.axisAlignCorr !== false) {
22144
22169
  dxfSystem.Dxf.addPreProcessor(PRE_PROCESSOR.AxisAlignCorr);
22145
- dxfSystem.Dxf.addPreProcessor(PRE_PROCESSOR.StepElimination);
22170
+ dxfSystem.Dxf.addPreProcessor(PRE_PROCESSOR.LinesSmoothing);
22146
22171
  dxfSystem.Dxf.addPreProcessor(PRE_PROCESSOR.RemoveShortDoubleWall);
22147
22172
  }
22148
22173
  if (trajectory2) {
@@ -15,7 +15,7 @@ export declare class CorrectionDxf<TEventMap extends {} = {}> extends Dxf<{} & T
15
15
  DoubleWallAlignment: typeof import('../utils/lineHandle/CadPreProcessor/doubleWallAlignment').doubleWallAlignment;
16
16
  WallHeightHandle: typeof import('../utils/lineHandle/CadPreProcessor/wallHeightHandle').wallHeightHandle;
17
17
  DoorSpaceHandle: typeof import('../utils/lineHandle/CadPreProcessor/doorSpaceHandle').doorSpaceHandle;
18
- StepElimination: typeof import('../utils/lineHandle/CadPreProcessor/stepElimination').stepElimination;
18
+ LinesSmoothing: typeof import('../utils/lineHandle/CadPreProcessor/linesSmoothing').linesSmoothing;
19
19
  RemoveShortDoubleWall: typeof import('../utils/lineHandle/CadPreProcessor/removeShortDoubleWall').removeShortDoubleWall;
20
20
  };
21
21
  rotateCorrCad?: CAD;
@@ -29,7 +29,7 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
29
29
  DoubleWallAlignment: typeof import('../utils/lineHandle/CadPreProcessor/doubleWallAlignment').doubleWallAlignment;
30
30
  WallHeightHandle: typeof import('../utils/lineHandle/CadPreProcessor/wallHeightHandle').wallHeightHandle;
31
31
  DoorSpaceHandle: typeof import('../utils/lineHandle/CadPreProcessor/doorSpaceHandle').doorSpaceHandle;
32
- StepElimination: typeof import('../utils/lineHandle/CadPreProcessor/stepElimination').stepElimination;
32
+ LinesSmoothing: typeof import('../utils/lineHandle/CadPreProcessor/linesSmoothing').linesSmoothing;
33
33
  RemoveShortDoubleWall: typeof import('../utils/lineHandle/CadPreProcessor/removeShortDoubleWall').removeShortDoubleWall;
34
34
  };
35
35
  width: number;
@@ -6,7 +6,7 @@ import { doubleWallAlignment } from './doubleWallAlignment';
6
6
  import { wallHeightHandle } from './wallHeightHandle';
7
7
  import { doorSpaceHandle } from './doorSpaceHandle';
8
8
  import { removeShortDoubleWall } from './removeShortDoubleWall';
9
- import { stepElimination } from './stepElimination';
9
+ import { linesSmoothing } from './linesSmoothing';
10
10
  /**
11
11
  * 默认提供的预处理函数
12
12
  */
@@ -28,9 +28,9 @@ export declare const PRE_PROCESSOR: {
28
28
  /** 处理门线垂直方向有其他线段遮挡的情况
29
29
  */
30
30
  DoorSpaceHandle: typeof doorSpaceHandle;
31
- /** 阶梯合并
31
+ /** 线段平滑处理
32
32
  */
33
- StepElimination: typeof stepElimination;
33
+ LinesSmoothing: typeof linesSmoothing;
34
34
  /** 移除与双线墙链接的短线段
35
35
  */
36
36
  RemoveShortDoubleWall: typeof removeShortDoubleWall;
@@ -1,3 +1,3 @@
1
1
  import { LineSegment } from '../../../../algorithmsStructures/LineSegment';
2
2
  import { SetDataOption } from '../../../type';
3
- export declare function stepElimination(lines: LineSegment[], opt?: SetDataOption): LineSegment<Record<string, any>>[];
3
+ export declare function linesSmoothing(lines: LineSegment[], _?: SetDataOption): LineSegment<Record<string, any>>[];
@@ -0,0 +1,7 @@
1
+ import { LineSegment } from '../../../../algorithmsStructures/LineSegment';
2
+ import { LineUserData } from '../../../type';
3
+ /** 构建飘窗组组结构
4
+ * @param lines
5
+ * @returns
6
+ */
7
+ export declare function buildBayWindowGroup(lines: LineSegment<LineUserData>[], clear?: boolean): LineSegment<LineUserData>[];
@@ -1,5 +1,5 @@
1
- import { LineSegment } from '../../../algorithmsStructures/LineSegment';
2
- import { LineUserData } from '../../type';
1
+ import { LineSegment } from '../../../../algorithmsStructures/LineSegment';
2
+ import { LineUserData } from '../../../type';
3
3
  /** 双线墙
4
4
  * @param lines_
5
5
  * @param clearInternalLine
@@ -10,8 +10,3 @@ export declare function buildDoubleWallGroup_(lines_: LineSegment<LineUserData>[
10
10
  export declare const buildDoubleWallGroup: typeof buildDoubleWallGroup_ & {
11
11
  setTrajectory(trajectory_: Record<string, any> | undefined): void;
12
12
  };
13
- /** 构建飘窗组组结构
14
- * @param lines
15
- * @returns
16
- */
17
- export declare function buildBayWindowGroup(lines: LineSegment<LineUserData>[], clear?: boolean): LineSegment<LineUserData>[];
@@ -0,0 +1,2 @@
1
+ export * from './buildBayWindowGroup';
2
+ export * from './buildDoubleWallGroup';
@@ -2,7 +2,7 @@ import { LineSegment } from '../../../algorithmsStructures/LineSegment';
2
2
  import { InsertObject, LineUserData } from '../../type';
3
3
  type InsertObjectKey = 'drawWindow' | 'passageEntrance';
4
4
  /**
5
- * 墙体嵌入物(窗户、空洞)
5
+ * 墙体嵌入物(窗户、空洞)处理
6
6
  */
7
7
  export declare class WallInsertObject {
8
8
  static mountedObjectType: never[];
@@ -3,4 +3,4 @@ import { LineSegment } from './LineSegment';
3
3
  * @param lineSegments
4
4
  * @returns
5
5
  */
6
- export declare function stepElimination(lineSegments: LineSegment[], callBack?: (mainLine: LineSegment, sortLine: LineSegment, secondaryLine: LineSegment, oldLine: LineSegment) => void): LineSegment<Record<string, any>>[];
6
+ export declare function stepElimination(lineSegments: LineSegment[], onMerge?: (mainLine: LineSegment, sortLine: LineSegment, secondaryLine: LineSegment, oldLine: LineSegment) => void): LineSegment<Record<string, any>>[];