Opened 5 years ago
Last modified 4 years ago
#5953 assigned defect
Broken visualization code generation for models with components having same name
| Reported by: | anonymous | Owned by: | Volker Waurich |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Code Generation | Version: | |
| Keywords: | Cc: |
Description
Model VisualizationBug has two shapes with the same name body.sphere and foo.body.sphere and body.sphere is missing from 3D animation scene in OMEdit.
model VisualizationBug model Foo Modelica.Mechanics.MultiBody.Parts.Body body( angles_fixed = true, m = 1, r_CM = {0, 0, 0}, r_0(each fixed = true, start = {0, 0, 0}), v_0(each fixed = true), w_0_fixed = true ); end Foo; Modelica.Mechanics.MultiBody.Parts.Body body( angles_fixed = true, m = 1, r_0(each fixed = true, start = {0, 1, 0}), r_CM = {0, 0, 0}, v_0(each fixed = true), w_0_fixed = true); inner Modelica.Mechanics.MultiBody.World world; VisualizationBug.Foo foo; end VisualizationBug;
I think that's because compiler generates wrong *_vis.xml file and shape body.sphere use foo.body.sphere parameters.
<shape> <ident>body.sphere</ident> <type>sphere</type> <T> <cref>foo.body.sphere.R.T[1,1]</cref> <cref>foo.body.sphere.R.T[1,2]</cref> <cref>foo.body.sphere.R.T[1,3]</cref> <cref>foo.body.sphere.R.T[2,1]</cref> <cref>foo.body.sphere.R.T[2,2]</cref> <cref>foo.body.sphere.R.T[2,3]</cref> <cref>foo.body.sphere.R.T[3,1]</cref> <cref>foo.body.sphere.R.T[3,2]</cref> <cref>foo.body.sphere.R.T[3,3]</cref> </T> <r> <cref>foo.body.sphere.r[1]</cref> <cref>foo.body.sphere.r[2]</cref> <cref>foo.body.sphere.r[3]</cref> </r> <r_shape> <cref>foo.body.sphere.r_shape[1]</cref> <cref>body.sphere.r_shape[2]</cref> <cref>body.sphere.r_shape[3]</cref> </r_shape> ... </shape>
Change History (7)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
| Component: | Code Generation → OMEdit |
|---|---|
| Milestone: | Future → 1.17.0 |
| Owner: | changed from to |
| Status: | new → assigned |
comment:3 by , 5 years ago
The file model_vis.xml is generated by the compiler when setCommandLineOptions("-d=visxml") is set.
This seems like code generation issue. OMEdit just reads the file and creates the OSG objects accordingly.
comment:5 by , 5 years ago
| Component: | OMEdit → Code Generation |
|---|---|
| Owner: | changed from to |
Volker implemented that but I am not sure who else can take care of this.
comment:6 by , 5 years ago
| Milestone: | 1.17.0 → 1.18.0 |
|---|
Retargeted to 1.18.0 because of 1.17.0 timed release.

Visualization works correctly if VisualizationBug.Foo foo moved above Modelica.Mechanics.MultiBody.Parts.Body body.