Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Aug 3, 2023
2 parents da0e10d + ea5ec6b commit bb99878
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/BIMOffline_XKT_ArchiCADSamples_DemoProjekt.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ <h3>Resources</h3>

const sceneModel = xktLoader.load({
id: "myModel",
src: "../assets/models/xkt/v10/glb/Archicad-Demoprojekt.glb.xkt",
src: "../assets/models/xkt/v10/glb/archicad-demoprojekt.xkt",
excludeTypes: ["IfcSpace"],
edges: true
});
Expand Down
2 changes: 2 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@
["BIMOffline_XKT_WaterLock", "Viewing a BIM model of a water lock"],
["BIMOffline_XKT_Federated_Clinic", "Viewing a federated BIM model"],

["BIMOffline_XKT_ArchiCADSamples_DemoProjekt", "Viewing a BIM model exported from ArchiCAD"],

// "# IFC models converted using IFC2glTFConverter from Creoox",
//
// ["BIMOffline_XKT_IFC2glTFConverter_HolterTower", "Viewing an IFC4 BIM model"],
Expand Down
24 changes: 24 additions & 0 deletions src/plugins/XKTLoaderPlugin/parsers/ParserV10.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,12 @@ function load(viewer, options, inflatedData, sceneModel) {
geometryArrays.geometryIndices = indices.subarray(eachGeometryIndicesPortion [geometryIndex], atLastGeometry ? indices.length : eachGeometryIndicesPortion [geometryIndex + 1]);
geometryValid = (geometryArrays.geometryPositions.length > 0 && geometryArrays.geometryIndices.length > 0);
break;
case 4:
geometryArrays.primitiveName = "line-strip";
geometryArrays.geometryPositions = positions.subarray(eachGeometryPositionsPortion [geometryIndex], atLastGeometry ? positions.length : eachGeometryPositionsPortion [geometryIndex + 1]);
geometryArrays.geometryIndices = lineStripToLines(indices.subarray(eachGeometryIndicesPortion [geometryIndex], atLastGeometry ? indices.length : eachGeometryIndicesPortion [geometryIndex + 1]));
geometryValid = (geometryArrays.geometryPositions.length > 0 && geometryArrays.geometryIndices.length > 0);
break;
default:
continue;
}
Expand Down Expand Up @@ -578,6 +584,12 @@ function load(viewer, options, inflatedData, sceneModel) {
geometryIndices = indices.subarray(eachGeometryIndicesPortion [geometryIndex], atLastGeometry ? indices.length : eachGeometryIndicesPortion [geometryIndex + 1]);
geometryValid = (geometryPositions.length > 0 && geometryIndices.length > 0);
break;
case 4:
primitiveName = "lines-strip";
geometryPositions = positions.subarray(eachGeometryPositionsPortion [geometryIndex], atLastGeometry ? positions.length : eachGeometryPositionsPortion [geometryIndex + 1]);
geometryIndices = lineStripToLines(indices.subarray(eachGeometryIndicesPortion [geometryIndex], atLastGeometry ? indices.length : eachGeometryIndicesPortion [geometryIndex + 1]));
geometryValid = (geometryPositions.length > 0 && geometryIndices.length > 0);
break;
default:
continue;
}
Expand Down Expand Up @@ -619,6 +631,18 @@ function load(viewer, options, inflatedData, sceneModel) {
}
}

function lineStripToLines(lineStrip) {
if (lineStrip.length < 2) {
return lineStrip;
}
const lines = [];
for (let i = 0; i < lineStrip.length - 1; i++) {
lines.push(lineStrip[i]);
lines.push(lineStrip[i + 1]);
}
return lines;
}

/** @private */
const ParserV10 = {
version: 10,
Expand Down

0 comments on commit bb99878

Please sign in to comment.