@ifc-lite/drawing-2d 5.1.0 → 5.2.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.
- package/README.md +55 -0
- package/dist/drawing-generator.d.ts +19 -9
- package/dist/drawing-generator.d.ts.map +1 -1
- package/dist/drawing-generator.js +39 -244
- package/dist/drawing-generator.js.map +1 -1
- package/dist/drawing-mesh-source.d.ts +28 -0
- package/dist/drawing-mesh-source.d.ts.map +1 -0
- package/dist/drawing-mesh-source.js +13 -0
- package/dist/drawing-mesh-source.js.map +1 -0
- package/dist/drawing-session.d.ts +78 -0
- package/dist/drawing-session.d.ts.map +1 -0
- package/dist/drawing-session.js +225 -0
- package/dist/drawing-session.js.map +1 -0
- package/dist/hidden-line-raster.d.ts +8 -0
- package/dist/hidden-line-raster.d.ts.map +1 -1
- package/dist/hidden-line-raster.js +16 -5
- package/dist/hidden-line-raster.js.map +1 -1
- package/dist/hidden-line.d.ts +8 -0
- package/dist/hidden-line.d.ts.map +1 -1
- package/dist/hidden-line.js +17 -1
- package/dist/hidden-line.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/open-surface.d.ts +24 -0
- package/dist/open-surface.d.ts.map +1 -1
- package/dist/open-surface.js +68 -8
- package/dist/open-surface.js.map +1 -1
- package/dist/projection-collector.d.ts +38 -0
- package/dist/projection-collector.d.ts.map +1 -0
- package/dist/projection-collector.js +84 -0
- package/dist/projection-collector.js.map +1 -0
- package/dist/storey-bands.d.ts +12 -0
- package/dist/storey-bands.d.ts.map +1 -1
- package/dist/storey-bands.js +38 -20
- package/dist/storey-bands.js.map +1 -1
- package/dist/svg-exporter.d.ts +0 -1
- package/dist/svg-exporter.d.ts.map +1 -1
- package/dist/svg-exporter.js +5 -38
- package/dist/svg-exporter.js.map +1 -1
- package/dist/svg-hatch-patterns.d.ts +6 -0
- package/dist/svg-hatch-patterns.d.ts.map +1 -0
- package/dist/svg-hatch-patterns.js +40 -0
- package/dist/svg-hatch-patterns.js.map +1 -0
- package/dist/svg-transform.d.ts +8 -2
- package/dist/svg-transform.d.ts.map +1 -1
- package/dist/svg-transform.js +11 -3
- package/dist/svg-transform.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -70,6 +70,61 @@ console.log(`${hatchLines.length} hatch lines`);
|
|
|
70
70
|
generator.dispose();
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
+
## Streamed geometry
|
|
74
|
+
|
|
75
|
+
When the meshes are not one resident array (for example read back from local
|
|
76
|
+
storage in chunks), give `generateFromSource` a `DrawingMeshSource`. The
|
|
77
|
+
generator reads it in at most two passes (`'geometry'`, then `'occlusion'`
|
|
78
|
+
when hidden lines or an open surface need it) and keeps no mesh: each batch
|
|
79
|
+
can be released as soon as the generator asks for the next. Every pass must
|
|
80
|
+
yield the same meshes in the same order. The drawing equals `generate` over
|
|
81
|
+
one pass's meshes; an error thrown by the source, or an aborted
|
|
82
|
+
`options.signal`, rejects it.
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import type { Drawing2DGenerator, DrawingMeshSource, SectionConfig } from '@ifc-lite/drawing-2d';
|
|
86
|
+
import type { MeshData } from '@ifc-lite/geometry';
|
|
87
|
+
|
|
88
|
+
declare const generator: Drawing2DGenerator, config: SectionConfig, signal: AbortSignal;
|
|
89
|
+
declare const chunks: number[]; // the host's stored chunk ids
|
|
90
|
+
declare function leaseChunk(chunk: number): Promise<{ meshes: MeshData[]; release(): void }>; // reads one chunk back
|
|
91
|
+
|
|
92
|
+
const source: DrawingMeshSource = {
|
|
93
|
+
async *pass() {
|
|
94
|
+
for (const chunk of chunks) {
|
|
95
|
+
const held = await leaseChunk(chunk);
|
|
96
|
+
try { yield held.meshes; } finally { held.release(); }
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
const drawing = await generator.generateFromSource(source, config, { signal });
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
To push chunks instead (each lease released before the next), use a session. `finish()` throws until the occlusion phase has fed what `endGeometry()` asked for (every batch again for a depth raster, or the open-surface entities' meshes), so a skipped replay is refused rather than drawn without free edges:
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import type { Drawing2DGenerator, EntityKey, GeneratorOptions, SectionConfig } from '@ifc-lite/drawing-2d';
|
|
107
|
+
import type { MeshData } from '@ifc-lite/geometry';
|
|
108
|
+
|
|
109
|
+
declare const generator: Drawing2DGenerator, config: SectionConfig, options: Partial<GeneratorOptions>;
|
|
110
|
+
declare const chunks: number[]; // the host's stored chunk ids
|
|
111
|
+
declare function leaseChunk(chunk: number): Promise<{ meshes: MeshData[]; release(): void }>; // reads one chunk back
|
|
112
|
+
declare function chunksOf(entities: ReadonlySet<EntityKey>): number[]; // the chunks holding these entities
|
|
113
|
+
|
|
114
|
+
const session = generator.beginDrawing(config, options);
|
|
115
|
+
for (const chunk of chunks) {
|
|
116
|
+
const held = await leaseChunk(chunk);
|
|
117
|
+
try { await session.addGeometry(held.meshes); } finally { held.release(); }
|
|
118
|
+
}
|
|
119
|
+
const needs = session.endGeometry();
|
|
120
|
+
// needs.depthRaster: feed every chunk again; otherwise only needs.openSurfaceEntities' meshes.
|
|
121
|
+
for (const chunk of needs.depthRaster ? chunks : chunksOf(needs.openSurfaceEntities)) {
|
|
122
|
+
const held = await leaseChunk(chunk);
|
|
123
|
+
try { session.addOcclusion(held.meshes); } finally { held.release(); }
|
|
124
|
+
}
|
|
125
|
+
const drawing = session.finish(); // or session.cancel()
|
|
126
|
+
```
|
|
127
|
+
|
|
73
128
|
## Graphic overrides
|
|
74
129
|
|
|
75
130
|
Apply named graphic presets (architectural, fire-safety, structural, MEP, monochrome) via the override engine:
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
import type { MeshData } from '@ifc-lite/geometry';
|
|
12
12
|
import type { SectionConfig, SectionAxis, Drawing2D, DrawingLine, ProfileEntry, MeshOutline2D } from './types.js';
|
|
13
13
|
import type { SVGExportOptions } from './svg-exporter.js';
|
|
14
|
+
import { type DrawingMeshSource } from './drawing-mesh-source.js';
|
|
15
|
+
import { DrawingSession } from './drawing-session.js';
|
|
14
16
|
export interface GeneratorOptions {
|
|
15
17
|
/** Use GPU acceleration if available */
|
|
16
18
|
useGPU: boolean;
|
|
@@ -49,6 +51,8 @@ export interface GeneratorOptions {
|
|
|
49
51
|
extraLines?: DrawingLine[];
|
|
50
52
|
/** Progress callback */
|
|
51
53
|
onProgress?: (stage: string, progress: number) => void;
|
|
54
|
+
/** Abandons the drawing between batches: the promise rejects with the signal's reason. */
|
|
55
|
+
signal?: AbortSignal;
|
|
52
56
|
}
|
|
53
57
|
export interface GeneratorProgress {
|
|
54
58
|
stage: 'cutting' | 'polygons' | 'edges' | 'hidden' | 'merging' | 'complete';
|
|
@@ -57,10 +61,6 @@ export interface GeneratorProgress {
|
|
|
57
61
|
}
|
|
58
62
|
export declare class Drawing2DGenerator {
|
|
59
63
|
private gpuCutter;
|
|
60
|
-
private cpuCutter;
|
|
61
|
-
private polygonBuilder;
|
|
62
|
-
private edgeExtractor;
|
|
63
|
-
private hiddenLineClassifier;
|
|
64
64
|
private hatchGenerator;
|
|
65
65
|
private svgExporter;
|
|
66
66
|
private gpuDevice;
|
|
@@ -70,9 +70,23 @@ export declare class Drawing2DGenerator {
|
|
|
70
70
|
*/
|
|
71
71
|
initialize(gpuDevice?: GPUDevice): Promise<void>;
|
|
72
72
|
/**
|
|
73
|
-
* Generate a complete 2D drawing from
|
|
73
|
+
* Generate a complete 2D drawing from a resident mesh array. Type-library
|
|
74
|
+
* geometry (`geometryClass` 1/2) is left out, as in the viewer's Model view.
|
|
74
75
|
*/
|
|
75
76
|
generate(meshes: MeshData[], config: SectionConfig, options?: Partial<GeneratorOptions>, profiles?: ProfileEntry[]): Promise<Drawing2D>;
|
|
77
|
+
/**
|
|
78
|
+
* Generate a complete 2D drawing from a replayable source (#10264), in at
|
|
79
|
+
* most two passes and without holding the source's meshes: see
|
|
80
|
+
* `DrawingMeshSource`. The result equals `generate` over one pass's meshes.
|
|
81
|
+
* An error thrown by the source (a stale or replaced generation) or an
|
|
82
|
+
* aborted `options.signal` rejects the drawing; nothing partial is returned.
|
|
83
|
+
*/
|
|
84
|
+
generateFromSource(source: DrawingMeshSource, config: SectionConfig, options?: Partial<GeneratorOptions>, profiles?: ProfileEntry[]): Promise<Drawing2D>;
|
|
85
|
+
/**
|
|
86
|
+
* Start one drawing fed batch by batch (see `DrawingSession`): for callers
|
|
87
|
+
* that lease geometry chunk by chunk. `generateFromSource` drives the same.
|
|
88
|
+
*/
|
|
89
|
+
beginDrawing(config: SectionConfig, options?: Partial<GeneratorOptions>, profiles?: readonly ProfileEntry[]): DrawingSession;
|
|
76
90
|
/**
|
|
77
91
|
* Export drawing to SVG string
|
|
78
92
|
*/
|
|
@@ -81,10 +95,6 @@ export declare class Drawing2DGenerator {
|
|
|
81
95
|
* Generate hatching lines for cut polygons
|
|
82
96
|
*/
|
|
83
97
|
generateHatching(drawing: Drawing2D): DrawingLine[];
|
|
84
|
-
/**
|
|
85
|
-
* Compute bounds from lines
|
|
86
|
-
*/
|
|
87
|
-
private computeBounds;
|
|
88
98
|
/**
|
|
89
99
|
* Dispose GPU resources
|
|
90
100
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawing-generator.d.ts","sourceRoot":"","sources":["../src/drawing-generator.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"drawing-generator.d.ts","sourceRoot":"","sources":["../src/drawing-generator.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,SAAS,E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sB,eAAe,CACnC,MAAM,EAAE,QAAQ,EAAE,EAClB,IAAI,EAAE,GAAG,GAAG,GAAG,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAClC,OAAO,CAAC,SAAS,CAAC,CAcpB"}
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { PolygonBuilder } from './polygon-builder.js';
|
|
7
|
-
import { OpenSurfaceIndex } from './open-surface.js';
|
|
8
|
-
import { EdgeExtractor } from './edge-extractor.js';
|
|
9
|
-
import { HiddenLineClassifier } from './hidden-line.js';
|
|
10
|
-
import { mergeDrawingLines } from './line-merger.js';
|
|
4
|
+
import { selectModelMeshes } from '@ifc-lite/geometry/geometry-class';
|
|
5
|
+
import { DEFAULT_SECTION_CONFIG } from './types.js';
|
|
11
6
|
import { HatchGenerator } from './hatch-generator.js';
|
|
12
7
|
import { SVGExporter } from './svg-exporter.js';
|
|
13
8
|
import { GPUSectionCutter } from './gpu-section-cutter.js';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { isFeatureElementType } from './feature-elements.js';
|
|
17
|
-
import { projectionBandMeshes, clipMeshToProjectionWindow } from './projection-clip.js';
|
|
18
|
-
import { removeCoveredOverhead } from './projection-overlap.js';
|
|
19
|
-
import { boundsEmpty, boundsExtendLine, } from './math.js';
|
|
9
|
+
import { meshArraySource } from './drawing-mesh-source.js';
|
|
10
|
+
import { DrawingSession } from './drawing-session.js';
|
|
20
11
|
const DEFAULT_OPTIONS = {
|
|
21
12
|
useGPU: true,
|
|
22
13
|
includeHiddenLines: true,
|
|
@@ -29,10 +20,6 @@ const DEFAULT_OPTIONS = {
|
|
|
29
20
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
30
21
|
export class Drawing2DGenerator {
|
|
31
22
|
gpuCutter = null;
|
|
32
|
-
cpuCutter = null;
|
|
33
|
-
polygonBuilder = new PolygonBuilder();
|
|
34
|
-
edgeExtractor = new EdgeExtractor(30); // 30° crease angle
|
|
35
|
-
hiddenLineClassifier = new HiddenLineClassifier({ resolution: 1024 });
|
|
36
23
|
hatchGenerator = new HatchGenerator();
|
|
37
24
|
svgExporter = new SVGExporter();
|
|
38
25
|
gpuDevice = null;
|
|
@@ -49,228 +36,46 @@ export class Drawing2DGenerator {
|
|
|
49
36
|
this.initialized = true;
|
|
50
37
|
}
|
|
51
38
|
/**
|
|
52
|
-
* Generate a complete 2D drawing from
|
|
39
|
+
* Generate a complete 2D drawing from a resident mesh array. Type-library
|
|
40
|
+
* geometry (`geometryClass` 1/2) is left out, as in the viewer's Model view.
|
|
53
41
|
*/
|
|
54
42
|
async generate(meshes, config, options = {}, profiles) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
else {
|
|
74
|
-
// CPU path. Always rebuild the cutter so a switch from cardinal
|
|
75
|
-
// to custom-plane (or between two different custom planes) takes
|
|
76
|
-
// effect immediately — caching the instance keyed only on
|
|
77
|
-
// existence, as the previous code did, would silently apply the
|
|
78
|
-
// first config used for the lifetime of the generator.
|
|
79
|
-
this.cpuCutter = new SectionCutter(config.plane);
|
|
80
|
-
const cutResult = this.cpuCutter.cutMeshes(meshes);
|
|
81
|
-
cutSegments = cutResult.segments;
|
|
82
|
-
}
|
|
83
|
-
report('cutting', 1);
|
|
84
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
85
|
-
// STAGE 2: Polygon Reconstruction
|
|
86
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
87
|
-
report('polygons', 0);
|
|
88
|
-
const openSurfaces = new OpenSurfaceIndex(meshes), openSurfaceSegments = new Set();
|
|
89
|
-
const cutPolygons = this.polygonBuilder.buildPolygons(cutSegments, openSurfaces, openSurfaceSegments);
|
|
90
|
-
// Opaque base cross-section per multi-material entity, for the 3D overlay to
|
|
91
|
-
// draw behind the per-layer fills (never see-through). Kept out of
|
|
92
|
-
// `cutPolygons` so the flat 2D drawing / export / measure paths are untouched.
|
|
93
|
-
const layerBaseCutPolygons = this.polygonBuilder.buildBasePolygons(cutSegments, openSurfaces);
|
|
94
|
-
report('polygons', 1);
|
|
95
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
96
|
-
// STAGE 3: Convert Cut Segments to Drawing Lines
|
|
97
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
98
|
-
const cutLines = cutSegments.map((seg) => ({
|
|
99
|
-
line: { start: seg.p0_2d, end: seg.p1_2d },
|
|
100
|
-
category: 'cut',
|
|
101
|
-
...(openSurfaceSegments.has(seg) ? { openSurfaceCut: true } : {}),
|
|
102
|
-
visibility: 'visible',
|
|
103
|
-
entityId: seg.entityId,
|
|
104
|
-
ifcType: seg.ifcType,
|
|
105
|
-
modelIndex: seg.modelIndex,
|
|
106
|
-
depth: 0,
|
|
107
|
-
}));
|
|
108
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
109
|
-
// STAGE 4: Construction Projection Lines (issue #979)
|
|
110
|
-
//
|
|
111
|
-
// Project geometry BEYOND the cut into two architectural bands:
|
|
112
|
-
// • below the cut → VISIBLE (thin solid)
|
|
113
|
-
// • above the cut → OVERHEAD (dashed, carried as `visibility:'hidden'`)
|
|
114
|
-
//
|
|
115
|
-
// Sources, picked per element to avoid double-drawing the same wall:
|
|
116
|
-
// • extruded-area solids → clean profile boundaries (`projectProfiles`)
|
|
117
|
-
// • everything else → mesh SILHOUETTE outline (NOT crease edges,
|
|
118
|
-
// which draw every tessellation facet). Runs only when `includeEdges`.
|
|
119
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
120
|
-
let projectionLines = [];
|
|
121
|
-
if (opts.includeProjection) {
|
|
122
|
-
report('edges', 0);
|
|
123
|
-
const bands = {
|
|
124
|
-
below: config.projectionBelowDepth ?? config.projectionDepth,
|
|
125
|
-
above: config.projectionAboveDepth ?? config.projectionDepth,
|
|
126
|
-
};
|
|
127
|
-
// Feature elements (IfcOpeningElement & the void/feature family) are
|
|
128
|
-
// boolean operands, not building structure — they must never project
|
|
129
|
-
// (issue #979 follow-up). Filter them from BOTH the profile path and the
|
|
130
|
-
// silhouette path: dropping them only from profiles would push them onto
|
|
131
|
-
// the silhouette path (they'd fall out of `coveredKeys` and their raw
|
|
132
|
-
// mesh would then be silhouetted), so the two must be filtered together.
|
|
133
|
-
// The Rust extractor already skips them at the source, but a CI-lagged
|
|
134
|
-
// WASM bundle can still emit opening profiles, and opening MESHES always
|
|
135
|
-
// reach `meshes` — so this TS filter is the load-bearing guard.
|
|
136
|
-
const projectionProfiles = (config.clipProjectionBands ? undefined : profiles)?.filter((p) => !isFeatureElementType(p.ifcType));
|
|
137
|
-
// Per-element dedup: elements with an extracted profile take their
|
|
138
|
-
// projection from the clean profile path only; the silhouette fallback
|
|
139
|
-
// skips them.
|
|
140
|
-
const coveredKeys = new Set();
|
|
141
|
-
if (projectionProfiles && projectionProfiles.length > 0) {
|
|
142
|
-
for (const profile of projectionProfiles) {
|
|
143
|
-
coveredKeys.add(makeEntityKey(profile.modelIndex, profile.expressId));
|
|
144
|
-
}
|
|
145
|
-
projectionLines.push(...projectProfiles(projectionProfiles, config.plane, bands));
|
|
146
|
-
}
|
|
147
|
-
if (opts.includeEdges) {
|
|
148
|
-
// Outline for non-extruded geometry (roofs, stairs, site, BReps) with
|
|
149
|
-
// no extracted profile — the elements issue #979 specifically calls
|
|
150
|
-
// out. Prefer the winding-robust Rust `meshOutline2d` footprint when an
|
|
151
|
-
// outlineProvider is supplied; fall back per-mesh to the normal-based
|
|
152
|
-
// silhouette (which can break on ifc-lite's unreliable winding).
|
|
153
|
-
const meshesForSilhouette = meshes.filter((m) => !isFeatureElementType(m.ifcType) &&
|
|
154
|
-
!coveredKeys.has(makeEntityKey(m.modelIndex ?? 0, m.expressId)));
|
|
155
|
-
const viewDir = getViewDirectionForPlane(config.plane);
|
|
156
|
-
// The outline provider contract is CARDINAL-only: it receives just
|
|
157
|
-
// (axis, flipped) and returns contours and axisMin/axisMax in cardinal
|
|
158
|
-
// projection space (the Rust `meshOutline2d` binding knows nothing of
|
|
159
|
-
// custom planes). The depth raster and every other line producer work
|
|
160
|
-
// in the custom tangent/bitangent basis when `customPlane` is set, so
|
|
161
|
-
// provider output would be band-classified against the wrong offset
|
|
162
|
-
// and occlusion-sampled against a raster in a DIFFERENT coordinate
|
|
163
|
-
// system (PR #2644 review). Bypass the provider on custom planes and
|
|
164
|
-
// take the silhouette path below, which is plane-aware end to end.
|
|
165
|
-
// Do NOT "optimise" the provider back in here without making its
|
|
166
|
-
// callback contract (and the WASM binding behind it) custom-basis
|
|
167
|
-
// aware.
|
|
168
|
-
const outlineProvider = config.plane.customPlane ? undefined : opts.outlineProvider;
|
|
169
|
-
for (const source of meshesForSilhouette) {
|
|
170
|
-
const clipped = config.clipProjectionBands
|
|
171
|
-
? projectionBandMeshes(source, config.plane, bands.below, bands.above) : [source];
|
|
172
|
-
for (const mesh of clipped) {
|
|
173
|
-
const outline = outlineProvider
|
|
174
|
-
? outlineProvider(mesh, config.plane.axis, config.plane.flipped)
|
|
175
|
-
: null;
|
|
176
|
-
if (outline && outline.contours.length > 0) {
|
|
177
|
-
projectionLines.push(...outlineToProjectionLines(outline, {
|
|
178
|
-
entityId: mesh.expressId,
|
|
179
|
-
ifcType: mesh.ifcType ?? 'Unknown',
|
|
180
|
-
modelIndex: mesh.modelIndex ?? 0,
|
|
181
|
-
}, config.plane, bands));
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
const edges = this.edgeExtractor.extractEdges(mesh);
|
|
185
|
-
const silhouettes = this.edgeExtractor.extractSilhouettes(edges, viewDir);
|
|
186
|
-
projectionLines.push(...this.edgeExtractor.edgesToProjectionLines(silhouettes, config.plane, bands));
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
// Projection edges are bounded by the configured depth and visibility,
|
|
192
|
-
// not by the cut extent: an elevation can legitimately cut only a post.
|
|
193
|
-
if (config.clipProjectionBands && config.plane.axis === 'y' && !config.plane.customPlane) {
|
|
194
|
-
projectionLines = removeCoveredOverhead(projectionLines);
|
|
43
|
+
return this.generateFromSource(meshArraySource(selectModelMeshes(meshes)), config, options, profiles);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Generate a complete 2D drawing from a replayable source (#10264), in at
|
|
47
|
+
* most two passes and without holding the source's meshes: see
|
|
48
|
+
* `DrawingMeshSource`. The result equals `generate` over one pass's meshes.
|
|
49
|
+
* An error thrown by the source (a stale or replaced generation) or an
|
|
50
|
+
* aborted `options.signal` rejects the drawing; nothing partial is returned.
|
|
51
|
+
*/
|
|
52
|
+
async generateFromSource(source, config, options = {}, profiles) {
|
|
53
|
+
const session = this.beginDrawing(config, options, profiles);
|
|
54
|
+
try {
|
|
55
|
+
for await (const batch of source.pass('geometry'))
|
|
56
|
+
await session.addGeometry(batch);
|
|
57
|
+
const needs = session.endGeometry();
|
|
58
|
+
if (needs.depthRaster || needs.openSurfaceEntities.size > 0) {
|
|
59
|
+
for await (const batch of source.pass('occlusion'))
|
|
60
|
+
session.addOcclusion(batch);
|
|
195
61
|
}
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
199
|
-
// STAGE 5: Hidden Line Removal
|
|
200
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
201
|
-
// Caller-supplied rim lines (issue #2042) are classifiable like projection
|
|
202
|
-
// lines despite their 'cut' category — see `GeneratorOptions.extraLines`.
|
|
203
|
-
const extraLines = opts.extraLines ?? [];
|
|
204
|
-
const classifiable = [...extraLines, ...projectionLines];
|
|
205
|
-
let allLines = [...cutLines, ...classifiable];
|
|
206
|
-
if ((opts.includeHiddenLines || config.clipProjectionBands) && classifiable.length > 0) {
|
|
207
|
-
report('hidden', 0);
|
|
208
|
-
// Compute bounds for depth buffer
|
|
209
|
-
const bounds = this.computeBounds(allLines);
|
|
210
|
-
const occluderDepth = config.clipProjectionBands
|
|
211
|
-
? (config.projectionBelowDepth ?? config.projectionDepth)
|
|
212
|
-
: Math.max(config.projectionDepth, config.projectionBelowDepth ?? config.projectionDepth, config.projectionAboveDepth ?? config.projectionDepth);
|
|
213
|
-
const occluders = config.clipProjectionBands
|
|
214
|
-
? meshes.map(mesh => clipMeshToProjectionWindow(mesh, config.plane, 0, occluderDepth))
|
|
215
|
-
.filter((mesh) => mesh !== null)
|
|
216
|
-
: meshes;
|
|
217
|
-
this.hiddenLineClassifier.buildDepthBuffer(occluders, config.plane, occluderDepth, bounds);
|
|
218
|
-
// Occlusion only DOWNGRADES visible → hidden; it can never reveal an
|
|
219
|
-
// already-dashed OVERHEAD line. So classify the visible (below-cut)
|
|
220
|
-
// projection lines and pass overhead lines through unchanged — otherwise
|
|
221
|
-
// an unoccluded overhead beam would be re-marked 'visible' (solid).
|
|
222
|
-
//
|
|
223
|
-
// The split is by SOURCE (`classifiable` vs the cutter's own
|
|
224
|
-
// `cutLines`), not by category: `extraLines` carry `category: 'cut'`
|
|
225
|
-
// yet must be classified. Filtering `allLines` on `category !== 'cut'`
|
|
226
|
-
// would both skip them AND drop them from the recombination below.
|
|
227
|
-
const toClassify = classifiable.filter((l) => l.visibility === 'visible');
|
|
228
|
-
const passthrough = classifiable.filter((l) => l.visibility !== 'visible');
|
|
229
|
-
const classified = this.hiddenLineClassifier.applyVisibility(toClassify);
|
|
230
|
-
// SDK hidden-output filtering applies to occlusion results. Existing
|
|
231
|
-
// overhead outlines keep their dashed convention even with HLR off.
|
|
232
|
-
const classifiedLines = config.clipProjectionBands && !opts.includeHiddenLines
|
|
233
|
-
? classified.filter(line => line.visibility !== 'hidden') : classified;
|
|
234
|
-
// Recombine with cut lines (always visible) + overhead pass-through.
|
|
235
|
-
allLines = [...cutLines, ...classifiedLines, ...passthrough];
|
|
236
|
-
report('hidden', 1);
|
|
62
|
+
return session.finish();
|
|
237
63
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
if (opts.mergeLines) {
|
|
242
|
-
report('merging', 0);
|
|
243
|
-
allLines = mergeDrawingLines(allLines);
|
|
244
|
-
report('merging', 1);
|
|
64
|
+
catch (error) {
|
|
65
|
+
session.cancel();
|
|
66
|
+
throw error;
|
|
245
67
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
return {
|
|
258
|
-
config,
|
|
259
|
-
lines: allLines,
|
|
260
|
-
cutPolygons,
|
|
261
|
-
layerBaseCutPolygons,
|
|
262
|
-
projectionPolygons: [], // TODO: implement projection polygon extraction
|
|
263
|
-
bounds,
|
|
264
|
-
stats: {
|
|
265
|
-
cutLineCount,
|
|
266
|
-
projectionLineCount,
|
|
267
|
-
hiddenLineCount,
|
|
268
|
-
silhouetteLineCount,
|
|
269
|
-
polygonCount: cutPolygons.length,
|
|
270
|
-
totalTriangles: meshes.reduce((sum, m) => sum + m.indices.length / 3, 0),
|
|
271
|
-
processingTimeMs,
|
|
272
|
-
},
|
|
273
|
-
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Start one drawing fed batch by batch (see `DrawingSession`): for callers
|
|
71
|
+
* that lease geometry chunk by chunk. `generateFromSource` drives the same.
|
|
72
|
+
*/
|
|
73
|
+
beginDrawing(config, options = {}, profiles) {
|
|
74
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
75
|
+
// GPU path. Falls back to CPU when a custom (face-picked) plane is active
|
|
76
|
+
// because GPUSectionCutter still assumes cardinal axes.
|
|
77
|
+
const gpuCutter = opts.useGPU && this.gpuDevice && !config.plane.customPlane ? this.gpuCutter : null;
|
|
78
|
+
return new DrawingSession(config, opts, profiles, gpuCutter);
|
|
274
79
|
}
|
|
275
80
|
/**
|
|
276
81
|
* Export drawing to SVG string
|
|
@@ -299,16 +104,6 @@ export class Drawing2DGenerator {
|
|
|
299
104
|
}
|
|
300
105
|
return hatchLines;
|
|
301
106
|
}
|
|
302
|
-
/**
|
|
303
|
-
* Compute bounds from lines
|
|
304
|
-
*/
|
|
305
|
-
computeBounds(lines) {
|
|
306
|
-
let bounds = boundsEmpty();
|
|
307
|
-
for (const line of lines) {
|
|
308
|
-
bounds = boundsExtendLine(bounds, line.line);
|
|
309
|
-
}
|
|
310
|
-
return bounds;
|
|
311
|
-
}
|
|
312
107
|
/**
|
|
313
108
|
* Dispose GPU resources
|
|
314
109
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawing-generator.js","sourceRoot":"","sources":["../src/drawing-generator.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA0B/D,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,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.generateFromSource` reads its meshes in at most two
|
|
5
|
+
* passes over a source and keeps none of them: each batch is cut, projected
|
|
6
|
+
* or rasterized while it is current, then only 2D output (segments, lines,
|
|
7
|
+
* one depth raster) and per-entity free-edge parity survive it. A source may
|
|
8
|
+
* therefore lease a batch from storage and release it as soon as the
|
|
9
|
+
* generator advances the iterator; no pass ever needs the whole model at once.
|
|
10
|
+
*
|
|
11
|
+
* Passes, in order:
|
|
12
|
+
* - `geometry`: section cut and construction projection;
|
|
13
|
+
* - `occlusion`: only when needed, the hidden-line depth raster and the
|
|
14
|
+
* free-edge test of entities whose cut left open chains.
|
|
15
|
+
* Every pass must yield the same meshes, in the same order, as the first: a
|
|
16
|
+
* source that cannot (its geometry changed between passes) must throw rather
|
|
17
|
+
* than yield different geometry. The output equals `generate` over the
|
|
18
|
+
* concatenation of one pass's batches.
|
|
19
|
+
*/
|
|
20
|
+
import type { MeshData } from '@ifc-lite/geometry';
|
|
21
|
+
export type DrawingPass = 'geometry' | 'occlusion';
|
|
22
|
+
export interface DrawingMeshSource {
|
|
23
|
+
/** One complete, ordered pass over the drawing's meshes, in batches. */
|
|
24
|
+
pass(pass: DrawingPass): AsyncIterable<readonly MeshData[]>;
|
|
25
|
+
}
|
|
26
|
+
/** A resident mesh array as a source: every pass yields it as one batch. */
|
|
27
|
+
export declare function meshArraySource(meshes: readonly MeshData[]): DrawingMeshSource;
|
|
28
|
+
//# sourceMappingURL=drawing-mesh-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawing-mesh-source.d.ts","sourceRoot":"","sources":["../src/drawing-mesh-source.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;AAEnD,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,IAAI,CAAC,IAAI,EAAE,WAAW,GAAG,aAAa,CAAC,SAAS,QAAQ,EAAE,CAAC,CAAC;CAC7D;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,GAAG,iBAAiB,CAM9E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
/** A resident mesh array as a source: every pass yields it as one batch. */
|
|
5
|
+
export function meshArraySource(meshes) {
|
|
6
|
+
return {
|
|
7
|
+
async *pass() {
|
|
8
|
+
if (meshes.length > 0)
|
|
9
|
+
yield meshes;
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=drawing-mesh-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawing-mesh-source.js","sourceRoot":"","sources":["../src/drawing-mesh-source.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA+B/D,4EAA4E;AAC5E,MAAM,UAAU,eAAe,CAAC,MAA2B;IACzD,OAAO;QACL,KAAK,CAAC,CAAC,IAAI;YACT,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;gBAAE,MAAM,MAAM,CAAC;QACtC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One drawing, fed batch by batch (#10264): the generator's whole algorithm,
|
|
3
|
+
* for callers that lease geometry chunk by chunk and must release each lease
|
|
4
|
+
* before taking the next (caps, plan cuts, view export, the 2D drawing).
|
|
5
|
+
*
|
|
6
|
+
* const session = generator.beginDrawing(config, options, profiles);
|
|
7
|
+
* for (chunk of geometry) { await session.addGeometry(lease.meshes); lease.release(); }
|
|
8
|
+
* const needs = session.endGeometry();
|
|
9
|
+
* if (needs.depthRaster) for (chunk of geometry) session.addOcclusion(...);
|
|
10
|
+
* else if (needs.openSurfaceEntities.size) for (chunk of those entities' chunks) session.addOcclusion(...);
|
|
11
|
+
* const drawing = session.finish();
|
|
12
|
+
*
|
|
13
|
+
* Between batches it keeps only 2D output (cut segments, projection lines),
|
|
14
|
+
* one depth raster and welded edge parity of the open-surface candidates;
|
|
15
|
+
* never a mesh. The occlusion phase must see every mesh of the geometry phase
|
|
16
|
+
* when `depthRaster` is set, and otherwise at least every mesh of each entity
|
|
17
|
+
* in `openSurfaceEntities` (other meshes are ignored). `generate` and
|
|
18
|
+
* `generateFromSource` are drivers over this class, so output is identical.
|
|
19
|
+
*/
|
|
20
|
+
import type { MeshData } from '@ifc-lite/geometry';
|
|
21
|
+
import type { CutSegment, Drawing2D, DrawingLine, EntityKey, ProfileEntry, SectionConfig, Bounds2D } from './types.js';
|
|
22
|
+
import type { GPUSectionCutter } from './gpu-section-cutter.js';
|
|
23
|
+
import { type ProjectionCollectorOptions } from './projection-collector.js';
|
|
24
|
+
export interface DrawingSessionOptions extends ProjectionCollectorOptions {
|
|
25
|
+
useGPU: boolean;
|
|
26
|
+
includeHiddenLines: boolean;
|
|
27
|
+
includeProjection: boolean;
|
|
28
|
+
mergeLines: boolean;
|
|
29
|
+
extraLines?: DrawingLine[];
|
|
30
|
+
onProgress?: (stage: string, progress: number) => void;
|
|
31
|
+
signal?: AbortSignal;
|
|
32
|
+
}
|
|
33
|
+
/** What the occlusion phase must be fed, known once the geometry phase ends. */
|
|
34
|
+
export interface DrawingOcclusionNeeds {
|
|
35
|
+
/** Hidden-line raster: feed every mesh of the geometry phase again. */
|
|
36
|
+
readonly depthRaster: boolean;
|
|
37
|
+
/** Entities whose cut left open chains (#8664): feed all of their meshes. */
|
|
38
|
+
readonly openSurfaceEntities: ReadonlySet<EntityKey>;
|
|
39
|
+
}
|
|
40
|
+
/** Bounds over lines and raw cut segments. */
|
|
41
|
+
export declare function drawingBounds(lines: readonly DrawingLine[], segments?: readonly CutSegment[]): Bounds2D;
|
|
42
|
+
export declare class DrawingSession {
|
|
43
|
+
private readonly config;
|
|
44
|
+
private readonly opts;
|
|
45
|
+
/** Cardinal planes only; null for the CPU cutter. */
|
|
46
|
+
private readonly gpuCutter;
|
|
47
|
+
private phase;
|
|
48
|
+
private readonly startTime;
|
|
49
|
+
private readonly cpuCutter;
|
|
50
|
+
private readonly projection;
|
|
51
|
+
private readonly segmentBatches;
|
|
52
|
+
private readonly hiddenLines;
|
|
53
|
+
private readonly polygonBuilder;
|
|
54
|
+
private totalTriangles;
|
|
55
|
+
private cutSegments;
|
|
56
|
+
private classifiable;
|
|
57
|
+
private classify;
|
|
58
|
+
private freeEdges;
|
|
59
|
+
private unfed;
|
|
60
|
+
private occluded;
|
|
61
|
+
private readonly occluderDepth;
|
|
62
|
+
constructor(config: SectionConfig, opts: DrawingSessionOptions, profiles: readonly ProfileEntry[] | undefined,
|
|
63
|
+
/** Cardinal planes only; null for the CPU cutter. */
|
|
64
|
+
gpuCutter: GPUSectionCutter | null);
|
|
65
|
+
private report;
|
|
66
|
+
private enter;
|
|
67
|
+
/** Cut and project one batch; keeps no reference to it. */
|
|
68
|
+
addGeometry(meshes: readonly MeshData[]): Promise<void>;
|
|
69
|
+
/** End the geometry phase; says what the occlusion phase needs, if anything. */
|
|
70
|
+
endGeometry(): DrawingOcclusionNeeds;
|
|
71
|
+
/** Feed one batch of the occlusion phase (see {@link DrawingOcclusionNeeds}). */
|
|
72
|
+
addOcclusion(meshes: readonly MeshData[]): void;
|
|
73
|
+
/** Abandon the drawing; every later call throws. */
|
|
74
|
+
cancel(): void;
|
|
75
|
+
/** Polygons, occlusion, merging: the finished drawing. */
|
|
76
|
+
finish(): Drawing2D;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=drawing-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawing-session.d.ts","sourceRoot":"","sources":["../src/drawing-session.ts"],"names":[],"mappings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