@bldrs-ai/conway 1.334.1066 → 1.336.1071
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 +1 -1
- package/compiled/examples/cli-bundled.cjs +1 -1
- package/compiled/examples/cli-step-bundled.cjs +1 -1
- package/compiled/examples/validator-bundled.cjs +1 -1
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.test.js +101 -0
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -69608,7 +69608,7 @@ var IfcStepParser = class extends StepParser {
|
|
|
69608
69608
|
IfcStepParser.Instance = new IfcStepParser();
|
|
69609
69609
|
|
|
69610
69610
|
// compiled/src/version/version.js
|
|
69611
|
-
var versionString = "Conway Web-Ifc Shim v1.
|
|
69611
|
+
var versionString = "Conway Web-Ifc Shim v1.336.1071";
|
|
69612
69612
|
|
|
69613
69613
|
// compiled/src/statistics/statistics.js
|
|
69614
69614
|
var Statistics = class {
|
|
@@ -85869,7 +85869,7 @@ var IfcSceneBuilder = class {
|
|
|
85869
85869
|
};
|
|
85870
85870
|
|
|
85871
85871
|
// compiled/src/version/version.js
|
|
85872
|
-
var versionString = "Conway Web-Ifc Shim v1.
|
|
85872
|
+
var versionString = "Conway Web-Ifc Shim v1.336.1071";
|
|
85873
85873
|
|
|
85874
85874
|
// compiled/src/statistics/statistics.js
|
|
85875
85875
|
var Statistics = class {
|
|
@@ -79320,7 +79320,7 @@ var ExtractResult;
|
|
|
79320
79320
|
})(ExtractResult || (ExtractResult = {}));
|
|
79321
79321
|
|
|
79322
79322
|
// compiled/src/version/version.js
|
|
79323
|
-
var versionString = "Conway Web-Ifc Shim v1.
|
|
79323
|
+
var versionString = "Conway Web-Ifc Shim v1.336.1071";
|
|
79324
79324
|
|
|
79325
79325
|
// compiled/src/statistics/statistics.js
|
|
79326
79326
|
var Statistics = class {
|
|
@@ -69606,7 +69606,7 @@ var IfcStepParser = class extends StepParser {
|
|
|
69606
69606
|
IfcStepParser.Instance = new IfcStepParser();
|
|
69607
69607
|
|
|
69608
69608
|
// compiled/src/version/version.js
|
|
69609
|
-
var versionString = "Conway Web-Ifc Shim v1.
|
|
69609
|
+
var versionString = "Conway Web-Ifc Shim v1.336.1071";
|
|
69610
69610
|
|
|
69611
69611
|
// compiled/src/statistics/statistics.js
|
|
69612
69612
|
var Statistics = class {
|
|
@@ -191,6 +191,107 @@ describe("AP214 Geometry Extraction", () => {
|
|
|
191
191
|
expect(v[i]).toBeCloseTo(original[i]);
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
|
+
test("uniformScaleBasis scales the 3x3 basis but PRESERVES translation", () => {
|
|
195
|
+
// Direct unit test for the rigid-transform scale helper used by the
|
|
196
|
+
// unit-conversion path in doTransforms (see
|
|
197
|
+
// https://github.com/bldrs-ai/conway/issues/308 and PR #309/#334).
|
|
198
|
+
// An assembly relationship placement is rigid: when the two related
|
|
199
|
+
// shapes are in different length units, only the 3x3 basis is rescaled;
|
|
200
|
+
// the translation column is a physical offset that must NOT move, or the
|
|
201
|
+
// sub-components collapse toward the origin (the "port cluster"). Models a
|
|
202
|
+
// placement in mm with a 1000 mm x / 50 mm y translation, converted to
|
|
203
|
+
// metres (factor = 1/MM_PER_M).
|
|
204
|
+
const MM_PER_M = 1000;
|
|
205
|
+
const TX_MM = 1000;
|
|
206
|
+
const TY_MM = 50;
|
|
207
|
+
const factor = 1 / MM_PER_M;
|
|
208
|
+
const model = conwayTubeModel;
|
|
209
|
+
const input = new model.wasmModule.Glmdmat4();
|
|
210
|
+
// Column-major: cols 0..2 = basis (identity), col 3 = translation.
|
|
211
|
+
input.setValues([
|
|
212
|
+
1,
|
|
213
|
+
0,
|
|
214
|
+
0,
|
|
215
|
+
0,
|
|
216
|
+
0,
|
|
217
|
+
1,
|
|
218
|
+
0,
|
|
219
|
+
0,
|
|
220
|
+
0,
|
|
221
|
+
0,
|
|
222
|
+
1,
|
|
223
|
+
0,
|
|
224
|
+
TX_MM,
|
|
225
|
+
TY_MM,
|
|
226
|
+
0,
|
|
227
|
+
1,
|
|
228
|
+
]);
|
|
229
|
+
const v = model.uniformScaleBasis(input, factor).getValues();
|
|
230
|
+
// Basis diagonal scaled by factor.
|
|
231
|
+
expect(v[0]).toBeCloseTo(factor);
|
|
232
|
+
expect(v[5]).toBeCloseTo(factor);
|
|
233
|
+
expect(v[10]).toBeCloseTo(factor);
|
|
234
|
+
// Translation PRESERVED — this is the #308 invariant that distinguishes
|
|
235
|
+
// uniformScaleBasis from uniformScaleAffine (which scales translation too).
|
|
236
|
+
// Scaling these to TX_MM*factor / TY_MM*factor is exactly the regression
|
|
237
|
+
// that re-clustered the Arty board's parts.
|
|
238
|
+
expect(v[12]).toBeCloseTo(TX_MM);
|
|
239
|
+
expect(v[13]).toBeCloseTo(TY_MM);
|
|
240
|
+
expect(v[14]).toBeCloseTo(0);
|
|
241
|
+
// Bottom row left at [0, 0, 0, 1].
|
|
242
|
+
expect(v[3]).toBe(0);
|
|
243
|
+
expect(v[7]).toBe(0);
|
|
244
|
+
expect(v[11]).toBe(0);
|
|
245
|
+
expect(v[15]).toBe(1);
|
|
246
|
+
});
|
|
247
|
+
test("uniformScaleBasis and uniformScaleAffine differ only on the translation column", () => {
|
|
248
|
+
// Pins the #308 contract: for the SAME placement input the two helpers
|
|
249
|
+
// agree on the 3x3 basis and disagree on translation — basis preserves it,
|
|
250
|
+
// affine scales it. A future refactor that collapsed the two helpers would
|
|
251
|
+
// trip this and re-introduce the cluster regression.
|
|
252
|
+
const factor = 0.5;
|
|
253
|
+
const TX = 7;
|
|
254
|
+
const TY = -3;
|
|
255
|
+
const TZ = 11;
|
|
256
|
+
const model = conwayTubeModel;
|
|
257
|
+
const values = [
|
|
258
|
+
2,
|
|
259
|
+
0,
|
|
260
|
+
0,
|
|
261
|
+
0,
|
|
262
|
+
0,
|
|
263
|
+
2,
|
|
264
|
+
0,
|
|
265
|
+
0,
|
|
266
|
+
0,
|
|
267
|
+
0,
|
|
268
|
+
2,
|
|
269
|
+
0,
|
|
270
|
+
TX,
|
|
271
|
+
TY,
|
|
272
|
+
TZ,
|
|
273
|
+
1,
|
|
274
|
+
];
|
|
275
|
+
const basisInput = new model.wasmModule.Glmdmat4();
|
|
276
|
+
basisInput.setValues(values);
|
|
277
|
+
const affineInput = new model.wasmModule.Glmdmat4();
|
|
278
|
+
affineInput.setValues(values);
|
|
279
|
+
const basis = model.uniformScaleBasis(basisInput, factor).getValues();
|
|
280
|
+
const affine = model.uniformScaleAffine(affineInput, factor).getValues();
|
|
281
|
+
// Basis diagonal (column-major 0,5,10) identical between the two helpers —
|
|
282
|
+
// both scale the 3x3 basis the same way. (Indexed access keeps these out
|
|
283
|
+
// of no-magic-numbers via ignoreArrayIndexes.)
|
|
284
|
+
expect(basis[0]).toBeCloseTo(affine[0]);
|
|
285
|
+
expect(basis[5]).toBeCloseTo(affine[5]);
|
|
286
|
+
expect(basis[10]).toBeCloseTo(affine[10]);
|
|
287
|
+
// Translation column (12,13,14): basis keeps it, affine scales it.
|
|
288
|
+
expect(basis[12]).toBeCloseTo(TX);
|
|
289
|
+
expect(basis[13]).toBeCloseTo(TY);
|
|
290
|
+
expect(basis[14]).toBeCloseTo(TZ);
|
|
291
|
+
expect(affine[12]).toBeCloseTo(TX * factor);
|
|
292
|
+
expect(affine[13]).toBeCloseTo(TY * factor);
|
|
293
|
+
expect(affine[14]).toBeCloseTo(TZ * factor);
|
|
294
|
+
});
|
|
194
295
|
test("destroy()", () => {
|
|
195
296
|
expect(destroy()).toBe(false);
|
|
196
297
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const versionString = 'Conway Web-Ifc Shim v1.
|
|
1
|
+
const versionString = 'Conway Web-Ifc Shim v1.336.1071';
|
|
2
2
|
export { versionString };
|