build-dxf 0.1.97 → 0.1.99

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/build.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.1.97",
3
+ "version": "0.1.99",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/build.js CHANGED
@@ -19220,7 +19220,8 @@ function layoutDesign(lines, axis, intersectPoints) {
19220
19220
  });
19221
19221
  const newLines = [];
19222
19222
  for (let i = 0; i < blocks.length; i++) {
19223
- const block = blocks[i], line = lines[block.index], ranges = [];
19223
+ const block = blocks[i], line = lines[block.index];
19224
+ let ranges = [];
19224
19225
  let start = block.range[0];
19225
19226
  for (let j = i + 1; j < blocks.length; j++) {
19226
19227
  const nextBlock = blocks[j];
@@ -19232,6 +19233,7 @@ function layoutDesign(lines, axis, intersectPoints) {
19232
19233
  start = Math.max(start, nextBlock.range[1]);
19233
19234
  }
19234
19235
  if (start < block.range[1]) ranges.push([start, block.range[1]]);
19236
+ ranges = ranges.filter((range) => range[1] - range[0] > 1e-4);
19235
19237
  for (let j = 0; j < ranges.length; j++) {
19236
19238
  const range = ranges[j], start2 = axis.pointAt(range[0]), end = axis.pointAt(range[1]);
19237
19239
  if (j === 0) {
@@ -19322,7 +19324,7 @@ class AlignToParallelSegments {
19322
19324
  * @returns
19323
19325
  */
19324
19326
  static align(lines, esp = 0.05, gap = 0.05) {
19325
- const axisLine = lines.find((line) => line.length() > 0.1), axisLineV = axisLine.clone().rotate(Math.PI * 0.5, axisLine.center);
19327
+ const axisLine = lines.find((line) => line.length() > 0.4), axisLineV = axisLine.clone().rotate(Math.PI * 0.5, axisLine.center);
19326
19328
  let [pllLines, verticalLines] = LineSegmentUtils.groupByParallelToAxis(lines, axisLine);
19327
19329
  const groups = this.group(pllLines, axisLine, axisLineV, esp, gap);
19328
19330
  pllLines = this.fittingAlignment(groups, verticalLines);