Skip to content

Commit a9e8f9b

Browse files
author
techmannih
committed
up
1 parent 27c8a7f commit a9e8f9b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/examples/hole_rotated_pill.fixture.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const RotatedPillHole = () => {
2525
hole_shape: "pill",
2626
hole_width: 2.5,
2727
hole_height: 5,
28-
hole_ccw_rotation: 45,
28+
ccw_rotation: 45,
2929
},
3030
{
3131
type: "pcb_hole",
@@ -35,7 +35,7 @@ export const RotatedPillHole = () => {
3535
hole_shape: "pill",
3636
hole_width: 2.5,
3737
hole_height: 5,
38-
hole_ccw_rotation: 0,
38+
ccw_rotation: 0,
3939
},
4040
] as any
4141
}

src/lib/convert-element-to-primitive.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import type {
77
PcbNoteDimension,
88
PcbSmtPadRotatedPill,
99
PcbPanel,
10+
PcbHole,
11+
PcbHoleRotatedPill,
1012
} from "circuit-json"
1113
import { su } from "@tscircuit/circuit-json-util"
1214
import type { Primitive } from "./types"
@@ -286,11 +288,7 @@ export const convertElementToPrimitives = (
286288
element.hole_shape === "pill" ||
287289
element.hole_shape === "rotated_pill"
288290
) {
289-
const { x, y, hole_width, hole_height } = element as any
290-
const ccw_rotation =
291-
(element as any).hole_ccw_rotation ??
292-
(element as any).ccw_rotation ??
293-
0
291+
const { x, y, hole_width, hole_height } = element
294292

295293
if (typeof hole_width !== "number" || typeof hole_height !== "number") {
296294
return []
@@ -308,7 +306,7 @@ export const convertElementToPrimitives = (
308306
_element: element,
309307
_parent_pcb_component,
310308
_parent_source_component,
311-
ccw_rotation,
309+
ccw_rotation: (element as PcbHoleRotatedPill).ccw_rotation,
312310
},
313311
]
314312
}

0 commit comments

Comments
 (0)