@ifc-lite/create 2.1.1 → 2.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/dist/ifc-creator-math.d.ts +21 -0
- package/dist/ifc-creator-math.d.ts.map +1 -1
- package/dist/ifc-creator-math.js +33 -0
- package/dist/ifc-creator-math.js.map +1 -1
- package/dist/ifc-creator.d.ts +18 -0
- package/dist/ifc-creator.d.ts.map +1 -1
- package/dist/ifc-creator.js +119 -23
- package/dist/ifc-creator.js.map +1 -1
- package/dist/in-store/_emit-helpers.d.ts +40 -0
- package/dist/in-store/_emit-helpers.d.ts.map +1 -1
- package/dist/in-store/_emit-helpers.js +73 -0
- package/dist/in-store/_emit-helpers.js.map +1 -1
- package/dist/in-store/apply-style.d.ts +142 -0
- package/dist/in-store/apply-style.d.ts.map +1 -0
- package/dist/in-store/apply-style.js +309 -0
- package/dist/in-store/apply-style.js.map +1 -0
- package/dist/in-store/beam.d.ts.map +1 -1
- package/dist/in-store/beam.js +7 -5
- package/dist/in-store/beam.js.map +1 -1
- package/dist/in-store/column.d.ts.map +1 -1
- package/dist/in-store/column.js +2 -5
- package/dist/in-store/column.js.map +1 -1
- package/dist/in-store/door.d.ts.map +1 -1
- package/dist/in-store/door.js +3 -7
- package/dist/in-store/door.js.map +1 -1
- package/dist/in-store/extract-walls.d.ts.map +1 -1
- package/dist/in-store/extract-walls.js +188 -13
- package/dist/in-store/extract-walls.js.map +1 -1
- package/dist/in-store/member.d.ts.map +1 -1
- package/dist/in-store/member.js +7 -5
- package/dist/in-store/member.js.map +1 -1
- package/dist/in-store/plate.d.ts.map +1 -1
- package/dist/in-store/plate.js +4 -6
- package/dist/in-store/plate.js.map +1 -1
- package/dist/in-store/roof.d.ts.map +1 -1
- package/dist/in-store/roof.js +4 -6
- package/dist/in-store/roof.js.map +1 -1
- package/dist/in-store/slab.d.ts.map +1 -1
- package/dist/in-store/slab.js +4 -6
- package/dist/in-store/slab.js.map +1 -1
- package/dist/in-store/space.d.ts.map +1 -1
- package/dist/in-store/space.js +4 -6
- package/dist/in-store/space.js.map +1 -1
- package/dist/in-store/wall.d.ts.map +1 -1
- package/dist/in-store/wall.js +7 -5
- package/dist/in-store/wall.js.map +1 -1
- package/dist/in-store/window.d.ts.map +1 -1
- package/dist/in-store/window.js +3 -7
- package/dist/in-store/window.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -16,6 +16,22 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { generateIfcGuid } from '@ifc-lite/encoding';
|
|
18
18
|
const POINT_EPSILON = 1e-6;
|
|
19
|
+
/**
|
|
20
|
+
* Guard for element-builder dimension params (Width, Depth, Height,
|
|
21
|
+
* Thickness, FrameThickness, ...). A bare `value <= 0` check is `false`
|
|
22
|
+
* for both `NaN` and `Infinity`, so those values sail past validation
|
|
23
|
+
* and land as the literal strings `"NaN"`/`"Infinity"` in the emitted
|
|
24
|
+
* `IfcExtrudedAreaSolid`/profile attributes — invalid IFC written with
|
|
25
|
+
* no error. `column.ts` picked this up while closing the merge-roundtrip
|
|
26
|
+
* gap from LTplus-AG/ifc-lite#592; every other builder needs the same
|
|
27
|
+
* `Number.isFinite` guard, so it lives here once instead of as N copies
|
|
28
|
+
* that can individually go stale.
|
|
29
|
+
*/
|
|
30
|
+
export function assertPositiveFinite(values, message) {
|
|
31
|
+
if (values.some((v) => !Number.isFinite(v) || v <= 0)) {
|
|
32
|
+
throw new Error(message);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
19
35
|
/**
|
|
20
36
|
* Emit an IfcLocalPlacement chained to a parent. Wraps the cartesian
|
|
21
37
|
* point + axis-placement bookkeeping. Pass `Axis` and/or `RefDirection`
|
|
@@ -154,4 +170,61 @@ export function ifcElementHeader(ownerHistoryId, placementId, productShapeId, pa
|
|
|
154
170
|
params.Tag ?? null,
|
|
155
171
|
];
|
|
156
172
|
}
|
|
173
|
+
/** Guards a caller's 0..255 or out-of-range channel from reaching STEP. */
|
|
174
|
+
function clamp01(v) {
|
|
175
|
+
return Number.isFinite(v) ? Math.min(1, Math.max(0, v)) : 0;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Transparency is `1 - alpha`, and binary floating point turns an alpha of 0.9
|
|
179
|
+
* into `0.09999999999999998` in the STEP text. Four decimals is what
|
|
180
|
+
* `@ifc-lite/export`'s demesh writer settles on for the same value.
|
|
181
|
+
*/
|
|
182
|
+
const TRANSPARENCY_DECIMALS = 4;
|
|
183
|
+
function roundTo(v, decimals) {
|
|
184
|
+
const factor = 10 ** decimals;
|
|
185
|
+
return Math.round(v * factor) / factor;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Emit `IfcColourRgb` -> `IfcSurfaceStyleShading` -> `IfcSurfaceStyle`.
|
|
189
|
+
*
|
|
190
|
+
* Returns the `IfcSurfaceStyle`, the id an `IfcStyledItem` should point at, and
|
|
191
|
+
* every entity in the chain. The first two differ on IFC2X3, which has no
|
|
192
|
+
* `IfcStyleAssignmentSelect`: there `IfcStyledItem.Styles` is a set of
|
|
193
|
+
* `IfcPresentationStyleAssignment`, the wrapper IFC4 deprecated and IFC4X3
|
|
194
|
+
* removed.
|
|
195
|
+
*
|
|
196
|
+
* `schemaVersion` is the schema the chain is built FOR. Callers that will
|
|
197
|
+
* export to a different schema than the model was parsed from have to pass the
|
|
198
|
+
* target, because this shape is not schema-neutral. IFC2X3 is the only version
|
|
199
|
+
* that needs the wrapper, so the test is for it by name and every later schema
|
|
200
|
+
* takes the default.
|
|
201
|
+
*/
|
|
202
|
+
export function emitSurfaceStyle(editor, schemaVersion, color, name) {
|
|
203
|
+
const red = clamp01(color.red);
|
|
204
|
+
const green = clamp01(color.green);
|
|
205
|
+
const blue = clamp01(color.blue);
|
|
206
|
+
const alpha = clamp01(color.alpha ?? 1);
|
|
207
|
+
const colour = editor.addEntity('IfcColourRgb', [
|
|
208
|
+
null, { real: red }, { real: green }, { real: blue },
|
|
209
|
+
]);
|
|
210
|
+
const shading = editor.addEntity('IfcSurfaceStyleShading', [
|
|
211
|
+
`#${colour.expressId}`,
|
|
212
|
+
{ real: roundTo(1 - alpha, TRANSPARENCY_DECIMALS) },
|
|
213
|
+
]);
|
|
214
|
+
const surfaceStyle = editor.addEntity('IfcSurfaceStyle', [
|
|
215
|
+
name ?? null,
|
|
216
|
+
'.BOTH.',
|
|
217
|
+
[`#${shading.expressId}`],
|
|
218
|
+
]);
|
|
219
|
+
const chainIds = [colour.expressId, shading.expressId, surfaceStyle.expressId];
|
|
220
|
+
let styleRefId = surfaceStyle.expressId;
|
|
221
|
+
if (schemaVersion === 'IFC2X3') {
|
|
222
|
+
const assignment = editor.addEntity('IfcPresentationStyleAssignment', [[`#${surfaceStyle.expressId}`]]);
|
|
223
|
+
styleRefId = assignment.expressId;
|
|
224
|
+
chainIds.push(assignment.expressId);
|
|
225
|
+
}
|
|
226
|
+
// chainIds so a caller that later finds nothing referencing this style can
|
|
227
|
+
// take the whole chain back out rather than leaving it orphaned.
|
|
228
|
+
return { surfaceStyleId: surfaceStyle.expressId, styleRefId, chainIds };
|
|
229
|
+
}
|
|
157
230
|
//# sourceMappingURL=_emit-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_emit-helpers.js","sourceRoot":"","sources":["../../src/in-store/_emit-helpers.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,eAAe,EAAqB,MAAM,oBAAoB,CAAC;AAGxE,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAmB,EACnB,iBAAyB,EACzB,QAAkC,EAClC,IAA+B,EAC/B,YAAuC;IAEvC,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC,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H,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAE/E,IAAI,UAAU,GAAG,YAAY,CAAC,SAAS,CAAC;IACxC,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CACjC,gCAAgC,EAAE,CAAC,CAAC,IAAI,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,CACnE,CAAC;QACF,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC;QAClC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IAED,2EAA2E;IAC3E,iEAAiE;IACjE,OAAO,EAAE,cAAc,EAAE,YAAY,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colour products by authoring real presentation-style entities into the store,
|
|
3
|
+
* so the colour survives export instead of living in a viewer overlay.
|
|
4
|
+
*
|
|
5
|
+
* `bim.viewer.colorize` paints the current view and is gone the moment the
|
|
6
|
+
* model is written out. Persisting the same colour meant hand-building the
|
|
7
|
+
* style chain and walking `IfcProductDefinitionShape -> IfcShapeRepresentation
|
|
8
|
+
* -> Items`, including the `IfcMappedItem` indirection, at every call site.
|
|
9
|
+
*
|
|
10
|
+
* Lives beside the other in-store builders so the backend layer can reach it
|
|
11
|
+
* without parser internals, the same arrangement as `resolve-source.ts`.
|
|
12
|
+
*/
|
|
13
|
+
import { type IfcDataStore } from '@ifc-lite/parser';
|
|
14
|
+
import type { IfcAttributeValue, StoreEditor } from '@ifc-lite/mutations';
|
|
15
|
+
import { type SurfaceStyleColor } from './_emit-helpers.js';
|
|
16
|
+
export type { SurfaceStyleColor };
|
|
17
|
+
export interface StyleBatch {
|
|
18
|
+
/** Products to colour, by expressId. */
|
|
19
|
+
products: readonly number[];
|
|
20
|
+
/** Channels in 0..1. */
|
|
21
|
+
color: SurfaceStyleColor;
|
|
22
|
+
/** `IfcSurfaceStyle.Name`. Omitted writes `$`. */
|
|
23
|
+
name?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ApplyStyleOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Replace a style the geometry already carries (default `true`). IFC allows
|
|
28
|
+
* at most one `IfcStyledItem` per representation item, so adding a second
|
|
29
|
+
* where one exists writes a schema-invalid file; the existing one is
|
|
30
|
+
* tombstoned instead. Pass `false` to leave already-styled geometry alone.
|
|
31
|
+
*/
|
|
32
|
+
replaceExisting?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Style the geometry a type's occurrences share, rather than each occurrence
|
|
35
|
+
* (default `true`).
|
|
36
|
+
*
|
|
37
|
+
* Following `IfcMappedItem` to the `IfcRepresentationMap` is what makes one
|
|
38
|
+
* style cover every occurrence of a type, which is what you want colouring by
|
|
39
|
+
* IFC class. It is wrong for any other grouping: colouring by system, storey
|
|
40
|
+
* or property value, the shared geometry takes the colour of whichever batch
|
|
41
|
+
* touched it last, and occurrences in other groups change with it. Pass
|
|
42
|
+
* `false` to style the `IfcMappedItem` itself, one per occurrence.
|
|
43
|
+
*
|
|
44
|
+
* Do not mix the two settings over one model. They style different entities
|
|
45
|
+
* — the mapped item and the geometry behind it — so `replaceExisting` cannot
|
|
46
|
+
* see the conflict, and an occurrence ends up carrying both a shared style
|
|
47
|
+
* and its own, with the winner left to the viewer.
|
|
48
|
+
*/
|
|
49
|
+
followMappedItems?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Schema the style chain is built for. Defaults to the store's own.
|
|
52
|
+
*
|
|
53
|
+
* `IfcStyledItem.Styles` holds `IfcPresentationStyleAssignment` on IFC2X3 and
|
|
54
|
+
* the `IfcSurfaceStyle` directly from IFC4 on, and this is decided when the
|
|
55
|
+
* style is authored, not when the file is written. Exporting to a different
|
|
56
|
+
* schema than the model was parsed from therefore needs the target passed in;
|
|
57
|
+
* otherwise the emitted records are invalid for the file they land in.
|
|
58
|
+
*
|
|
59
|
+
* Typed as the store's own schema union rather than a bare string: the two
|
|
60
|
+
* are halves of one decision, and a near-miss like `'IFC2x3'` would otherwise
|
|
61
|
+
* typecheck and silently emit the IFC4 shape. IFC2X3 is the only member that
|
|
62
|
+
* differs; IFC4, IFC4X3 and IFC5 all take the `IfcSurfaceStyle` directly,
|
|
63
|
+
* which is why the branch tests for IFC2X3 rather than listing the rest.
|
|
64
|
+
*/
|
|
65
|
+
schema?: IfcDataStore['schemaVersion'];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* What one batch did.
|
|
69
|
+
*
|
|
70
|
+
* A snapshot taken when the call returns, not a live view. Results from a
|
|
71
|
+
* single `applyStylesInStore` are reconciled against each other before they are
|
|
72
|
+
* handed back, so a batch whose work a later batch replaced reports that. A
|
|
73
|
+
* result from an *earlier* call cannot be: recolouring the same geometry in a
|
|
74
|
+
* second call removes the styled items the first call named, and that first
|
|
75
|
+
* result still names them. The file is correct either way; only the older
|
|
76
|
+
* return value goes stale.
|
|
77
|
+
*/
|
|
78
|
+
export interface ApplyStyleResult {
|
|
79
|
+
/**
|
|
80
|
+
* The `IfcSurfaceStyle` every item styled by this batch now points at, or
|
|
81
|
+
* `null` when the batch styled nothing.
|
|
82
|
+
*
|
|
83
|
+
* Null rather than an id because the style is only authored once there is
|
|
84
|
+
* something to attach it to. Emitting it up front left an orphan colour chain
|
|
85
|
+
* in the file for every batch that reached no geometry — and a caller
|
|
86
|
+
* colouring by IFC class hands in a batch per class, most of which (types,
|
|
87
|
+
* ports, spatial structure) have none.
|
|
88
|
+
*/
|
|
89
|
+
surfaceStyleId: number | null;
|
|
90
|
+
/** One `IfcStyledItem` per representation item that was styled. */
|
|
91
|
+
styledItemIds: number[];
|
|
92
|
+
/** Products that reached no geometry: no representation, or an empty one. */
|
|
93
|
+
productsWithoutGeometry: number[];
|
|
94
|
+
/**
|
|
95
|
+
* Pre-existing `IfcStyledItem` entities tombstoned to make room.
|
|
96
|
+
*
|
|
97
|
+
* Only the styled item is removed. The `IfcSurfaceStyle` it pointed at stays
|
|
98
|
+
* in the file, detached: a style can be shared with styled items this call
|
|
99
|
+
* never touched, so removing it is not safe in general, and an unreferenced
|
|
100
|
+
* style definition is valid IFC.
|
|
101
|
+
*
|
|
102
|
+
* Empty whenever `replaceExisting` is `false`, which is when
|
|
103
|
+
* `keptExistingItemIds` is the field carrying the answer.
|
|
104
|
+
*/
|
|
105
|
+
replacedStyledItemIds: number[];
|
|
106
|
+
/**
|
|
107
|
+
* Representation items left alone because they already carried a style and
|
|
108
|
+
* `replaceExisting` was `false`. Empty otherwise.
|
|
109
|
+
*/
|
|
110
|
+
keptExistingItemIds: number[];
|
|
111
|
+
}
|
|
112
|
+
interface RawEntity {
|
|
113
|
+
type: string;
|
|
114
|
+
attributes: IfcAttributeValue[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The geometry a product is drawn from.
|
|
118
|
+
*
|
|
119
|
+
* With `followMappedItems` (the default), an `IfcMappedItem` resolves to the
|
|
120
|
+
* items of the `IfcRepresentationMap` behind it, so the geometry every
|
|
121
|
+
* occurrence of a type shares is what comes back. Without it, the mapped item
|
|
122
|
+
* itself is the leaf. See `ApplyStyleOptions.followMappedItems` for which one
|
|
123
|
+
* you want.
|
|
124
|
+
*
|
|
125
|
+
* Exported because three private copies of this walk already exist in
|
|
126
|
+
* `extract-walls.ts` and one in `@ifc-lite/export`'s LOD generator, and none of
|
|
127
|
+
* them follows mapped items. This is the complete one.
|
|
128
|
+
*/
|
|
129
|
+
export declare function collectLeafRepresentationItems(read: (id: number) => RawEntity | null, representationId: number, options?: {
|
|
130
|
+
followMappedItems?: boolean;
|
|
131
|
+
}): Set<number>;
|
|
132
|
+
/**
|
|
133
|
+
* Give every representation item behind each batch's products one
|
|
134
|
+
* `IfcSurfaceStyle`.
|
|
135
|
+
*
|
|
136
|
+
* Batches are applied in order, and a later batch wins where two of them reach
|
|
137
|
+
* the same geometry. Writes through the `StoreEditor` overlay, so nothing
|
|
138
|
+
* touches the source buffer and `StepExporter` picks the new entities up on
|
|
139
|
+
* export.
|
|
140
|
+
*/
|
|
141
|
+
export declare function applyStylesInStore(editor: StoreEditor, store: IfcDataStore, batches: readonly StyleBatch[], options?: ApplyStyleOptions): ApplyStyleResult[];
|
|
142
|
+
//# sourceMappingURL=apply-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-style.d.ts","sourceRoot":"","sources":["../../src/in-store/apply-style.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAmD,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACtG,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE9E,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,MAAM,WAAW,UAAU;IACzB,wCAAwC;IACxC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,wBAAwB;IACxB,KAAK,EAAE,iBAAiB,CAAC;IACzB,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;;;;;;;;;;OAeG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;CACxC;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;OASG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mEAAmE;IACnE,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,6EAA6E;IAC7E,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC;;;;;;;;;;OAUG;IACH,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC;;;OAGG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACjC;AA0DD;;;;;;;;;;;;GAYG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,SAAS,GAAG,IAAI,EACtC,gBAAgB,EAAE,MAAM,EACxB,OAAO,GAAE;IAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5C,GAAG,CAAC,MAAM,CAAC,CA8Bb;AAsDD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,OAAO,GAAE,iBAAsB,GAC9B,gBAAgB,EAAE,CA+FpB"}
|
|
@@ -0,0 +1,309 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* Colour products by authoring real presentation-style entities into the store,
|
|
6
|
+
* so the colour survives export instead of living in a viewer overlay.
|
|
7
|
+
*
|
|
8
|
+
* `bim.viewer.colorize` paints the current view and is gone the moment the
|
|
9
|
+
* model is written out. Persisting the same colour meant hand-building the
|
|
10
|
+
* style chain and walking `IfcProductDefinitionShape -> IfcShapeRepresentation
|
|
11
|
+
* -> Items`, including the `IfcMappedItem` indirection, at every call site.
|
|
12
|
+
*
|
|
13
|
+
* Lives beside the other in-store builders so the backend layer can reach it
|
|
14
|
+
* without parser internals, the same arrangement as `resolve-source.ts`.
|
|
15
|
+
*/
|
|
16
|
+
import { EntityExtractor, getAttributeNamesAcrossSchemas } from '@ifc-lite/parser';
|
|
17
|
+
import { emitSurfaceStyle } from './_emit-helpers.js';
|
|
18
|
+
/**
|
|
19
|
+
* A STEP reference as an expressId.
|
|
20
|
+
*
|
|
21
|
+
* Source-parsed entities carry refs as numbers; overlay-created ones carry the
|
|
22
|
+
* `'#123'` strings `StoreEditor.addEntity` takes. Both reach this module, so
|
|
23
|
+
* both forms have to resolve.
|
|
24
|
+
*/
|
|
25
|
+
function asRef(value) {
|
|
26
|
+
if (typeof value === 'number')
|
|
27
|
+
return value;
|
|
28
|
+
if (typeof value === 'string' && value.startsWith('#')) {
|
|
29
|
+
const id = Number(value.slice(1));
|
|
30
|
+
return Number.isInteger(id) ? id : null;
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
function refList(value) {
|
|
35
|
+
if (!Array.isArray(value))
|
|
36
|
+
return [];
|
|
37
|
+
const out = [];
|
|
38
|
+
for (const item of value) {
|
|
39
|
+
const id = asRef(item);
|
|
40
|
+
if (id !== null)
|
|
41
|
+
out.push(id);
|
|
42
|
+
}
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Depth limit for the representation walk. Real nesting is three levels (shape
|
|
47
|
+
* -> representation -> item, plus one hop through a mapped representation);
|
|
48
|
+
* this only has to stop a malformed file from looping.
|
|
49
|
+
*/
|
|
50
|
+
const MAX_REPRESENTATION_DEPTH = 8;
|
|
51
|
+
/** Attribute indices that are fixed across every schema for these classes. */
|
|
52
|
+
const SHAPE_REPRESENTATIONS_INDEX = 2; // IfcProductDefinitionShape.Representations
|
|
53
|
+
const REPRESENTATION_ITEMS_INDEX = 3; // IfcShapeRepresentation.Items
|
|
54
|
+
const MAPPED_ITEM_SOURCE_INDEX = 0; // IfcMappedItem.MappingSource
|
|
55
|
+
const MAPPED_REPRESENTATION_INDEX = 1; // IfcRepresentationMap.MappedRepresentation
|
|
56
|
+
const STYLED_ITEM_TARGET_INDEX = 0; // IfcStyledItem.Item
|
|
57
|
+
/**
|
|
58
|
+
* Index of a named attribute on a class, resolved against the bundled schema
|
|
59
|
+
* union rather than hardcoded.
|
|
60
|
+
*
|
|
61
|
+
* `Representation` is index 6 on `IfcProduct` but the same slot is
|
|
62
|
+
* `RepresentationMaps` on `IfcTypeProduct` — a list, not a single ref. Reading
|
|
63
|
+
* a constant 6 turns a type object handed in by a caller into a silent no-op
|
|
64
|
+
* instead of an honest "no geometry". Same reasoning as `findAttrIndex` in
|
|
65
|
+
* `@ifc-lite/export`'s demesh writer (#2032).
|
|
66
|
+
*/
|
|
67
|
+
function attributeIndex(typeName, attrName) {
|
|
68
|
+
const names = getAttributeNamesAcrossSchemas(typeName);
|
|
69
|
+
const idx = names.indexOf(attrName);
|
|
70
|
+
return idx >= 0 ? idx : null;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The geometry a product is drawn from.
|
|
74
|
+
*
|
|
75
|
+
* With `followMappedItems` (the default), an `IfcMappedItem` resolves to the
|
|
76
|
+
* items of the `IfcRepresentationMap` behind it, so the geometry every
|
|
77
|
+
* occurrence of a type shares is what comes back. Without it, the mapped item
|
|
78
|
+
* itself is the leaf. See `ApplyStyleOptions.followMappedItems` for which one
|
|
79
|
+
* you want.
|
|
80
|
+
*
|
|
81
|
+
* Exported because three private copies of this walk already exist in
|
|
82
|
+
* `extract-walls.ts` and one in `@ifc-lite/export`'s LOD generator, and none of
|
|
83
|
+
* them follows mapped items. This is the complete one.
|
|
84
|
+
*/
|
|
85
|
+
export function collectLeafRepresentationItems(read, representationId, options = {}) {
|
|
86
|
+
const followMapped = options.followMappedItems ?? true;
|
|
87
|
+
const out = new Set();
|
|
88
|
+
const walk = (id, depth) => {
|
|
89
|
+
if (depth > MAX_REPRESENTATION_DEPTH)
|
|
90
|
+
return;
|
|
91
|
+
const entity = read(id);
|
|
92
|
+
if (!entity)
|
|
93
|
+
return;
|
|
94
|
+
const type = entity.type.toUpperCase();
|
|
95
|
+
if (type === 'IFCPRODUCTDEFINITIONSHAPE') {
|
|
96
|
+
for (const rep of refList(entity.attributes[SHAPE_REPRESENTATIONS_INDEX]))
|
|
97
|
+
walk(rep, depth + 1);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (type === 'IFCSHAPEREPRESENTATION') {
|
|
101
|
+
for (const item of refList(entity.attributes[REPRESENTATION_ITEMS_INDEX]))
|
|
102
|
+
walk(item, depth + 1);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (type === 'IFCMAPPEDITEM' && followMapped) {
|
|
106
|
+
const source = asRef(entity.attributes[MAPPED_ITEM_SOURCE_INDEX]);
|
|
107
|
+
if (source === null)
|
|
108
|
+
return;
|
|
109
|
+
const mapped = asRef(read(source)?.attributes[MAPPED_REPRESENTATION_INDEX]);
|
|
110
|
+
if (mapped !== null)
|
|
111
|
+
walk(mapped, depth + 1);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
out.add(id);
|
|
115
|
+
};
|
|
116
|
+
walk(representationId, 0);
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Read an entity by expressId, source buffer first and overlay second.
|
|
121
|
+
*
|
|
122
|
+
* `StoreEditor.addEntity` does not insert into `store.entityIndex`, so a
|
|
123
|
+
* source-only reader cannot see anything created in the same session: styling a
|
|
124
|
+
* wall from `bim.store.addWall` reported it as geometry-less and wrote an
|
|
125
|
+
* orphan style. Mirrors `readEntity` in `extract-walls.ts`.
|
|
126
|
+
*/
|
|
127
|
+
function createReader(store, editor) {
|
|
128
|
+
const extractor = new EntityExtractor(store.source);
|
|
129
|
+
return (id) => {
|
|
130
|
+
const ref = store.entityIndex.byId.get(id);
|
|
131
|
+
if (ref && ref.byteLength > 0 && ref.byteOffset >= 0) {
|
|
132
|
+
const entity = extractor.extractEntity(ref);
|
|
133
|
+
if (entity)
|
|
134
|
+
return { type: entity.type, attributes: entity.attributes ?? [] };
|
|
135
|
+
}
|
|
136
|
+
const created = editor.getNewEntity(id);
|
|
137
|
+
return created ? { type: created.type, attributes: created.attributes ?? [] } : null;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Every representation item that already carries an `IfcStyledItem`, keyed by
|
|
142
|
+
* the item it styles.
|
|
143
|
+
*
|
|
144
|
+
* Built once per call and then maintained as styled items are added and
|
|
145
|
+
* removed. Rebuilding it per batch was both the dominant cost of a
|
|
146
|
+
* colour-by-class pass (87 ms per batch on a 92k-styled-item model) and a
|
|
147
|
+
* correctness gap: a second batch could not see the first batch's styled items,
|
|
148
|
+
* so overlapping geometry ended up with two of them.
|
|
149
|
+
*/
|
|
150
|
+
function indexExistingStyles(store, editor, read) {
|
|
151
|
+
const styledBy = new Map();
|
|
152
|
+
for (const id of store.entityIndex.byType.get('IFCSTYLEDITEM') ?? []) {
|
|
153
|
+
const target = asRef(read(id)?.attributes[STYLED_ITEM_TARGET_INDEX]);
|
|
154
|
+
if (target !== null)
|
|
155
|
+
styledBy.set(target, id);
|
|
156
|
+
}
|
|
157
|
+
for (const created of editor.getNewEntities()) {
|
|
158
|
+
if (created.type.toUpperCase() !== 'IFCSTYLEDITEM')
|
|
159
|
+
continue;
|
|
160
|
+
const target = asRef(created.attributes?.[STYLED_ITEM_TARGET_INDEX]);
|
|
161
|
+
if (target !== null)
|
|
162
|
+
styledBy.set(target, created.expressId);
|
|
163
|
+
}
|
|
164
|
+
return styledBy;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Give every representation item behind each batch's products one
|
|
168
|
+
* `IfcSurfaceStyle`.
|
|
169
|
+
*
|
|
170
|
+
* Batches are applied in order, and a later batch wins where two of them reach
|
|
171
|
+
* the same geometry. Writes through the `StoreEditor` overlay, so nothing
|
|
172
|
+
* touches the source buffer and `StepExporter` picks the new entities up on
|
|
173
|
+
* export.
|
|
174
|
+
*/
|
|
175
|
+
export function applyStylesInStore(editor, store, batches, options = {}) {
|
|
176
|
+
const replaceExisting = options.replaceExisting ?? true;
|
|
177
|
+
const followMapped = options.followMappedItems ?? true;
|
|
178
|
+
const schema = options.schema ?? store.schemaVersion;
|
|
179
|
+
const read = createReader(store, editor);
|
|
180
|
+
const styledBy = indexExistingStyles(store, editor, read);
|
|
181
|
+
const results = batches.map(batch => {
|
|
182
|
+
const items = new Set();
|
|
183
|
+
const productsWithoutGeometry = [];
|
|
184
|
+
for (const product of batch.products) {
|
|
185
|
+
// Per product, then merged. Asking whether the shared set grew would call
|
|
186
|
+
// every occurrence after the first "geometry-less" whenever a type's
|
|
187
|
+
// occurrences share one mapped representation — which is most of them.
|
|
188
|
+
const entity = read(product);
|
|
189
|
+
const repIndex = entity ? attributeIndex(entity.type, 'Representation') : null;
|
|
190
|
+
const representation = repIndex === null
|
|
191
|
+
? null
|
|
192
|
+
: asRef(entity?.attributes[repIndex]);
|
|
193
|
+
const reached = representation === null
|
|
194
|
+
? new Set()
|
|
195
|
+
: collectLeafRepresentationItems(read, representation, { followMappedItems: followMapped });
|
|
196
|
+
if (reached.size === 0) {
|
|
197
|
+
productsWithoutGeometry.push(product);
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
for (const item of reached)
|
|
201
|
+
items.add(item);
|
|
202
|
+
}
|
|
203
|
+
// Split before emitting anything, so a batch that turns out to style
|
|
204
|
+
// nothing does not leave a colour chain behind.
|
|
205
|
+
const keptExistingItemIds = [];
|
|
206
|
+
const toStyle = [];
|
|
207
|
+
for (const item of [...items].sort((a, b) => a - b)) {
|
|
208
|
+
if (!replaceExisting && styledBy.has(item))
|
|
209
|
+
keptExistingItemIds.push(item);
|
|
210
|
+
else
|
|
211
|
+
toStyle.push(item);
|
|
212
|
+
}
|
|
213
|
+
if (toStyle.length === 0) {
|
|
214
|
+
return {
|
|
215
|
+
surfaceStyleId: null,
|
|
216
|
+
styledItemIds: [],
|
|
217
|
+
productsWithoutGeometry,
|
|
218
|
+
replacedStyledItemIds: [],
|
|
219
|
+
keptExistingItemIds,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
const style = emitSurfaceStyle(editor, schema, batch.color, batch.name);
|
|
223
|
+
const styleRef = `#${style.styleRefId}`;
|
|
224
|
+
const chain = {
|
|
225
|
+
styleId: style.surfaceStyleId, chainIds: style.chainIds, styledItemIds: [],
|
|
226
|
+
};
|
|
227
|
+
authoredChains.set(editor, [...(authoredChains.get(editor) ?? []), chain]);
|
|
228
|
+
const styledItemIds = [];
|
|
229
|
+
const replacedStyledItemIds = [];
|
|
230
|
+
for (const item of toStyle) {
|
|
231
|
+
const existing = styledBy.get(item);
|
|
232
|
+
if (existing !== undefined) {
|
|
233
|
+
editor.removeEntity(existing);
|
|
234
|
+
replacedStyledItemIds.push(existing);
|
|
235
|
+
}
|
|
236
|
+
const styled = editor.addEntity('IfcStyledItem', [`#${item}`, [styleRef], null]);
|
|
237
|
+
styledBy.set(item, styled.expressId);
|
|
238
|
+
styledItemIds.push(styled.expressId);
|
|
239
|
+
chain.styledItemIds.push(styled.expressId);
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
surfaceStyleId: style.surfaceStyleId,
|
|
243
|
+
styledItemIds,
|
|
244
|
+
productsWithoutGeometry,
|
|
245
|
+
replacedStyledItemIds,
|
|
246
|
+
keptExistingItemIds,
|
|
247
|
+
};
|
|
248
|
+
});
|
|
249
|
+
sweepAuthoredChains(editor);
|
|
250
|
+
// A styled item can be replaced after its batch returned — by a later batch,
|
|
251
|
+
// or by a later call entirely. Report what is actually still in the file.
|
|
252
|
+
const live = new Set(editor.getNewEntities().map(e => e.expressId));
|
|
253
|
+
return results.map(result => {
|
|
254
|
+
const surviving = result.styledItemIds.filter(id => live.has(id));
|
|
255
|
+
if (surviving.length === result.styledItemIds.length)
|
|
256
|
+
return result;
|
|
257
|
+
return {
|
|
258
|
+
...result,
|
|
259
|
+
styledItemIds: surviving,
|
|
260
|
+
surfaceStyleId: surviving.length === 0 ? null : result.surfaceStyleId,
|
|
261
|
+
};
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Style chains this module authored, per editor, and the styled items each was
|
|
266
|
+
* created for.
|
|
267
|
+
*
|
|
268
|
+
* Kept rather than inferred. Deciding "is this style garbage" by reading the
|
|
269
|
+
* overlay was wrong three ways: it could not see `setPositionalAttribute` edits
|
|
270
|
+
* (`getNewEntities` returns creation-time attributes, while the exporter
|
|
271
|
+
* applies positional mutations on top), so it deleted live styles and kept dead
|
|
272
|
+
* ones; it removed a chain's shading and colour without checking whether
|
|
273
|
+
* another style still used them; and it collected any overlay `IfcSurfaceStyle`
|
|
274
|
+
* at all, including chains a caller had authored with `bim.store.addEntity` and
|
|
275
|
+
* not yet attached. All three needed a caller using `bim.store.*` alongside
|
|
276
|
+
* `bim.style`, which is public API.
|
|
277
|
+
*
|
|
278
|
+
* A `WeakMap` because it has to outlive one call — recolouring in a second
|
|
279
|
+
* `apply` is exactly the case per-call bookkeeping could not reach — without
|
|
280
|
+
* keeping a finished editor alive.
|
|
281
|
+
*/
|
|
282
|
+
const authoredChains = new WeakMap();
|
|
283
|
+
/**
|
|
284
|
+
* Drop the chains whose every styled item is gone.
|
|
285
|
+
*
|
|
286
|
+
* Liveness is membership in the overlay: removing an overlay-created entity
|
|
287
|
+
* deletes it from `newEntities`, so `getNewEntity` answering null is the whole
|
|
288
|
+
* test. Nothing here reads an attribute, which is what makes it immune to a
|
|
289
|
+
* caller repointing one of these styled items — that leaves the chain looking
|
|
290
|
+
* referenced, so it survives. Keeping a chain that turned out to be garbage is
|
|
291
|
+
* the safe direction; removing one still pointed at writes a dangling
|
|
292
|
+
* reference into the file.
|
|
293
|
+
*/
|
|
294
|
+
function sweepAuthoredChains(editor) {
|
|
295
|
+
const chains = authoredChains.get(editor);
|
|
296
|
+
if (!chains || chains.length === 0)
|
|
297
|
+
return;
|
|
298
|
+
const surviving = [];
|
|
299
|
+
for (const chain of chains) {
|
|
300
|
+
if (chain.styledItemIds.some(id => editor.getNewEntity(id) !== null)) {
|
|
301
|
+
surviving.push(chain);
|
|
302
|
+
continue;
|
|
303
|
+
}
|
|
304
|
+
for (const id of chain.chainIds)
|
|
305
|
+
editor.removeEntity(id);
|
|
306
|
+
}
|
|
307
|
+
authoredChains.set(editor, surviving);
|
|
308
|
+
}
|
|
309
|
+
//# sourceMappingURL=apply-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-style.js","sourceRoot":"","sources":["../../src/in-store/apply-style.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,eAAe,EAAE,8BAA8B,EAAqB,MAAM,kBAAkB,CAAC;AAEtG,OAAO,EAAE,gBAAgB,EAA0B,MAAM,oBAAoB,CAAC;AA2G9E;;;;;;GAMG;AACH,SAAS,KAAK,CAAC,KAAoC;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACvD,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,OAAO,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,OAAO,CAAC,KAAoC;IACnD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;QACvB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CAAC;IAC3D,CAAC;IACD,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beam.d.ts","sourceRoot":"","sources":["../../src/in-store/beam.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAkC,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjF,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAUD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,iBAAiB,GACxB,eAAe,
|
|
1
|
+
{"version":3,"file":"beam.d.ts","sourceRoot":"","sources":["../../src/in-store/beam.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAkC,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjF,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAUD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,iBAAiB,GACxB,eAAe,CA8GjB"}
|
package/dist/in-store/beam.js
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
* Pure: no I/O, no parser access — operates entirely through the editor.
|
|
18
18
|
*/
|
|
19
19
|
import { generateIfcGuid } from '@ifc-lite/encoding';
|
|
20
|
-
import { vecCross, vecNorm } from '../ifc-creator-math.js';
|
|
20
|
+
import { vecCross, vecNorm, assertFinitePoint3 } from '../ifc-creator-math.js';
|
|
21
21
|
import { toNativeLength, toNativePoint3 } from './anchor.js';
|
|
22
|
-
import { ownerHistoryRef } from './_emit-helpers.js';
|
|
22
|
+
import { assertPositiveFinite, ownerHistoryRef } from './_emit-helpers.js';
|
|
23
23
|
/**
|
|
24
24
|
* Stable perpendicular to a beam axis. Mirrors IfcCreator.computeRefDirection.
|
|
25
25
|
*/
|
|
@@ -29,6 +29,10 @@ function computeRefDirection(axis) {
|
|
|
29
29
|
}
|
|
30
30
|
export function addBeamToStore(editor, anchor, params) {
|
|
31
31
|
const { ownerHistoryId, bodyContextId, storeyId, storeyPlacementId } = anchor;
|
|
32
|
+
// A non-finite Start/End coordinate makes the derived beamLen NaN, and
|
|
33
|
+
// `NaN <= 0` is false, so the distinct-points check below never fires.
|
|
34
|
+
// Validate the source coordinates instead of trusting the derived value.
|
|
35
|
+
assertFinitePoint3({ Start: params.Start, End: params.End }, 'addBeamToStore');
|
|
32
36
|
// Params are metres; convert dimensioned fields to the file's native
|
|
33
37
|
// length unit before emit (see SpatialAnchor.lengthUnitScale).
|
|
34
38
|
params = {
|
|
@@ -45,9 +49,7 @@ export function addBeamToStore(editor, anchor, params) {
|
|
|
45
49
|
if (beamLen <= 0) {
|
|
46
50
|
throw new Error('addBeamToStore: Start and End must be distinct points');
|
|
47
51
|
}
|
|
48
|
-
|
|
49
|
-
throw new Error('addBeamToStore: Width and Height must be positive');
|
|
50
|
-
}
|
|
52
|
+
assertPositiveFinite([params.Width, params.Height], 'addBeamToStore: Width and Height must be positive');
|
|
51
53
|
const dir = vecNorm([dx, dy, dz]);
|
|
52
54
|
const refDir = computeRefDirection(dir);
|
|
53
55
|
// Placement at Start with local Z along the beam axis.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beam.js","sourceRoot":"","sources":["../../src/in-store/beam.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"beam.js","sourceRoot":"","sources":["../../src/in-store/beam.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EA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,MAAM;QACN,WAAW;QACX,SAAS;QACT,OAAO;QACP,UAAU;QACV,cAAc;QACd,cAAc;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../../src/in-store/column.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAkC,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjF,MAAM,WAAW,mBAAmB;IAClC,uEAAuE;IACvE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,mBAAmB,GAC1B,iBAAiB,
|
|
1
|
+
{"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../../src/in-store/column.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,WAAW,EAA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