cutout_a_gerber.FlatScript 1.5 KB

12345678910111213141516171819202122232425262728
  1. # #####################################################################################
  2. # DESCRIPTION:
  3. # Will cut a PCB piece with a pattern (Gerber file) out of the surrounding PCB material
  4. # #####################################################################################
  5. puts "**************** RUNNING an EXAMPLE SCRIPT = Cutout a Gerber file *******************"
  6. # ----------- START: This is needed only for the examples ----------------
  7. # first set the default location where to search for the files to be open and store it to the ROOT_FOLDER variable
  8. set ROOT_FOLDER [get_sys root_folder_path]
  9. # calculate the resources path for the examples we need to run and store it inside the PATH varaible
  10. set PATH ${ROOT_FOLDER}/assets/examples/files
  11. # ----------- END: This is needed only for the examples ----------------
  12. # set the working path to the path that holds the files we are going to work with
  13. set_path $PATH
  14. # load the GERBER file test.gbr as gerber_file
  15. open_gerber test.gbr -outname gerber_file
  16. # cutout the Gerber file with name gerber_file using an endmill with diameter 1.2 at a distance of 0.1 units from
  17. # the Gerber object. Will add gaps (bridges to hold the PCB to the surrounding material) on each side of the PCB
  18. # (4 sides) and the resulting Geometry object that hold the cutout geometry will be named cutout_geo
  19. cutout gerber_file -dia 1.2 -margin 0.1 -gapsize 3 -gaps "4" -outname cutout_geo
  20. # plot the objects so we can see them; not required for the script but in this script we want to see the results
  21. plot_all