Skip to content

Commit d9c27f9

Browse files
committed
up
1 parent 9881062 commit d9c27f9

1 file changed

Lines changed: 10 additions & 23 deletions

File tree

src/gerber/convert-soup-to-gerber-commands/defineAperturesForLayer.ts

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -306,16 +306,6 @@ function getAllApertureTemplateConfigsForLayer(
306306
): ApertureTemplateConfig[] {
307307
const configs: ApertureTemplateConfig[] = []
308308
const configHashMap = new Set<string>()
309-
const ccwRotationDegreesByPoint = new Map<string, number>()
310-
311-
for (const elm of soup) {
312-
if (elm.type === "pcb_plated_hole") {
313-
ccwRotationDegreesByPoint.set(
314-
`${elm.x}:${elm.y}`,
315-
"ccw_rotation" in elm ? (elm.ccw_rotation ?? 0) : 0,
316-
)
317-
}
318-
}
319309

320310
const addConfigIfNew = (config: ApertureTemplateConfig) => {
321311
const hash = stableStringify(config)
@@ -332,19 +322,16 @@ function getAllApertureTemplateConfigsForLayer(
332322
}
333323
} else if (elm.type === "pcb_solder_paste") {
334324
if (elm.layer === layer) {
335-
const ccwRotationDegrees =
336-
"ccw_rotation" in elm && typeof elm.ccw_rotation === "number"
337-
? elm.ccw_rotation
338-
: (ccwRotationDegreesByPoint.get(`${elm.x}:${elm.y}`) ?? 0)
339-
340-
addConfigIfNew(
341-
getApertureConfigFromPcbSolderPaste(
342-
elm.shape === "pill" &&
343-
(ccwRotationDegrees === 90 || ccwRotationDegrees === 270)
344-
? { ...elm, width: elm.height, height: elm.width }
345-
: elm,
346-
),
347-
)
325+
addConfigIfNew(getApertureConfigFromPcbSolderPaste(elm))
326+
if (elm.shape === "pill") {
327+
addConfigIfNew(
328+
getApertureConfigFromPcbSolderPaste({
329+
...elm,
330+
width: elm.height,
331+
height: elm.width,
332+
}),
333+
)
334+
}
348335
}
349336
} else if (elm.type === "pcb_plated_hole") {
350337
if (elm.layers.includes(layer)) {

0 commit comments

Comments
 (0)