Skip to content

Commit

Permalink
Merge pull request #74 from tscircuit/fix/duplicate-plated-hole
Browse files Browse the repository at this point in the history
fix: duplicate plated hole with same pin number
  • Loading branch information
imrishabh18 authored Dec 24, 2024
2 parents 9f73dc7 + 49188fc commit b68d512
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/dsn-pcb/circuit-json-to-dsn-json/process-plated-holes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,14 @@ export function processPlatedHoles(
}

// Only return pin if it doesn't already exist in the image
return !existingImage.pins.some(
(existingPin) =>
return !existingImage.pins.some((existingPin) => {
const samePinNumber = existingPin.pin_number === pin.pin_number
const samePositionAndPadstack =
existingPin.x === pin.x &&
existingPin.y === pin.y &&
existingPin.padstack_name === pin.padstack_name,
)
existingPin.padstack_name === pin.padstack_name
return samePinNumber || samePositionAndPadstack
})
? pin
: undefined
} else if (hole.shape === "oval" || hole.shape === "pill") {
Expand Down Expand Up @@ -196,7 +198,6 @@ export function processPlatedHoles(
.filter((pin): pin is Pin => pin !== undefined)

existingImage.pins.push(...platedHolePins)
// }
}

// Add component placements for plated-hole-only components
Expand Down

0 comments on commit b68d512

Please sign in to comment.