File tree Expand file tree Collapse file tree
src/gerber/convert-soup-to-gerber-commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,20 +48,6 @@ const getGerberInnerLayerName = (layerRef: LayerRef) => {
4848 return `In${ layerRef . replace ( "inner" , "" ) } _Cu` as const
4949}
5050
51- const getPlatedHoleCcwRotation = (
52- platedHole : PcbPlatedHole | undefined ,
53- ) : number => {
54- if ( ! platedHole ) return 0
55- switch ( platedHole . shape ) {
56- case "oval" :
57- case "pill" :
58- case "hole_with_polygon_pad" :
59- return platedHole . ccw_rotation ?? 0
60- default :
61- return 0
62- }
63- }
64-
6551/**
6652 * Converts Circuit JSON to arrays of Gerber commands for each layer
6753 */
@@ -778,12 +764,16 @@ export const convertSoupToGerberCommands = (
778764 : 0
779765 if ( ! rotation ) {
780766 const platedHole = circuitJson . find (
781- ( candidate ) : candidate is PcbPlatedHole =>
767+ (
768+ candidate ,
769+ ) : candidate is PcbPlatedHole & { ccw_rotation : number } =>
782770 candidate . type === "pcb_plated_hole" &&
783771 candidate . x === element . x &&
784- candidate . y === element . y ,
772+ candidate . y === element . y &&
773+ "ccw_rotation" in candidate &&
774+ typeof candidate . ccw_rotation === "number" ,
785775 )
786- rotation = getPlatedHoleCcwRotation ( platedHole )
776+ rotation = platedHole ?. ccw_rotation ?? 0
787777 }
788778 const apertureConfig =
789779 element . shape === "pill" && ( rotation === 90 || rotation === 270 )
You can’t perform that action at this time.
0 commit comments