Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Hermann-SW
Created July 30, 2022 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hermann-SW/03536703dfcde3c2d774ba7c60a498d2 to your computer and use it in GitHub Desktop.
Save Hermann-SW/03536703dfcde3c2d774ba7c60a498d2 to your computer and use it in GitHub Desktop.
Generate Graphviz dotfile from OpenSCAD "use" calltree
#/bin/bash
if [ "$2" = "" ]; then
echo "digraph G {"
echo "rankdir=LR"
echo "node [shape=none]"
fi
echo \"$2\" "->" \"$1\" "[label=\"`wc --lines $1 | cut -f1 -d\ `\"]"
for f in `grep "^use" $1 | cut -f2 -d\< | cut -f1 -d\>`
do
./scad_calltree `dirname $1`/$f $1
done
if [ "$2" = "" ]; then
echo "}"
fi
@Hermann-SW
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment