build-dxf 0.1.96 → 0.1.98

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 +1 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.1.96",
3
+ "version": "0.1.98",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/build.js CHANGED
@@ -19322,15 +19322,13 @@ class AlignToParallelSegments {
19322
19322
  * @returns
19323
19323
  */
19324
19324
  static align(lines, esp = 0.05, gap = 0.05) {
19325
- const axisLine = lines[0], axisLineV = axisLine.clone().rotate(Math.PI * 0.5, axisLine.center);
19325
+ const axisLine = lines.find((line) => line.length() > 0.1), axisLineV = axisLine.clone().rotate(Math.PI * 0.5, axisLine.center);
19326
19326
  let [pllLines, verticalLines] = LineSegmentUtils.groupByParallelToAxis(lines, axisLine);
19327
19327
  const groups = this.group(pllLines, axisLine, axisLineV, esp, gap);
19328
19328
  pllLines = this.fittingAlignment(groups, verticalLines);
19329
19329
  verticalLines = verticalLines.filter((line) => line.length() > 1e-6);
19330
- TEST = true;
19331
19330
  const groups2 = this.group(verticalLines, axisLineV, axisLine, esp, gap);
19332
19331
  verticalLines = this.fittingAlignment(groups2, pllLines);
19333
- TEST = false;
19334
19332
  pllLines = pllLines.filter((line) => line.length() > 1e-6);
19335
19333
  return [
19336
19334
  ...pllLines,