GltfSerializer: name hierarchy group nodes after their own element

With --element-hierarchy, the intermediate nodes representing spatial
structure (storey, building, site) were all named after whichever leaf
element triggered their creation, instead of their own entity. Use the
ancestor element at the current tree level, so --use-element-guids and
default naming both identify group nodes correctly.

Generated with the assistance of an AI coding tool.
This commit is contained in:
Petru Conduraru
2026-07-19 21:29:19 +03:00
parent 89523999b3
commit ecdc60b231
+1 -1
View File
@@ -249,7 +249,7 @@ void GltfSerializer::write(const IfcGeom::TriangulationElement* o) {
size_t new_node_index = json_["nodes"].size();
node_indices_[(*it)->product()] = new_node_index;
node_array_.push_back(new_node_index);
parent_node["name"] = object_id(o);
parent_node["name"] = object_id(*it);
parent_node["children"] = json::array({current_node_index});
json_["nodes"].push_back(parent_node);