ComputationalBiomechanicsLab / opensim-creator

A UI for building OpenSim models
https://opensimcreator.com
Apache License 2.0
154 stars 18 forks source link

Add basic multibody system graph visualization via graphviz #920

Closed adamkewley closed 2 months ago

adamkewley commented 2 months ago

Idea from @mjhmilla

It would be useful to visualize the multibody system topology graph, a bit like how it's available in OpenSim GUI's Topology Viewer panel.

For OSC, the long-term UI goal would be to have a live-updating graph visualizer that's integrated as an open-able window. However, for now, it would still be useful to emit a dotviz graph representation that can be viewed in an external visualizer (i.e. "it's better than nothing"). This issue covers doing that.

adamkewley commented 2 months ago

A basic form of this is now implemented in main. It's available from Tools > Experimental Tools > Export Multibody Graph to Dotviz. Running that and then Ctrl+Ving the dotviz into https://dreampuf.github.io/GraphvizOnline yields:

graphviz

Ideally, it would also show the offset frames. This can be added seperately. This feature was whacked out very quickly as a "it's better than nothing and I know the trick right now" 15 minute thing.