You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
413 B

  1. #!/bin/bash
  2. SCAD_FILE=3d_models/gears.scad
  3. CONFIG_GEN=arduino/teeth_config.h
  4. gear1_teeth=$(grep 'gear1_teeth =' < $SCAD_FILE | sed -e 's/gear1_teeth = \(.*\);/\1/g')
  5. gear2_teeth=$(grep 'gear2_teeth =' < $SCAD_FILE | sed -e 's/gear2_teeth = \(.*\);/\1/g')
  6. echo $gear2_teeth $gear1_teeth
  7. TMPL="#pragma once\n\
  8. #define CONFIG_TEETH_SMALL 13.0\n\
  9. #define CONFIG_TEETH_BIG 51.0\n\
  10. "
  11. echo -e $TMPL > $CONFIG_GEN