2009-09-13 12:58:30 +03:00
|
|
|
/*
|
|
|
|
* overlap.c - Test for overlaps
|
|
|
|
*
|
2010-04-25 16:09:36 +03:00
|
|
|
* Written 2009, 2010 by Werner Almesberger
|
|
|
|
* Copyright 2009, 2010 by Werner Almesberger
|
2009-09-13 12:58:30 +03:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2010-04-25 16:09:36 +03:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2009-09-13 12:58:30 +03:00
|
|
|
#include "coord.h"
|
|
|
|
#include "obj.h"
|
|
|
|
#include "inst.h"
|
|
|
|
#include "overlap.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2010-04-25 16:09:36 +03:00
|
|
|
* @@@ result may be too optimistic if "b" is a rounded pad
|
2009-09-13 12:58:30 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
int inside(const struct inst *a, const struct inst *b)
|
|
|
|
{
|
|
|
|
struct coord min_a, max_a;
|
|
|
|
struct coord min_b, max_b;
|
|
|
|
|
|
|
|
min_a = a->base;
|
2010-04-25 16:09:36 +03:00
|
|
|
switch (a->obj->type) {
|
|
|
|
case ot_pad:
|
|
|
|
max_a = a->u.pad.other;
|
|
|
|
break;
|
|
|
|
case ot_hole:
|
|
|
|
max_a = a->u.hole.other;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
abort();
|
|
|
|
}
|
2009-09-13 12:58:30 +03:00
|
|
|
sort_coord(&min_a, &max_a);
|
2012-05-28 09:11:15 +03:00
|
|
|
|
2009-09-13 12:58:30 +03:00
|
|
|
min_b = b->base;
|
2010-04-25 16:09:36 +03:00
|
|
|
switch (b->obj->type) {
|
|
|
|
case ot_pad:
|
|
|
|
max_b = b->u.pad.other;
|
|
|
|
break;
|
|
|
|
case ot_hole:
|
|
|
|
max_b = b->u.hole.other;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
abort();
|
|
|
|
}
|
2009-09-13 12:58:30 +03:00
|
|
|
sort_coord(&min_b, &max_b);
|
|
|
|
|
|
|
|
return min_a.x >= min_b.x && max_a.x <= max_b.x &&
|
|
|
|
min_a.y >= min_b.y && max_a.y <= max_b.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* ----- Overlap test for primitives --------------------------------------- */
|
|
|
|
|
|
|
|
|
|
|
|
struct shape {
|
|
|
|
int circle;
|
|
|
|
struct coord center;
|
|
|
|
unit_type r;
|
|
|
|
struct coord min, max;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static int circle_circle_overlap(struct coord c1, unit_type r1,
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
struct coord c2, unit_type r2, enum allow_overlap allow)
|
2009-09-13 12:58:30 +03:00
|
|
|
{
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
if (allow == ao_touch)
|
|
|
|
return dist_point(c1, c2) < r1+r2;
|
2009-09-13 12:58:30 +03:00
|
|
|
return dist_point(c1, c2) <= r1+r2;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int circle_rect_overlap(struct coord c, unit_type r,
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
struct coord min, struct coord max, enum allow_overlap allow)
|
2009-09-13 12:58:30 +03:00
|
|
|
{
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
if (allow == ao_touch) {
|
|
|
|
if (c.x <= min.x-r || c.x >= max.x+r)
|
|
|
|
return 0;
|
|
|
|
if (c.y <= min.y-r || c.y >= max.y+r)
|
|
|
|
return 0;
|
|
|
|
}
|
2009-09-13 12:58:30 +03:00
|
|
|
if (c.x < min.x-r || c.x > max.x+r)
|
|
|
|
return 0;
|
|
|
|
if (c.y < min.y-r || c.y > max.y+r)
|
|
|
|
return 0;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int rect_rect_overlap(struct coord min1, struct coord max1,
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
struct coord min2, struct coord max2, enum allow_overlap allow)
|
2009-09-13 12:58:30 +03:00
|
|
|
{
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
if (allow == ao_touch) {
|
|
|
|
if (max1.x <= min2.x || max2.x <= min1.x)
|
|
|
|
return 0;
|
|
|
|
if (max1.y <= min2.y || max2.y <= min1.y)
|
|
|
|
return 0;
|
|
|
|
}
|
2009-09-13 12:58:30 +03:00
|
|
|
if (max1.x < min2.x || max2.x < min1.x)
|
|
|
|
return 0;
|
|
|
|
if (max1.y < min2.y || max2.y < min1.y)
|
|
|
|
return 0;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
static int shapes_overlap(const struct shape *a, const struct shape *b,
|
|
|
|
enum allow_overlap allow)
|
2009-09-13 12:58:30 +03:00
|
|
|
{
|
|
|
|
if (a->circle && !b->circle)
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
return shapes_overlap(b, a, allow);
|
2009-09-13 12:58:30 +03:00
|
|
|
if (a->circle) /* b must be circle, too */
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
return circle_circle_overlap(a->center, a->r, b->center, b->r,
|
|
|
|
allow);
|
2009-09-13 12:58:30 +03:00
|
|
|
if (b->circle) /* a must be rect */
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
return circle_rect_overlap(b->center, b->r, a->min, a->max,
|
|
|
|
allow);
|
|
|
|
return rect_rect_overlap(a->min, a->max, b->min, b->max, allow);
|
2009-09-13 12:58:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* ----- Recursive overlap tester ------------------------------------------ */
|
|
|
|
|
|
|
|
|
|
|
|
static int test_overlap(const struct inst *a, const struct inst *b,
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
const struct shape *other, enum allow_overlap allow);
|
2009-09-13 12:58:30 +03:00
|
|
|
|
|
|
|
|
|
|
|
static int do_circle(const struct inst *next, const struct shape *other,
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
unit_type x, unit_type y, unit_type r, enum allow_overlap allow)
|
2009-09-13 12:58:30 +03:00
|
|
|
{
|
|
|
|
struct shape shape = {
|
|
|
|
.circle = 1,
|
|
|
|
.center = {
|
|
|
|
.x = x,
|
|
|
|
.y = y,
|
|
|
|
},
|
|
|
|
.r = r,
|
|
|
|
};
|
|
|
|
|
|
|
|
if (next)
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
return test_overlap(next, NULL, &shape, allow);
|
|
|
|
return shapes_overlap(other, &shape, allow);
|
2009-09-13 12:58:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int do_rect(const struct inst *next, const struct shape *other,
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
unit_type x, unit_type y, unit_type w, unit_type h,
|
|
|
|
enum allow_overlap allow)
|
2009-09-13 12:58:30 +03:00
|
|
|
{
|
|
|
|
struct shape shape = {
|
|
|
|
.circle = 0,
|
|
|
|
.min = {
|
|
|
|
.x = x,
|
|
|
|
.y = y,
|
|
|
|
},
|
|
|
|
.max = {
|
|
|
|
.x = x+w,
|
2009-09-13 14:11:03 +03:00
|
|
|
.y = y+h,
|
2009-09-13 12:58:30 +03:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
if (next)
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
return test_overlap(next, NULL, &shape, allow);
|
|
|
|
return shapes_overlap(other, &shape, allow);
|
2009-09-13 12:58:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int test_overlap(const struct inst *a, const struct inst *b,
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
const struct shape *other, enum allow_overlap allow)
|
2009-09-13 12:58:30 +03:00
|
|
|
{
|
|
|
|
struct coord min, max;
|
|
|
|
unit_type h, w, r;
|
2010-04-25 16:09:36 +03:00
|
|
|
int rounded;
|
2009-09-13 12:58:30 +03:00
|
|
|
|
|
|
|
min = a->base;
|
2010-04-25 16:09:36 +03:00
|
|
|
switch (a->obj->type) {
|
|
|
|
case ot_pad:
|
|
|
|
max = a->u.pad.other;
|
|
|
|
rounded = a->obj->u.pad.rounded;
|
|
|
|
break;
|
|
|
|
case ot_hole:
|
|
|
|
max = a->u.hole.other;
|
|
|
|
rounded = 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
abort();
|
|
|
|
}
|
2009-09-13 12:58:30 +03:00
|
|
|
sort_coord(&min, &max);
|
|
|
|
|
|
|
|
h = max.y-min.y;
|
|
|
|
w = max.x-min.x;
|
|
|
|
|
2010-04-25 16:09:36 +03:00
|
|
|
if (!rounded)
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
return do_rect(b, other, min.x, min.y, w, h, allow);
|
2009-09-13 12:58:30 +03:00
|
|
|
|
|
|
|
if (h > w) {
|
|
|
|
r = w/2;
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
return do_circle(b, other, min.x+r, max.y-r, r, allow) ||
|
|
|
|
do_rect(b, other, min.x, min.y+r, w, h-2*r, allow) ||
|
|
|
|
do_circle(b, other, min.x+r, min.y+r, r, allow);
|
2009-09-13 12:58:30 +03:00
|
|
|
} else {
|
|
|
|
r = h/2;
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
return do_circle(b, other, min.x+r, min.y+r, r, allow) ||
|
|
|
|
do_rect(b, other, min.x+r, min.y, w-2*r, h, allow) ||
|
|
|
|
do_circle(b, other, max.x-r, min.y+r, r, allow);
|
2009-09-13 12:58:30 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
int overlap(const struct inst *a, const struct inst *b,
|
|
|
|
enum allow_overlap allow)
|
2009-09-13 12:58:30 +03:00
|
|
|
{
|
Added relaxation of pad overlap checking. Not GUI-settable yet.
- README, fpd.l, fpd.y: added directives "allow touch" and "allow overlap" to
make overlap checking more permissive
- dump.c (dump_allow, dump): generate "allow" directive
- obj.h, obj.c (allow_overlap): added global variable for strictness of overlap
checking
- overlap.h, overlap.c (overlap, ...), layer.h, layer.c (refine_layers):
strictness of overlap checking is passed as an argument
- hole.c (check_through_hole), layer.h, layer.c (refine_copper), obj.c
(instantiate): updated callers of "overlap" to provide "allow" argument
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5974 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-08-09 07:16:37 +03:00
|
|
|
if (allow == ao_any)
|
|
|
|
return 0;
|
|
|
|
return test_overlap(a, b, NULL, allow);
|
2009-09-13 12:58:30 +03:00
|
|
|
}
|