Skip to content

Commit

Permalink
Update write_opf.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
VEZY committed Mar 20, 2023
1 parent 5f9c8b1 commit e180556
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/opf/write_opf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit e180556

Please sign in to comment.