mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user