@ifc-lite/drawing-2d 2.0.0 → 2.1.0

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 (49) hide show
  1. package/dist/color-raster.d.ts +95 -0
  2. package/dist/color-raster.d.ts.map +1 -0
  3. package/dist/color-raster.js +225 -0
  4. package/dist/color-raster.js.map +1 -0
  5. package/dist/drawing-generator.d.ts +12 -0
  6. package/dist/drawing-generator.d.ts.map +1 -1
  7. package/dist/drawing-generator.js +13 -4
  8. package/dist/drawing-generator.js.map +1 -1
  9. package/dist/edge-extractor.d.ts +17 -0
  10. package/dist/edge-extractor.d.ts.map +1 -1
  11. package/dist/edge-extractor.js +95 -0
  12. package/dist/edge-extractor.js.map +1 -1
  13. package/dist/half-space-clip.d.ts +77 -0
  14. package/dist/half-space-clip.d.ts.map +1 -0
  15. package/dist/half-space-clip.js +257 -0
  16. package/dist/half-space-clip.js.map +1 -0
  17. package/dist/hidden-line-raster.d.ts +11 -2
  18. package/dist/hidden-line-raster.d.ts.map +1 -1
  19. package/dist/hidden-line-raster.js +7 -58
  20. package/dist/hidden-line-raster.js.map +1 -1
  21. package/dist/index.d.ts +11 -3
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +25 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/pdf-scale.d.ts +17 -0
  26. package/dist/pdf-scale.d.ts.map +1 -1
  27. package/dist/pdf-scale.js +38 -0
  28. package/dist/pdf-scale.js.map +1 -1
  29. package/dist/raster-core.d.ts +71 -0
  30. package/dist/raster-core.d.ts.map +1 -0
  31. package/dist/raster-core.js +89 -0
  32. package/dist/raster-core.js.map +1 -0
  33. package/dist/sheet/index.d.ts +2 -0
  34. package/dist/sheet/index.d.ts.map +1 -1
  35. package/dist/sheet/index.js +1 -0
  36. package/dist/sheet/index.js.map +1 -1
  37. package/dist/sheet/scale-stamp.d.ts +130 -0
  38. package/dist/sheet/scale-stamp.d.ts.map +1 -0
  39. package/dist/sheet/scale-stamp.js +277 -0
  40. package/dist/sheet/scale-stamp.js.map +1 -0
  41. package/dist/view-plane.d.ts +99 -0
  42. package/dist/view-plane.d.ts.map +1 -0
  43. package/dist/view-plane.js +183 -0
  44. package/dist/view-plane.js.map +1 -0
  45. package/dist/world-line-seeds.d.ts +41 -0
  46. package/dist/world-line-seeds.d.ts.map +1 -0
  47. package/dist/world-line-seeds.js +43 -0
  48. package/dist/world-line-seeds.js.map +1 -0
  49. package/package.json +1 -1
@@ -0,0 +1,43 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ import { EPSILON, point2DDistance } from './math.js';
5
+ import { projectPointForPlane, signedDepth } from './projection-bands.js';
6
+ /**
7
+ * Project `seeds` into drawing lines against `plane`.
8
+ *
9
+ * Segments whose 2D projection collapses to a point (an edge parallel to the
10
+ * view direction) are dropped: they carry no information on the page and
11
+ * would only add zero-length strokes for the line merger and the PDF writer
12
+ * to trip over.
13
+ */
14
+ export function projectWorldLineSeeds(seeds, plane) {
15
+ const lines = [];
16
+ for (const seed of seeds) {
17
+ const start = projectPointForPlane(seed.start, plane);
18
+ const end = projectPointForPlane(seed.end, plane);
19
+ if (point2DDistance(start, end) < EPSILON)
20
+ continue;
21
+ // VIEW depth (issue #2639): the negated flip-adjusted signed depth — 0 at
22
+ // the plane, growing into the kept half, smaller means nearer the viewer.
23
+ // Identical quantity to the one `buildDepthRaster` stores per pixel.
24
+ const depth = -signedDepth(seed.start, plane);
25
+ const depthEnd = -signedDepth(seed.end, plane);
26
+ const line = {
27
+ line: { start, end },
28
+ category: 'cut',
29
+ visibility: 'visible',
30
+ entityId: seed.entityId,
31
+ ifcType: seed.ifcType,
32
+ modelIndex: seed.modelIndex,
33
+ depth,
34
+ };
35
+ // "Omitted means constant depth" — only carry `depthEnd` when it differs,
36
+ // matching what every other producer in this package emits.
37
+ if (depthEnd !== depth)
38
+ line.depthEnd = depthEnd;
39
+ lines.push(line);
40
+ }
41
+ return lines;
42
+ }
43
+ //# sourceMappingURL=world-line-seeds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"world-line-seeds.js","sourceRoot":"","sources":["../src/world-line-seeds.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA0B/D,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAW1E;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAA+B,EAC/B,KAAyB;IAEzB,MAAM,KAAK,GAAkB,EAAE,CAAC;IAEhC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,KAAK,GAAY,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC/D,MAAM,GAAG,GAAY,oBAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3D,IAAI,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,OAAO;YAAE,SAAS;QAEpD,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,MAAM,KAAK,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9C,MAAM,QAAQ,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAE/C,MAAM,IAAI,GAAgB;YACxB,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;YACpB,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,SAAS;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK;SACN,CAAC;QACF,0EAA0E;QAC1E,4DAA4D;QAC5D,IAAI,QAAQ,KAAK,KAAK;YAAE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACjD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ifc-lite/drawing-2d",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "2D architectural drawing generation from IFC models - section cuts, floor plans, and elevations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",