@@ -16,6 +16,7 @@ test("test8 support courtyard elements", async () => {
1616 <courtyardoutline outline={[{"x":-1.8,"y":-1.4},{"x":1.8,"y":-1.4},{"x":1.8,"y":1.4},{"x":-1.8,"y":1.4}]} layer="top" />
1717 <courtyardrect pcbX={0} pcbY={0} width={4} height={3} layer="top" />
1818 <courtyardrect pcbX={0.2} pcbY={0.2} width={4.6} height={3.6} layer="bottom" />
19+ <courtyardcircle pcbX={0.4} pcbY={-0.3} radius={2.1} layer="top" />
1920 </footprint>}
2021 {...props}
2122 />
@@ -39,16 +40,23 @@ circuit.add(
3940 ` ) ) as any [ ]
4041
4142 const courtyardElements = renderedCircuitJson . filter ( ( elm ) =>
42- [ "pcb_courtyard_outline" , "pcb_courtyard_rect" ] . includes ( elm . type ) ,
43+ [
44+ "pcb_courtyard_outline" ,
45+ "pcb_courtyard_rect" ,
46+ "pcb_courtyard_circle" ,
47+ ] . includes ( elm . type ) ,
4348 )
4449
45- expect ( courtyardElements ) . toHaveLength ( 6 )
50+ expect ( courtyardElements ) . toHaveLength ( 8 )
4651 expect (
4752 courtyardElements . filter ( ( elm ) => elm . type === "pcb_courtyard_outline" ) ,
4853 ) . toHaveLength ( 2 )
4954 expect (
5055 courtyardElements . filter ( ( elm ) => elm . type === "pcb_courtyard_rect" ) ,
5156 ) . toHaveLength ( 4 )
57+ expect (
58+ courtyardElements . filter ( ( elm ) => elm . type === "pcb_courtyard_circle" ) ,
59+ ) . toHaveLength ( 2 )
5260} )
5361
5462const circuitJson : any = [
@@ -126,4 +134,12 @@ const circuitJson: any = [
126134 height : 3.6 ,
127135 layer : "bottom" ,
128136 } ,
137+ {
138+ type : "pcb_courtyard_circle" ,
139+ pcb_courtyard_circle_id : "pcb_courtyard_circle_0" ,
140+ pcb_component_id : "pcb_generic_component_0" ,
141+ center : { x : 0.4 , y : - 0.3 } ,
142+ radius : 2.1 ,
143+ layer : "top" ,
144+ } ,
129145]
0 commit comments