Index: work/bug_files/poly_selfi_bdale/A.lht =================================================================== --- work/bug_files/poly_selfi_bdale/A.lht (nonexistent) +++ work/bug_files/poly_selfi_bdale/A.lht (revision 34614) @@ -0,0 +1,729 @@ +ha:pcb-rnd-board-v8 { + ha:meta { + ha:size { + thermal_scale = 0.500000 + x = 0.1um + y = 0.1um + } + ha:grid { + spacing = 0.001um + offs_x = 0.0 + offs_y = 0.0 + } + } + ha:layer_stack { + li:groups { + ha:0 { + ha:type { + top = 1 + paste = 1 + } + li:layers { + 8 + } + name = top_paste + } + ha:1 { + ha:type { + silk = 1 + top = 1 + } + li:layers { + 7 + } + name = top_silk + } + ha:2 { + ha:type { + top = 1 + mask = 1 + } + li:layers { + 9 + } + name = top_mask + } + ha:3 { + ha:type { + copper = 1 + top = 1 + } + li:layers { + 0 + 2 + } + name = top_copper + } + ha:4 { + ha:attributes { + thickness = {0.7375mm } + } + ha:type { + substrate = 1 + intern = 1 + } + li:layers { + } + name = grp_4 + } + ha:5 { + ha:type { + copper = 1 + intern = 1 + } + li:layers { + 5 + } + name = Intern + } + ha:6 { + ha:attributes { + thickness = {0.125mm } + } + ha:type { + substrate = 1 + intern = 1 + } + li:layers { + } + name = grp_6 + } + ha:7 { + ha:type { + copper = 1 + intern = 1 + } + li:layers { + 4 + } + name = Intern + } + ha:8 { + ha:attributes { + thickness = {0.7375mm } + } + ha:type { + substrate = 1 + intern = 1 + } + li:layers { + } + name = grp_8 + } + ha:9 { + ha:type { + bottom = 1 + copper = 1 + } + li:layers { + 1 + 3 + } + name = bottom_copper + } + ha:10 { + ha:type { + bottom = 1 + mask = 1 + } + li:layers { + 10 + } + name = bottom_mask + } + ha:11 { + ha:type { + silk = 1 + bottom = 1 + } + li:layers { + 6 + } + name = bottom_silk + } + ha:12 { + ha:type { + bottom = 1 + paste = 1 + } + li:layers { + 11 + } + name = bottom_paste + } + ha:13 { + purpose = proute + ha:type { + mech = 1 + } + li:layers { + 12 + } + name = pmech + } + ha:14 { + purpose = uroute + ha:type { + mech = 1 + } + li:layers { + 13 + } + name = umech + } + ha:15 { + ha:attributes { + init-invis = 1 + } + purpose = assy + ha:type { + top = 1 + doc = 1 + } + li:layers { + 14 + } + name = top_assy + } + ha:16 { + ha:attributes { + init-invis = 1 + } + purpose = assy + ha:type { + bottom = 1 + doc = 1 + } + li:layers { + 15 + } + name = bot_assy + } + ha:17 { + ha:attributes { + init-invis = 1 + } + purpose = fab + ha:type { + top = 1 + doc = 1 + } + li:layers { + 16 + } + name = fab + } + } + } + li:styles { + ha:Signal { + via_proto = 0 + thickness = 0.01um + text_thick = 0.0 + text_scale = 100 + clearance = 0.02um + } + ha:Power { + via_proto = 1 + thickness = 0.02um + text_thick = 0.0 + text_scale = 100 + clearance = 0.02um + } + ha:Fat { + via_proto = 2 + thickness = 0.08um + text_thick = 0.0 + text_scale = 100 + clearance = 0.025um + } + ha:Sig-tight { + via_proto = 3 + thickness = 0.01um + text_thick = 0.0 + text_scale = 100 + clearance = 0.012um + } + } + li:pcb-rnd-conf-v1 { + ha:overwrite { + ha:design { + line_thickness = 10 nm + via_proto = 0 + text_font_id = 0 + text_scale = 100 + text_thickness = 0 + clearance = 20 nm + } + ha:editor { + grid_unit = nm + buffer_number = 0 + grids_idx = -1 + grid = 1 nm + } + } + } + ha:data { + li:padstack_prototypes { + ha:ps_proto_v6.0 { + htop = 0 + hdia = 0.8mm + li:shape { + ha:ps_shape_v4 { + clearance = 0.0 + ha:ps_circ { + x = 0.0 + y = 0.0 + dia = 2.0mm + } + ha:layer_mask { + copper = 1 + top = 1 + } + ha:combining { + } + } + ha:ps_shape_v4 { + clearance = 0.0 + ha:ps_circ { + x = 0.0 + y = 0.0 + dia = 2.0mm + } + ha:layer_mask { + bottom = 1 + copper = 1 + } + ha:combining { + } + } + ha:ps_shape_v4 { + clearance = 0.0 + ha:ps_circ { + x = 0.0 + y = 0.0 + dia = 2.0mm + } + ha:layer_mask { + copper = 1 + intern = 1 + } + ha:combining { + } + } + } + hbottom = 0 + hplated = 1 + } + ha:ps_proto_v6.1 { + htop = 0 + hdia = 1.0mm + li:shape { + ha:ps_shape_v4 { + clearance = 0.0 + ha:ps_circ { + x = 0.0 + y = 0.0 + dia = 2.2mm + } + ha:layer_mask { + copper = 1 + top = 1 + } + ha:combining { + } + } + ha:ps_shape_v4 { + clearance = 0.0 + ha:ps_circ { + x = 0.0 + y = 0.0 + dia = 2.2mm + } + ha:layer_mask { + bottom = 1 + copper = 1 + } + ha:combining { + } + } + ha:ps_shape_v4 { + clearance = 0.0 + ha:ps_circ { + x = 0.0 + y = 0.0 + dia = 2.2mm + } + ha:layer_mask { + copper = 1 + intern = 1 + } + ha:combining { + } + } + } + hbottom = 0 + hplated = 1 + } + ha:ps_proto_v6.2 { + htop = 0 + hdia = 1.2mm + li:shape { + ha:ps_shape_v4 { + clearance = 0.0 + ha:ps_circ { + x = 0.0 + y = 0.0 + dia = 3.5mm + } + ha:layer_mask { + copper = 1 + top = 1 + } + ha:combining { + } + } + ha:ps_shape_v4 { + clearance = 0.0 + ha:ps_circ { + x = 0.0 + y = 0.0 + dia = 3.5mm + } + ha:layer_mask { + bottom = 1 + copper = 1 + } + ha:combining { + } + } + ha:ps_shape_v4 { + clearance = 0.0 + ha:ps_circ { + x = 0.0 + y = 0.0 + dia = 3.5mm + } + ha:layer_mask { + copper = 1 + intern = 1 + } + ha:combining { + } + } + } + hbottom = 0 + hplated = 1 + } + ha:ps_proto_v6.3 { + htop = 0 + hdia = 0.8mm + li:shape { + ha:ps_shape_v4 { + clearance = 0.0 + ha:ps_circ { + x = 0.0 + y = 0.0 + dia = 64.0mil + } + ha:layer_mask { + copper = 1 + top = 1 + } + ha:combining { + } + } + ha:ps_shape_v4 { + clearance = 0.0 + ha:ps_circ { + x = 0.0 + y = 0.0 + dia = 64.0mil + } + ha:layer_mask { + bottom = 1 + copper = 1 + } + ha:combining { + } + } + ha:ps_shape_v4 { + clearance = 0.0 + ha:ps_circ { + x = 0.0 + y = 0.0 + dia = 64.0mil + } + ha:layer_mask { + copper = 1 + intern = 1 + } + ha:combining { + } + } + } + hbottom = 0 + hplated = 1 + } + ha:ps_proto_v6.4 { + htop = 0 + hdia = 0.0 + li:shape { + ha:ps_shape_v4 { + clearance = 0.04um + li:ps_poly { + -0.003um + -0.005um + 0.002um + -0.005um + 0.002um + 0.005um + -0.003um + 0.005um + } + ha:layer_mask { + copper = 1 + top = 1 + } + ha:combining { + } + } + } + hbottom = 0 + hplated = 0 + } + } + li:objects { + ha:padstack_ref.41 { + smirror = 0 + proto = 4 + xmirror = 0 + x = 0.028um + rot = 0.000000 + y = 0.021um + li:thermal { + } + ha:flags { + clearline = 1 + } + clearance = 0.005um + } + ha:padstack_ref.49 { + proto=4; x=0.044um; y=0.021um; rot=0.000000; xmirror=0; smirror=0; clearance=0.005um; + ha:flags { + clearline=1 + selected=1 + } + + li:thermal { + } + } + } + li:layers { + ha:top-sig { + ha:attributes { + {pcb-rnd::key::vis} = {l; Shiftt} + {pcb-rnd::key::select} = {l; t} + } + lid = 0 + li:objects { + ha:polygon.42 { clearance=0.04um; + li:geometry { + ta:contour { + { 0.004um; 0.019um } + { 0.085um; 0.019um } + { 0.085um; 0.071um } + { 0.004um; 0.071um } + } + } + + ha:flags { + clearpoly=1 + } + } + } + color = {#8b2323} + group = 3 + ha:combining { + } + } + ha:bottom-sig { + ha:attributes { + {pcb-rnd::key::vis} = {l; Shiftb} + {pcb-rnd::key::select} = {l; b} + } + lid = 1 + li:objects { + } + color = {#3a5fcd} + group = 9 + ha:combining { + } + } + ha:top-gnd { + lid = 2 + li:objects { + } + color = {#104e8b} + group = 3 + ha:combining { + } + } + ha:bottom-gnd { + lid = 3 + li:objects { + } + color = {#cd3700} + group = 9 + ha:combining { + } + } + ha:int-sig2 { + ha:attributes { + {pcb-rnd::key::vis} = {l; Shifti} + {pcb-rnd::key::select} = {l; i} + } + lid = 4 + li:objects { + } + color = {#548b54} + group = 7 + ha:combining { + } + } + ha:int-sig1 { + ha:attributes { + {pcb-rnd::key::vis} = {l; Shifto} + {pcb-rnd::key::select} = {l; o} + } + lid = 5 + li:objects { + } + color = {#8b7355} + group = 5 + ha:combining { + } + } + ha:bottom-silk { + ha:attributes { + {pcb-rnd::key::vis} = {l; Shiftx} + {pcb-rnd::key::select} = {l; x} + } + lid = 6 + li:objects { + } + color = {#000000} + group = 11 + ha:combining { + auto = 1 + } + } + ha:top-silk { + ha:attributes { + {pcb-rnd::key::vis} = {l; Shifts} + {pcb-rnd::key::select} = {l; s} + } + lid = 7 + li:objects { + } + color = {#000000} + group = 1 + ha:combining { + auto = 1 + } + } + ha:top-paste { + lid = 8 + li:objects { + } + color = {#cd00cd} + group = 0 + ha:combining { + auto = 1 + } + } + ha:top-mask { + lid = 9 + li:objects { + } + color = {#ff0000} + group = 2 + ha:combining { + sub = 1 + auto = 1 + } + } + ha:bottom-mask { + lid = 10 + li:objects { + } + color = {#ff0000} + group = 10 + ha:combining { + sub = 1 + auto = 1 + } + } + ha:bottom-paste { + lid = 11 + li:objects { + } + color = {#cd00cd} + group = 12 + ha:combining { + auto = 1 + } + } + ha:slot-plated { + lid = 12 + li:objects { + } + color = {#8b7355} + group = 13 + ha:combining { + auto = 1 + } + } + ha:slot-unplated { + lid = 13 + li:objects { + } + color = {#00868b} + group = 14 + ha:combining { + auto = 1 + } + } + ha:top-assy { + lid = 14 + li:objects { + } + color = {#444444} + group = 15 + ha:combining { + } + } + ha:bot-assy { + lid = 15 + li:objects { + } + color = {#444444} + group = 16 + ha:combining { + } + } + ha:fab { + lid = 16 + li:objects { + } + color = {#222222} + group = 17 + ha:combining { + auto = 1 + } + } + } + } + ha:pixmaps { + } +} Index: work/bug_files/poly_selfi_bdale/CRASH1 =================================================================== --- work/bug_files/poly_selfi_bdale/CRASH1 (nonexistent) +++ work/bug_files/poly_selfi_bdale/CRASH1 (revision 34614) @@ -0,0 +1 @@ +movecursorto(41nm, 16nm); pastebuffer(clear); pastebuffer(addselected); pastebuffer(ToLayout, 36,35, nm); Index: work/bug_files/poly_selfi_bdale/NM.patch =================================================================== --- work/bug_files/poly_selfi_bdale/NM.patch (nonexistent) +++ work/bug_files/poly_selfi_bdale/NM.patch (revision 34614) @@ -0,0 +1,40 @@ +Index: polyarea.c +=================================================================== +--- polyarea.c (revision 32623) ++++ polyarea.c (working copy) +@@ -3074,21 +3074,21 @@ + } + while ((v = v->next) != pl); + rnd_fprintf(stderr, "scale 1 -1\n"); +- rnd_fprintf(stderr, "viewport %mm %mm - %mm %mm\n", minx, miny, maxx, maxy); ++ rnd_fprintf(stderr, "viewport %mI %mI - %mI %mI\n", minx-2, miny-2, maxx+2, maxy+2); + rnd_fprintf(stderr, "frame\n"); + v = pl; + do { + n = v->next; +- rnd_fprintf(stderr, "line %#mm %#mm %#mm %#mm\n", v->point[0], v->point[1], n->point[0], n->point[1]); ++ rnd_fprintf(stderr, "line %mI %mI %mI %mI\n", v->point[0], v->point[1], n->point[0], n->point[1]); + } + while ((v = v->next) != pl); + + if ((chk != NULL) && (chk->marks > 0)) { +- int n, MR=RND_MM_TO_COORD(0.05); ++ int n, MR=3; + fprintf(stderr, "color #770000\n"); + for(n = 0; n < chk->marks; n++) { +- rnd_fprintf(stderr, "line %#mm %#mm %#mm %#mm\n", chk->x[n]-MR, chk->y[n]-MR, chk->x[n]+MR, chk->y[n]+MR); +- rnd_fprintf(stderr, "line %#mm %#mm %#mm %#mm\n", chk->x[n]-MR, chk->y[n]+MR, chk->x[n]+MR, chk->y[n]-MR); ++ rnd_fprintf(stderr, "line %mI %mI %mI %mI\n", chk->x[n]-MR, chk->y[n]-MR, chk->x[n]+MR, chk->y[n]+MR); ++ rnd_fprintf(stderr, "line %mI %mI %mI %mI\n", chk->x[n]-MR, chk->y[n]+MR, chk->x[n]+MR, chk->y[n]-MR); + } + } + +@@ -3096,7 +3096,7 @@ + int n; + fprintf(stderr, "color #990000\n"); + for(n = 0; n < chk->lines; n++) +- rnd_fprintf(stderr, "line %#mm %#mm %#mm %#mm\n", chk->x1[n], chk->y1[n], chk->x2[n], chk->y2[n]); ++ rnd_fprintf(stderr, "line %mI %mI %mI %mI\n", chk->x1[n], chk->y1[n], chk->x2[n], chk->y2[n]); + } + + fprintf(stderr, "flush\n"); Index: work/bug_files/poly_selfi_bdale/README =================================================================== --- work/bug_files/poly_selfi_bdale/README (nonexistent) +++ work/bug_files/poly_selfi_bdale/README (revision 34614) @@ -0,0 +1,19 @@ +poly clipping bug when clearance cutouts are +-1 nm + +to reproduce: + +1. patch librnd with NM.patch and zoom.patch + +2. run pcb-rnd in gui mode on A.lht + +3. zoom out so the whole board is visible + +4. execute the action from CRASH1, which will grab the selected right side + padstack by its top left corner and place it so that its clearance cuts + into the existing clearances. + +The result is self intersecting clearance, see nano.png. + +Changing the clearance to 6nm removes the poly hair between the two padstacks +and the bug is gone. + Index: work/bug_files/poly_selfi_bdale/nano.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: work/bug_files/poly_selfi_bdale/nano.png =================================================================== --- work/bug_files/poly_selfi_bdale/nano.png (nonexistent) +++ work/bug_files/poly_selfi_bdale/nano.png (revision 34614) Property changes on: work/bug_files/poly_selfi_bdale/nano.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: work/bug_files/poly_selfi_bdale/zoom.patch =================================================================== --- work/bug_files/poly_selfi_bdale/zoom.patch (nonexistent) +++ work/bug_files/poly_selfi_bdale/zoom.patch (revision 34614) @@ -0,0 +1,13 @@ +Index: plugins/lib_gtk_common/ui_zoompan.c +=================================================================== +--- plugins/lib_gtk_common/ui_zoompan.c (revision 32623) ++++ plugins/lib_gtk_common/ui_zoompan.c (working copy) +@@ -38,7 +38,7 @@ + { + double min_zoom, max_zoom, max_zoom_w, max_zoom_h, out_zoom; + +- min_zoom = 200; ++ min_zoom = 0.02; + + /* max zoom is calculated so that zoom * canvas_size * 2 doesn't overflow rnd_coord_t */ + max_zoom_w = (double)RND_COORD_MAX / (double)vw->canvas_width;