build-dxf 0.1.11 → 0.1.13

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.11",
3
+ "version": "0.1.13",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/build.js CHANGED
@@ -3881,9 +3881,10 @@ class CAD {
3881
3881
  /**
3882
3882
  * 转为绘制数据
3883
3883
  */
3884
- _cachedDrawData = null;
3884
+ _cachedDrawDataMap = /* @__PURE__ */ new Map();
3885
3885
  toDrawData(unit = "Centimeters") {
3886
- if (!this.needUpdate && this._cachedDrawData) return this._cachedDrawData;
3886
+ if (!this.needUpdate && this._cachedDrawDataMap.has(unit)) return this._cachedDrawDataMap.get(unit);
3887
+ this._cachedDrawDataMap.clear();
3887
3888
  this.needUpdate = false;
3888
3889
  const lines = this.groups.flatMap((group2) => group2.lines), s = units[unit], expansionWidth = 2, box = Box2.fromByLineSegment(...lines).expansion(expansionWidth), center = box.center, data = {
3889
3890
  unit,
@@ -3950,7 +3951,7 @@ class CAD {
3950
3951
  drawDottedLine(p2C, p2, 0.04, 0.05, "line2");
3951
3952
  drawLine2(p1C, p2C);
3952
3953
  color = "white";
3953
- drawText2((length * 10).toFixed(2) + "cm", line.center);
3954
+ drawText2((length * 100).toFixed(2) + "cm", line.center);
3954
3955
  }
3955
3956
  function drawArc(pos, radius, startAngle, endAngle) {
3956
3957
  data.arcs.push([
@@ -3970,7 +3971,7 @@ class CAD {
3970
3971
  } };
3971
3972
  set2.forEach((fun) => fun.handler(option));
3972
3973
  });
3973
- this._cachedDrawData = data;
3974
+ this._cachedDrawDataMap.set(unit, data);
3974
3975
  return data;
3975
3976
  }
3976
3977
  /** 转为图片
@@ -94,7 +94,7 @@ export declare class CAD {
94
94
  /**
95
95
  * 转为绘制数据
96
96
  */
97
- private _cachedDrawData;
97
+ private _cachedDrawDataMap;
98
98
  toDrawData(unit?: Unit): DrawData;
99
99
  /** 转为图片
100
100
  * @param type