@@ -632,6 +632,12 @@ export const convertSoupToGerberCommands = (
632632 }
633633 }
634634 } else if ( element . type === "pcb_board" && layer === "edgecut" ) {
635+ // Skip boards that are inside a panel - only render the panel outline
636+ const board = element as any
637+ if ( board . pcb_panel_id ) {
638+ continue
639+ }
640+
635641 const glayer = glayers . Edge_Cuts
636642 const { width, height, center, outline } = element
637643 const gerberBuild = gerberBuilder ( ) . add ( "select_aperture" , {
@@ -678,6 +684,36 @@ export const convertSoupToGerberCommands = (
678684 } )
679685 }
680686
687+ glayer . push ( ...gerberBuild . build ( ) )
688+ } else if ( element . type === "pcb_panel" && layer === "edgecut" ) {
689+ const glayer = glayers . Edge_Cuts
690+ const panel = element as any
691+ const { width, height, center } = panel
692+ const gerberBuild = gerberBuilder ( )
693+ . add ( "select_aperture" , {
694+ aperture_number : 10 ,
695+ } )
696+ . add ( "move_operation" , {
697+ x : center . x - width / 2 ,
698+ y : mfy ( center . y - height / 2 ) ,
699+ } )
700+ . add ( "plot_operation" , {
701+ x : center . x + width / 2 ,
702+ y : mfy ( center . y - height / 2 ) ,
703+ } )
704+ . add ( "plot_operation" , {
705+ x : center . x + width / 2 ,
706+ y : mfy ( center . y + height / 2 ) ,
707+ } )
708+ . add ( "plot_operation" , {
709+ x : center . x - width / 2 ,
710+ y : mfy ( center . y + height / 2 ) ,
711+ } )
712+ . add ( "plot_operation" , {
713+ x : center . x - width / 2 ,
714+ y : mfy ( center . y - height / 2 ) ,
715+ } )
716+
681717 glayer . push ( ...gerberBuild . build ( ) )
682718 } else if ( element . type === "pcb_cutout" ) {
683719 if ( layer === "edgecut" ) {
0 commit comments