No Description
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.

generate_plot.sh 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/bin/bash
  2. # SPDX-FileCopyrightText: 2024 Thomas Buck <thomas@xythobuz.de>
  3. # SPDX-License-Identifier: CERN-OHL-S-2.0+
  4. #
  5. # ------------------------------------------------------------------------------
  6. # | Copyright (c) 2024 Thomas Buck <thomas@xythobuz.de> |
  7. # | |
  8. # | This source describes Open Hardware and is licensed under the CERN-OHL-S v2 |
  9. # | or any later version. |
  10. # | |
  11. # | You may redistribute and modify this source and make products using it under |
  12. # | the terms of the CERN-OHL-S v2 (https://ohwr.org/cern_ohl_s_v2.txt) |
  13. # | or any later version. |
  14. # | |
  15. # | This source is distributed WITHOUT ANY EXPRESS OR IMPLIED WARRANTY, |
  16. # | INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY AND FITNESS FOR A |
  17. # | PARTICULAR PURPOSE. Please see the CERN-OHL-S v2 (or any later version) |
  18. # | for applicable conditions. |
  19. # | |
  20. # | Source location: https://git.xythobuz.de/thomas/drumkit |
  21. # | |
  22. # | As per CERN-OHL-S v2 section 4, should You produce hardware based on this |
  23. # | source, You must where practicable maintain the Source Location visible |
  24. # | on the external case of the Gizmo or other products you make using this |
  25. # | source. |
  26. # ------------------------------------------------------------------------------
  27. INSCH="drumkit.kicad_sch"
  28. INPCB="drumkit.kicad_pcb"
  29. OUTDIR="plot"
  30. LAYER_F="F.Cu,F.Mask,F.Paste,F.Silkscreen,Edge.Cuts,User.Drawings"
  31. LAYER_B="B.Cu,B.Mask,B.Paste,B.Silkscreen,Edge.Cuts,User.Drawings"
  32. LAYER_MANUAL="B.Cu,Edge.Cuts"
  33. cd "$(dirname "$0")"
  34. rm -rf $OUTDIR
  35. mkdir -p $OUTDIR
  36. # --------------
  37. # | 2D Schematic |
  38. # --------------
  39. for IN in $INSCH
  40. do
  41. echo "Exporting schematic $IN"
  42. for TYPE in pdf svg
  43. do
  44. echo "Exporting schematic $TYPE"
  45. rm -rf $OUTDIR/$IN.$TYPE
  46. kicad-cli sch export $TYPE \
  47. -t "KiCad Default" \
  48. -o $OUTDIR/$IN.$TYPE \
  49. $IN
  50. echo
  51. done
  52. done
  53. for IN in $INPCB
  54. do
  55. echo "Exporting board $IN"
  56. # -----------
  57. # | 2D Layout |
  58. # -----------
  59. for TYPE in pdf svg
  60. do
  61. rm -rf $OUTDIR/$IN.$TYPE
  62. echo "Exporting board $TYPE"
  63. kicad-cli pcb export $TYPE \
  64. -t "KiCad Classic" \
  65. -l $LAYER_F,$LAYER_B \
  66. -o $OUTDIR/$IN.$TYPE \
  67. $IN
  68. echo
  69. echo "Exporting DIY board $VAR"
  70. rm -rf $OUTDIR/${IN}_diy.$TYPE
  71. kicad-cli pcb export $TYPE \
  72. -t "KiCad Default" \
  73. -l $LAYER_MANUAL \
  74. --black-and-white \
  75. --negative \
  76. -o $OUTDIR/${IN}_diy.$TYPE \
  77. $IN
  78. echo
  79. done
  80. # -----------
  81. # | 3D Layout |
  82. # -----------
  83. echo "Exporting board 3D"
  84. kicad-cli pcb export vrml \
  85. -o $OUTDIR/$IN.wrl \
  86. $IN
  87. echo
  88. done