@ifc-lite/create 2.6.0 → 2.8.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 +8 -0
- package/dist/cost-authoring-rules.d.ts +70 -0
- package/dist/cost-authoring-rules.d.ts.map +1 -0
- package/dist/cost-authoring-rules.js +118 -0
- package/dist/cost-authoring-rules.js.map +1 -0
- package/dist/ifc-creator-cost.d.ts +3 -14
- package/dist/ifc-creator-cost.d.ts.map +1 -1
- package/dist/ifc-creator-cost.js +4 -62
- package/dist/ifc-creator-cost.js.map +1 -1
- package/dist/in-store/_emit-helpers.d.ts +10 -0
- package/dist/in-store/_emit-helpers.d.ts.map +1 -1
- package/dist/in-store/_emit-helpers.js +15 -2
- package/dist/in-store/_emit-helpers.js.map +1 -1
- package/dist/in-store/beam.d.ts +2 -0
- package/dist/in-store/beam.d.ts.map +1 -1
- package/dist/in-store/beam.js +2 -2
- package/dist/in-store/beam.js.map +1 -1
- package/dist/in-store/column.d.ts +2 -0
- package/dist/in-store/column.d.ts.map +1 -1
- package/dist/in-store/column.js +2 -2
- package/dist/in-store/column.js.map +1 -1
- package/dist/in-store/cost-nesting-cycle.d.ts +8 -0
- package/dist/in-store/cost-nesting-cycle.d.ts.map +1 -0
- package/dist/in-store/cost-nesting-cycle.js +28 -0
- package/dist/in-store/cost-nesting-cycle.js.map +1 -0
- package/dist/in-store/cost-reference-validation.d.ts +13 -0
- package/dist/in-store/cost-reference-validation.d.ts.map +1 -0
- package/dist/in-store/cost-reference-validation.js +49 -0
- package/dist/in-store/cost-reference-validation.js.map +1 -0
- package/dist/in-store/cost-removal.d.ts +40 -0
- package/dist/in-store/cost-removal.d.ts.map +1 -0
- package/dist/in-store/cost-removal.js +107 -0
- package/dist/in-store/cost-removal.js.map +1 -0
- package/dist/in-store/cost.d.ts +109 -0
- package/dist/in-store/cost.d.ts.map +1 -0
- package/dist/in-store/cost.js +323 -0
- package/dist/in-store/cost.js.map +1 -0
- package/dist/in-store/door.d.ts +2 -0
- package/dist/in-store/door.d.ts.map +1 -1
- package/dist/in-store/door.js.map +1 -1
- package/dist/in-store/member.d.ts +2 -0
- package/dist/in-store/member.d.ts.map +1 -1
- package/dist/in-store/member.js.map +1 -1
- package/dist/in-store/plate.d.ts +4 -0
- package/dist/in-store/plate.d.ts.map +1 -1
- package/dist/in-store/plate.js.map +1 -1
- package/dist/in-store/resolve-source.d.ts.map +1 -1
- package/dist/in-store/resolve-source.js +11 -8
- package/dist/in-store/resolve-source.js.map +1 -1
- package/dist/in-store/roof.d.ts +4 -0
- package/dist/in-store/roof.d.ts.map +1 -1
- package/dist/in-store/roof.js.map +1 -1
- package/dist/in-store/slab.d.ts +4 -0
- package/dist/in-store/slab.d.ts.map +1 -1
- package/dist/in-store/slab.js +2 -2
- package/dist/in-store/slab.js.map +1 -1
- package/dist/in-store/space.d.ts +4 -0
- package/dist/in-store/space.d.ts.map +1 -1
- package/dist/in-store/space.js +2 -2
- package/dist/in-store/space.js.map +1 -1
- package/dist/in-store/structural-action.d.ts +85 -0
- package/dist/in-store/structural-action.d.ts.map +1 -0
- package/dist/in-store/structural-action.js +83 -0
- package/dist/in-store/structural-action.js.map +1 -0
- package/dist/in-store/structural-analysis-model.d.ts +49 -0
- package/dist/in-store/structural-analysis-model.d.ts.map +1 -0
- package/dist/in-store/structural-analysis-model.js +29 -0
- package/dist/in-store/structural-analysis-model.js.map +1 -0
- package/dist/in-store/structural-curve-member.d.ts +90 -0
- package/dist/in-store/structural-curve-member.d.ts.map +1 -0
- package/dist/in-store/structural-curve-member.js +83 -0
- package/dist/in-store/structural-curve-member.js.map +1 -0
- package/dist/in-store/structural-load-group.d.ts +61 -0
- package/dist/in-store/structural-load-group.d.ts.map +1 -0
- package/dist/in-store/structural-load-group.js +38 -0
- package/dist/in-store/structural-load-group.js.map +1 -0
- package/dist/in-store/structural-point-connection.d.ts +75 -0
- package/dist/in-store/structural-point-connection.d.ts.map +1 -0
- package/dist/in-store/structural-point-connection.js +41 -0
- package/dist/in-store/structural-point-connection.js.map +1 -0
- package/dist/in-store/structural-relationships.d.ts +47 -0
- package/dist/in-store/structural-relationships.d.ts.map +1 -0
- package/dist/in-store/structural-relationships.js +85 -0
- package/dist/in-store/structural-relationships.js.map +1 -0
- package/dist/in-store/wall.d.ts +2 -0
- package/dist/in-store/wall.d.ts.map +1 -1
- package/dist/in-store/wall.js +2 -2
- package/dist/in-store/wall.js.map +1 -1
- package/dist/in-store/window.d.ts +2 -0
- package/dist/in-store/window.d.ts.map +1 -1
- package/dist/in-store/window.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/types-cost.d.ts +2 -2
- package/dist/types-cost.d.ts.map +1 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -29,6 +29,14 @@ const { content } = creator.toIfc(); // IFC STEP text
|
|
|
29
29
|
- Property sets, element quantities, materials, and colors
|
|
30
30
|
- 4D scheduling entities: IfcWorkSchedule, IfcTask, IfcRelSequence
|
|
31
31
|
- In-store builders (`addWallToStore`, `addSlabToStore`, ...) that emit elements into an existing parsed model
|
|
32
|
+
- Loaded-model cost builders (`addCostScheduleToStore`, `addCostItemToStore`, `addCostValueToStore`,
|
|
33
|
+
`addCostQuantityToStore`) plus relationship helpers for nesting, schedule/object assignment, value lists,
|
|
34
|
+
and safe removal. They require a `CostAnchor` for schema/owner-history/GUID allocation, accept existing
|
|
35
|
+
relationship maps from the host, reject IFC2X3 authoring, and make destructive removal explicit with
|
|
36
|
+
`{ detach: true }` when surviving references must be rewritten. Removal referrer data distinguishes
|
|
37
|
+
required relationship endpoints (whose relationship is deleted) from optional scalar and list
|
|
38
|
+
attributes on non-relationship owners. Optional scalars are rewritten to `$`; optional lists retain
|
|
39
|
+
their surviving members, or become `$` when emptied, so detaching a cost value never deletes its owner.
|
|
32
40
|
- Space generation: `generateSpacesFromWalls` and `detectEnclosedAreas` derive IfcSpace footprints from wall layouts
|
|
33
41
|
- Fully typed parameter objects for every element
|
|
34
42
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema-free validation shared by both cost-entity emitters (#4857 PR A):
|
|
3
|
+
* the STEP-TEXT emitter `ifc-creator-cost.ts` (`IfcCreator`, building a file
|
|
4
|
+
* from scratch) and the in-store builder `in-store/cost.ts`
|
|
5
|
+
* (`bim.store.addCost*`, authoring into an already-loaded model). Neither
|
|
6
|
+
* caller's serialization concern lives here — `ifc-creator-cost.ts` writes a
|
|
7
|
+
* raw STEP argument string, `in-store/cost.ts` writes a `StoreEditor`
|
|
8
|
+
* attribute array — only WHETHER an authored value is legal, decided once, so
|
|
9
|
+
* the same typo or out-of-range value is rejected identically from either
|
|
10
|
+
* entry point rather than by two allow-lists that can drift.
|
|
11
|
+
*/
|
|
12
|
+
/** The schemas cost entities can be authored in (IFC2X3 is refused up front). */
|
|
13
|
+
export type CostSchema = 'IFC2X3' | 'IFC4' | 'IFC4X3';
|
|
14
|
+
/** A typed IFC value: the SELECT branch name plus its numeric value. */
|
|
15
|
+
export interface CostTypedValueInput {
|
|
16
|
+
Type: string;
|
|
17
|
+
Value: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Runtime allow-lists for every closed vocabulary a cost method writes. The
|
|
21
|
+
* TypeScript unions at the call sites only bind typed callers; the sandbox
|
|
22
|
+
* hands these methods untyped script input, and an unchecked string becomes
|
|
23
|
+
* `IFCBOGUSMEASURE(1.)` or `.BOGUS.` — well-formed STEP naming nothing in the
|
|
24
|
+
* schema.
|
|
25
|
+
*/
|
|
26
|
+
export declare const MEASURE_TYPES: ReadonlySet<string>;
|
|
27
|
+
export declare const QUANTITY_KINDS: ReadonlySet<string>;
|
|
28
|
+
export declare const ARITHMETIC_OPERATORS: ReadonlySet<string>;
|
|
29
|
+
export declare const COST_SCHEDULE_TYPES: ReadonlySet<string>;
|
|
30
|
+
export declare const COST_ITEM_TYPES: ReadonlySet<string>;
|
|
31
|
+
/** Validate a loaded model's schema at the untyped runtime boundary. */
|
|
32
|
+
export declare function requireCostSchema(schema: unknown): CostSchema;
|
|
33
|
+
/** Refuse a value outside its closed vocabulary; `undefined` (absent) passes. */
|
|
34
|
+
export declare function assertOneOf(value: unknown, allowed: ReadonlySet<string>, what: string, context: string): void;
|
|
35
|
+
/** Validate IfcArithmeticOperatorEnum, whose MODULO member exists only in IFC4X3. */
|
|
36
|
+
export declare function validateArithmeticOperator(value: unknown, schema: CostSchema, context: string): void;
|
|
37
|
+
/** EXPRESS INTEGER-valued measures: IfcInteger always, IfcCountMeasure from IFC4X3 on. */
|
|
38
|
+
export declare function isIntegerMeasure(type: string, schema: CostSchema): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Refuse IFC2X3 cost authoring by name, loudly.
|
|
41
|
+
*
|
|
42
|
+
* IFC2X3 lays IfcCostSchedule / IfcCostItem / IfcCostValue out differently
|
|
43
|
+
* (IfcCostSchedule carries an `ID` and IfcDateAndTime references where IFC4
|
|
44
|
+
* carries `Identification` and IfcDateTime strings; IfcCostValue has
|
|
45
|
+
* `CostType` where IFC4 has `Category`, and no `Components` at all). Writing
|
|
46
|
+
* the IFC4 layout into an IFC2X3 file would produce records that parse and are
|
|
47
|
+
* wrong. A no-op — or a method that returned an id having written nothing —
|
|
48
|
+
* would look like success at the call site, so this throws instead.
|
|
49
|
+
*/
|
|
50
|
+
export declare function assertCostSchema(schema: string, method: string): void;
|
|
51
|
+
/**
|
|
52
|
+
* Validate a typed IFC value (`IfcCostValue.AppliedValue`,
|
|
53
|
+
* `IfcMeasureWithUnit.ValueComponent` — both `IfcValue`/SELECT-typed
|
|
54
|
+
* attributes). Does not serialize: the caller picks the STEP form (a named
|
|
55
|
+
* SELECT branch as raw text, or a `{ typed: { type, value } }` overlay
|
|
56
|
+
* marker) once this passes.
|
|
57
|
+
*/
|
|
58
|
+
export declare function validateTypedValue(value: CostTypedValueInput | undefined, schema: CostSchema, context: string): void;
|
|
59
|
+
/**
|
|
60
|
+
* Validate an optional LIST-of-reference attribute.
|
|
61
|
+
*
|
|
62
|
+
* `undefined` is absent. An empty array is NOT absent: the EXPRESS
|
|
63
|
+
* declaration is `[1:?]`, so `()` would be a malformed list that the reader
|
|
64
|
+
* reports as INVALID_LIST. Refusing here keeps the two states distinct end to
|
|
65
|
+
* end, for both emitters.
|
|
66
|
+
*/
|
|
67
|
+
export declare function validateRefList(ids: number[] | undefined, attribute: string, context: string): void;
|
|
68
|
+
/** Require a positive integer express id for a single-reference attribute. */
|
|
69
|
+
export declare function requireRef(id: number, attribute: string, context: string): void;
|
|
70
|
+
//# sourceMappingURL=cost-authoring-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost-authoring-rules.d.ts","sourceRoot":"","sources":["../src/cost-authoring-rules.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,iFAAiF;AACjF,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEtD,wEAAwE;AACxE,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,CAI5C,CAAC;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAG7C,CAAC;AACH,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAAwE,CAAC;AAC9H,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAGlD,CAAC;AACH,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAAkD,CAAC;AAEnG,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU,CAK7D;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAK7G;AAED,qFAAqF;AACrF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAKpG;AAED,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAE1E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAMrE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAYpH;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAYnG;AAED,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAI/E"}
|
|
@@ -0,0 +1,118 @@
|
|
|
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
|
+
* Runtime allow-lists for every closed vocabulary a cost method writes. The
|
|
6
|
+
* TypeScript unions at the call sites only bind typed callers; the sandbox
|
|
7
|
+
* hands these methods untyped script input, and an unchecked string becomes
|
|
8
|
+
* `IFCBOGUSMEASURE(1.)` or `.BOGUS.` — well-formed STEP naming nothing in the
|
|
9
|
+
* schema.
|
|
10
|
+
*/
|
|
11
|
+
export const MEASURE_TYPES = new Set([
|
|
12
|
+
'IfcMonetaryMeasure', 'IfcAreaMeasure', 'IfcVolumeMeasure', 'IfcLengthMeasure',
|
|
13
|
+
'IfcMassMeasure', 'IfcTimeMeasure', 'IfcCountMeasure', 'IfcNumericMeasure',
|
|
14
|
+
'IfcRatioMeasure', 'IfcReal', 'IfcInteger',
|
|
15
|
+
]);
|
|
16
|
+
export const QUANTITY_KINDS = new Set([
|
|
17
|
+
'IfcQuantityLength', 'IfcQuantityArea', 'IfcQuantityVolume', 'IfcQuantityWeight',
|
|
18
|
+
'IfcQuantityTime', 'IfcQuantityCount', 'IfcQuantityNumber',
|
|
19
|
+
]);
|
|
20
|
+
export const ARITHMETIC_OPERATORS = new Set(['ADD', 'DIVIDE', 'MODULO', 'MULTIPLY', 'SUBTRACT']);
|
|
21
|
+
export const COST_SCHEDULE_TYPES = new Set([
|
|
22
|
+
'BUDGET', 'COSTPLAN', 'ESTIMATE', 'TENDER', 'PRICEDBILLOFQUANTITIES',
|
|
23
|
+
'UNPRICEDBILLOFQUANTITIES', 'SCHEDULEOFRATES', 'USERDEFINED', 'NOTDEFINED',
|
|
24
|
+
]);
|
|
25
|
+
export const COST_ITEM_TYPES = new Set(['USERDEFINED', 'NOTDEFINED']);
|
|
26
|
+
/** Validate a loaded model's schema at the untyped runtime boundary. */
|
|
27
|
+
export function requireCostSchema(schema) {
|
|
28
|
+
if (schema !== 'IFC2X3' && schema !== 'IFC4' && schema !== 'IFC4X3') {
|
|
29
|
+
throw new Error('CostAnchor.schema is required and must match the loaded model schema');
|
|
30
|
+
}
|
|
31
|
+
return schema;
|
|
32
|
+
}
|
|
33
|
+
/** Refuse a value outside its closed vocabulary; `undefined` (absent) passes. */
|
|
34
|
+
export function assertOneOf(value, allowed, what, context) {
|
|
35
|
+
if (value === undefined)
|
|
36
|
+
return;
|
|
37
|
+
if (typeof value !== 'string' || !allowed.has(value)) {
|
|
38
|
+
throw new Error(`${context}: ${what} '${String(value)}' is not one of ${[...allowed].join(', ')}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** Validate IfcArithmeticOperatorEnum, whose MODULO member exists only in IFC4X3. */
|
|
42
|
+
export function validateArithmeticOperator(value, schema, context) {
|
|
43
|
+
assertOneOf(value, ARITHMETIC_OPERATORS, 'ArithmeticOperator', context);
|
|
44
|
+
if (value === 'MODULO' && schema !== 'IFC4X3') {
|
|
45
|
+
throw new Error(`${context}: ArithmeticOperator 'MODULO' is only valid in IFC4X3`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** EXPRESS INTEGER-valued measures: IfcInteger always, IfcCountMeasure from IFC4X3 on. */
|
|
49
|
+
export function isIntegerMeasure(type, schema) {
|
|
50
|
+
return type === 'IfcInteger' || (type === 'IfcCountMeasure' && schema === 'IFC4X3');
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Refuse IFC2X3 cost authoring by name, loudly.
|
|
54
|
+
*
|
|
55
|
+
* IFC2X3 lays IfcCostSchedule / IfcCostItem / IfcCostValue out differently
|
|
56
|
+
* (IfcCostSchedule carries an `ID` and IfcDateAndTime references where IFC4
|
|
57
|
+
* carries `Identification` and IfcDateTime strings; IfcCostValue has
|
|
58
|
+
* `CostType` where IFC4 has `Category`, and no `Components` at all). Writing
|
|
59
|
+
* the IFC4 layout into an IFC2X3 file would produce records that parse and are
|
|
60
|
+
* wrong. A no-op — or a method that returned an id having written nothing —
|
|
61
|
+
* would look like success at the call site, so this throws instead.
|
|
62
|
+
*/
|
|
63
|
+
export function assertCostSchema(schema, method) {
|
|
64
|
+
if (schema === 'IFC2X3') {
|
|
65
|
+
throw new Error(`${method} is not supported for IFC2X3: the IFC2X3 cost entities have a different `
|
|
66
|
+
+ 'attribute layout. Create or load the model as IFC4 or IFC4X3.');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Validate a typed IFC value (`IfcCostValue.AppliedValue`,
|
|
71
|
+
* `IfcMeasureWithUnit.ValueComponent` — both `IfcValue`/SELECT-typed
|
|
72
|
+
* attributes). Does not serialize: the caller picks the STEP form (a named
|
|
73
|
+
* SELECT branch as raw text, or a `{ typed: { type, value } }` overlay
|
|
74
|
+
* marker) once this passes.
|
|
75
|
+
*/
|
|
76
|
+
export function validateTypedValue(value, schema, context) {
|
|
77
|
+
if (value === undefined || value === null)
|
|
78
|
+
throw new Error(`${context}: a typed value is required`);
|
|
79
|
+
if (value.Type === undefined)
|
|
80
|
+
throw new Error(`${context}: Type is required on a typed value`);
|
|
81
|
+
assertOneOf(value.Type, MEASURE_TYPES, 'Type', context);
|
|
82
|
+
if (!Number.isFinite(value.Value)) {
|
|
83
|
+
throw new Error(`${context}: ${value.Type} value must be a finite number`);
|
|
84
|
+
}
|
|
85
|
+
// Rounding would silently change the caller's number: an INTEGER measure
|
|
86
|
+
// given a fraction is a caller error, not something to fix up.
|
|
87
|
+
if (isIntegerMeasure(value.Type, schema) && !Number.isInteger(value.Value)) {
|
|
88
|
+
throw new Error(`${context}: ${value.Type} value must be an integer in ${schema}, got ${value.Value}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Validate an optional LIST-of-reference attribute.
|
|
93
|
+
*
|
|
94
|
+
* `undefined` is absent. An empty array is NOT absent: the EXPRESS
|
|
95
|
+
* declaration is `[1:?]`, so `()` would be a malformed list that the reader
|
|
96
|
+
* reports as INVALID_LIST. Refusing here keeps the two states distinct end to
|
|
97
|
+
* end, for both emitters.
|
|
98
|
+
*/
|
|
99
|
+
export function validateRefList(ids, attribute, context) {
|
|
100
|
+
if (ids === undefined)
|
|
101
|
+
return;
|
|
102
|
+
if (ids.length === 0) {
|
|
103
|
+
throw new Error(`${context}: ${attribute} must name at least one entity. Omit the field entirely `
|
|
104
|
+
+ 'to write it as absent — an empty list is a malformed IFC list, not "no value".');
|
|
105
|
+
}
|
|
106
|
+
for (const id of ids) {
|
|
107
|
+
if (!Number.isInteger(id) || id <= 0) {
|
|
108
|
+
throw new Error(`${context}: ${attribute} contains '${id}', which is not an express id`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/** Require a positive integer express id for a single-reference attribute. */
|
|
113
|
+
export function requireRef(id, attribute, context) {
|
|
114
|
+
if (!Number.isInteger(id) || id <= 0) {
|
|
115
|
+
throw new Error(`${context}: ${attribute} must be an express id, got '${id}'`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=cost-authoring-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost-authoring-rules.js","sourceRoot":"","sources":["../src/cost-authoring-rules.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAuB/D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAS;IAChE,oBAAoB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,kBAAkB;IAC9E,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB;IAC1E,iBAAiB,EAAE,SAAS,EAAE,YAAY;CAC3C,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAS;IACjE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB;IAChF,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB;CAC3D,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwB,IAAI,GAAG,CAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAC9H,MAAM,CAAC,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAS;IACtE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,wBAAwB;IACpE,0BAA0B,EAAE,iBAAi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IAC3F,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO;IAC9B,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,GAAG,OAAO,KAAK,SAAS,0DAA0D;cAChF,gFAAgF,CAAC,CAAC;IACxF,CAAC;IACD,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,KAAK,SAAS,cAAc,EAAE,+BAA+B,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;AACH,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CAAC,EAAU,EAAE,SAAiB,EAAE,OAAe;IACvE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,KAAK,SAAS,gCAAgC,EAAE,GAAG,CAAC,CAAC;IACjF,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { type CostSchema } from './cost-authoring-rules.js';
|
|
1
2
|
import type { CostItemParams, CostQuantityParams, CostScheduleParams, CostTypedValue, CostValueParams, SIUnitParams } from './types-cost.js';
|
|
3
|
+
export type { CostSchema };
|
|
2
4
|
/** Allocate an express id, emit `#id=TYPE(attrs);`, and return the id. */
|
|
3
5
|
export type EmitEntity = (type: string, attrs: string) => number;
|
|
4
|
-
/** The schemas cost entities can be authored in (IFC2X3 is refused up front). */
|
|
5
|
-
export type CostSchema = 'IFC2X3' | 'IFC4' | 'IFC4X3';
|
|
6
6
|
/**
|
|
7
7
|
* Serialize a finite number as an exact STEP REAL.
|
|
8
8
|
*
|
|
@@ -13,18 +13,7 @@ export type CostSchema = 'IFC2X3' | 'IFC4' | 'IFC4X3';
|
|
|
13
13
|
* `toString()` are kept and only rewritten into STEP's spelling.
|
|
14
14
|
*/
|
|
15
15
|
export declare function stepReal(v: number): string;
|
|
16
|
-
|
|
17
|
-
* Refuse IFC2X3 cost authoring by name, loudly.
|
|
18
|
-
*
|
|
19
|
-
* IFC2X3 lays IfcCostSchedule / IfcCostItem / IfcCostValue out differently
|
|
20
|
-
* (IfcCostSchedule carries an `ID` and IfcDateAndTime references where IFC4
|
|
21
|
-
* carries `Identification` and IfcDateTime strings; IfcCostValue has
|
|
22
|
-
* `CostType` where IFC4 has `Category`, and no `Components` at all). Writing
|
|
23
|
-
* the IFC4 layout into an IFC2X3 file would produce records that parse and are
|
|
24
|
-
* wrong. A no-op — or a method that returned an id having written nothing —
|
|
25
|
-
* would look like success at the call site, so this throws instead.
|
|
26
|
-
*/
|
|
27
|
-
export declare function assertCostSchema(schema: string, method: string): void;
|
|
16
|
+
export { assertCostSchema } from './cost-authoring-rules.js';
|
|
28
17
|
/**
|
|
29
18
|
* Serialize a typed IFC value as a named SELECT branch.
|
|
30
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifc-creator-cost.d.ts","sourceRoot":"","sources":["../src/ifc-creator-cost.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,YAAY,EACb,MAAM,iBAAiB,CAAC;AAEzB,0EAA0E;AAC1E,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;AAEjE
|
|
1
|
+
{"version":3,"file":"ifc-creator-cost.d.ts","sourceRoot":"","sources":["../src/ifc-creator-cost.ts"],"names":[],"mappings":"AA0CA,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EACl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I,EAAE,UAAU,GACf,MAAM,CAQR;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACrC,iBAAiB,EAAE,MAAM,EACzB,gBAAgB,EAAE,MAAM,EAAE,EAC1B,WAAW,EAAE,MAAM,MAAM,EACzB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,UAAU,GACf,MAAM,CAKR;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,UAAU,GACf,MAAM,CAOR"}
|
package/dist/ifc-creator-cost.js
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
* lists `[1:?]`) and is refused loudly rather than degraded to `$`.
|
|
39
39
|
*/
|
|
40
40
|
import { esc, optStr, optEnum, refList } from './ifc-creator-math.js';
|
|
41
|
+
import { COST_ITEM_TYPES, COST_SCHEDULE_TYPES, QUANTITY_KINDS, assertOneOf, isIntegerMeasure, validateArithmeticOperator, validateTypedValue, } from './cost-authoring-rules.js';
|
|
41
42
|
/**
|
|
42
43
|
* Serialize a finite number as an exact STEP REAL.
|
|
43
44
|
*
|
|
@@ -56,56 +57,7 @@ export function stepReal(v) {
|
|
|
56
57
|
const exponent = s.slice(e + 1).replace(/^\+/, '');
|
|
57
58
|
return `${mantissa.includes('.') ? mantissa : `${mantissa}.`}E${exponent}`;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
* Runtime allow-lists for every closed vocabulary a cost method writes. The
|
|
61
|
-
* TypeScript unions only bind typed callers; the sandbox hands these methods
|
|
62
|
-
* untyped script input, and an unchecked string becomes `IFCBOGUSMEASURE(1.)`
|
|
63
|
-
* or `.BOGUS.` — well-formed STEP naming nothing in the schema.
|
|
64
|
-
*/
|
|
65
|
-
const MEASURE_TYPES = new Set([
|
|
66
|
-
'IfcMonetaryMeasure', 'IfcAreaMeasure', 'IfcVolumeMeasure', 'IfcLengthMeasure',
|
|
67
|
-
'IfcMassMeasure', 'IfcTimeMeasure', 'IfcCountMeasure', 'IfcNumericMeasure',
|
|
68
|
-
'IfcRatioMeasure', 'IfcReal', 'IfcInteger',
|
|
69
|
-
]);
|
|
70
|
-
const QUANTITY_KINDS = new Set([
|
|
71
|
-
'IfcQuantityLength', 'IfcQuantityArea', 'IfcQuantityVolume', 'IfcQuantityWeight',
|
|
72
|
-
'IfcQuantityTime', 'IfcQuantityCount', 'IfcQuantityNumber',
|
|
73
|
-
]);
|
|
74
|
-
const ARITHMETIC_OPERATORS = new Set(['ADD', 'DIVIDE', 'MULTIPLY', 'SUBTRACT']);
|
|
75
|
-
const COST_SCHEDULE_TYPES = new Set([
|
|
76
|
-
'BUDGET', 'COSTPLAN', 'ESTIMATE', 'TENDER', 'PRICEDBILLOFQUANTITIES',
|
|
77
|
-
'UNPRICEDBILLOFQUANTITIES', 'SCHEDULEOFRATES', 'USERDEFINED', 'NOTDEFINED',
|
|
78
|
-
]);
|
|
79
|
-
const COST_ITEM_TYPES = new Set(['USERDEFINED', 'NOTDEFINED']);
|
|
80
|
-
/** Refuse a value outside its closed vocabulary; `undefined` (absent) passes. */
|
|
81
|
-
function assertOneOf(value, allowed, what, context) {
|
|
82
|
-
if (value === undefined)
|
|
83
|
-
return;
|
|
84
|
-
if (typeof value !== 'string' || !allowed.has(value)) {
|
|
85
|
-
throw new Error(`${context}: ${what} '${String(value)}' is not one of ${[...allowed].join(', ')}`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
/** EXPRESS INTEGER-valued measures: IfcInteger always, IfcCountMeasure from IFC4X3 on. */
|
|
89
|
-
function isIntegerMeasure(type, schema) {
|
|
90
|
-
return type === 'IfcInteger' || (type === 'IfcCountMeasure' && schema === 'IFC4X3');
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Refuse IFC2X3 cost authoring by name, loudly.
|
|
94
|
-
*
|
|
95
|
-
* IFC2X3 lays IfcCostSchedule / IfcCostItem / IfcCostValue out differently
|
|
96
|
-
* (IfcCostSchedule carries an `ID` and IfcDateAndTime references where IFC4
|
|
97
|
-
* carries `Identification` and IfcDateTime strings; IfcCostValue has
|
|
98
|
-
* `CostType` where IFC4 has `Category`, and no `Components` at all). Writing
|
|
99
|
-
* the IFC4 layout into an IFC2X3 file would produce records that parse and are
|
|
100
|
-
* wrong. A no-op — or a method that returned an id having written nothing —
|
|
101
|
-
* would look like success at the call site, so this throws instead.
|
|
102
|
-
*/
|
|
103
|
-
export function assertCostSchema(schema, method) {
|
|
104
|
-
if (schema === 'IFC2X3') {
|
|
105
|
-
throw new Error(`${method} is not supported for IFC2X3: the IFC2X3 cost entities have a different `
|
|
106
|
-
+ 'attribute layout. Create the IfcCreator with Schema "IFC4" or "IFC4X3".');
|
|
107
|
-
}
|
|
108
|
-
}
|
|
60
|
+
export { assertCostSchema } from './cost-authoring-rules.js';
|
|
109
61
|
/**
|
|
110
62
|
* Serialize a typed IFC value as a named SELECT branch.
|
|
111
63
|
*
|
|
@@ -114,18 +66,8 @@ export function assertCostSchema(schema, method) {
|
|
|
114
66
|
* and picking one by inspecting the value would silently retype the file.
|
|
115
67
|
*/
|
|
116
68
|
export function typedValue(value, schema, context) {
|
|
117
|
-
|
|
118
|
-
throw new Error(`${context}: a typed value is required`);
|
|
119
|
-
assertOneOf(value.Type, MEASURE_TYPES, 'Type', context);
|
|
120
|
-
if (!Number.isFinite(value.Value)) {
|
|
121
|
-
throw new Error(`${context}: ${value.Type} value must be a finite number`);
|
|
122
|
-
}
|
|
123
|
-
// Rounding would silently change the caller's number: an INTEGER measure
|
|
124
|
-
// given a fraction is a caller error, not something to fix up.
|
|
69
|
+
validateTypedValue(value, schema, context);
|
|
125
70
|
if (isIntegerMeasure(value.Type, schema)) {
|
|
126
|
-
if (!Number.isInteger(value.Value)) {
|
|
127
|
-
throw new Error(`${context}: ${value.Type} value must be an integer in ${schema}, got ${value.Value}`);
|
|
128
|
-
}
|
|
129
71
|
return `${value.Type.toUpperCase()}(${value.Value.toString()})`;
|
|
130
72
|
}
|
|
131
73
|
return `${value.Type.toUpperCase()}(${stepReal(value.Value)})`;
|
|
@@ -266,7 +208,7 @@ export function emitPhysicalQuantity(params, schema, emit) {
|
|
|
266
208
|
* [8] ArithmeticOperator, [9] Components.
|
|
267
209
|
*/
|
|
268
210
|
export function emitCostValue(params, schema, emit) {
|
|
269
|
-
|
|
211
|
+
validateArithmeticOperator(params.ArithmeticOperator, schema, 'addIfcCostValue');
|
|
270
212
|
if (params.AppliedValue !== undefined && params.AppliedValueRef !== undefined) {
|
|
271
213
|
throw new Error('addIfcCostValue: AppliedValue and AppliedValueRef are the two branches of one SELECT — give at most one');
|
|
272
214
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifc-creator-cost.js","sourceRoot":"","sources":["../src/ifc-creator-cost.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ifc-creator-cost.js","sourceRoot":"","sources":["../src/ifc-creator-cost.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EACL,eAAe,EAAE,mBAAmB,EAAE,cAAc,EACpD,WAAW,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,kBAAkB,GAE9E,MAAM,2BAA2B,CAAC;AAenC;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAS;IAChC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;IACvB,MAAM,CAAC,GA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M,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -78,11 +78,21 @@ export declare function emitRelContainedInSpatialStructure(editor: StoreEditor,
|
|
|
78
78
|
* `random` seeds the element's GlobalId (see `SpatialAnchor.guidRandom`).
|
|
79
79
|
*/
|
|
80
80
|
export declare function ifcElementHeader(ownerHistoryId: number | null, placementId: number, productShapeId: number, params: {
|
|
81
|
+
GlobalId?: string;
|
|
81
82
|
Name?: string;
|
|
82
83
|
Description?: string;
|
|
83
84
|
ObjectType?: string;
|
|
84
85
|
Tag?: string;
|
|
85
86
|
}, defaultName: string, random?: RandomSource): Array<unknown>;
|
|
87
|
+
/**
|
|
88
|
+
* The product's GlobalId: the caller's when it supplies one (a re-runnable
|
|
89
|
+
* author such as a flow graph derives it from a stable key so a re-run
|
|
90
|
+
* updates the element instead of duplicating it), else freshly generated.
|
|
91
|
+
* A malformed GlobalId is refused rather than silently replaced.
|
|
92
|
+
*/
|
|
93
|
+
export declare function productGuid(params: {
|
|
94
|
+
GlobalId?: string;
|
|
95
|
+
}, random?: RandomSource): string;
|
|
86
96
|
/** An RGB colour with channels in 0..1. */
|
|
87
97
|
export interface SurfaceStyleColor {
|
|
88
98
|
red: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_emit-helpers.d.ts","sourceRoot":"","sources":["../../src/in-store/_emit-helpers.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"_emit-helpers.d.ts","sourceRoot":"","sources":["../../src/in-store/_emit-helpers.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAmC,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,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,MAAM,CAAC,EAAE,YAAY,GACpB,MAAM,CASR;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EACrG,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,YAAY,GACpB,KAAK,CAAC,OAAO,CAAC,CAWhB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAIxF;AAED,2CAA2C;AAC3C,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EACnB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,iBAAiB,EACxB,IAAI,CAAC,EAAE,MAAM,GACZ;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAiCpE"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* All helpers operate purely through the StoreEditor; no parser
|
|
15
15
|
* access, no I/O.
|
|
16
16
|
*/
|
|
17
|
-
import { generateIfcGuid } from '@ifc-lite/encoding';
|
|
17
|
+
import { generateIfcGuid, isValidIfcGuid } from '@ifc-lite/encoding';
|
|
18
18
|
const POINT_EPSILON = 1e-6;
|
|
19
19
|
/**
|
|
20
20
|
* Guard for element-builder dimension params (Width, Depth, Height,
|
|
@@ -160,7 +160,7 @@ export function emitRelContainedInSpatialStructure(editor, ownerHistoryId, eleme
|
|
|
160
160
|
*/
|
|
161
161
|
export function ifcElementHeader(ownerHistoryId, placementId, productShapeId, params, defaultName, random) {
|
|
162
162
|
return [
|
|
163
|
-
|
|
163
|
+
productGuid(params, random),
|
|
164
164
|
ownerHistoryRef(ownerHistoryId),
|
|
165
165
|
params.Name ?? defaultName,
|
|
166
166
|
params.Description ?? null,
|
|
@@ -170,6 +170,19 @@ export function ifcElementHeader(ownerHistoryId, placementId, productShapeId, pa
|
|
|
170
170
|
params.Tag ?? null,
|
|
171
171
|
];
|
|
172
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* The product's GlobalId: the caller's when it supplies one (a re-runnable
|
|
175
|
+
* author such as a flow graph derives it from a stable key so a re-run
|
|
176
|
+
* updates the element instead of duplicating it), else freshly generated.
|
|
177
|
+
* A malformed GlobalId is refused rather than silently replaced.
|
|
178
|
+
*/
|
|
179
|
+
export function productGuid(params, random) {
|
|
180
|
+
if (params.GlobalId === undefined)
|
|
181
|
+
return generateIfcGuid(random);
|
|
182
|
+
if (!isValidIfcGuid(params.GlobalId))
|
|
183
|
+
throw new Error(`GlobalId "${params.GlobalId}" is not a valid 22-character IFC GUID`);
|
|
184
|
+
return params.GlobalId;
|
|
185
|
+
}
|
|
173
186
|
/** Guards a caller's 0..255 or out-of-range channel from reaching STEP. */
|
|
174
187
|
function clamp01(v) {
|
|
175
188
|
return Number.isFinite(v) ? Math.min(1, Math.max(0, v)) : 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_emit-helpers.js","sourceRoot":"","sources":["../../src/in-store/_emit-helpers.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;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AC;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"}
|
package/dist/in-store/beam.d.ts
CHANGED
|
@@ -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;
|
|
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;IACb,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;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
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { generateIfcGuid } from '@ifc-lite/encoding';
|
|
20
20
|
import { vecCross, vecNorm, assertFinitePoint3 } from '../ifc-creator-math.js';
|
|
21
21
|
import { toNativeLength, toNativePoint3 } from './anchor.js';
|
|
22
|
-
import { assertPositiveFinite, ownerHistoryRef } from './_emit-helpers.js';
|
|
22
|
+
import { assertPositiveFinite, ownerHistoryRef, productGuid } from './_emit-helpers.js';
|
|
23
23
|
/**
|
|
24
24
|
* Stable perpendicular to a beam axis. Mirrors IfcCreator.computeRefDirection.
|
|
25
25
|
*/
|
|
@@ -98,7 +98,7 @@ export function addBeamToStore(editor, anchor, params) {
|
|
|
98
98
|
]).expressId;
|
|
99
99
|
// `IfcBeam.PredefinedType` only exists from IFC4 onward.
|
|
100
100
|
const beamAttrs = [
|
|
101
|
-
|
|
101
|
+
productGuid(params, anchor.guidRandom),
|
|
102
102
|
ownerHistoryRef(ownerHistoryId),
|
|
103
103
|
params.Name ?? 'Beam',
|
|
104
104
|
params.Description ?? null,
|
|
@@ -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,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
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,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AA2BxF;;GAEG;AACH,SAAS,mBAAmB,CAAC,IAAa;IACxC,MAAM,EAAE,GAAY,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACpE,OAAO,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,MAAm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AAC,UAAU,IAAI,IAAI;QACzB,IAAI,WAAW,EAAE;QACjB,IAAI,cAAc,EAAE;QACpB,MAAM,CAAC,GAAG,IAAI,IAAI;KACnB,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC3C,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,SAAoD,CAAC,CAAC,SAAS,CAAC;IAE3G,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,mCAAmC,EAAE;QAC3E,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC;QAClC,eAAe,CAAC,cAAc,CAAC;QAC/B,IAAI;QACJ,IAAI;QACJ,CAAC,IAAI,MAAM,EAAE,CAAC;QACd,IAAI,QAAQ,EAAE;KACf,CAAC,CAAC,SAAS,CAAC;IAEb,OAAO;QACL,MAAM;QACN,WAAW;QACX,SAAS;QACT,OAAO;QACP,UAAU;QACV,cAAc;QACd,cAAc;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -14,6 +14,8 @@ export interface ColumnInStoreParams {
|
|
|
14
14
|
Description?: string;
|
|
15
15
|
ObjectType?: string;
|
|
16
16
|
Tag?: string;
|
|
17
|
+
/** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
|
|
18
|
+
GlobalId?: string;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* Result of `addColumnToStore` — the new column's expressId plus a
|
|
@@ -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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E;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,CAuGnB"}
|
package/dist/in-store/column.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { generateIfcGuid } from '@ifc-lite/encoding';
|
|
18
18
|
import { toNativeLength, toNativePoint3 } from './anchor.js';
|
|
19
|
-
import { assertPositiveFinite, ownerHistoryRef } from './_emit-helpers.js';
|
|
19
|
+
import { assertPositiveFinite, ownerHistoryRef, productGuid } from './_emit-helpers.js';
|
|
20
20
|
/**
|
|
21
21
|
* Add an IfcColumn to a parsed model via the StoreEditor overlay. Returns
|
|
22
22
|
* the freshly-allocated expressIds for every entity that was emitted.
|
|
@@ -83,7 +83,7 @@ export function addColumnToStore(editor, anchor, params) {
|
|
|
83
83
|
// onward — IFC2X3 has no such attribute, so emitting `.COLUMN.` there
|
|
84
84
|
// would produce an invalid 9-arg entity record.
|
|
85
85
|
const columnAttrs = [
|
|
86
|
-
|
|
86
|
+
productGuid(params, anchor.guidRandom),
|
|
87
87
|
ownerHistoryRef(ownerHistoryId),
|
|
88
88
|
params.Name ?? 'Column',
|
|
89
89
|
params.Description ?? null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column.js","sourceRoot":"","sources":["../../src/in-store/column.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"column.js","sourceRoot":"","sources":["../../src/in-store/column.ts"],"names":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