Index: trunk/tests/drc_query/Makefile =================================================================== --- trunk/tests/drc_query/Makefile (revision 31476) +++ trunk/tests/drc_query/Makefile (revision 31477) @@ -6,7 +6,8 @@ GLOBARGS=-c rc/library_search_paths=../tests/RTT/lib -c rc/quiet=1 TESTS = \ -thickness.diff overlap.diff netint.diff dwg_area.diff fullpoly.diff +thickness.diff overlap.diff netint.diff dwg_area.diff fullpoly.diff \ +zone_clr.diff test: $(TESTS) @@ -42,6 +43,12 @@ fullpoly.out: FORCE @cd $(SRC) && echo "drc()" | $(PCBRND) $(GLOBARGS) $(TDIR)/fullpoly.lht --gui batch > $(TDIR)/fullpoly.out +zone_clr.diff: zone_clr.out + @diff -u zone_clr.ref zone_clr.out && rm zone_clr.out + +zone_clr.out: FORCE + @cd $(SRC) && echo "drc()" | $(PCBRND) $(GLOBARGS) $(TDIR)/zone_clr.lht --gui batch > $(TDIR)/zone_clr.out + clean: @echo "a" > dummy.out rm *.out Index: trunk/tests/drc_query/zone_clr.lht =================================================================== --- trunk/tests/drc_query/zone_clr.lht (nonexistent) +++ trunk/tests/drc_query/zone_clr.lht (revision 31477) @@ -0,0 +1,793 @@ +ha:pcb-rnd-board-v7 { + + ha:meta { + ha:size { + x = 725.0mil + y = 700.0mil + } + ha:grid { + spacing = 25.0mil + offs_x = 0.0 + offs_y = 0.0 + } + } + + ha:data { + li:padstack_prototypes { + + ha:ps_proto_v6.0 { + hdia=31.5mil; hplated=1; htop=0; hbottom=0; + li:shape { + + ha:ps_shape_v4 { + ha:ps_circ { x=0.0; y=0.0; dia=2.0mm; } + ha:combining { } + ha:layer_mask { + copper = 1 + top = 1 + } + clearance=0.0 + } + + ha:ps_shape_v4 { + ha:ps_circ { x=0.0; y=0.0; dia=2.0mm; } + ha:combining { } + ha:layer_mask { + bottom = 1 + copper = 1 + } + clearance=0.0 + } + + ha:ps_shape_v4 { + ha:ps_circ { x=0.0; y=0.0; dia=2.0mm; } + ha:combining { } + ha:layer_mask { + copper = 1 + intern = 1 + } + clearance=0.0 + } + } + } + } + + li:objects { + ha:padstack_ref.436 { + proto=0; x=475.0mil; y=500.0mil; rot=0.000000; xmirror=0; smirror=0; clearance=20.0mil; + ha:flags { + clearline=1 + } + + li:thermal { + } + } + ha:subc.48 { + ha:attributes { + footprint=1206 Standard SMT resistor, capacitor etc + refdes=R1 + } + ha:data { + li:padstack_prototypes { + + ha:ps_proto_v6.0 { + hdia=0.0; hplated=0; htop=0; hbottom=0; + li:shape { + + ha:ps_shape_v4 { + ha:combining { } + ha:layer_mask { + copper = 1 + top = 1 + } + clearance=0.0 + li:ps_poly { + 0.649986mm + -0.94996mm + -0.649986mm + -0.94996mm + -0.649986mm + 0.94996mm + 0.649986mm + 0.94996mm + } + } + + ha:ps_shape_v4 { + ha:combining { sub=1; auto=1; } + ha:layer_mask { + top = 1 + mask = 1 + } + clearance=0.0 + li:ps_poly { + 0.726186mm + -1.02616mm + -0.726186mm + -1.02616mm + -0.726186mm + 1.02616mm + 0.726186mm + 1.02616mm + } + } + + ha:ps_shape_v4 { + ha:combining { auto=1; } + ha:layer_mask { + top = 1 + paste = 1 + } + clearance=0.0 + li:ps_poly { + 0.649986mm + -0.94996mm + -0.649986mm + -0.94996mm + -0.649986mm + 0.94996mm + 0.649986mm + 0.94996mm + } + } + } + } + } + + li:objects { + ha:padstack_ref.68 { + proto=0; x=90.95mil; y=425.0mil; rot=90.000000; xmirror=0; smirror=0; clearance=10.0mil; + ha:flags { + clearline=1 + } + + li:thermal { + } + + ha:attributes { + term=1 + name=1 + } + } + ha:padstack_ref.69 { + proto=0; x=90.95mil; y=7.79526mm; rot=90.000000; xmirror=0; smirror=0; clearance=10.0mil; + ha:flags { + clearline=1 + } + + li:thermal { + } + + ha:attributes { + term=2 + name=2 + } + } + } + li:layers { + + ha:top-silk { + lid=0 + ha:combining { } + + li:objects { + ha:line.49 { + x1=1.36017mm; y1=9.895078mm; x2=1.36017mm; y2=8.695182mm; thickness=8.0mil; clearance=0.0; + } + ha:line.52 { + x1=3.26009mm; y1=9.895078mm; x2=3.26009mm; y2=8.695182mm; thickness=8.0mil; clearance=0.0; + } + ha:text.55 { + string=%a.parent.refdes%; x=43.5mil; y=581.5mil; scale=100; fid=0; + ha:flags { + dyntext=1 + floater=1 + } + rot = 90.000000 + } + } + ha:type { + silk = 1 + top = 1 + } + } + + ha:subc-aux { + lid=1 + ha:combining { } + + li:objects { + ha:line.56 { + x1=90.95mil; y1=9.29513mm; x2=90.95mil; y2=9.29513mm; thickness=0.1mm; clearance=0.0; + ha:attributes { + subc-role=pnp-origin + } + } + ha:line.59 { + x1=90.95mil; y1=9.29513mm; x2=90.95mil; y2=9.29513mm; thickness=0.1mm; clearance=0.0; + ha:attributes { + subc-role=origin + } + } + ha:line.62 { + x1=90.95mil; y1=9.29513mm; x2=90.95mil; y2=8.29513mm; thickness=0.1mm; clearance=0.0; + ha:attributes { + subc-role=x + } + } + ha:line.65 { + x1=90.95mil; y1=9.29513mm; x2=3.31013mm; y2=9.29513mm; thickness=0.1mm; clearance=0.0; + ha:attributes { + subc-role=y + } + } + } + ha:type { + top = 1 + misc = 1 + virtual = 1 + } + } + } + } + uid = pjaLj8tSfYLVqy1mjLYAAAAB + } + ha:subc.71 { + ha:attributes { + footprint=1206 Standard SMT resistor, capacitor etc + refdes=R2 + } + ha:data { + li:padstack_prototypes { + + ha:ps_proto_v6.0 { + hdia=0.0; hplated=0; htop=0; hbottom=0; + li:shape { + + ha:ps_shape_v4 { + ha:combining { } + ha:layer_mask { + copper = 1 + top = 1 + } + clearance=0.0 + li:ps_poly { + 0.649986mm + -0.94996mm + -0.649986mm + -0.94996mm + -0.649986mm + 0.94996mm + 0.649986mm + 0.94996mm + } + } + + ha:ps_shape_v4 { + ha:combining { sub=1; auto=1; } + ha:layer_mask { + top = 1 + mask = 1 + } + clearance=0.0 + li:ps_poly { + 0.726186mm + -1.02616mm + -0.726186mm + -1.02616mm + -0.726186mm + 1.02616mm + 0.726186mm + 1.02616mm + } + } + + ha:ps_shape_v4 { + ha:combining { auto=1; } + ha:layer_mask { + top = 1 + paste = 1 + } + clearance=0.0 + li:ps_poly { + 0.649986mm + -0.94996mm + -0.649986mm + -0.94996mm + -0.649986mm + 0.94996mm + 0.649986mm + 0.94996mm + } + } + } + } + } + + li:objects { + ha:padstack_ref.91 { + proto=0; x=640.95mil; y=425.0mil; rot=90.000000; xmirror=0; smirror=0; clearance=10.0mil; + ha:flags { + clearline=1 + } + + li:thermal { + } + + ha:attributes { + term=1 + name=1 + } + } + ha:padstack_ref.92 { + proto=0; x=640.95mil; y=7.79526mm; rot=90.000000; xmirror=0; smirror=0; clearance=10.0mil; + ha:flags { + clearline=1 + } + + li:thermal { + } + + ha:attributes { + term=2 + name=2 + } + } + } + li:layers { + + ha:top-silk { + lid=0 + ha:combining { } + + li:objects { + ha:line.72 { + x1=15.33017mm; y1=9.895078mm; x2=15.33017mm; y2=8.695182mm; thickness=8.0mil; clearance=0.0; + } + ha:line.75 { + x1=678.35mil; y1=9.895078mm; x2=678.35mil; y2=8.695182mm; thickness=8.0mil; clearance=0.0; + } + ha:text.78 { + string=%a.parent.refdes%; x=618.5mil; y=581.5mil; scale=100; fid=0; + ha:flags { + dyntext=1 + floater=1 + } + rot = 90.000000 + } + } + ha:type { + silk = 1 + top = 1 + } + } + + ha:subc-aux { + lid=1 + ha:combining { } + + li:objects { + ha:line.79 { + x1=640.95mil; y1=9.29513mm; x2=640.95mil; y2=9.29513mm; thickness=0.1mm; clearance=0.0; + ha:attributes { + subc-role=pnp-origin + } + } + ha:line.82 { + x1=640.95mil; y1=9.29513mm; x2=640.95mil; y2=9.29513mm; thickness=0.1mm; clearance=0.0; + ha:attributes { + subc-role=origin + } + } + ha:line.85 { + x1=640.95mil; y1=9.29513mm; x2=640.95mil; y2=8.29513mm; thickness=0.1mm; clearance=0.0; + ha:attributes { + subc-role=x + } + } + ha:line.88 { + x1=640.95mil; y1=9.29513mm; x2=17.28013mm; y2=9.29513mm; thickness=0.1mm; clearance=0.0; + ha:attributes { + subc-role=y + } + } + } + ha:type { + top = 1 + misc = 1 + virtual = 1 + } + } + } + } + uid = pjaLj8tSfYLVqy1mjLYAAAAB + } + } + li:layers { + + ha:top-sig { + lid=0 + group=1 + ha:combining { } + + ha:attributes { + {pcb-rnd::key::vis}={l; Shiftt} + {pcb-rnd::key::select}={l; t} + } + + li:objects { + ha:line.174 { + x1=90.95mil; y1=7.79526mm; x2=90.95mil; y2=234.05mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.177 { + x1=90.95mil; y1=234.05mil; x2=125.0mil; y2=200.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.180 { + x1=125.0mil; y1=200.0mil; x2=225.0mil; y2=200.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.183 { + x1=225.0mil; y1=200.0mil; x2=225.0mil; y2=8.06196mm; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.186 { + x1=225.0mil; y1=325.0mil; x2=275.0mil; y2=325.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.189 { + x1=274.8mil; y1=8.05688mm; x2=274.8mil; y2=200.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.192 { + x1=275.0mil; y1=200.0mil; x2=400.0mil; y2=200.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.195 { + x1=400.0mil; y1=200.0mil; x2=400.0mil; y2=8.07466mm; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.198 { + x1=400.0mil; y1=325.0mil; x2=450.0mil; y2=325.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.201 { + x1=449.3mil; y1=8.04926mm; x2=449.3mil; y2=200.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.204 { + x1=450.0mil; y1=200.0mil; x2=625.0mil; y2=200.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.207 { + x1=625.0mil; y1=200.0mil; x2=625.0mil; y2=7.39013mm; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.210 { + x1=625.0mil; y1=7.39013mm; x2=640.95mil; y2=7.79526mm; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.213 { + x1=90.95mil; y1=425.0mil; x2=90.95mil; y2=12.47013mm; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.216 { + x1=90.95mil; y1=12.47013mm; x2=100.0mil; y2=500.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.219 { + x1=100.0mil; y1=500.0mil; x2=225.0mil; y2=500.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.222 { + x1=225.0mil; y1=500.0mil; x2=225.0mil; y2=357.6mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.225 { + x1=225.0mil; y1=350.0mil; x2=275.0mil; y2=350.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.228 { + x1=274.8mil; y1=358.0mil; x2=274.8mil; y2=500.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.231 { + x1=275.0mil; y1=500.0mil; x2=400.0mil; y2=500.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.237 { + x1=400.0mil; y1=350.0mil; x2=450.0mil; y2=350.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.240 { + x1=450.0mil; y1=9.10336mm; x2=450.0mil; y2=500.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.243 { + x1=450.0mil; y1=500.0mil; x2=650.0mil; y2=500.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.246 { + x1=650.0mil; y1=500.0mil; x2=650.0mil; y2=434.05mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.249 { + x1=650.0mil; y1=434.05mil; x2=640.95mil; y2=425.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.345 { + x1=400.0mil; y1=500.0mil; x2=10.15746mm; y2=9.11606mm; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.440 { + x1=500.0mil; y1=500.0mil; x2=500.0mil; y2=225.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + } + color = {#8b2323} + } + + ha:bottom-sig { + lid=1 + group=7 + ha:combining { } + + ha:attributes { + {pcb-rnd::key::vis}={l; Shiftb} + {pcb-rnd::key::select}={l; b} + } + + li:objects { + ha:line.443 { + x1=475.0mil; y1=500.0mil; x2=425.0mil; y2=500.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.446 { + x1=425.0mil; y1=500.0mil; x2=400.0mil; y2=500.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.449 { + x1=350.0mil; y1=450.0mil; x2=350.0mil; y2=225.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + ha:line.452 { + x1=400.0mil; y1=500.0mil; x2=350.0mil; y2=450.0mil; thickness=10.0mil; clearance=40.0mil; + ha:flags { + clearline=1 + } + } + } + color = {#3a5fcd} + } + + ha:outline { + lid=2 + group=5 + ha:combining { } + + li:objects { + } + color = {#00868b} + } + + ha:top-silk { + lid=3 + group=0 + ha:combining { auto=1; } + + ha:attributes { + {pcb-rnd::key::vis}={l; Shifts} + {pcb-rnd::key::select}={l; s} + } + + li:objects { + } + color = {#000000} + } + + ha:zone-clr { + lid=4 + group=6 + ha:combining { } + + li:objects { + ha:polygon.253 { clearance=40.0mil; + li:geometry { + ta:contour { + { 175.0mil; 125.0mil } + { 325.0mil; 125.0mil } + { 325.0mil; 575.0mil } + { 175.0mil; 575.0mil } + } + } + + ha:flags { + clearpoly=1 + } + + ha:attributes { + min_copper_clearance=8mil + } + } + ha:polygon.258 { clearance=40.0mil; + li:geometry { + ta:contour { + { 350.0mil; 125.0mil } + { 500.0mil; 125.0mil } + { 500.0mil; 575.0mil } + { 350.0mil; 575.0mil } + } + } + + ha:flags { + clearpoly=1 + } + + ha:attributes { + min_copper_clearance=20mil + } + } + } + color = {#104e8b} + } + } + } + + ha:netlists { + li:netlist_patch { + ha:add_conn { net=pcbrnd1; term=R1-2; } + ha:add_conn { net=pcbrnd1; term=R2-2; } + ha:add_conn { net=pcbrnd2; term=R1-1; } + ha:add_conn { net=pcbrnd2; term=R2-1; } + } + } + ha:layer_stack { + li:groups { + ha:0 { + name = top_silk + ha:type { top=1; silk=1; } + li:layers { 3; } + } + ha:1 { + name = top_copper + ha:type { top=1; copper=1; } + li:layers { 0; } + } + ha:2 { + name = grp_4 + ha:type { substrate=1; intern=1; } + li:layers { } + ha:attributes { + thickness={0.7375mm } + } + } + ha:3 { + name = grp_6 + ha:type { substrate=1; intern=1; } + li:layers { } + ha:attributes { + thickness={0.125mm } + } + } + ha:4 { + name = grp_8 + ha:type { substrate=1; intern=1; } + li:layers { } + ha:attributes { + thickness={0.7375mm } + } + } + ha:5 { + name = global_outline + ha:type { boundary=1; } + li:layers { 2;} + purpose = uroute + } + ha:6 { + name = zones + ha:type { doc=1; } + li:layers { 4;} + purpose = zone + } + ha:7 { + name = bottom_copper + ha:type { bottom=1; copper=1; } + li:layers { 1; } + } + } + } + li:pcb-rnd-conf-v1 { + ha:overwrite { + ha:plugins { + ha:drc_query { + li:rules { + ha:zone_clr { + type = shorted nets + title = net too close to other net (zone) + desc = insufficient clearance between an object of the network and objects of other networks + query = { +rule zone_clr +let Z ((@.type == POLYGON) && (@.layer.purpose == "zone") && (@.a.min_copper_clearance)) thus @ +let A (@.type == PSTK) || (@.layer.type == COPPER) +let B A +assert (A.IID < B.IID) && (overlap(A, Z) || overlap(B, Z)) && (A.netname != B.netname) && intersect(A, B, Z.a.min_copper_clearance) thus violation(DRCGRP1, A, DRCGRP2, B, DRCEXPECT, Z.a.min_copper_clearance) + } + } + } + } + } + ha:design { + text_font_id = 0 + } + ha:editor { + wireframe_draw = false + line_refraction = 1 + grids_idx = 4 + grid = 25.00 mil + } + } + } + ha:pixmaps { + } +} Index: trunk/tests/drc_query/zone_clr.ref =================================================================== --- trunk/tests/drc_query/zone_clr.ref (nonexistent) +++ trunk/tests/drc_query/zone_clr.ref (revision 31477) @@ -0,0 +1,10 @@ +1: shorted nets: net too close to other net (zone) +within (362.40, 293.65, 487.60, 356.35) mil +required value 20.00 mil +insufficient clearance between an object of the network and objects of other networks + +2: shorted nets: net too close to other net (zone) +within (396.78, 168.65, 678.22, 231.35) mil +required value 20.00 mil +insufficient clearance between an object of the network and objects of other networks +