Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ export type GridAxisData = {

export type GridData = {
id: number;
guid: string;
transform: number[];
uAxes: GridAxisData[];
vAxes: GridAxisData[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,23 @@ test(
CONVERSION_TIMEOUT,
);

test(
"each grid carries its own IFC GlobalId as guid",
async () => {
vi.spyOn(console, "warn").mockImplementation(() => {});

// Two grids with distinct GlobalIds, so a guid read from the wrong entity
// (or shared between grids) would not match.
const grids = await convertAndGetGrids("grids-one-placementless.ifc");

expect(grids.map(({ id, guid }) => ({ id, guid }))).toEqual([
{ id: 226, guid: "2jMlNfpwHEGgnr29aaaaa1" },
{ id: 238, guid: "2jMlNfpwHEGgnr29aaaaa2" },
]);
},
CONVERSION_TIMEOUT,
);

// Regression for https://github.com/ThatOpen/engine_fragment/issues/263:
// IFCGRID's ObjectPlacement is optional in the schema, but the importer read
// `ObjectPlacement.value` unguarded and its all-or-nothing catch dropped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class GridReader {

const data: GridData = {
id,
guid: grid.GlobalId.value,
transform: transform.elements,
// prettier-ignore
uAxes: this.getGridAxes(grid, webIfc, units, "UAxes", unsupportedAxes),
Expand Down
Loading