Skip to content

Commit

Permalink
make flip_y_axis flag false by default
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Aug 22, 2024
1 parent 2891c09 commit a9da5c2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ docs
*.artifact.*
gerber-output
gerber-output.zip
tmp-debug-logs
tmp-debug-logs
.aider*
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const mmToInch = (mm: number) => {
export const convertSoupToExcellonDrillCommands = ({
soup,
is_plated,
flip_y_axis = true,
flip_y_axis = false,
}: {
soup: Array<AnySoupElement>
is_plated: boolean
Expand Down
20 changes: 10 additions & 10 deletions src/lib/gerber/convert-soup-to-gerber-commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import { getGerberLayerName } from "./getGerberLayerName"
*/
export const convertSoupToGerberCommands = (
soup: AnySoupElement[],
opts: { flip_y_axis?: boolean } = {}
opts: { flip_y_axis?: boolean } = {},
): LayerToGerberCommandsMap => {
opts.flip_y_axis ??= true
opts.flip_y_axis ??= false
const glayers: LayerToGerberCommandsMap = {
F_Cu: getCommandHeaders({
layer: "top",
Expand Down Expand Up @@ -63,7 +63,7 @@ export const convertSoupToGerberCommands = (
standard_template_code: "C",
diameter: 0.05, //mm
})
.build()
.build(),
)

/**
Expand Down Expand Up @@ -92,7 +92,7 @@ export const convertSoupToGerberCommands = (
})
.add("move_operation", { x: a.x, y: mfy(a.y) })
.add("plot_operation", { x: b.x, y: mfy(b.y) })
.build()
.build(),
)
}
}
Expand All @@ -108,11 +108,11 @@ export const convertSoupToGerberCommands = (
.add("select_aperture", {
aperture_number: findApertureNumber(
glayer,
getApertureConfigFromPcbSmtpad(element)
getApertureConfigFromPcbSmtpad(element),
),
})
.add("flash_operation", { x: element.x, y: mfy(element.y) })
.build()
.build(),
)
}
}
Expand All @@ -124,7 +124,7 @@ export const convertSoupToGerberCommands = (
]) {
if (element.shape !== "circle") {
console.warn(
"NOT IMPLEMENTED: drawing gerber for non-circle plated hole"
"NOT IMPLEMENTED: drawing gerber for non-circle plated hole",
)
continue
}
Expand All @@ -133,11 +133,11 @@ export const convertSoupToGerberCommands = (
.add("select_aperture", {
aperture_number: findApertureNumber(
glayer,
getApertureConfigFromCirclePcbPlatedHole(element)
getApertureConfigFromCirclePcbPlatedHole(element),
),
})
.add("flash_operation", { x: element.x, y: mfy(element.y) })
.build()
.build(),
)
}
}
Expand Down Expand Up @@ -181,7 +181,7 @@ export const convertSoupToGerberCommands = (
x: center.x - width / 2,
y: mfy(center.y - height / 2),
})
.build()
.build(),
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/pick-and-place-csv/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ interface PickAndPlaceRow {

export const convertSoupToPickAndPlaceRows = (
soup: AnySoupElement[],
opts: { flip_y_axis?: boolean } = {}
opts: { flip_y_axis?: boolean } = {},
): PickAndPlaceRow[] => {
opts.flip_y_axis ??= true
opts.flip_y_axis ??= false

const rows: PickAndPlaceRow[] = []
for (const element of soup) {
Expand All @@ -38,5 +38,5 @@ export const convertSoupToPickAndPlaceCsv = (soup: AnySoupElement[]): string =>
"Mid Y": row.mid_y,
Layer: row.layer,
Rotation: row.rotation,
}))
})),
)

0 comments on commit a9da5c2

Please sign in to comment.