@bldrs-ai/conway 0.15.836 → 0.15.839
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/dependencies/conway-geom/Dist/ConwayGeomWasmNode.js +1 -1
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNodeMT.js +1 -1
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWeb.js +1 -1
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.js +1 -1
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.wasm +0 -0
- package/compiled/dependencies/conway-geom/index.d.ts +0 -2
- package/compiled/dependencies/conway-geom/index.d.ts.map +1 -1
- package/compiled/dependencies/conway-geom/index.js +0 -2
- package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts +0 -6
- package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts.map +1 -1
- package/compiled/dependencies/conway-geom/interface/conway_geometry.js +0 -7
- package/compiled/examples/browser-bundled.js +69044 -0
- package/compiled/examples/browser.d.ts +3 -0
- package/compiled/examples/browser.d.ts.map +1 -0
- package/compiled/examples/browser.js +393 -0
- package/compiled/examples/validator-bundled.js +69057 -0
- package/compiled/examples/validator.d.ts +3 -0
- package/compiled/examples/validator.d.ts.map +1 -0
- package/compiled/examples/validator.js +378 -0
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts +1 -22
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_geometry_extraction.js +38 -109
- package/compiled/src/ifc/ifc_step_model.d.ts +1 -0
- package/compiled/src/ifc/ifc_step_model.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_step_model.js +1 -0
- package/compiled/src/ifc/ifc_step_parser.d.ts +1 -0
- package/compiled/src/ifc/ifc_step_parser.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_step_parser.js +1 -0
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +49 -42
- package/compiled/dependencies/conway-geom/interface/parameters/flattened_points.d.ts +0 -6
- package/compiled/dependencies/conway-geom/interface/parameters/flattened_points.d.ts.map +0 -1
- package/compiled/dependencies/conway-geom/interface/parameters/flattened_points.js +0 -1
- package/compiled/dependencies/conway-geom/interface/parameters/params_add_face_to_geometry_simple.d.ts +0 -10
- package/compiled/dependencies/conway-geom/interface/parameters/params_add_face_to_geometry_simple.d.ts.map +0 -1
- package/compiled/dependencies/conway-geom/interface/parameters/params_add_face_to_geometry_simple.js +0 -1
|
@@ -121,7 +121,6 @@ export class IfcGeometryExtraction {
|
|
|
121
121
|
this.TWO_DIMENSIONS = 2;
|
|
122
122
|
this.THREE_DIMENSIONS = 3;
|
|
123
123
|
this.circleSegments = 12;
|
|
124
|
-
this.pointBuffer = null;
|
|
125
124
|
this.csgMemoization = true;
|
|
126
125
|
this.freeVectorPolygonalFaces_ = [];
|
|
127
126
|
this.csgMemoization = !this.lowMemoryMode;
|
|
@@ -2418,91 +2417,6 @@ export class IfcGeometryExtraction {
|
|
|
2418
2417
|
});
|
|
2419
2418
|
return flatCoordinates;
|
|
2420
2419
|
}
|
|
2421
|
-
/**
|
|
2422
|
-
* Efficiently flatten the points into a Float64Array while skipping
|
|
2423
|
-
* consecutive points with the same localID.
|
|
2424
|
-
*
|
|
2425
|
-
* @param points - Array of IfcCartesianPoint
|
|
2426
|
-
* @param dimensions - Number of coordinates per point (e.g. 3 for x,y,z)
|
|
2427
|
-
* @return {Float64Array}
|
|
2428
|
-
*/
|
|
2429
|
-
flattenCartesianPointsToFloat64ArrayFiltered(points, dimensions) {
|
|
2430
|
-
// 1) First pass: figure out how many points *actually* get included
|
|
2431
|
-
// (skipping consecutive duplicates by localID)
|
|
2432
|
-
let uniqueCount = 0;
|
|
2433
|
-
for (let i = 0; i < points.length; i++) {
|
|
2434
|
-
if (i === 0 || points[i].localID !== points[i - 1].localID) {
|
|
2435
|
-
uniqueCount++;
|
|
2436
|
-
}
|
|
2437
|
-
}
|
|
2438
|
-
// 2) Knowing how many we'll include, allocate the final TypedArray
|
|
2439
|
-
const totalCoordinates = uniqueCount * dimensions;
|
|
2440
|
-
const flatCoordinates = new Float64Array(totalCoordinates);
|
|
2441
|
-
// 3) Second pass: populate flatCoordinates
|
|
2442
|
-
let offset = 0;
|
|
2443
|
-
let prevLocalID = -1;
|
|
2444
|
-
for (let i = 0; i < points.length; i++) {
|
|
2445
|
-
const point = points[i];
|
|
2446
|
-
if (i === 0 || point.localID !== prevLocalID) {
|
|
2447
|
-
// Copy only if localID changed
|
|
2448
|
-
flatCoordinates.set(point.Coordinates, offset);
|
|
2449
|
-
offset += point.Coordinates.length; // or offset += dimensions if all are guaranteed
|
|
2450
|
-
prevLocalID = point.localID;
|
|
2451
|
-
}
|
|
2452
|
-
}
|
|
2453
|
-
return flatCoordinates;
|
|
2454
|
-
}
|
|
2455
|
-
/**
|
|
2456
|
-
* Flatten the points into WASM memory (skipping consecutive duplicates).
|
|
2457
|
-
* Reuses an existing WASM buffer if provided and large enough.
|
|
2458
|
-
*
|
|
2459
|
-
* @param points - Array of IfcCartesianPoint
|
|
2460
|
-
* @param dimensions - Number of coordinates per point (e.g. 3 for x,y,z)
|
|
2461
|
-
* @param existingPtr - (Optional) Pointer to an existing WASM buffer
|
|
2462
|
-
* @param existingCapacity - (Optional) Capacity of that buffer in Float64 elements
|
|
2463
|
-
* @return {FlattenedPointsResult} pointer, length used, total capacity
|
|
2464
|
-
*/
|
|
2465
|
-
flattenCartesianPointsToWasmFiltered(points, dimensions, existingPtr, existingCapacity) {
|
|
2466
|
-
// The maximum we might need if we do NOT skip duplicates
|
|
2467
|
-
const maxPossibleFloats = points.length * dimensions;
|
|
2468
|
-
const bytesPerElement = 8; // Float64
|
|
2469
|
-
// 1) Allocate or reuse memory in WASM
|
|
2470
|
-
let pointer = existingPtr ?? 0;
|
|
2471
|
-
let capacity = existingCapacity ?? 0;
|
|
2472
|
-
// If we have no existing buffer OR it's too small, allocate a new one
|
|
2473
|
-
if (!pointer || capacity < maxPossibleFloats) {
|
|
2474
|
-
// Free the old buffer if it exists and is too small
|
|
2475
|
-
if (pointer) {
|
|
2476
|
-
this.wasmModule._free(pointer);
|
|
2477
|
-
}
|
|
2478
|
-
const numBytes = maxPossibleFloats * bytesPerElement;
|
|
2479
|
-
pointer = this.wasmModule._malloc(numBytes);
|
|
2480
|
-
capacity = maxPossibleFloats;
|
|
2481
|
-
}
|
|
2482
|
-
// 2) Create a Float64Array view into WASM memory
|
|
2483
|
-
// We only need to create a subarray up to the capacity
|
|
2484
|
-
const wasmFloat64View = this.wasmModule.HEAPF64.subarray(pointer / bytesPerElement,
|
|
2485
|
-
// eslint-disable-next-line no-mixed-operators
|
|
2486
|
-
pointer / bytesPerElement + capacity);
|
|
2487
|
-
// 3) Single pass to skip consecutive duplicates, fill up the wasm array
|
|
2488
|
-
let offset = 0;
|
|
2489
|
-
let prevLocalID = -1;
|
|
2490
|
-
for (let i = 0; i < points.length; i++) {
|
|
2491
|
-
const point = points[i];
|
|
2492
|
-
if (i === 0 || point.localID !== prevLocalID) {
|
|
2493
|
-
// Copy 'dimensions' values for the current point
|
|
2494
|
-
wasmFloat64View.set(point.Coordinates, offset);
|
|
2495
|
-
offset += dimensions;
|
|
2496
|
-
prevLocalID = point.localID;
|
|
2497
|
-
}
|
|
2498
|
-
}
|
|
2499
|
-
// 4) Return the pointer, the actual usage, and the capacity
|
|
2500
|
-
return {
|
|
2501
|
-
pointer,
|
|
2502
|
-
length: offset,
|
|
2503
|
-
capacity,
|
|
2504
|
-
};
|
|
2505
|
-
}
|
|
2506
2420
|
/**
|
|
2507
2421
|
*
|
|
2508
2422
|
* @param from
|
|
@@ -3170,7 +3084,7 @@ export class IfcGeometryExtraction {
|
|
|
3170
3084
|
coordParseBuffer.resize(0);
|
|
3171
3085
|
}
|
|
3172
3086
|
vec3Array = this.wasmModule.parseVertexVector(coordParseBuffer);
|
|
3173
|
-
|
|
3087
|
+
this.wasmModule.freeParseBuffer(coordParseBuffer);
|
|
3174
3088
|
}
|
|
3175
3089
|
else if (innerBound instanceof IfcEdgeLoop) {
|
|
3176
3090
|
vec3Array = this.nativeVectorGlmdVec3();
|
|
@@ -3452,33 +3366,53 @@ export class IfcGeometryExtraction {
|
|
|
3452
3366
|
extractFace(from, geometry) {
|
|
3453
3367
|
if (from.Bounds.length > 0) {
|
|
3454
3368
|
const bound3DVector = this.nativeBound3DVector();
|
|
3455
|
-
// let pointsPtrs:any[]
|
|
3456
3369
|
for (let boundIndex = 0; boundIndex < from.Bounds.length; ++boundIndex) {
|
|
3370
|
+
const vec3Array = this.nativeVectorGlmdVec3();
|
|
3457
3371
|
const bound = from.Bounds[boundIndex];
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
this.pointBuffer = result;
|
|
3372
|
+
if (bound.Bound instanceof IfcPolyLoop) {
|
|
3373
|
+
let prevLocalID = -1;
|
|
3374
|
+
for (let pointIndex = 0; pointIndex < bound.Bound.Polygon.length; ++pointIndex) {
|
|
3375
|
+
const vec3 = {
|
|
3376
|
+
x: bound.Bound.Polygon[pointIndex].Coordinates[0],
|
|
3377
|
+
y: bound.Bound.Polygon[pointIndex].Coordinates[1],
|
|
3378
|
+
z: bound.Bound.Polygon[pointIndex].Coordinates[2],
|
|
3379
|
+
};
|
|
3380
|
+
const currentLocalID = bound.Bound.Polygon[pointIndex].localID;
|
|
3381
|
+
if (currentLocalID !== prevLocalID) {
|
|
3382
|
+
vec3Array.push_back(vec3);
|
|
3383
|
+
prevLocalID = currentLocalID;
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3473
3386
|
}
|
|
3387
|
+
const edgesDummy = this.nativeVectorCurve();
|
|
3388
|
+
// get curve
|
|
3389
|
+
const parameters = {
|
|
3390
|
+
points: vec3Array,
|
|
3391
|
+
edges: edgesDummy,
|
|
3392
|
+
};
|
|
3393
|
+
const curve = this.conwayModel.getLoop(parameters);
|
|
3394
|
+
// create bound vector
|
|
3395
|
+
const parametersCreateBounds3D = {
|
|
3396
|
+
curve: curve,
|
|
3397
|
+
orientation: bound.Orientation,
|
|
3398
|
+
type: (bound.type === EntityTypesIfc.IFCFACEOUTERBOUND) ? 0 : 1,
|
|
3399
|
+
};
|
|
3400
|
+
const bound3D = this.conwayModel.createBound3D(parametersCreateBounds3D);
|
|
3401
|
+
bound3DVector.push_back(bound3D);
|
|
3402
|
+
vec3Array.delete();
|
|
3403
|
+
edgesDummy.delete();
|
|
3474
3404
|
}
|
|
3475
3405
|
// add face to geometry
|
|
3406
|
+
const defaultSurface = (new (this.wasmModule.IfcSurface));
|
|
3476
3407
|
const parameters = {
|
|
3477
3408
|
boundsArray: bound3DVector,
|
|
3409
|
+
advancedBrep: false,
|
|
3410
|
+
surface: defaultSurface,
|
|
3478
3411
|
scaling: this.getLinearScalingFactor(),
|
|
3479
3412
|
};
|
|
3480
|
-
this.conwayModel.
|
|
3413
|
+
this.conwayModel.addFaceToGeometry(parameters, geometry);
|
|
3481
3414
|
bound3DVector.delete();
|
|
3415
|
+
defaultSurface.delete();
|
|
3482
3416
|
}
|
|
3483
3417
|
}
|
|
3484
3418
|
/**
|
|
@@ -4432,11 +4366,6 @@ export class IfcGeometryExtraction {
|
|
|
4432
4366
|
this.model.geometry.deleteTemporaries();
|
|
4433
4367
|
this.model.voidGeometry.deleteTemporaries();
|
|
4434
4368
|
}
|
|
4435
|
-
// free buffer at the end if you don't need it anymore
|
|
4436
|
-
if (this.pointBuffer?.pointer) {
|
|
4437
|
-
this.wasmModule._free(this.pointBuffer.pointer);
|
|
4438
|
-
this.pointBuffer = null;
|
|
4439
|
-
}
|
|
4440
4369
|
result = ExtractResult.COMPLETE;
|
|
4441
4370
|
return [result, this.scene];
|
|
4442
4371
|
}
|
|
@@ -25,6 +25,7 @@ export default class IfcStepModel extends StepModelBase<EntityTypesIfc> {
|
|
|
25
25
|
* Construct this model given a buffer containing the data and the parsed data index on that,
|
|
26
26
|
* adding the typeIndex on top of that.
|
|
27
27
|
*
|
|
28
|
+
* @param wasmModule
|
|
28
29
|
* @param buffer The buffer to values from.
|
|
29
30
|
* @param elementIndex The parsed index to elements in the STEP.
|
|
30
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifc_step_model.d.ts","sourceRoot":"","sources":["../../../src/ifc/ifc_step_model.ts"],"names":[],"mappings":"AAAA,OAAO,cAAqC,MAAM,iCAAiC,CAAA;AACnF,OAAO,aAAa,MAAM,yBAAyB,CAAA;AAEnD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAA;AAE1D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,sBAAsB,MAAM,6BAA6B,CAAA;AAChE,OAAO,cAAc,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAKvD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,aAAa,CAAE,cAAc,CAAE;IAEvE,SAAgB,SAAS,EAAE,aAAa,CAAE,cAAc,CAAE,CAAA;IAC1D,SAAgB,mBAAmB,gCAAyB;IAC5D,SAAgB,QAAQ,mBAA+B;IACvD,SAAgB,YAAY,mBAAqC;IACjE,SAAgB,QAAQ,kBAA4B;IACpD,SAAgB,MAAM,iBAA2B;IACjD,SAAgB,aAAa,iBAAuB;IACpD,SAAgB,SAAS,mBAA+B;IACxD,SAAgB,aAAa,mBAAqC;IAElE
|
|
1
|
+
{"version":3,"file":"ifc_step_model.d.ts","sourceRoot":"","sources":["../../../src/ifc/ifc_step_model.ts"],"names":[],"mappings":"AAAA,OAAO,cAAqC,MAAM,iCAAiC,CAAA;AACnF,OAAO,aAAa,MAAM,yBAAyB,CAAA;AAEnD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAA;AAE1D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,sBAAsB,MAAM,6BAA6B,CAAA;AAChE,OAAO,cAAc,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAKvD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,aAAa,CAAE,cAAc,CAAE;IAEvE,SAAgB,SAAS,EAAE,aAAa,CAAE,cAAc,CAAE,CAAA;IAC1D,SAAgB,mBAAmB,gCAAyB;IAC5D,SAAgB,QAAQ,mBAA+B;IACvD,SAAgB,YAAY,mBAAqC;IACjE,SAAgB,QAAQ,kBAA4B;IACpD,SAAgB,MAAM,iBAA2B;IACjD,SAAgB,aAAa,iBAAuB;IACpD,SAAgB,SAAS,mBAA+B;IACxD,SAAgB,aAAa,mBAAqC;IAElE;;;;;;;OAOG;gBAEC,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,cAAc,CAAE,cAAc,CAAE,EAAE;CAKrD"}
|
|
@@ -17,6 +17,7 @@ export default class IfcStepModel extends StepModelBase {
|
|
|
17
17
|
* Construct this model given a buffer containing the data and the parsed data index on that,
|
|
18
18
|
* adding the typeIndex on top of that.
|
|
19
19
|
*
|
|
20
|
+
* @param wasmModule
|
|
20
21
|
* @param buffer The buffer to values from.
|
|
21
22
|
* @param elementIndex The parsed index to elements in the STEP.
|
|
22
23
|
*/
|
|
@@ -20,6 +20,7 @@ export default class IfcStepParser extends StepParser<EntityTypesIfc> {
|
|
|
20
20
|
/**
|
|
21
21
|
* Parse data to the model
|
|
22
22
|
*
|
|
23
|
+
* @param wasmModule A conway-geom wasm module environnment for this.
|
|
23
24
|
* @param input The parsing buffer, set to user data, to read.
|
|
24
25
|
* @return {[ParseResult, IfcStepModel | undefined]} The parse result as well as the model,
|
|
25
26
|
* if it can be extracted.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifc_step_parser.d.ts","sourceRoot":"","sources":["../../../src/ifc/ifc_step_parser.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,2BAA2B,CAAA;AACrD,OAAO,UAAU,EAAE,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAA;AACnE,OAAO,cAAc,MAAM,iCAAiC,CAAA;AAE5D,OAAO,YAAY,MAAM,kBAAkB,CAAA;AAE3C;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAE,cAAc,CAAE;IACrE;;OAEG;;IAKH;;;;;OAKG;IACH,gBAAuB,QAAQ,gBAAsB;IAErD
|
|
1
|
+
{"version":3,"file":"ifc_step_parser.d.ts","sourceRoot":"","sources":["../../../src/ifc/ifc_step_parser.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,2BAA2B,CAAA;AACrD,OAAO,UAAU,EAAE,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAA;AACnE,OAAO,cAAc,MAAM,iCAAiC,CAAA;AAE5D,OAAO,YAAY,MAAM,kBAAkB,CAAA;AAE3C;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAE,cAAc,CAAE;IACrE;;OAEG;;IAKH;;;;;OAKG;IACH,gBAAuB,QAAQ,gBAAsB;IAErD;;;;;;;OAOG;IACI,gBAAgB,CACnB,KAAK,EAAE,aAAa,GAAI,CAAC,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC;CAKpE"}
|
|
@@ -14,6 +14,7 @@ export default class IfcStepParser extends StepParser {
|
|
|
14
14
|
/**
|
|
15
15
|
* Parse data to the model
|
|
16
16
|
*
|
|
17
|
+
* @param wasmModule A conway-geom wasm module environnment for this.
|
|
17
18
|
* @param input The parsing buffer, set to user data, to read.
|
|
18
19
|
* @return {[ParseResult, IfcStepModel | undefined]} The parse result as well as the model,
|
|
19
20
|
* if it can be extracted.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const versionString = 'Conway Web-Ifc Shim v0.
|
|
1
|
+
const versionString = 'Conway Web-Ifc Shim v0.13.835';
|
|
2
2
|
export { versionString };
|