Skip to content

Commit

Permalink
round hole fix
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Sep 6, 2024
1 parent fd23af0 commit 5d26423
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions module/lib/solver-utils/getObstaclesFromCircuitJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ export const getObstaclesFromCircuitJson = (soup: AnySoupElement[]) => {
connectedTo: [],
})
}
}
else if (element.type === "pcb_hole") {
} else if (element.type === "pcb_hole") {
if (element.hole_shape === "oval") {
obstacles.push({
// @ts-ignore
Expand All @@ -80,6 +79,17 @@ export const getObstaclesFromCircuitJson = (soup: AnySoupElement[]) => {
height: element.hole_diameter,
connectedTo: [],
})
} else if (element.hole_shape === "round") {
obstacles.push({
type: "rect",
center: {
x: element.x,
y: element.y,
},
width: element.hole_diameter,
height: element.hole_diameter,
connectedTo: [],
})
}
} else if (element.type === "pcb_plated_hole") {
if (element.shape === "circle") {
Expand Down Expand Up @@ -108,7 +118,10 @@ export const getObstaclesFromCircuitJson = (soup: AnySoupElement[]) => {
})
}
} else if (element.type === "pcb_trace") {
const traceObstacles = getObstaclesFromRoute(element.route, element.source_trace_id!)
const traceObstacles = getObstaclesFromRoute(
element.route,
element.source_trace_id!,
)
obstacles.push(...traceObstacles)
}
}
Expand Down

0 comments on commit 5d26423

Please sign in to comment.