@bldrs-ai/conway 1.444.1334 → 1.445.1339
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/compiled/examples/browser-bundled.cjs +42 -1
- package/compiled/examples/cli-bundled.cjs +116 -15
- package/compiled/examples/cli-step-bundled.cjs +42 -1
- package/compiled/examples/validator-bundled.cjs +42 -1
- package/compiled/src/compat/web-ifc/coordination_f64.d.ts +12 -0
- package/compiled/src/compat/web-ifc/coordination_f64.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/coordination_f64.js +13 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts +13 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api.js +19 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts +9 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.js +124 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts +10 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.js +35 -2
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +20 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +56 -2
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts +5 -4
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_geometry_extraction.js +60 -16
- package/compiled/src/step/parsing/uint32_sink.d.ts +37 -0
- package/compiled/src/step/parsing/uint32_sink.d.ts.map +1 -0
- package/compiled/src/step/parsing/uint32_sink.js +50 -0
- package/compiled/src/step/parsing/uint32_sink.test.d.ts +2 -0
- package/compiled/src/step/parsing/uint32_sink.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/uint32_sink.test.js +77 -0
- package/compiled/src/step/step_entity_base.d.ts +20 -0
- package/compiled/src/step/step_entity_base.d.ts.map +1 -1
- package/compiled/src/step/step_entity_base.js +42 -1
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/* eslint-disable no-magic-numbers */
|
|
2
|
+
// Uint32Sink backs the polygonal-faceset extraction fast path, and
|
|
3
|
+
// extractIntegerArrayInto must stay exactly equivalent to the generated
|
|
4
|
+
// array getters it replaces there — including for a real model's faces.
|
|
5
|
+
import * as fs from "fs";
|
|
6
|
+
import { beforeAll, describe, expect, test } from "@jest/globals";
|
|
7
|
+
import { IfcAPI } from "../../compat/web-ifc/ifc_api.js";
|
|
8
|
+
import { IfcIndexedPolygonalFace, IfcIndexedPolygonalFaceWithVoids, } from "../../ifc/ifc4_gen/index.js";
|
|
9
|
+
import { Uint32Sink } from "./uint32_sink.js";
|
|
10
|
+
describe("Uint32Sink", () => {
|
|
11
|
+
test("appends, grows past its initial capacity, and views exactly its length", () => {
|
|
12
|
+
const sink = new Uint32Sink(2);
|
|
13
|
+
expect(sink.length).toBe(0);
|
|
14
|
+
expect(Array.from(sink.view)).toEqual([]);
|
|
15
|
+
for (let where = 0; where < 10; ++where) {
|
|
16
|
+
sink.push(where * 3);
|
|
17
|
+
}
|
|
18
|
+
expect(sink.length).toBe(10);
|
|
19
|
+
expect(Array.from(sink.view)).toEqual([0, 3, 6, 9, 12, 15, 18, 21, 24, 27]);
|
|
20
|
+
});
|
|
21
|
+
test("reset drops elements but keeps capacity for reuse", () => {
|
|
22
|
+
const sink = new Uint32Sink(4);
|
|
23
|
+
sink.push(11);
|
|
24
|
+
sink.push(22);
|
|
25
|
+
sink.reset();
|
|
26
|
+
expect(sink.length).toBe(0);
|
|
27
|
+
expect(Array.from(sink.view)).toEqual([]);
|
|
28
|
+
sink.push(33);
|
|
29
|
+
expect(Array.from(sink.view)).toEqual([33]);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
describe("extractIntegerArrayInto", () => {
|
|
33
|
+
let api;
|
|
34
|
+
let modelID;
|
|
35
|
+
/**
|
|
36
|
+
* The faces the extraction fast path actually covers: voided faces
|
|
37
|
+
* keep the getter path in production, so exclude them here too.
|
|
38
|
+
*
|
|
39
|
+
* @return {IfcIndexedPolygonalFace[]} Non-voided faces of the fixture.
|
|
40
|
+
*/
|
|
41
|
+
function plainFaces() {
|
|
42
|
+
// The passthrough holds the proxy tuple; the StepModel is its head.
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
+
const model = api.models.get(modelID).model[0];
|
|
45
|
+
return Array.from(model.types(IfcIndexedPolygonalFace))
|
|
46
|
+
.filter((face) => !(face instanceof IfcIndexedPolygonalFaceWithVoids));
|
|
47
|
+
}
|
|
48
|
+
beforeAll(async () => {
|
|
49
|
+
api = new IfcAPI();
|
|
50
|
+
await api.Init();
|
|
51
|
+
modelID = api.OpenModel(new Uint8Array(fs.readFileSync("data/index.ifc")), { COORDINATE_TO_ORIGIN: true, USE_FAST_BOOLS: true });
|
|
52
|
+
}, 120000);
|
|
53
|
+
test("matches the generated CoordIndex getter on every face of a real model", () => {
|
|
54
|
+
const faces = plainFaces();
|
|
55
|
+
expect(faces.length).toBeGreaterThan(0);
|
|
56
|
+
const sink = new Uint32Sink(4);
|
|
57
|
+
for (const face of faces) {
|
|
58
|
+
// The getter caches, so read it first and compare the in-place
|
|
59
|
+
// parse against it — the fast path must be a drop-in.
|
|
60
|
+
const expected = face.CoordIndex;
|
|
61
|
+
sink.reset();
|
|
62
|
+
const count = face.extractIntegerArrayInto(0, 0, 3, sink);
|
|
63
|
+
expect(count).toBe(expected.length);
|
|
64
|
+
expect(Array.from(sink.view)).toEqual(expected);
|
|
65
|
+
}
|
|
66
|
+
}, 120000);
|
|
67
|
+
test("appends consecutively across records into one sink", () => {
|
|
68
|
+
const faces = plainFaces();
|
|
69
|
+
const sink = new Uint32Sink(4);
|
|
70
|
+
const expected = [];
|
|
71
|
+
for (const face of faces) {
|
|
72
|
+
face.extractIntegerArrayInto(0, 0, 3, sink);
|
|
73
|
+
expected.push(...face.CoordIndex);
|
|
74
|
+
}
|
|
75
|
+
expect(Array.from(sink.view)).toEqual(expected);
|
|
76
|
+
}, 120000);
|
|
77
|
+
});
|
|
@@ -3,6 +3,7 @@ import { Entity } from "../core/entity.js";
|
|
|
3
3
|
import { EntityDescription, EntityFieldsDescription } from "../core/entity_description.js";
|
|
4
4
|
import { EntityFieldDescription } from "../core/entity_field_description.js";
|
|
5
5
|
import { WasmModule } from "../core/native_types.js";
|
|
6
|
+
import { Uint32Sink } from "./parsing/uint32_sink.js";
|
|
6
7
|
import { StepEntityConstructorAbstract } from "./step_entity_constructor.js";
|
|
7
8
|
import StepEntityInternalReference from "./step_entity_internal_reference.js";
|
|
8
9
|
import StepModelBase from "./step_model_base.js";
|
|
@@ -307,6 +308,25 @@ export default abstract class StepEntityBase<EntityTypeIDs extends number> imple
|
|
|
307
308
|
* @return {boolean} True if this extracts, false (usually because this is optional)
|
|
308
309
|
*/
|
|
309
310
|
extractParseBuffer(offset: number, baseOffset: number, depth: number, result: ParseBuffer, module: WasmModule, optional: boolean): boolean;
|
|
311
|
+
/**
|
|
312
|
+
* Append an unsigned-integer list field straight from the STEP buffer
|
|
313
|
+
* into `sink`, without materialising an intermediate `Array< number >`.
|
|
314
|
+
*
|
|
315
|
+
* Semantically identical to the generated array getters (same
|
|
316
|
+
* optional handling, same element extraction, same "incorrectly
|
|
317
|
+
* typed" error), but it neither allocates nor caches a per-record
|
|
318
|
+
* array — the caller owns one reusable sink for the whole batch. On
|
|
319
|
+
* tessellated models this removes millions of short-lived arrays and
|
|
320
|
+
* the retained heap that goes with them; see Uint32Sink.
|
|
321
|
+
*
|
|
322
|
+
* @param offset The offset in the vtable to extract from.
|
|
323
|
+
* @param baseOffset The base offset of the class in the vtable.
|
|
324
|
+
* @param depth The depth in the inheritance hierarchy.
|
|
325
|
+
* @param sink Receives the appended values.
|
|
326
|
+
* @return {number} How many values were appended (0 when the field is
|
|
327
|
+
* unset/optional-null).
|
|
328
|
+
*/
|
|
329
|
+
extractIntegerArrayInto(offset: number, baseOffset: number, depth: number, sink: Uint32Sink): number;
|
|
310
330
|
/**
|
|
311
331
|
* Extract a number at the particular vtable offset (i.e. the position
|
|
312
332
|
* in the matching step object).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step_entity_base.d.ts","sourceRoot":"","sources":["../../../src/step/step_entity_base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uDAAuD,CAAA;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"step_entity_base.d.ts","sourceRoot":"","sources":["../../../src/step/step_entity_base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uDAAuD,CAAA;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAejD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,OA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;OAKG;IACH,SAAS,CAAC,eAAe,CAAE,KAAK,EAAE,MAAM,GACtC,QAAQ,CAAE,2BAA2B,CAAC,aAAa,CAAC,CAAE;IAwCxD;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,IAAI;CAKlC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { stepExtractArray, stepExtractBinary, stepExtractBoolean, stepExtractInlineElemement, stepExtractLogical, stepExtractNumber, stepExtractOptional, stepExtractReference, stepExtractString, } from "./parsing/step_deserialization_functions.js";
|
|
1
|
+
import { skipValue, stepExtractArray, stepExtractArrayBegin, stepExtractArrayToken, stepExtractBinary, stepExtractBoolean, stepExtractInlineElemement, stepExtractLogical, stepExtractNumber, stepExtractOptional, stepExtractReference, stepExtractString, } from "./parsing/step_deserialization_functions.js";
|
|
2
2
|
import { stepBufferBase } from "./step_buffer_provider.js";
|
|
3
3
|
var IfcTokenType;
|
|
4
4
|
(function (IfcTokenType) {
|
|
@@ -449,6 +449,47 @@ export default class StepEntityBase {
|
|
|
449
449
|
module.HEAPU8.set(buffer.subarray(cursor, endCursor), dataPtr);
|
|
450
450
|
return true;
|
|
451
451
|
}
|
|
452
|
+
/**
|
|
453
|
+
* Append an unsigned-integer list field straight from the STEP buffer
|
|
454
|
+
* into `sink`, without materialising an intermediate `Array< number >`.
|
|
455
|
+
*
|
|
456
|
+
* Semantically identical to the generated array getters (same
|
|
457
|
+
* optional handling, same element extraction, same "incorrectly
|
|
458
|
+
* typed" error), but it neither allocates nor caches a per-record
|
|
459
|
+
* array — the caller owns one reusable sink for the whole batch. On
|
|
460
|
+
* tessellated models this removes millions of short-lived arrays and
|
|
461
|
+
* the retained heap that goes with them; see Uint32Sink.
|
|
462
|
+
*
|
|
463
|
+
* @param offset The offset in the vtable to extract from.
|
|
464
|
+
* @param baseOffset The base offset of the class in the vtable.
|
|
465
|
+
* @param depth The depth in the inheritance hierarchy.
|
|
466
|
+
* @param sink Receives the appended values.
|
|
467
|
+
* @return {number} How many values were appended (0 when the field is
|
|
468
|
+
* unset/optional-null).
|
|
469
|
+
*/
|
|
470
|
+
extractIntegerArrayInto(offset, baseOffset, depth, sink) {
|
|
471
|
+
let cursor = this.getOffsetCursor(offset, baseOffset, depth);
|
|
472
|
+
const buffer = this.buffer;
|
|
473
|
+
const endCursor = buffer.length;
|
|
474
|
+
if (stepExtractOptional(buffer, cursor, endCursor) === null) {
|
|
475
|
+
return 0;
|
|
476
|
+
}
|
|
477
|
+
let count = 0;
|
|
478
|
+
let signedCursor0 = stepExtractArrayBegin(buffer, cursor, endCursor);
|
|
479
|
+
cursor = Math.abs(signedCursor0);
|
|
480
|
+
while (signedCursor0 >= 0) {
|
|
481
|
+
const value = stepExtractNumber(buffer, cursor, endCursor);
|
|
482
|
+
if (value === void 0) {
|
|
483
|
+
throw new Error("Value in STEP was incorrectly typed");
|
|
484
|
+
}
|
|
485
|
+
cursor = skipValue(buffer, cursor, endCursor);
|
|
486
|
+
sink.push(value);
|
|
487
|
+
++count;
|
|
488
|
+
signedCursor0 = stepExtractArrayToken(buffer, cursor, endCursor);
|
|
489
|
+
cursor = Math.abs(signedCursor0);
|
|
490
|
+
}
|
|
491
|
+
return count;
|
|
492
|
+
}
|
|
452
493
|
/**
|
|
453
494
|
* Extract a number at the particular vtable offset (i.e. the position
|
|
454
495
|
* in the matching step object).
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
// only the first segment (major) is meaningful and is the one CI carries forward.
|
|
6
6
|
// Must stay in `vN.N.N` shape: the CI stamp regex, scripts/updateVersion.mjs, and
|
|
7
7
|
// statistics.ts all match `v\d+\.\d+\.\d+`.
|
|
8
|
-
const versionString = 'Conway v1.
|
|
8
|
+
const versionString = 'Conway v1.445.1339';
|
|
9
9
|
export { versionString };
|