From e18055698f75feab83869154150654cb35a5e580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Vezy?= Date: Mon, 20 Mar 2023 23:33:19 +0100 Subject: [PATCH] Update write_opf.jl --- src/opf/write_opf.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/opf/write_opf.jl b/src/opf/write_opf.jl index 653c62e..41e2d21 100644 --- a/src/opf/write_opf.jl +++ b/src/opf/write_opf.jl @@ -90,7 +90,7 @@ function write_opf(file, mtg) # Parsing the materialBDD section. materialBDD = addelement!(opf_elm, "materialBDD") - for (key, mesh_) in enumerate(mtg[:ref_meshes].meshes[2:end]) + for (key, mesh_) in enumerate(mtg[:ref_meshes].meshes) mat_elm = addelement!(materialBDD, "material") mat_elm["Id"] = key - 1 # opf uses 0-based indexing @@ -153,8 +153,10 @@ function write_opf(file, mtg) # Parsing the attributeBDD section: attrBDD = addelement!(opf_elm, "attributeBDD") - attrs = MultiScaleTreeGraph.get_features(mtg) + attrs = unique(MultiScaleTreeGraph.get_features(mtg)) for i = 1:size(attrs, 1) + (string(attrs[i, 1]) == "ref_meshes" || string(attrs[i, 1]) == "geometry") && continue + shape_elm = addelement!(attrBDD, "attribute") shape_elm["name"] = string(attrs[i, 1]) attr_type = attrs[i, 2]