Index: trunk/src/polygon1.c =================================================================== --- trunk/src/polygon1.c (revision 29282) +++ trunk/src/polygon1.c (nonexistent) @@ -1,3612 +0,0 @@ -/* - polygon clipping functions. harry eaton implemented the algorithm - described in "A Closed Set of Algorithms for Performing Set - Operations on Polygonal Regions in the Plane" which the original - code did not do. I also modified it for integer coordinates - and faster computation. The license for this modified copy was - switched to the GPL per term (3) of the original LGPL license. - Copyright (C) 2006 harry eaton - - based on: - poly_Boolean: a polygon clip library - Copyright (C) 1997 Alexey Nikitin, Michael Leonov - (also the authors of the paper describing the actual algorithm) - leonov@propro.iis.nsk.su - - in turn based on: - nclip: a polygon clip library - Copyright (C) 1993 Klamer Schutte - - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - polygon1.c - (C) 1997 Alexey Nikitin, Michael Leonov - (C) 1993 Klamer Schutte - - all cases where original (Klamer Schutte) code is present - are marked -*/ - -#include -#include -#include -#include -#include - -#include "config.h" -#include "rtree.h" -#include -#include -#include -#include -#include "polyarea.h" -#include "obj_common.h" -#include "macro.h" -#include -#include "rtree2_compat.h" - - -#define ROUND(a) (long)((a) > 0 ? ((a) + 0.5) : ((a) - 0.5)) - -#define EPSILON (1E-8) -#define IsZero(a, b) (fabs((a) - (b)) < EPSILON) - -#undef min -#undef max -#define min(x, y) ((x) < (y) ? (x) : (y)) -#define max(x, y) ((x) > (y) ? (x) : (y)) - -/*********************************************************************/ -/* L o n g V e c t o r S t u f f */ -/*********************************************************************/ - -#define Vcopy(a,b) {(a)[0]=(b)[0];(a)[1]=(b)[1];} -int vect_equal(pcb_vector_t v1, pcb_vector_t v2); -void vect_init(pcb_vector_t v, double x, double y); -void vect_sub(pcb_vector_t res, pcb_vector_t v2, pcb_vector_t v3); - -void vect_min(pcb_vector_t res, pcb_vector_t v2, pcb_vector_t v3); -void vect_max(pcb_vector_t res, pcb_vector_t v2, pcb_vector_t v3); - -double pcb_vect_dist2(pcb_vector_t v1, pcb_vector_t v2); -double pcb_vect_det2(pcb_vector_t v1, pcb_vector_t v2); -double pcb_vect_len2(pcb_vector_t v1); - -int pcb_vect_inters2(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D, pcb_vector_t S1, pcb_vector_t S2); - -/* note that a vertex v's Flags.status represents the edge defined by - * v to v->next (i.e. the edge is forward of v) - */ -#define ISECTED 3 -#define UNKNWN 0 -#define INSIDE 1 -#define OUTSIDE 2 -#define SHARED 3 -#define SHARED2 4 - -#define TOUCHES 99 - -#define NODE_LABEL(n) ((n)->Flags.status) -#define LABEL_NODE(n,l) ((n)->Flags.status = (l)) - -#define error(code) longjmp(*(e), code) - -#define MemGet(ptr, type) \ - if (PCB_UNLIKELY(((ptr) = (type *)malloc(sizeof(type))) == NULL)) \ - error(pcb_err_no_memory); - -#undef DEBUG_LABEL -#undef DEBUG_ALL_LABELS -#undef DEBUG_JUMP -#undef DEBUG_GATHER -#undef DEBUG_ANGLE -#undef DEBUG - -#ifndef NDEBUG -#include -PCB_INLINE void DEBUGP(const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - pcb_vfprintf(stderr, fmt, ap); - va_end(ap); -} -#else -PCB_INLINE void DEBUGP(const char *fmt, ...) { } -#endif - -/* ///////////////////////////////////////////////////////////////////////////// * / -/ * 2-Dimensional stuff -/ * ///////////////////////////////////////////////////////////////////////////// */ - -#define Vsub2(r,a,b) {(r)[0] = (a)[0] - (b)[0]; (r)[1] = (a)[1] - (b)[1];} -#define Vadd2(r,a,b) {(r)[0] = (a)[0] + (b)[0]; (r)[1] = (a)[1] + (b)[1];} -#define Vsca2(r,a,s) {(r)[0] = (a)[0] * (s); (r)[1] = (a)[1] * (s);} -#define Vcpy2(r,a) {(r)[0] = (a)[0]; (r)[1] = (a)[1];} -#define Vequ2(a,b) ((a)[0] == (b)[0] && (a)[1] == (b)[1]) -#define Vadds(r,a,b,s) {(r)[0] = ((a)[0] + (b)[0]) * (s); (r)[1] = ((a)[1] + (b)[1]) * (s);} -#define Vswp2(a,b) { long t; \ - t = (a)[0], (a)[0] = (b)[0], (b)[0] = t; \ - t = (a)[1], (a)[1] = (b)[1], (b)[1] = t; \ -} - -#ifdef DEBUG -static char *theState(pcb_vnode_t * v); - -static void pline_dump(pcb_vnode_t * v) -{ - pcb_vnode_t *s, *n; - - s = v; - do { - n = v->next; - pcb_fprintf(stderr, "Line [%#mS %#mS %#mS %#mS 10 10 \"%s\"]\n", - v->point[0], v->point[1], n->point[0], n->point[1], theState(v)); - } - while ((v = v->next) != s); -} - -static void poly_dump(pcb_polyarea_t * p) -{ - pcb_polyarea_t *f = p; - pcb_pline_t *pl; - - do { - pl = p->contours; - do { - pline_dump(pl->head); - fprintf(stderr, "NEXT pcb_pline_t\n"); - } - while ((pl = pl->next) != NULL); - fprintf(stderr, "NEXT POLY\n"); - } - while ((p = p->f) != f); -} -#endif - -/***************************************************************/ -/* routines for processing intersections */ - -/* -node_add - (C) 1993 Klamer Schutte - (C) 1997 Alexey Nikitin, Michael Leonov - (C) 2006 harry eaton - - returns a bit field in new_point that indicates where the - point was. - 1 means a new node was created and inserted - 4 means the intersection was not on the dest point -*/ -static pcb_vnode_t *node_add_single(pcb_vnode_t * dest, pcb_vector_t po) -{ - pcb_vnode_t *p; - - if (vect_equal(po, dest->point)) - return dest; - if (vect_equal(po, dest->next->point)) - return dest->next; - p = pcb_poly_node_create(po); - if (p == NULL) - return NULL; - p->cvc_prev = p->cvc_next = NULL; - p->Flags.status = UNKNWN; - return p; -} /* node_add */ - -#define ISECT_BAD_PARAM (-1) -#define ISECT_NO_MEMORY (-2) - - -/* -new_descriptor - (C) 2006 harry eaton -*/ -static pcb_cvc_list_t *new_descriptor(pcb_vnode_t * a, char poly, char side) -{ - pcb_cvc_list_t *l = (pcb_cvc_list_t *) malloc(sizeof(pcb_cvc_list_t)); - pcb_vector_t v; - register double ang, dx, dy; - - if (!l) - return NULL; - l->head = NULL; - l->parent = a; - l->poly = poly; - l->side = side; - l->next = l->prev = l; - if (side == 'P') /* previous */ - vect_sub(v, a->prev->point, a->point); - else /* next */ - vect_sub(v, a->next->point, a->point); - /* Uses slope/(slope+1) in quadrant 1 as a proxy for the angle. - * It still has the same monotonic sort result - * and is far less expensive to compute than the real angle. - */ - if (vect_equal(v, vect_zero)) { - if (side == 'P') { - if (a->prev->cvc_prev == (pcb_cvc_list_t *) - 1) - a->prev->cvc_prev = a->prev->cvc_next = NULL; - pcb_poly_vertex_exclude(NULL, a->prev); - vect_sub(v, a->prev->point, a->point); - } - else { - if (a->next->cvc_prev == (pcb_cvc_list_t *) - 1) - a->next->cvc_prev = a->next->cvc_next = NULL; - pcb_poly_vertex_exclude(NULL, a->next); - vect_sub(v, a->next->point, a->point); - } - } - assert(!vect_equal(v, vect_zero)); - dx = fabs((double) v[0]); - dy = fabs((double) v[1]); - ang = dy / (dy + dx); - /* now move to the actual quadrant */ - if (v[0] < 0 && v[1] >= 0) - ang = 2.0 - ang; /* 2nd quadrant */ - else if (v[0] < 0 && v[1] < 0) - ang += 2.0; /* 3rd quadrant */ - else if (v[0] >= 0 && v[1] < 0) - ang = 4.0 - ang; /* 4th quadrant */ - l->angle = ang; - assert(ang >= 0.0 && ang <= 4.0); -#ifdef DEBUG_ANGLE - DEBUGP("node on %c at %#mD assigned angle %g on side %c\n", poly, a->point[0], a->point[1], ang, side); -#endif - return l; -} - -/* -insert_descriptor - (C) 2006 harry eaton - - argument a is a cross-vertex node. - argument poly is the polygon it comes from ('A' or 'B') - argument side is the side this descriptor goes on ('P' for previous - 'N' for next. - argument start is the head of the list of cvclists -*/ -static pcb_cvc_list_t *insert_descriptor(pcb_vnode_t * a, char poly, char side, pcb_cvc_list_t * start) -{ - pcb_cvc_list_t *l, *newone, *big, *small; - - if (!(newone = new_descriptor(a, poly, side))) - return NULL; - /* search for the pcb_cvc_list_t for this point */ - if (!start) { - start = newone; /* return is also new, so we know where start is */ - start->head = newone; /* circular list */ - return newone; - } - else { - l = start; - do { - assert(l->head); - if (l->parent->point[0] == a->point[0] - && l->parent->point[1] == a->point[1]) { /* this pcb_cvc_list_t is at our point */ - start = l; - newone->head = l->head; - break; - } - if (l->head->parent->point[0] == start->parent->point[0] - && l->head->parent->point[1] == start->parent->point[1]) { - /* this seems to be a new point */ - /* link this cvclist to the list of all cvclists */ - for (; l->head != newone; l = l->next) - l->head = newone; - newone->head = start; - return newone; - } - l = l->head; - } - while (1); - } - assert(start); - l = big = small = start; - do { - if (l->next->angle < l->angle) { /* find start/end of list */ - small = l->next; - big = l; - } - else if (newone->angle >= l->angle && newone->angle <= l->next->angle) { - /* insert new cvc if it lies between existing points */ - newone->prev = l; - newone->next = l->next; - l->next = l->next->prev = newone; - return newone; - } - } - while ((l = l->next) != start); - /* didn't find it between points, it must go on an end */ - if (big->angle <= newone->angle) { - newone->prev = big; - newone->next = big->next; - big->next = big->next->prev = newone; - return newone; - } - assert(small->angle >= newone->angle); - newone->next = small; - newone->prev = small->prev; - small->prev = small->prev->next = newone; - return newone; -} - -/* -node_add_point - (C) 1993 Klamer Schutte - (C) 1997 Alexey Nikitin, Michael Leonov - - return 1 if new node in b, 2 if new node in a and 3 if new node in both -*/ - -static pcb_vnode_t *node_add_single_point(pcb_vnode_t * a, pcb_vector_t p) -{ - pcb_vnode_t *next_a, *new_node; - - next_a = a->next; - - new_node = node_add_single(a, p); - assert(new_node != NULL); - - new_node->cvc_prev = new_node->cvc_next = (pcb_cvc_list_t *) - 1; - - if (new_node == a || new_node == next_a) - return NULL; - - return new_node; -} /* node_add_point */ - -/* -node_label - (C) 2006 harry eaton -*/ -static unsigned int node_label(pcb_vnode_t * pn) -{ - pcb_cvc_list_t *first_l, *l; - char this_poly; - int region = UNKNWN; - - assert(pn); - assert(pn->cvc_next); - this_poly = pn->cvc_next->poly; - /* search counter-clockwise in the cross vertex connectivity (CVC) list - * - * check for shared edges (that could be prev or next in the list since the angles are equal) - * and check if this edge (pn -> pn->next) is found between the other poly's entry and exit - */ - if (pn->cvc_next->angle == pn->cvc_next->prev->angle) - l = pn->cvc_next->prev; - else - l = pn->cvc_next->next; - - first_l = l; - while ((l->poly == this_poly) && (l != first_l->prev)) - l = l->next; - assert(l->poly != this_poly); - - assert(l && l->angle >= 0 && l->angle <= 4.0); - if (l->poly != this_poly) { - if (l->side == 'P') { - if (l->parent->prev->point[0] == pn->next->point[0] && l->parent->prev->point[1] == pn->next->point[1]) { - region = SHARED2; - pn->shared = l->parent->prev; - } - else - region = INSIDE; - } - else { - if (l->angle == pn->cvc_next->angle) { - assert(l->parent->next->point[0] == pn->next->point[0] && l->parent->next->point[1] == pn->next->point[1]); - region = SHARED; - pn->shared = l->parent; - } - else - region = OUTSIDE; - } - } - if (region == UNKNWN) { - for (l = l->next; l != pn->cvc_next; l = l->next) { - if (l->poly != this_poly) { - if (l->side == 'P') - region = INSIDE; - else - region = OUTSIDE; - break; - } - } - } - assert(region != UNKNWN); - assert(NODE_LABEL(pn) == UNKNWN || NODE_LABEL(pn) == region); - LABEL_NODE(pn, region); - if (region == SHARED || region == SHARED2) - return UNKNWN; - return region; -} /* node_label */ - -/* - add_descriptors - (C) 2006 harry eaton -*/ -static pcb_cvc_list_t *add_descriptors(pcb_pline_t * pl, char poly, pcb_cvc_list_t * list) -{ - pcb_vnode_t *node = pl->head; - - do { - if (node->cvc_prev) { - assert(node->cvc_prev == (pcb_cvc_list_t *) - 1 && node->cvc_next == (pcb_cvc_list_t *) - 1); - list = node->cvc_prev = insert_descriptor(node, poly, 'P', list); - if (!node->cvc_prev) - return NULL; - list = node->cvc_next = insert_descriptor(node, poly, 'N', list); - if (!node->cvc_next) - return NULL; - } - } - while ((node = node->next) != pl->head); - return list; -} - -static inline void cntrbox_adjust(pcb_pline_t * c, const pcb_vector_t p) -{ - c->xmin = min(c->xmin, p[0]); - c->xmax = max(c->xmax, p[0] + 1); - c->ymin = min(c->ymin, p[1]); - c->ymax = max(c->ymax, p[1] + 1); -} - -/* some structures for handling segment intersections using the rtrees */ - -typedef struct seg { - pcb_box_t box; - pcb_vnode_t *v; - pcb_pline_t *p; - int intersected; -} seg; - -typedef struct _insert_node_task insert_node_task; - -struct _insert_node_task { - insert_node_task *next; - seg *node_seg; - pcb_vnode_t *new_node; -}; - -typedef struct info { - double m, b; - pcb_rtree_t *tree; - pcb_vnode_t *v; - struct seg *s; - jmp_buf *env, sego, *touch; - int need_restart; - insert_node_task *node_insert_list; -} info; - -typedef struct contour_info { - pcb_pline_t *pa; - jmp_buf restart; - jmp_buf *getout; - int need_restart; - insert_node_task *node_insert_list; -} contour_info; - - -/* - * adjust_tree() - * (C) 2006 harry eaton - * This replaces the segment in the tree with the two new segments after - * a vertex has been added - */ -static int adjust_tree(pcb_rtree_t * tree, struct seg *s) -{ - struct seg *q; - - q = (seg *) malloc(sizeof(struct seg)); - if (!q) - return 1; - q->intersected = 0; - q->v = s->v; - q->p = s->p; - q->box.X1 = min(q->v->point[0], q->v->next->point[0]); - q->box.X2 = max(q->v->point[0], q->v->next->point[0]) + 1; - q->box.Y1 = min(q->v->point[1], q->v->next->point[1]); - q->box.Y2 = max(q->v->point[1], q->v->next->point[1]) + 1; - pcb_r_insert_entry(tree, (const pcb_box_t *) q); - q = (seg *) malloc(sizeof(struct seg)); - if (!q) - return 1; - q->intersected = 0; - q->v = s->v->next; - q->p = s->p; - q->box.X1 = min(q->v->point[0], q->v->next->point[0]); - q->box.X2 = max(q->v->point[0], q->v->next->point[0]) + 1; - q->box.Y1 = min(q->v->point[1], q->v->next->point[1]); - q->box.Y2 = max(q->v->point[1], q->v->next->point[1]) + 1; - pcb_r_insert_entry(tree, (const pcb_box_t *) q); - pcb_r_delete_entry(tree, (const pcb_box_t *) s); - free(s); - return 0; -} - -/* - * seg_in_region() - * (C) 2006, harry eaton - * This prunes the search for boxes that don't intersect the segment. - */ -static pcb_r_dir_t seg_in_region(const pcb_box_t * b, void *cl) -{ - struct info *i = (struct info *) cl; - double y1, y2; - /* for zero slope the search is aligned on the axis so it is already pruned */ - if (i->m == 0.) - return PCB_R_DIR_FOUND_CONTINUE; - y1 = i->m * b->X1 + i->b; - y2 = i->m * b->X2 + i->b; - if (min(y1, y2) >= b->Y2) - return PCB_R_DIR_NOT_FOUND; - if (max(y1, y2) < b->Y1) - return PCB_R_DIR_NOT_FOUND; - return PCB_R_DIR_FOUND_CONTINUE; /* might intersect */ -} - -/* Prepend a deferred node-insertion task to a list */ -static insert_node_task *prepend_insert_node_task(insert_node_task * list, seg * seg, pcb_vnode_t * new_node) -{ - insert_node_task *task = (insert_node_task *) malloc(sizeof(*task)); - task->node_seg = seg; - task->new_node = new_node; - task->next = list; - return task; -} - -/* - * seg_in_seg() - * (C) 2006 harry eaton - * This routine checks if the segment in the tree intersect the search segment. - * If it does, the plines are marked as intersected and the point is marked for - * the cvclist. If the point is not already a vertex, a new vertex is inserted - * and the search for intersections starts over at the beginning. - * That is potentially a significant time penalty, but it does solve the snap rounding - * problem. There are efficient algorithms for finding intersections with snap - * rounding, but I don't have time to implement them right now. - */ -static pcb_r_dir_t seg_in_seg(const pcb_box_t * b, void *cl) -{ - struct info *i = (struct info *) cl; - struct seg *s = (struct seg *) b; - pcb_vector_t s1, s2; - int cnt; - pcb_vnode_t *new_node; - - /* When new nodes are added at the end of a pass due to an intersection - * the segments may be altered. If either segment we're looking at has - * already been intersected this pass, skip it until the next pass. - */ - if (s->intersected || i->s->intersected) - return PCB_R_DIR_NOT_FOUND; - - cnt = pcb_vect_inters2(s->v->point, s->v->next->point, i->v->point, i->v->next->point, s1, s2); - if (!cnt) - return PCB_R_DIR_NOT_FOUND; - if (i->touch) /* if checking touches one find and we're done */ - longjmp(*i->touch, TOUCHES); - i->s->p->Flags.status = ISECTED; - s->p->Flags.status = ISECTED; - for (; cnt; cnt--) { - pcb_bool done_insert_on_i = pcb_false; - new_node = node_add_single_point(i->v, cnt > 1 ? s2 : s1); - if (new_node != NULL) { -#ifdef DEBUG_INTERSECT - DEBUGP("new intersection on segment \"i\" at %#mD\n", cnt > 1 ? s2[0] : s1[0], cnt > 1 ? s2[1] : s1[1]); -#endif - i->node_insert_list = prepend_insert_node_task(i->node_insert_list, i->s, new_node); - i->s->intersected = 1; - done_insert_on_i = pcb_true; - } - new_node = node_add_single_point(s->v, cnt > 1 ? s2 : s1); - if (new_node != NULL) { -#ifdef DEBUG_INTERSECT - DEBUGP("new intersection on segment \"s\" at %#mD\n", cnt > 1 ? s2[0] : s1[0], cnt > 1 ? s2[1] : s1[1]); -#endif - i->node_insert_list = prepend_insert_node_task(i->node_insert_list, s, new_node); - s->intersected = 1; - return PCB_R_DIR_NOT_FOUND; /* Keep looking for intersections with segment "i" */ - } - /* Skip any remaining r_search hits against segment i, as any further - * intersections will be rejected until the next pass anyway. - */ - if (done_insert_on_i) - longjmp(*i->env, 1); - } - return PCB_R_DIR_NOT_FOUND; -} - -void *pcb_poly_make_edge_tree(pcb_pline_t *pb) -{ - struct seg *s; - pcb_vnode_t *bv; - pcb_rtree_t *ans = pcb_r_create_tree(); - bv = pb->head; - do { - s = (seg *) malloc(sizeof(struct seg)); - s->intersected = 0; - if (bv->point[0] < bv->next->point[0]) { - s->box.X1 = bv->point[0]; - s->box.X2 = bv->next->point[0] + 1; - } - else { - s->box.X2 = bv->point[0] + 1; - s->box.X1 = bv->next->point[0]; - } - if (bv->point[1] < bv->next->point[1]) { - s->box.Y1 = bv->point[1]; - s->box.Y2 = bv->next->point[1] + 1; - } - else { - s->box.Y2 = bv->point[1] + 1; - s->box.Y1 = bv->next->point[1]; - } - s->v = bv; - s->p = pb; - pcb_r_insert_entry(ans, (const pcb_box_t *) s); - } - while ((bv = bv->next) != pb->head); - return (void *) ans; -} - -static pcb_r_dir_t get_seg(const pcb_box_t * b, void *cl) -{ - struct info *i = (struct info *) cl; - struct seg *s = (struct seg *) b; - if (i->v == s->v) { - i->s = s; - return PCB_R_DIR_CANCEL; /* found */ - } - return PCB_R_DIR_NOT_FOUND; -} - -/* - * intersect() (and helpers) - * (C) 2006, harry eaton - * This uses an rtree to find A-B intersections. Whenever a new vertex is - * added, the search for intersections is re-started because the rounding - * could alter the topology otherwise. - * This should use a faster algorithm for snap rounding intersection finding. - * The best algorithm is probably found in: - * - * "Improved output-sensitive snap rounding," John Hershberger, Proceedings - * of the 22nd annual symposium on Computational geometry, 2006, pp 357-366. - * http://doi.acm.org/10.1145/1137856.1137909 - * - * Algorithms described by de Berg, or Goodrich or Halperin, or Hobby would - * probably work as well. - * - */ - -static pcb_r_dir_t contour_bounds_touch(const pcb_box_t * b, void *cl) -{ - contour_info *c_info = (contour_info *) cl; - pcb_pline_t *pa = c_info->pa; - pcb_pline_t *pb = (pcb_pline_t *) b; - pcb_pline_t *rtree_over; - pcb_pline_t *looping_over; - pcb_vnode_t *av; /* node iterators */ - struct info info; - pcb_box_t box; - jmp_buf restart; - - /* Have seg_in_seg return to our desired location if it touches */ - info.env = &restart; - info.touch = c_info->getout; - info.need_restart = 0; - info.node_insert_list = c_info->node_insert_list; - - /* Pick which contour has the fewer points, and do the loop - * over that. The r_tree makes hit-testing against a contour - * faster, so we want to do that on the bigger contour. - */ - if (pa->Count < pb->Count) { - rtree_over = pb; - looping_over = pa; - } - else { - rtree_over = pa; - looping_over = pb; - } - - av = looping_over->head; - do { /* Loop over the nodes in the smaller contour */ - pcb_r_dir_t rres; - /* check this edge for any insertions */ - double dx; - info.v = av; - /* compute the slant for region trimming */ - dx = av->next->point[0] - av->point[0]; - if (dx == 0) - info.m = 0; - else { - info.m = (av->next->point[1] - av->point[1]) / dx; - info.b = av->point[1] - info.m * av->point[0]; - } - box.X2 = (box.X1 = av->point[0]) + 1; - box.Y2 = (box.Y1 = av->point[1]) + 1; - - /* fill in the segment in info corresponding to this node */ - rres = pcb_r_search(looping_over->tree, &box, NULL, get_seg, &info, NULL); - assert(rres == PCB_R_DIR_CANCEL); - - /* If we're going to have another pass anyway, skip this */ - if (info.s->intersected && info.node_insert_list != NULL) - continue; - - if (setjmp(restart)) - continue; - - /* NB: If this actually hits anything, we are teleported back to the beginning */ - info.tree = rtree_over->tree; - if (info.tree) { - int seen; - pcb_r_search(info.tree, &info.s->box, seg_in_region, seg_in_seg, &info, &seen); - if (PCB_UNLIKELY(seen)) - assert(0); /* XXX: Memory allocation failure */ - } - } - while ((av = av->next) != looping_over->head); - - c_info->node_insert_list = info.node_insert_list; - if (info.need_restart) - c_info->need_restart = 1; - return PCB_R_DIR_NOT_FOUND; -} - -static int intersect_impl(jmp_buf * jb, pcb_polyarea_t * b, pcb_polyarea_t * a, int add) -{ - pcb_polyarea_t *t; - pcb_pline_t *pa; - contour_info c_info; - int need_restart = 0; - insert_node_task *task; - c_info.need_restart = 0; - c_info.node_insert_list = NULL; - - /* Search the r-tree of the object with most contours - * We loop over the contours of "a". Swap if necessary. - */ - if (a->contour_tree->size > b->contour_tree->size) { - t = b; - b = a; - a = t; - } - - for (pa = a->contours; pa; pa = pa->next) { /* Loop over the contours of pcb_polyarea_t "a" */ - pcb_box_t sb; - jmp_buf out; - int retval; - - c_info.getout = NULL; - c_info.pa = pa; - - if (!add) { - retval = setjmp(out); - if (retval) { - /* The intersection test short-circuited back here, - * we need to clean up, then longjmp to jb */ - longjmp(*jb, retval); - } - c_info.getout = &out; - } - - sb.X1 = pa->xmin; - sb.Y1 = pa->ymin; - sb.X2 = pa->xmax + 1; - sb.Y2 = pa->ymax + 1; - - pcb_r_search(b->contour_tree, &sb, NULL, contour_bounds_touch, &c_info, NULL); - if (c_info.need_restart) - need_restart = 1; - } - - /* Process any deferred node insertions */ - task = c_info.node_insert_list; - while (task != NULL) { - insert_node_task *next = task->next; - - /* Do insertion */ - task->new_node->prev = task->node_seg->v; - task->new_node->next = task->node_seg->v->next; - task->node_seg->v->next->prev = task->new_node; - task->node_seg->v->next = task->new_node; - task->node_seg->p->Count++; - - cntrbox_adjust(task->node_seg->p, task->new_node->point); - if (adjust_tree(task->node_seg->p->tree, task->node_seg)) - assert(0); /* XXX: Memory allocation failure */ - - need_restart = 1; /* Any new nodes could intersect */ - - free(task); - task = next; - } - - return need_restart; -} - -static int intersect(jmp_buf * jb, pcb_polyarea_t * b, pcb_polyarea_t * a, int add) -{ - int call_count = 1; - while (intersect_impl(jb, b, a, add)) - call_count++; - return 0; -} - -static void M_pcb_polyarea_t_intersect(jmp_buf * e, pcb_polyarea_t * afst, pcb_polyarea_t * bfst, int add) -{ - pcb_polyarea_t *a = afst, *b = bfst; - pcb_pline_t *curcA, *curcB; - pcb_cvc_list_t *the_list = NULL; - - if (a == NULL || b == NULL) - error(pcb_err_bad_parm); - do { - do { - if (a->contours->xmax >= b->contours->xmin && - a->contours->ymax >= b->contours->ymin && - a->contours->xmin <= b->contours->xmax && a->contours->ymin <= b->contours->ymax) { - if (PCB_UNLIKELY(intersect(e, a, b, add))) - error(pcb_err_no_memory); - } - } - while (add && (a = a->f) != afst); - for (curcB = b->contours; curcB != NULL; curcB = curcB->next) - if (curcB->Flags.status == ISECTED) { - the_list = add_descriptors(curcB, 'B', the_list); - if (PCB_UNLIKELY(the_list == NULL)) - error(pcb_err_no_memory); - } - } - while (add && (b = b->f) != bfst); - do { - for (curcA = a->contours; curcA != NULL; curcA = curcA->next) - if (curcA->Flags.status == ISECTED) { - the_list = add_descriptors(curcA, 'A', the_list); - if (PCB_UNLIKELY(the_list == NULL)) - error(pcb_err_no_memory); - } - } - while (add && (a = a->f) != afst); -} /* M_pcb_polyarea_t_intersect */ - -static inline int cntrbox_inside(pcb_pline_t * c1, pcb_pline_t * c2) -{ - assert(c1 != NULL && c2 != NULL); - return ((c1->xmin >= c2->xmin) && (c1->ymin >= c2->ymin) && (c1->xmax <= c2->xmax) && (c1->ymax <= c2->ymax)); -} - -/*****************************************************************/ -/* Routines for making labels */ - -static pcb_r_dir_t count_contours_i_am_inside(const pcb_box_t * b, void *cl) -{ - pcb_pline_t *me = (pcb_pline_t *) cl; - pcb_pline_t *check = (pcb_pline_t *) b; - - if (pcb_poly_contour_in_contour(check, me)) - return PCB_R_DIR_FOUND_CONTINUE; - return PCB_R_DIR_NOT_FOUND; -} - -/* cntr_in_M_pcb_polyarea_t -returns poly is inside outfst ? pcb_true : pcb_false */ -static int cntr_in_M_pcb_polyarea_t(pcb_pline_t * poly, pcb_polyarea_t * outfst, pcb_bool test) -{ - pcb_polyarea_t *outer = outfst; - pcb_heap_t *heap; - - assert(poly != NULL); - assert(outer != NULL); - - heap = pcb_heap_create(); - do { - if (cntrbox_inside(poly, outer->contours)) - pcb_heap_insert(heap, outer->contours->area, (void *) outer); - } - /* if checking touching, use only the first polygon */ - while (!test && (outer = outer->f) != outfst); - /* we need only check the smallest poly container - * but we must loop in case the box container is not - * the poly container */ - do { - int cnt; - - if (pcb_heap_is_empty(heap)) - break; - outer = (pcb_polyarea_t *) pcb_heap_remove_smallest(heap); - - pcb_r_search(outer->contour_tree, (pcb_box_t *) poly, NULL, count_contours_i_am_inside, poly, &cnt); - switch (cnt) { - case 0: /* Didn't find anything in this piece, Keep looking */ - break; - case 1: /* Found we are inside this piece, and not any of its holes */ - pcb_heap_destroy(&heap); - return pcb_true; - case 2: /* Found inside a hole in the smallest polygon so far. No need to check the other polygons */ - pcb_heap_destroy(&heap); - return pcb_false; - default: - printf("Something strange here\n"); - break; - } - } - while (1); - pcb_heap_destroy(&heap); - return pcb_false; -} /* cntr_in_M_pcb_polyarea_t */ - -#ifdef DEBUG - -static char *theState(pcb_vnode_t * v) -{ - static char u[] = "UNKNOWN"; - static char i[] = "INSIDE"; - static char o[] = "OUTSIDE"; - static char s[] = "SHARED"; - static char s2[] = "SHARED2"; - - switch (NODE_LABEL(v)) { - case INSIDE: - return i; - case OUTSIDE: - return o; - case SHARED: - return s; - case SHARED2: - return s2; - default: - return u; - } -} - -#ifdef DEBUG_ALL_LABELS -static void print_labels(pcb_pline_t * a) -{ - pcb_vnode_t *c = a->head; - - do { - DEBUGP("%#mD->%#mD labeled %s\n", c->point[0], c->point[1], c->next->point[0], c->next->point[1], theState(c)); - } - while ((c = c->next) != a->head); -} -#endif -#endif - -/* -label_contour - (C) 2006 harry eaton - (C) 1993 Klamer Schutte - (C) 1997 Alexey Nikitin, Michael Leonov -*/ - -static pcb_bool label_contour(pcb_pline_t * a) -{ - pcb_vnode_t *cur = a->head; - pcb_vnode_t *first_labelled = NULL; - int label = UNKNWN; - - do { - if (cur->cvc_next) { /* examine cross vertex */ - label = node_label(cur); - if (first_labelled == NULL) - first_labelled = cur; - continue; - } - - if (first_labelled == NULL) - continue; - - /* This labels nodes which aren't cross-connected */ - assert(label == INSIDE || label == OUTSIDE); - LABEL_NODE(cur, label); - } - while ((cur = cur->next) != first_labelled); -#ifdef DEBUG_ALL_LABELS - print_labels(a); - DEBUGP("\n\n"); -#endif - return pcb_false; -} /* label_contour */ - -static pcb_bool cntr_label_pcb_polyarea_t(pcb_pline_t * poly, pcb_polyarea_t * ppl, pcb_bool test) -{ - assert(ppl != NULL && ppl->contours != NULL); - if (poly->Flags.status == ISECTED) { - label_contour(poly); /* should never get here when pcb_bool is pcb_true */ - } - else if (cntr_in_M_pcb_polyarea_t(poly, ppl, test)) { - if (test) - return pcb_true; - poly->Flags.status = INSIDE; - } - else { - if (test) - return pcb_false; - poly->Flags.status = OUTSIDE; - } - return pcb_false; -} /* cntr_label_pcb_polyarea_t */ - -static pcb_bool M_pcb_polyarea_t_label_separated(pcb_pline_t * afst, pcb_polyarea_t * b, pcb_bool touch) -{ - pcb_pline_t *curc = afst; - - for (curc = afst; curc != NULL; curc = curc->next) { - if (cntr_label_pcb_polyarea_t(curc, b, touch) && touch) - return pcb_true; - } - return pcb_false; -} - -static pcb_bool M_pcb_polyarea_t_label(pcb_polyarea_t * afst, pcb_polyarea_t * b, pcb_bool touch) -{ - pcb_polyarea_t *a = afst; - pcb_pline_t *curc; - - assert(a != NULL); - do { - for (curc = a->contours; curc != NULL; curc = curc->next) - if (cntr_label_pcb_polyarea_t(curc, b, touch)) { - if (touch) - return pcb_true; - } - } - while (!touch && (a = a->f) != afst); - return pcb_false; -} - -/****************************************************************/ - -/* routines for temporary storing resulting contours */ -static void InsCntr(jmp_buf * e, pcb_pline_t * c, pcb_polyarea_t ** dst) -{ - pcb_polyarea_t *newp; - - if (*dst == NULL) { - MemGet(*dst, pcb_polyarea_t); - (*dst)->f = (*dst)->b = *dst; - newp = *dst; - } - else { - MemGet(newp, pcb_polyarea_t); - newp->f = *dst; - newp->b = (*dst)->b; - newp->f->b = newp->b->f = newp; - } - newp->contours = c; - newp->contour_tree = pcb_r_create_tree(); - pcb_r_insert_entry(newp->contour_tree, (pcb_box_t *) c); - c->next = NULL; -} /* InsCntr */ - -static void -PutContour(jmp_buf * e, pcb_pline_t * cntr, pcb_polyarea_t ** contours, pcb_pline_t ** holes, - pcb_polyarea_t * owner, pcb_polyarea_t * parent, pcb_pline_t * parent_contour) -{ - assert(cntr != NULL); - assert(cntr->Count > 2); - cntr->next = NULL; - - if (cntr->Flags.orient == PCB_PLF_DIR) { - if (owner != NULL) - pcb_r_delete_entry(owner->contour_tree, (pcb_box_t *) cntr); - InsCntr(e, cntr, contours); - } - /* put hole into temporary list */ - else { - /* if we know this belongs inside the parent, put it there now */ - if (parent_contour) { - cntr->next = parent_contour->next; - parent_contour->next = cntr; - if (owner != parent) { - if (owner != NULL) - pcb_r_delete_entry(owner->contour_tree, (pcb_box_t *) cntr); - pcb_r_insert_entry(parent->contour_tree, (pcb_box_t *) cntr); - } - } - else { - cntr->next = *holes; - *holes = cntr; /* let cntr be 1st hole in list */ - /* We don't insert the holes into an r-tree, - * they just form a linked list */ - if (owner != NULL) - pcb_r_delete_entry(owner->contour_tree, (pcb_box_t *) cntr); - } - } -} /* PutContour */ - -static inline void remove_contour(pcb_polyarea_t * piece, pcb_pline_t * prev_contour, pcb_pline_t * contour, int remove_rtree_entry) -{ - if (piece->contours == contour) - piece->contours = contour->next; - else if (prev_contour != NULL) { - assert(prev_contour->next == contour); - prev_contour->next = contour->next; - } - - contour->next = NULL; - - if (remove_rtree_entry) - pcb_r_delete_entry(piece->contour_tree, (pcb_box_t *) contour); -} - -struct polyarea_info { - pcb_box_t BoundingBox; - pcb_polyarea_t *pa; -}; - -static pcb_r_dir_t heap_it(const pcb_box_t * b, void *cl) -{ - pcb_heap_t *heap = (pcb_heap_t *) cl; - struct polyarea_info *pa_info = (struct polyarea_info *) b; - pcb_pline_t *p = pa_info->pa->contours; - if (p->Count == 0) - return PCB_R_DIR_NOT_FOUND; /* how did this happen? */ - pcb_heap_insert(heap, p->area, pa_info); - return PCB_R_DIR_FOUND_CONTINUE; -} - -struct find_inside_info { - jmp_buf jb; - pcb_pline_t *want_inside; - pcb_pline_t *result; -}; - -static pcb_r_dir_t find_inside(const pcb_box_t * b, void *cl) -{ - struct find_inside_info *info = (struct find_inside_info *) cl; - pcb_pline_t *check = (pcb_pline_t *) b; - /* Do test on check to see if it inside info->want_inside */ - /* If it is: */ - if (check->Flags.orient == PCB_PLF_DIR) { - return PCB_R_DIR_NOT_FOUND; - } - if (pcb_poly_contour_in_contour(info->want_inside, check)) { - info->result = check; - longjmp(info->jb, 1); - } - return PCB_R_DIR_NOT_FOUND; -} - -void pcb_poly_insert_holes(jmp_buf * e, pcb_polyarea_t * dest, pcb_pline_t ** src) -{ - pcb_polyarea_t *curc; - pcb_pline_t *curh, *container; - pcb_heap_t *heap; - pcb_rtree_t *tree; - int i; - int num_polyareas = 0; - struct polyarea_info *all_pa_info, *pa_info; - - if (*src == NULL) - return; /* empty hole list */ - if (dest == NULL) - error(pcb_err_bad_parm); /* empty contour list */ - - /* Count dest polyareas */ - curc = dest; - do { - num_polyareas++; - } - while ((curc = curc->f) != dest); - - /* make a polyarea info table */ - /* make an rtree of polyarea info table */ - all_pa_info = (struct polyarea_info *) malloc(sizeof(struct polyarea_info) * num_polyareas); - tree = pcb_r_create_tree(); - i = 0; - curc = dest; - do { - all_pa_info[i].BoundingBox.X1 = curc->contours->xmin; - all_pa_info[i].BoundingBox.Y1 = curc->contours->ymin; - all_pa_info[i].BoundingBox.X2 = curc->contours->xmax; - all_pa_info[i].BoundingBox.Y2 = curc->contours->ymax; - all_pa_info[i].pa = curc; - pcb_r_insert_entry(tree, (const pcb_box_t *) &all_pa_info[i]); - i++; - } - while ((curc = curc->f) != dest); - - /* loop through the holes and put them where they belong */ - while ((curh = *src) != NULL) { - *src = curh->next; - - container = NULL; - /* build a heap of all of the polys that the hole is inside its bounding box */ - heap = pcb_heap_create(); - pcb_r_search(tree, (pcb_box_t *) curh, NULL, heap_it, heap, NULL); - if (pcb_heap_is_empty(heap)) { -#ifndef NDEBUG -#ifdef DEBUG - poly_dump(dest); -#endif -#endif - pcb_poly_contour_del(&curh); - error(pcb_err_bad_parm); - } - /* Now search the heap for the container. If there was only one item - * in the heap, assume it is the container without the expense of - * proving it. - */ - pa_info = (struct polyarea_info *) pcb_heap_remove_smallest(heap); - if (pcb_heap_is_empty(heap)) { /* only one possibility it must be the right one */ - assert(pcb_poly_contour_in_contour(pa_info->pa->contours, curh)); - container = pa_info->pa->contours; - } - else { - do { - if (pcb_poly_contour_in_contour(pa_info->pa->contours, curh)) { - container = pa_info->pa->contours; - break; - } - if (pcb_heap_is_empty(heap)) - break; - pa_info = (struct polyarea_info *) pcb_heap_remove_smallest(heap); - } - while (1); - } - pcb_heap_destroy(&heap); - if (container == NULL) { - /* bad input polygons were given */ -#ifndef NDEBUG -#ifdef DEBUG - poly_dump(dest); -#endif -#endif - curh->next = NULL; - pcb_poly_contour_del(&curh); - error(pcb_err_bad_parm); - } - else { - /* Need to check if this new hole means we need to kick out any old ones for reprocessing */ - while (1) { - struct find_inside_info info; - pcb_pline_t *prev; - - info.want_inside = curh; - - /* Set jump return */ - if (setjmp(info.jb)) { - /* Returned here! */ - } - else { - info.result = NULL; - /* Rtree search, calling back a routine to longjmp back with data about any hole inside the added one */ - /* Be sure not to bother jumping back to report the main contour! */ - pcb_r_search(pa_info->pa->contour_tree, (pcb_box_t *) curh, NULL, find_inside, &info, NULL); - - /* Nothing found? */ - break; - } - - /* We need to find the contour before it, so we can update its next pointer */ - prev = container; - while (prev->next != info.result) { - prev = prev->next; - } - - /* Remove hole from the contour */ - remove_contour(pa_info->pa, prev, info.result, pcb_true); - - /* Add hole as the next on the list to be processed in this very function */ - info.result->next = *src; - *src = info.result; - } - /* End check for kicked out holes */ - - /* link at front of hole list */ - curh->next = container->next; - container->next = curh; - pcb_r_insert_entry(pa_info->pa->contour_tree, (pcb_box_t *) curh); - - } - } - pcb_r_destroy_tree(&tree); - free(all_pa_info); -} /* pcb_poly_insert_holes */ - - -/****************************************************************/ -/* routines for collecting result */ - -typedef enum { - FORW, BACKW -} DIRECTION; - -/* Start Rule */ -typedef int (*S_Rule) (pcb_vnode_t *, DIRECTION *); - -/* Jump Rule */ -typedef int (*J_Rule) (char, pcb_vnode_t *, DIRECTION *); - -static int UniteS_Rule(pcb_vnode_t * cur, DIRECTION * initdir) -{ - *initdir = FORW; - return (NODE_LABEL(cur) == OUTSIDE) || (NODE_LABEL(cur) == SHARED); -} - -static int IsectS_Rule(pcb_vnode_t * cur, DIRECTION * initdir) -{ - *initdir = FORW; - return (NODE_LABEL(cur) == INSIDE) || (NODE_LABEL(cur) == SHARED); -} - -static int SubS_Rule(pcb_vnode_t * cur, DIRECTION * initdir) -{ - *initdir = FORW; - return (NODE_LABEL(cur) == OUTSIDE) || (NODE_LABEL(cur) == SHARED2); -} - -static int XorS_Rule(pcb_vnode_t * cur, DIRECTION * initdir) -{ - if (cur->Flags.status == INSIDE) { - *initdir = BACKW; - return pcb_true; - } - if (cur->Flags.status == OUTSIDE) { - *initdir = FORW; - return pcb_true; - } - return pcb_false; -} - -static int IsectJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir) -{ - assert(*cdir == FORW); - return (v->Flags.status == INSIDE || v->Flags.status == SHARED); -} - -static int UniteJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir) -{ - assert(*cdir == FORW); - return (v->Flags.status == OUTSIDE || v->Flags.status == SHARED); -} - -static int XorJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir) -{ - if (v->Flags.status == INSIDE) { - *cdir = BACKW; - return pcb_true; - } - if (v->Flags.status == OUTSIDE) { - *cdir = FORW; - return pcb_true; - } - return pcb_false; -} - -static int SubJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir) -{ - if (p == 'B' && v->Flags.status == INSIDE) { - *cdir = BACKW; - return pcb_true; - } - if (p == 'A' && v->Flags.status == OUTSIDE) { - *cdir = FORW; - return pcb_true; - } - if (v->Flags.status == SHARED2) { - if (p == 'A') - *cdir = FORW; - else - *cdir = BACKW; - return pcb_true; - } - return pcb_false; -} - -/* return the edge that comes next. - * if the direction is BACKW, then we return the next vertex - * so that prev vertex has the flags for the edge - * - * returns pcb_true if an edge is found, pcb_false otherwise - */ -static int jump(pcb_vnode_t ** cur, DIRECTION * cdir, J_Rule rule) -{ - pcb_cvc_list_t *d, *start; - pcb_vnode_t *e; - DIRECTION newone; - - if (!(*cur)->cvc_prev) { /* not a cross-vertex */ - if (*cdir == FORW ? (*cur)->Flags.mark : (*cur)->prev->Flags.mark) - return pcb_false; - return pcb_true; - } -#ifdef DEBUG_JUMP - DEBUGP("jump entering node at %$mD\n", (*cur)->point[0], (*cur)->point[1]); -#endif - if (*cdir == FORW) - d = (*cur)->cvc_prev->prev; - else - d = (*cur)->cvc_next->prev; - start = d; - do { - e = d->parent; - if (d->side == 'P') - e = e->prev; - newone = *cdir; - if (!e->Flags.mark && rule(d->poly, e, &newone)) { - if ((d->side == 'N' && newone == FORW) || (d->side == 'P' && newone == BACKW)) { -#ifdef DEBUG_JUMP - if (newone == FORW) - DEBUGP("jump leaving node at %#mD\n", e->next->point[0], e->next->point[1]); - else - DEBUGP("jump leaving node at %#mD\n", e->point[0], e->point[1]); -#endif - *cur = d->parent; - *cdir = newone; - return pcb_true; - } - } - } - while ((d = d->prev) != start); - return pcb_false; -} - -static int Gather(pcb_vnode_t * start, pcb_pline_t ** result, J_Rule v_rule, DIRECTION initdir) -{ - pcb_vnode_t *cur = start, *newn; - DIRECTION dir = initdir; -#ifdef DEBUG_GATHER - DEBUGP("gather direction = %d\n", dir); -#endif - assert(*result == NULL); - do { - /* see where to go next */ - if (!jump(&cur, &dir, v_rule)) - break; - /* add edge to polygon */ - if (!*result) { - *result = pcb_poly_contour_new(cur->point); - if (*result == NULL) - return pcb_err_no_memory; - } - else { - if ((newn = pcb_poly_node_create(cur->point)) == NULL) - return pcb_err_no_memory; - pcb_poly_vertex_include((*result)->head->prev, newn); - } -#ifdef DEBUG_GATHER - DEBUGP("gather vertex at %#mD\n", cur->point[0], cur->point[1]); -#endif - /* Now mark the edge as included. */ - newn = (dir == FORW ? cur : cur->prev); - newn->Flags.mark = 1; - /* for SHARED edge mark both */ - if (newn->shared) - newn->shared->Flags.mark = 1; - - /* Advance to the next edge. */ - cur = (dir == FORW ? cur->next : cur->prev); - } - while (1); - return pcb_err_ok; -} /* Gather */ - -static void Collect1(jmp_buf * e, pcb_vnode_t * cur, DIRECTION dir, pcb_polyarea_t ** contours, pcb_pline_t ** holes, J_Rule j_rule) -{ - pcb_pline_t *p = NULL; /* start making contour */ - int errc = pcb_err_ok; - if ((errc = Gather(dir == FORW ? cur : cur->next, &p, j_rule, dir)) != pcb_err_ok) { - if (p != NULL) - pcb_poly_contour_del(&p); - error(errc); - } - if (!p) - return; - pcb_poly_contour_pre(p, pcb_true); - if (p->Count > 2) { -#ifdef DEBUG_GATHER - DEBUGP("adding contour with %d vertices and direction %c\n", p->Count, p->Flags.orient ? 'F' : 'B'); -#endif - PutContour(e, p, contours, holes, NULL, NULL, NULL); - } - else { - /* some sort of computation error ? */ -#ifdef DEBUG_GATHER - DEBUGP("Bad contour! Not enough points!!\n"); -#endif - pcb_poly_contour_del(&p); - } -} - -static void Collect(jmp_buf * e, pcb_pline_t * a, pcb_polyarea_t ** contours, pcb_pline_t ** holes, S_Rule s_rule, J_Rule j_rule) -{ - pcb_vnode_t *cur, *other; - DIRECTION dir; - - cur = a->head; - do { - if (s_rule(cur, &dir) && cur->Flags.mark == 0) - Collect1(e, cur, dir, contours, holes, j_rule); - other = cur; - if ((other->cvc_prev && jump(&other, &dir, j_rule))) - Collect1(e, other, dir, contours, holes, j_rule); - } - while ((cur = cur->next) != a->head); -} /* Collect */ - - -static int -cntr_Collect(jmp_buf * e, pcb_pline_t ** A, pcb_polyarea_t ** contours, pcb_pline_t ** holes, - int action, pcb_polyarea_t * owner, pcb_polyarea_t * parent, pcb_pline_t * parent_contour) -{ - pcb_pline_t *tmprev; - - if ((*A)->Flags.status == ISECTED) { - switch (action) { - case PCB_PBO_UNITE: - Collect(e, *A, contours, holes, UniteS_Rule, UniteJ_Rule); - break; - case PCB_PBO_ISECT: - Collect(e, *A, contours, holes, IsectS_Rule, IsectJ_Rule); - break; - case PCB_PBO_XOR: - Collect(e, *A, contours, holes, XorS_Rule, XorJ_Rule); - break; - case PCB_PBO_SUB: - Collect(e, *A, contours, holes, SubS_Rule, SubJ_Rule); - break; - }; - } - else { - switch (action) { - case PCB_PBO_ISECT: - if ((*A)->Flags.status == INSIDE) { - tmprev = *A; - /* disappear this contour (rtree entry removed in PutContour) */ - *A = tmprev->next; - tmprev->next = NULL; - PutContour(e, tmprev, contours, holes, owner, NULL, NULL); - return pcb_true; - } - break; - case PCB_PBO_XOR: - if ((*A)->Flags.status == INSIDE) { - tmprev = *A; - /* disappear this contour (rtree entry removed in PutContour) */ - *A = tmprev->next; - tmprev->next = NULL; - pcb_poly_contour_inv(tmprev); - PutContour(e, tmprev, contours, holes, owner, NULL, NULL); - return pcb_true; - } - /* break; *//* Fall through (I think this is correct! pcjc2) */ - case PCB_PBO_UNITE: - case PCB_PBO_SUB: - if ((*A)->Flags.status == OUTSIDE) { - tmprev = *A; - /* disappear this contour (rtree entry removed in PutContour) */ - *A = tmprev->next; - tmprev->next = NULL; - PutContour(e, tmprev, contours, holes, owner, parent, parent_contour); - return pcb_true; - } - break; - } - } - return pcb_false; -} /* cntr_Collect */ - -static void M_B_AREA_Collect(jmp_buf * e, pcb_polyarea_t * bfst, pcb_polyarea_t ** contours, pcb_pline_t ** holes, int action) -{ - pcb_polyarea_t *b = bfst; - pcb_pline_t **cur, **next, *tmp; - - assert(b != NULL); - do { - for (cur = &b->contours; *cur != NULL; cur = next) { - next = &((*cur)->next); - if ((*cur)->Flags.status == ISECTED) - continue; - - if ((*cur)->Flags.status == INSIDE) - switch (action) { - case PCB_PBO_XOR: - case PCB_PBO_SUB: - pcb_poly_contour_inv(*cur); - case PCB_PBO_ISECT: - tmp = *cur; - *cur = tmp->next; - next = cur; - tmp->next = NULL; - tmp->Flags.status = UNKNWN; - PutContour(e, tmp, contours, holes, b, NULL, NULL); - break; - case PCB_PBO_UNITE: - break; /* nothing to do - already included */ - } - else if ((*cur)->Flags.status == OUTSIDE) - switch (action) { - case PCB_PBO_XOR: - case PCB_PBO_UNITE: - /* include */ - tmp = *cur; - *cur = tmp->next; - next = cur; - tmp->next = NULL; - tmp->Flags.status = UNKNWN; - PutContour(e, tmp, contours, holes, b, NULL, NULL); - break; - case PCB_PBO_ISECT: - case PCB_PBO_SUB: - break; /* do nothing, not included */ - } - } - } - while ((b = b->f) != bfst); -} - - -static inline int contour_is_first(pcb_polyarea_t * a, pcb_pline_t * cur) -{ - return (a->contours == cur); -} - - -static inline int contour_is_last(pcb_pline_t * cur) -{ - return (cur->next == NULL); -} - - -static inline void remove_polyarea(pcb_polyarea_t ** list, pcb_polyarea_t * piece) -{ - /* If this item was the start of the list, advance that pointer */ - if (*list == piece) - *list = (*list)->f; - - /* But reset it to NULL if it wraps around and hits us again */ - if (*list == piece) - *list = NULL; - - piece->b->f = piece->f; - piece->f->b = piece->b; - piece->f = piece->b = piece; -} - -static void M_pcb_polyarea_separate_isected(jmp_buf * e, pcb_polyarea_t ** pieces, pcb_pline_t ** holes, pcb_pline_t ** isected) -{ - pcb_polyarea_t *a = *pieces; - pcb_polyarea_t *anext; - pcb_pline_t *curc, *next, *prev; - int finished; - - if (a == NULL) - return; - - /* TODO: STASH ENOUGH INFORMATION EARLIER ON, SO WE CAN REMOVE THE INTERSECTED - CONTOURS WITHOUT HAVING TO WALK THE FULL DATA-STRUCTURE LOOKING FOR THEM. */ - - do { - int hole_contour = 0; - int is_outline = 1; - - anext = a->f; - finished = (anext == *pieces); - - prev = NULL; - for (curc = a->contours; curc != NULL; curc = next, is_outline = 0) { - int is_first = contour_is_first(a, curc); - int is_last = contour_is_last(curc); - int isect_contour = (curc->Flags.status == ISECTED); - - next = curc->next; - - if (isect_contour || hole_contour) { - - /* Reset the intersection flags, since we keep these pieces */ - if (curc->Flags.status != ISECTED) - curc->Flags.status = UNKNWN; - - remove_contour(a, prev, curc, !(is_first && is_last)); - - if (isect_contour) { - /* Link into the list of intersected contours */ - curc->next = *isected; - *isected = curc; - } - else if (hole_contour) { - /* Link into the list of holes */ - curc->next = *holes; - *holes = curc; - } - else { - assert(0); - } - - if (is_first && is_last) { - remove_polyarea(pieces, a); - pcb_polyarea_free(&a); /* NB: Sets a to NULL */ - } - - } - else { - /* Note the item we just didn't delete as the next - candidate for having its "next" pointer adjusted. - Saves walking the contour list when we delete one. */ - prev = curc; - } - - /* If we move or delete an outer contour, we need to move any holes - we wish to keep within that contour to the holes list. */ - if (is_outline && isect_contour) - hole_contour = 1; - - } - - /* If we deleted all the pieces of the polyarea, *pieces is NULL */ - } - while ((a = anext), *pieces != NULL && !finished); -} - - -struct find_inside_m_pa_info { - jmp_buf jb; - pcb_polyarea_t *want_inside; - pcb_pline_t *result; -}; - -static pcb_r_dir_t find_inside_m_pa(const pcb_box_t * b, void *cl) -{ - struct find_inside_m_pa_info *info = (struct find_inside_m_pa_info *) cl; - pcb_pline_t *check = (pcb_pline_t *) b; - /* Don't report for the main contour */ - if (check->Flags.orient == PCB_PLF_DIR) - return PCB_R_DIR_NOT_FOUND; - /* Don't look at contours marked as being intersected */ - if (check->Flags.status == ISECTED) - return PCB_R_DIR_NOT_FOUND; - if (cntr_in_M_pcb_polyarea_t(check, info->want_inside, pcb_false)) { - info->result = check; - longjmp(info->jb, 1); - } - return PCB_R_DIR_NOT_FOUND; -} - - -static void M_pcb_polyarea_t_update_primary(jmp_buf * e, pcb_polyarea_t ** pieces, pcb_pline_t ** holes, int action, pcb_polyarea_t * bpa) -{ - pcb_polyarea_t *a = *pieces; - pcb_polyarea_t *b; - pcb_polyarea_t *anext; - pcb_pline_t *curc, *next, *prev; - pcb_box_t box; - /* int inv_inside = 0; */ - int del_inside = 0; - int del_outside = 0; - int finished; - - if (a == NULL) - return; - - switch (action) { - case PCB_PBO_ISECT: - del_outside = 1; - break; - case PCB_PBO_UNITE: - case PCB_PBO_SUB: - del_inside = 1; - break; - case PCB_PBO_XOR: /* NOT IMPLEMENTED OR USED */ - /* inv_inside = 1; */ - assert(0); - break; - } - - box = *((pcb_box_t *) bpa->contours); - b = bpa; - while ((b = b->f) != bpa) { - pcb_box_t *b_box = (pcb_box_t *) b->contours; - PCB_MAKE_MIN(box.X1, b_box->X1); - PCB_MAKE_MIN(box.Y1, b_box->Y1); - PCB_MAKE_MAX(box.X2, b_box->X2); - PCB_MAKE_MAX(box.Y2, b_box->Y2); - } - - if (del_inside) { - - do { - anext = a->f; - finished = (anext == *pieces); - - /* Test the outer contour first, as we may need to remove all children */ - - /* We've not yet split intersected contours out, just ignore them */ - if (a->contours->Flags.status != ISECTED && - /* Pre-filter on bounding box */ - ((a->contours->xmin >= box.X1) && (a->contours->ymin >= box.Y1) - && (a->contours->xmax <= box.X2) - && (a->contours->ymax <= box.Y2)) && - /* Then test properly */ - cntr_in_M_pcb_polyarea_t(a->contours, bpa, pcb_false)) { - - /* Delete this contour, all children -> holes queue */ - - /* Delete the outer contour */ - curc = a->contours; - remove_contour(a, NULL, curc, pcb_false); /* Rtree deleted in poly_Free below */ - /* a->contours now points to the remaining holes */ - pcb_poly_contour_del(&curc); - - if (a->contours != NULL) { - /* Find the end of the list of holes */ - curc = a->contours; - while (curc->next != NULL) - curc = curc->next; - - /* Take the holes and prepend to the holes queue */ - curc->next = *holes; - *holes = a->contours; - a->contours = NULL; - } - - remove_polyarea(pieces, a); - pcb_polyarea_free(&a); /* NB: Sets a to NULL */ - - continue; - } - - /* Loop whilst we find INSIDE contours to delete */ - while (1) { - struct find_inside_m_pa_info info; - pcb_pline_t *prev; - - info.want_inside = bpa; - - /* Set jump return */ - if (setjmp(info.jb)) { - /* Returned here! */ - } - else { - info.result = NULL; - /* r-tree search, calling back a routine to longjmp back with - * data about any hole inside the B polygon. - * NB: Does not jump back to report the main contour! - */ - pcb_r_search(a->contour_tree, &box, NULL, find_inside_m_pa, &info, NULL); - - /* Nothing found? */ - break; - } - - /* We need to find the contour before it, so we can update its next pointer */ - prev = a->contours; - while (prev->next != info.result) { - prev = prev->next; - } - - /* Remove hole from the contour */ - remove_contour(a, prev, info.result, pcb_true); - pcb_poly_contour_del(&info.result); - } - /* End check for deleted holes */ - - /* If we deleted all the pieces of the polyarea, *pieces is NULL */ - } - while ((a = anext), *pieces != NULL && !finished); - - return; - } - else { - /* This path isn't optimised for speed */ - } - - do { - int hole_contour = 0; - int is_outline = 1; - - anext = a->f; - finished = (anext == *pieces); - - prev = NULL; - for (curc = a->contours; curc != NULL; curc = next, is_outline = 0) { - int is_first = contour_is_first(a, curc); - int is_last = contour_is_last(curc); - int del_contour = 0; - - next = curc->next; - - if (del_outside) - del_contour = curc->Flags.status != ISECTED && !cntr_in_M_pcb_polyarea_t(curc, bpa, pcb_false); - - /* Skip intersected contours */ - if (curc->Flags.status == ISECTED) { - prev = curc; - continue; - } - - /* Reset the intersection flags, since we keep these pieces */ - curc->Flags.status = UNKNWN; - - if (del_contour || hole_contour) { - - remove_contour(a, prev, curc, !(is_first && is_last)); - - if (del_contour) { - /* Delete the contour */ - pcb_poly_contour_del(&curc); /* NB: Sets curc to NULL */ - } - else if (hole_contour) { - /* Link into the list of holes */ - curc->next = *holes; - *holes = curc; - } - else { - assert(0); - } - - if (is_first && is_last) { - remove_polyarea(pieces, a); - pcb_polyarea_free(&a); /* NB: Sets a to NULL */ - } - - } - else { - /* Note the item we just didn't delete as the next - candidate for having its "next" pointer adjusted. - Saves walking the contour list when we delete one. */ - prev = curc; - } - - /* If we move or delete an outer contour, we need to move any holes - we wish to keep within that contour to the holes list. */ - if (is_outline && del_contour) - hole_contour = 1; - - } - - /* If we deleted all the pieces of the polyarea, *pieces is NULL */ - } - while ((a = anext), *pieces != NULL && !finished); -} - -static void -M_pcb_polyarea_t_Collect_separated(jmp_buf * e, pcb_pline_t * afst, pcb_polyarea_t ** contours, pcb_pline_t ** holes, int action, pcb_bool maybe) -{ - pcb_pline_t **cur, **next; - - for (cur = &afst; *cur != NULL; cur = next) { - next = &((*cur)->next); - /* if we disappear a contour, don't advance twice */ - if (cntr_Collect(e, cur, contours, holes, action, NULL, NULL, NULL)) - next = cur; - } -} - -static void M_pcb_polyarea_t_Collect(jmp_buf * e, pcb_polyarea_t * afst, pcb_polyarea_t ** contours, pcb_pline_t ** holes, int action, pcb_bool maybe) -{ - pcb_polyarea_t *a = afst; - pcb_polyarea_t *parent = NULL; /* Quiet compiler warning */ - pcb_pline_t **cur, **next, *parent_contour; - - assert(a != NULL); - while ((a = a->f) != afst); - /* now the non-intersect parts are collected in temp/holes */ - do { - if (maybe && a->contours->Flags.status != ISECTED) - parent_contour = a->contours; - else - parent_contour = NULL; - - /* Take care of the first contour - so we know if we - * can shortcut reparenting some of its children - */ - cur = &a->contours; - if (*cur != NULL) { - next = &((*cur)->next); - /* if we disappear a contour, don't advance twice */ - if (cntr_Collect(e, cur, contours, holes, action, a, NULL, NULL)) { - parent = (*contours)->b; /* InsCntr inserts behind the head */ - next = cur; - } - else - parent = a; - cur = next; - } - for (; *cur != NULL; cur = next) { - next = &((*cur)->next); - /* if we disappear a contour, don't advance twice */ - if (cntr_Collect(e, cur, contours, holes, action, a, parent, parent_contour)) - next = cur; - } - } - while ((a = a->f) != afst); -} - -/* determine if two polygons touch or overlap */ -pcb_bool pcb_polyarea_touching(pcb_polyarea_t * a, pcb_polyarea_t * b) -{ - jmp_buf e; - int code; - - if ((code = setjmp(e)) == 0) { -#ifdef DEBUG - if (!pcb_poly_valid(a)) - return -1; - if (!pcb_poly_valid(b)) - return -1; -#endif - M_pcb_polyarea_t_intersect(&e, a, b, pcb_false); - - if (M_pcb_polyarea_t_label(a, b, pcb_true)) - return pcb_true; - if (M_pcb_polyarea_t_label(b, a, pcb_true)) - return pcb_true; - } - else if (code == TOUCHES) - return pcb_true; - return pcb_false; -} - -/* the main clipping routines */ -int pcb_polyarea_boolean(const pcb_polyarea_t * a_org, const pcb_polyarea_t * b_org, pcb_polyarea_t ** res, int action) -{ - pcb_polyarea_t *a = NULL, *b = NULL; - - if (!pcb_polyarea_m_copy0(&a, a_org) || !pcb_polyarea_m_copy0(&b, b_org)) - return pcb_err_no_memory; - - return pcb_polyarea_boolean_free(a, b, res, action); -} /* poly_Boolean */ - -/* just like poly_Boolean but frees the input polys */ -int pcb_polyarea_boolean_free(pcb_polyarea_t * ai, pcb_polyarea_t * bi, pcb_polyarea_t ** res, int action) -{ - pcb_polyarea_t *a = ai, *b = bi; - pcb_pline_t *a_isected = NULL; - pcb_pline_t *p, *holes = NULL; - jmp_buf e; - int code; - - *res = NULL; - - if (!a) { - switch (action) { - case PCB_PBO_XOR: - case PCB_PBO_UNITE: - *res = bi; - return pcb_err_ok; - case PCB_PBO_SUB: - case PCB_PBO_ISECT: - if (b != NULL) - pcb_polyarea_free(&b); - return pcb_err_ok; - } - } - if (!b) { - switch (action) { - case PCB_PBO_SUB: - case PCB_PBO_XOR: - case PCB_PBO_UNITE: - *res = ai; - return pcb_err_ok; - case PCB_PBO_ISECT: - if (a != NULL) - pcb_polyarea_free(&a); - return pcb_err_ok; - } - } - - if ((code = setjmp(e)) == 0) { -#ifdef DEBUG - assert(pcb_poly_valid(a)); - assert(pcb_poly_valid(b)); -#endif - - /* intersect needs to make a list of the contours in a and b which are intersected */ - M_pcb_polyarea_t_intersect(&e, a, b, pcb_true); - - /* We could speed things up a lot here if we only processed the relevant contours */ - /* NB: Relevant parts of a are labeled below */ - M_pcb_polyarea_t_label(b, a, pcb_false); - - *res = a; - M_pcb_polyarea_t_update_primary(&e, res, &holes, action, b); - M_pcb_polyarea_separate_isected(&e, res, &holes, &a_isected); - M_pcb_polyarea_t_label_separated(a_isected, b, pcb_false); - M_pcb_polyarea_t_Collect_separated(&e, a_isected, res, &holes, action, pcb_false); - M_B_AREA_Collect(&e, b, res, &holes, action); - pcb_polyarea_free(&b); - - /* free a_isected */ - while ((p = a_isected) != NULL) { - a_isected = p->next; - pcb_poly_contour_del(&p); - } - - pcb_poly_insert_holes(&e, *res, &holes); - } - /* delete holes if any left */ - while ((p = holes) != NULL) { - holes = p->next; - pcb_poly_contour_del(&p); - } - - if (code) { - pcb_polyarea_free(res); - return code; - } - assert(!*res || pcb_poly_valid(*res)); - return code; -} /* poly_Boolean_free */ - -static void clear_marks(pcb_polyarea_t * p) -{ - pcb_polyarea_t *n = p; - pcb_pline_t *c; - pcb_vnode_t *v; - - do { - for (c = n->contours; c; c = c->next) { - v = c->head; - do { - v->Flags.mark = 0; - } - while ((v = v->next) != c->head); - } - } - while ((n = n->f) != p); -} - -/* compute the intersection and subtraction (divides "a" into two pieces) - * and frees the input polys. This assumes that bi is a single simple polygon. - */ -int pcb_polyarea_and_subtract_free(pcb_polyarea_t * ai, pcb_polyarea_t * bi, pcb_polyarea_t ** aandb, pcb_polyarea_t ** aminusb) -{ - pcb_polyarea_t *a = ai, *b = bi; - pcb_pline_t *p, *holes = NULL; - jmp_buf e; - int code; - - *aandb = NULL; - *aminusb = NULL; - - if ((code = setjmp(e)) == 0) { - -#ifdef DEBUG - if (!pcb_poly_valid(a)) - return -1; - if (!pcb_poly_valid(b)) - return -1; -#endif - M_pcb_polyarea_t_intersect(&e, a, b, pcb_true); - - M_pcb_polyarea_t_label(a, b, pcb_false); - M_pcb_polyarea_t_label(b, a, pcb_false); - - M_pcb_polyarea_t_Collect(&e, a, aandb, &holes, PCB_PBO_ISECT, pcb_false); - pcb_poly_insert_holes(&e, *aandb, &holes); - assert(pcb_poly_valid(*aandb)); - /* delete holes if any left */ - while ((p = holes) != NULL) { - holes = p->next; - pcb_poly_contour_del(&p); - } - holes = NULL; - clear_marks(a); - clear_marks(b); - M_pcb_polyarea_t_Collect(&e, a, aminusb, &holes, PCB_PBO_SUB, pcb_false); - pcb_poly_insert_holes(&e, *aminusb, &holes); - pcb_polyarea_free(&a); - pcb_polyarea_free(&b); - assert(pcb_poly_valid(*aminusb)); - } - /* delete holes if any left */ - while ((p = holes) != NULL) { - holes = p->next; - pcb_poly_contour_del(&p); - } - - - if (code) { - pcb_polyarea_free(aandb); - pcb_polyarea_free(aminusb); - return code; - } - assert(!*aandb || pcb_poly_valid(*aandb)); - assert(!*aminusb || pcb_poly_valid(*aminusb)); - return code; -} /* poly_AndSubtract_free */ - -static inline int cntrbox_pointin(const pcb_pline_t *c, const pcb_vector_t p) -{ - return (p[0] >= c->xmin && p[1] >= c->ymin && p[0] <= c->xmax && p[1] <= c->ymax); -} - -static inline int node_neighbours(pcb_vnode_t * a, pcb_vnode_t * b) -{ - return (a == b) || (a->next == b) || (b->next == a) || (a->next == b->next); -} - -pcb_vnode_t *pcb_poly_node_create(pcb_vector_t v) -{ - pcb_vnode_t *res; - pcb_coord_t *c; - - assert(v); - res = (pcb_vnode_t *) calloc(1, sizeof(pcb_vnode_t)); - if (res == NULL) - return NULL; - /* bzero (res, sizeof (pcb_vnode_t) - sizeof(pcb_vector_t)); */ - c = res->point; - *c++ = *v++; - *c = *v; - return res; -} - -void pcb_poly_contour_init(pcb_pline_t * c) -{ - if (c == NULL) - return; - /* bzero (c, sizeof(pcb_pline_t)); */ - if (c->head == NULL) - c->head = calloc(sizeof(pcb_vnode_t), 1); - c->head->next = c->head->prev = c->head; - c->xmin = c->ymin = COORD_MAX; - c->xmax = c->ymax = -COORD_MAX-1; - c->is_round = pcb_false; - c->cx = 0; - c->cy = 0; - c->radius = 0; -} - -pcb_pline_t *pcb_poly_contour_new(const pcb_vector_t v) -{ - pcb_pline_t *res; - - res = (pcb_pline_t *) calloc(1, sizeof(pcb_pline_t)); - if (res == NULL) - return NULL; - - pcb_poly_contour_init(res); - - if (v != NULL) { - res->head = calloc(sizeof(pcb_vnode_t), 1); - res->head->next = res->head->prev = res->head; - Vcopy(res->head->point, v); - cntrbox_adjust(res, v); - } - - return res; -} - -void pcb_poly_contour_clear(pcb_pline_t * c) -{ - pcb_vnode_t *cur; - - assert(c != NULL); - while ((cur = c->head->next) != c->head) { - pcb_poly_vertex_exclude(NULL, cur); - free(cur); - } - free(c->head); - c->head = NULL; - pcb_poly_contour_init(c); -} - -void pcb_poly_contour_del(pcb_pline_t ** c) -{ - pcb_vnode_t *cur, *prev; - - if (*c == NULL) - return; - for (cur = (*c)->head->prev; cur != (*c)->head; cur = prev) { - prev = cur->prev; - if (cur->cvc_next != NULL) { - free(cur->cvc_next); - free(cur->cvc_prev); - } - free(cur); - } - if ((*c)->head->cvc_next != NULL) { - free((*c)->head->cvc_next); - free((*c)->head->cvc_prev); - } - /* FIXME -- strict aliasing violation. */ - if ((*c)->tree) { - pcb_rtree_t *r = (*c)->tree; - pcb_r_free_tree_data(r, free); - pcb_r_destroy_tree(&r); - } - free((*c)->head); - free(*c), *c = NULL; -} - -void pcb_poly_contour_pre(pcb_pline_t * C, pcb_bool optimize) -{ - double area = 0; - pcb_vnode_t *p, *c; - pcb_vector_t p1, p2; - - assert(C != NULL); - - if (optimize) { - for (c = (p = C->head)->next; c != C->head; c = (p = c)->next) { - /* if the previous node is on the same line with this one, we should remove it */ - Vsub2(p1, c->point, p->point); - Vsub2(p2, c->next->point, c->point); - /* If the product below is zero then - * the points on either side of c - * are on the same line! - * So, remove the point c - */ - - if (pcb_vect_det2(p1, p2) == 0) { - pcb_poly_vertex_exclude(C, c); - free(c); - c = p; - } - } - } - C->Count = 0; - C->xmin = C->xmax = C->head->point[0]; - C->ymin = C->ymax = C->head->point[1]; - - p = (c = C->head)->prev; - if (c != p) { - do { - /* calculate area for orientation */ - area += (double) (p->point[0] - c->point[0]) * (p->point[1] + c->point[1]); - cntrbox_adjust(C, c->point); - C->Count++; - } - while ((c = (p = c)->next) != C->head); - } - C->area = PCB_ABS(area); - if (C->Count > 2) - C->Flags.orient = ((area < 0) ? PCB_PLF_INV : PCB_PLF_DIR); - C->tree = (pcb_rtree_t *) pcb_poly_make_edge_tree(C); -} /* poly_PreContour */ - -static pcb_r_dir_t flip_cb(const pcb_box_t * b, void *cl) -{ - struct seg *s = (struct seg *) b; - s->v = s->v->prev; - return PCB_R_DIR_FOUND_CONTINUE; -} - -void pcb_poly_contour_inv(pcb_pline_t * c) -{ - pcb_vnode_t *cur, *next; - int r; - - assert(c != NULL); - cur = c->head; - do { - next = cur->next; - cur->next = cur->prev; - cur->prev = next; - /* fix the segment tree */ - } - while ((cur = next) != c->head); - c->Flags.orient ^= 1; - if (c->tree) { - pcb_r_search(c->tree, NULL, NULL, flip_cb, NULL, &r); - assert(r == c->Count); - } -} - -void pcb_poly_vertex_exclude(pcb_pline_t *parent, pcb_vnode_t * node) -{ - assert(node != NULL); - if (parent != NULL) { - if (parent->head == node) /* if node is excluded from a pline, it can not remain the head */ - parent->head = node->next; - } - if (node->cvc_next) { - free(node->cvc_next); - free(node->cvc_prev); - } - node->prev->next = node->next; - node->next->prev = node->prev; - - if (parent != NULL) { - if (parent->head == node) /* special case: removing head which was the last node in pline */ - parent->head = NULL; - } -} - -PCB_INLINE void pcb_poly_vertex_include_force_(pcb_vnode_t *after, pcb_vnode_t *node) -{ - assert(after != NULL); - assert(node != NULL); - - node->prev = after; - node->next = after->next; - after->next = after->next->prev = node; -} - -void pcb_poly_vertex_include_force(pcb_vnode_t *after, pcb_vnode_t *node) -{ - pcb_poly_vertex_include_force_(after, node); -} - -void pcb_poly_vertex_include(pcb_vnode_t *after, pcb_vnode_t *node) -{ - double a, b; - - pcb_poly_vertex_include_force_(after, node); - - /* remove points on same line */ - if (node->prev->prev == node) - return; /* we don't have 3 points in the poly yet */ - a = (node->point[1] - node->prev->prev->point[1]); - a *= (node->prev->point[0] - node->prev->prev->point[0]); - b = (node->point[0] - node->prev->prev->point[0]); - b *= (node->prev->point[1] - node->prev->prev->point[1]); - if (fabs(a - b) < EPSILON) { - pcb_vnode_t *t = node->prev; - t->prev->next = node; - node->prev = t->prev; - free(t); - } -} - -pcb_bool pcb_poly_contour_copy(pcb_pline_t **dst, const pcb_pline_t *src) -{ - pcb_vnode_t *cur, *newnode; - - assert(src != NULL); - *dst = NULL; - *dst = pcb_poly_contour_new(src->head->point); - if (*dst == NULL) - return pcb_false; - - (*dst)->Count = src->Count; - (*dst)->Flags.orient = src->Flags.orient; - (*dst)->xmin = src->xmin, (*dst)->xmax = src->xmax; - (*dst)->ymin = src->ymin, (*dst)->ymax = src->ymax; - (*dst)->area = src->area; - - for (cur = src->head->next; cur != src->head; cur = cur->next) { - if ((newnode = pcb_poly_node_create(cur->point)) == NULL) - return pcb_false; - /* newnode->Flags = cur->Flags; */ - pcb_poly_vertex_include((*dst)->head->prev, newnode); - } - (*dst)->tree = (pcb_rtree_t *) pcb_poly_make_edge_tree(*dst); - return pcb_true; -} - -/**********************************************************************/ -/* polygon routines */ - -pcb_bool pcb_polyarea_copy0(pcb_polyarea_t ** dst, const pcb_polyarea_t * src) -{ - *dst = NULL; - if (src != NULL) - *dst = (pcb_polyarea_t *) calloc(1, sizeof(pcb_polyarea_t)); - if (*dst == NULL) - return pcb_false; - (*dst)->contour_tree = pcb_r_create_tree(); - - return pcb_polyarea_copy1(*dst, src); -} - -pcb_bool pcb_polyarea_copy1(pcb_polyarea_t * dst, const pcb_polyarea_t * src) -{ - pcb_pline_t *cur, **last = &dst->contours; - - *last = NULL; - dst->f = dst->b = dst; - - for (cur = src->contours; cur != NULL; cur = cur->next) { - if (!pcb_poly_contour_copy(last, cur)) - return pcb_false; - pcb_r_insert_entry(dst->contour_tree, (pcb_box_t *) * last); - last = &(*last)->next; - } - return pcb_true; -} - -void pcb_polyarea_m_include(pcb_polyarea_t ** list, pcb_polyarea_t * a) -{ - if (*list == NULL) - a->f = a->b = a, *list = a; - else { - a->f = *list; - a->b = (*list)->b; - (*list)->b = (*list)->b->f = a; - } -} - -pcb_bool pcb_polyarea_m_copy0(pcb_polyarea_t ** dst, const pcb_polyarea_t * srcfst) -{ - const pcb_polyarea_t *src = srcfst; - pcb_polyarea_t *di; - - *dst = NULL; - if (src == NULL) - return pcb_false; - do { - if ((di = pcb_polyarea_create()) == NULL || !pcb_polyarea_copy1(di, src)) - return pcb_false; - pcb_polyarea_m_include(dst, di); - } - while ((src = src->f) != srcfst); - return pcb_true; -} - -pcb_bool pcb_polyarea_contour_include(pcb_polyarea_t * p, pcb_pline_t * c) -{ - pcb_pline_t *tmp; - - if ((c == NULL) || (p == NULL)) - return pcb_false; - if (c->Flags.orient == PCB_PLF_DIR) { - if (p->contours != NULL) - return pcb_false; - p->contours = c; - } - else { - if (p->contours == NULL) - return pcb_false; - /* link at front of hole list */ - tmp = p->contours->next; - p->contours->next = c; - c->next = tmp; - } - pcb_r_insert_entry(p->contour_tree, (pcb_box_t *) c); - return pcb_true; -} - -typedef struct pip { - int f; - pcb_vector_t p; - jmp_buf env; -} pip; - - -static pcb_r_dir_t crossing(const pcb_box_t * b, void *cl) -{ - struct seg *s = (struct seg *) b; - struct pip *p = (struct pip *) cl; - - if (s->v->point[1] <= p->p[1]) { - if (s->v->next->point[1] > p->p[1]) { - pcb_vector_t v1, v2; - pcb_long64_t cross; - Vsub2(v1, s->v->next->point, s->v->point); - Vsub2(v2, p->p, s->v->point); - cross = (pcb_long64_t) v1[0] * v2[1] - (pcb_long64_t) v2[0] * v1[1]; - if (cross == 0) { - p->f = 1; - longjmp(p->env, 1); - } - if (cross > 0) - p->f += 1; - } - } - else { - if (s->v->next->point[1] <= p->p[1]) { - pcb_vector_t v1, v2; - pcb_long64_t cross; - Vsub2(v1, s->v->next->point, s->v->point); - Vsub2(v2, p->p, s->v->point); - cross = (pcb_long64_t) v1[0] * v2[1] - (pcb_long64_t) v2[0] * v1[1]; - if (cross == 0) { - p->f = 1; - longjmp(p->env, 1); - } - if (cross < 0) - p->f -= 1; - } - } - return PCB_R_DIR_FOUND_CONTINUE; -} - -int pcb_poly_contour_inside(const pcb_pline_t *c, pcb_vector_t p) -{ - struct pip info; - pcb_box_t ray; - - if (!cntrbox_pointin(c, p)) - return pcb_false; - info.f = 0; - info.p[0] = ray.X1 = p[0]; - info.p[1] = ray.Y1 = p[1]; - ray.X2 = COORD_MAX; - ray.Y2 = p[1] + 1; - if (setjmp(info.env) == 0) - pcb_r_search(c->tree, &ray, NULL, crossing, &info, NULL); - return info.f; -} - -pcb_bool pcb_polyarea_contour_inside(pcb_polyarea_t * p, pcb_vector_t v0) -{ - pcb_pline_t *cur; - - if ((p == NULL) || (v0 == NULL) || (p->contours == NULL)) - return pcb_false; - cur = p->contours; - if (pcb_poly_contour_inside(cur, v0)) { - for (cur = cur->next; cur != NULL; cur = cur->next) - if (pcb_poly_contour_inside(cur, v0)) - return pcb_false; - return pcb_true; - } - return pcb_false; -} - -pcb_bool poly_M_CheckInside(pcb_polyarea_t * p, pcb_vector_t v0) -{ - pcb_polyarea_t *cur; - - if ((p == NULL) || (v0 == NULL)) - return pcb_false; - cur = p; - do { - if (pcb_polyarea_contour_inside(cur, v0)) - return pcb_true; - } - while ((cur = cur->f) != p); - return pcb_false; -} - -static double dot(pcb_vector_t A, pcb_vector_t B) -{ - return (double) A[0] * (double) B[0] + (double) A[1] * (double) B[1]; -} - -/* Compute whether point is inside a triangle formed by 3 other points */ -/* Algorithm from http://www.blackpawn.com/texts/pointinpoly/default.html */ -static int point_in_triangle(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t P) -{ - pcb_vector_t v0, v1, v2; - double dot00, dot01, dot02, dot11, dot12; - double invDenom; - double u, v; - - /* Compute vectors */ - v0[0] = C[0] - A[0]; - v0[1] = C[1] - A[1]; - v1[0] = B[0] - A[0]; - v1[1] = B[1] - A[1]; - v2[0] = P[0] - A[0]; - v2[1] = P[1] - A[1]; - - /* Compute dot products */ - dot00 = dot(v0, v0); - dot01 = dot(v0, v1); - dot02 = dot(v0, v2); - dot11 = dot(v1, v1); - dot12 = dot(v1, v2); - - /* Compute barycentric coordinates */ - invDenom = 1. / (dot00 * dot11 - dot01 * dot01); - u = (dot11 * dot02 - dot01 * dot12) * invDenom; - v = (dot00 * dot12 - dot01 * dot02) * invDenom; - - /* Check if point is in triangle */ - return (u > 0.0) && (v > 0.0) && (u + v < 1.0); -} - - -/* Returns the dot product of pcb_vector_t A->B, and a vector - * orthogonal to pcb_vector_t C->D. The result is not normalised, so will be - * weighted by the magnitude of the C->D vector. - */ -static double dot_orthogonal_to_direction(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D) -{ - pcb_vector_t l1, l2, l3; - l1[0] = B[0] - A[0]; - l1[1] = B[1] - A[1]; - l2[0] = D[0] - C[0]; - l2[1] = D[1] - C[1]; - - l3[0] = -l2[1]; - l3[1] = l2[0]; - - return dot(l1, l3); -} - -/* Algorithm from http://www.exaflop.org/docs/cgafaq/cga2.html - * - * "Given a simple polygon, find some point inside it. Here is a method based - * on the proof that there exists an internal diagonal, in [O'Rourke, 13-14]. - * The idea is that the midpoint of a diagonal is interior to the polygon. - * - * 1. Identify a convex vertex v; let its adjacent vertices be a and b. - * 2. For each other vertex q do: - * 2a. If q is inside avb, compute distance to v (orthogonal to ab). - * 2b. Save point q if distance is a new min. - * 3. If no point is inside, return midpoint of ab, or centroid of avb. - * 4. Else if some point inside, qv is internal: return its midpoint." - * - * [O'Rourke]: Computational Geometry in C (2nd Ed.) - * Joseph O'Rourke, Cambridge University Press 1998, - * ISBN 0-521-64010-5 Pbk, ISBN 0-521-64976-5 Hbk - */ -static void poly_ComputeInteriorPoint(pcb_pline_t * poly, pcb_vector_t v) -{ - pcb_vnode_t *pt1, *pt2, *pt3, *q; - pcb_vnode_t *min_q = NULL; - double dist; - double min_dist = 0.0; - double dir = (poly->Flags.orient == PCB_PLF_DIR) ? 1. : -1; - - /* Find a convex node on the polygon */ - pt1 = poly->head; - do { - double dot_product; - - pt2 = pt1->next; - pt3 = pt2->next; - - dot_product = dot_orthogonal_to_direction(pt1->point, pt2->point, pt3->point, pt2->point); - - if (dot_product * dir > 0.) - break; - } - while ((pt1 = pt1->next) != poly->head); - - /* Loop over remaining vertices */ - q = pt3; - do { - /* Is current vertex "q" outside pt1 pt2 pt3 triangle? */ - if (!point_in_triangle(pt1->point, pt2->point, pt3->point, q->point)) - continue; - - /* NO: compute distance to pt2 (v) orthogonal to pt1 - pt3) */ - /* Record minimum */ - dist = dot_orthogonal_to_direction(q->point, pt2->point, pt1->point, pt3->point); - if (min_q == NULL || dist < min_dist) { - min_dist = dist; - min_q = q; - } - } - while ((q = q->next) != pt2); - - /* Were any "q" found inside pt1 pt2 pt3? */ - if (min_q == NULL) { - /* NOT FOUND: Return midpoint of pt1 pt3 */ - v[0] = (pt1->point[0] + pt3->point[0]) / 2; - v[1] = (pt1->point[1] + pt3->point[1]) / 2; - } - else { - /* FOUND: Return mid point of min_q, pt2 */ - v[0] = (pt2->point[0] + min_q->point[0]) / 2; - v[1] = (pt2->point[1] + min_q->point[1]) / 2; - } -} - - -/* NB: This function assumes the caller _knows_ the contours do not - * intersect. If the contours intersect, the result is undefined. - * It will return the correct result if the two contours share - * common points between their contours. (Identical contours - * are treated as being inside each other). - */ -int pcb_poly_contour_in_contour(pcb_pline_t * poly, pcb_pline_t * inner) -{ - pcb_vector_t point; - assert(poly != NULL); - assert(inner != NULL); - if (cntrbox_inside(inner, poly)) { - /* We need to prove the "inner" contour is not outside - * "poly" contour. If it is outside, we can return. - */ - if (!pcb_poly_contour_inside(poly, inner->head->point)) - return 0; - - poly_ComputeInteriorPoint(inner, point); - return pcb_poly_contour_inside(poly, point); - } - return 0; -} - -void pcb_polyarea_init(pcb_polyarea_t * p) -{ - p->f = p->b = p; - p->contours = NULL; - p->contour_tree = pcb_r_create_tree(); -} - -pcb_polyarea_t *pcb_polyarea_create(void) -{ - pcb_polyarea_t *res; - - if ((res = (pcb_polyarea_t *) malloc(sizeof(pcb_polyarea_t))) != NULL) - pcb_polyarea_init(res); - return res; -} - -void pcb_poly_contours_free(pcb_pline_t ** pline) -{ - pcb_pline_t *pl; - - while ((pl = *pline) != NULL) { - *pline = pl->next; - pcb_poly_contour_del(&pl); - } -} - -void pcb_polyarea_free(pcb_polyarea_t ** p) -{ - pcb_polyarea_t *cur; - - if (*p == NULL) - return; - for (cur = (*p)->f; cur != *p; cur = (*p)->f) { - pcb_poly_contours_free(&cur->contours); - pcb_r_destroy_tree(&cur->contour_tree); - cur->f->b = cur->b; - cur->b->f = cur->f; - free(cur); - } - pcb_poly_contours_free(&cur->contours); - pcb_r_destroy_tree(&cur->contour_tree); - free(*p), *p = NULL; -} - -static pcb_bool inside_sector(pcb_vnode_t * pn, pcb_vector_t p2) -{ - pcb_vector_t cdir, ndir, pdir; - int p_c, n_c, p_n; - - assert(pn != NULL); - vect_sub(cdir, p2, pn->point); - vect_sub(pdir, pn->point, pn->prev->point); - vect_sub(ndir, pn->next->point, pn->point); - - p_c = pcb_vect_det2(pdir, cdir) >= 0; - n_c = pcb_vect_det2(ndir, cdir) >= 0; - p_n = pcb_vect_det2(pdir, ndir) >= 0; - - if ((p_n && p_c && n_c) || ((!p_n) && (p_c || n_c))) - return pcb_true; - else - return pcb_false; -} /* inside_sector */ - -/* returns pcb_true if bad contour */ -typedef struct { - int marks, lines; -#ifndef NDEBUG - pcb_coord_t x[8], y[8]; - pcb_coord_t x1[8], y1[8], x2[8], y2[8]; - char msg[256]; -#endif -} pa_chk_res_t; - - -#ifndef NDEBUG -#define PA_CHK_MARK(x_, y_) \ -do { \ - if (res->marks < sizeof(res->x) / sizeof(res->x[0])) { \ - res->x[res->marks] = x_; \ - res->y[res->marks] = y_; \ - res->marks++; \ - } \ -} while(0) -#define PA_CHK_LINE(x1_, y1_, x2_, y2_) \ -do { \ - if (res->lines < sizeof(res->x1) / sizeof(res->x1[0])) { \ - res->x1[res->lines] = x1_; \ - res->y1[res->lines] = y1_; \ - res->x2[res->lines] = x2_; \ - res->y2[res->lines] = y2_; \ - res->lines++; \ - } \ -} while(0) -#else -#define PA_CHK_MARK(x, y) -#define PA_CHK_LINE(x1, y1, x2, y2) -#endif - - -PCB_INLINE pcb_bool PA_CHK_ERROR(pa_chk_res_t *res, const char *fmt, ...) -{ -#ifndef NDEBUG - va_list ap; - va_start(ap, fmt); - pcb_vsnprintf(res->msg, sizeof(res->msg), fmt, ap); - va_end(ap); -#endif - return pcb_true; -} - -pcb_bool pcb_polyarea_contour_check_(pcb_pline_t *a, pa_chk_res_t *res) -{ - pcb_vnode_t *a1, *a2, *hit1, *hit2; - pcb_vector_t i1, i2; - int icnt; - -#ifndef NDEBUG - *res->msg = '\0'; -#endif - res->marks = res->lines = 0; - - assert(a != NULL); - a1 = a->head; - do { - a2 = a1; - do { - if (!node_neighbours(a1, a2) && (icnt = pcb_vect_inters2(a1->point, a1->next->point, a2->point, a2->next->point, i1, i2)) > 0) { - if (icnt > 1) { - PA_CHK_MARK(a1->point[0], a1->point[1]); - PA_CHK_MARK(a2->point[0], a2->point[1]); - return PA_CHK_ERROR(res, "icnt > 1 (%d) at %mm;%mm or %mm;%mm", icnt, a1->point[0], a1->point[1], a2->point[0], a2->point[1]); - } - -TODO(": ugly workaround: test where exactly the intersection happens and tune the endpoint of the line") - /* EPSILON^2 for endpoint matching; the bool algebra code is not - perfect and causes tiny self intersections at the end of sharp - spikes. Accept at most 10 nanometer of such intersection */ -# define ENDP_EPSILON 100 - - if (pcb_vect_dist2(i1, a1->point) < ENDP_EPSILON) - hit1 = a1; - else if (pcb_vect_dist2(i1, a1->next->point) < ENDP_EPSILON) - hit1 = a1->next; - else - hit1 = NULL; - - if (pcb_vect_dist2(i1, a2->point) < ENDP_EPSILON) - hit2 = a2; - else if (pcb_vect_dist2(i1, a2->next->point) < ENDP_EPSILON) - hit2 = a2->next; - else - hit2 = NULL; - - if ((hit1 == NULL) && (hit2 == NULL)) { - /* If the intersection didn't land on an end-point of either - * line, we know the lines cross and we return pcb_true. - */ - PA_CHK_LINE(a1->point[0], a1->point[1], a1->next->point[0], a1->next->point[1]); - PA_CHK_LINE(a2->point[0], a2->point[1], a2->next->point[0], a2->next->point[1]); - return PA_CHK_ERROR(res, "lines cross between %mm;%mm and %mm;%mm", a1->point[0], a1->point[1], a2->point[0], a2->point[1]); - } - else if (hit1 == NULL) { - /* An end-point of the second line touched somewhere along the - length of the first line. Check where the second line leads. */ - if (inside_sector(hit2, a1->point) != inside_sector(hit2, a1->next->point)) { - PA_CHK_MARK(a1->point[0], a1->point[1]); - PA_CHK_MARK(hit2->point[0], hit2->point[1]); - return PA_CHK_ERROR(res, "lines is inside sector (1) at %mm;%mm", a1->point[0], a1->point[1]); - } - } - else if (hit2 == NULL) { - /* An end-point of the first line touched somewhere along the - length of the second line. Check where the first line leads. */ - if (inside_sector(hit1, a2->point) != inside_sector(hit1, a2->next->point)) { - PA_CHK_MARK(a2->point[0], a2->point[1]); - PA_CHK_MARK(hit1->point[0], hit1->point[1]); - return PA_CHK_ERROR(res, "lines is inside sector (2) at %mm;%mm", a2->point[0], a2->point[1]); - } - } - else { - /* Both lines intersect at an end-point. Check where they lead. */ - if (inside_sector(hit1, hit2->prev->point) != inside_sector(hit1, hit2->next->point)) { - PA_CHK_MARK(hit1->point[0], hit2->point[1]); - PA_CHK_MARK(hit2->point[0], hit2->point[1]); - return PA_CHK_ERROR(res, "lines is inside sector (3) at %mm;%mm or %mm;%mm", hit1->point[0], hit1->point[1], hit2->point[0], hit2->point[1]); - } - } - } - } - while ((a2 = a2->next) != a->head); - } - while ((a1 = a1->next) != a->head); - return pcb_false; -} - -pcb_bool pcb_polyarea_contour_check(pcb_pline_t *a) -{ - pa_chk_res_t res; - return pcb_polyarea_contour_check_(a, &res); -} - -void pcb_polyarea_bbox(pcb_polyarea_t * p, pcb_box_t * b) -{ - pcb_pline_t *n; - /*int cnt;*/ - - n = p->contours; - b->X1 = b->X2 = n->xmin; - b->Y1 = b->Y2 = n->ymin; - - for (/*cnt = 0*/; /*cnt < 2 */ n != NULL; n = n->next) { - if (n->xmin < b->X1) - b->X1 = n->xmin; - if (n->ymin < b->Y1) - b->Y1 = n->ymin; - if (n->xmax > b->X2) - b->X2 = n->xmax; - if (n->ymax > b->Y2) - b->Y2 = n->ymax; -/* if (n == p->contours) - cnt++;*/ - } -} - -#ifndef NDEBUG -static void pcb_poly_valid_report(pcb_pline_t *c, pcb_vnode_t *pl, pa_chk_res_t *chk) -{ - pcb_vnode_t *v, *n; - pcb_coord_t minx = COORD_MAX, miny = COORD_MAX, maxx = -COORD_MAX, maxy = -COORD_MAX; - -#define update_minmax(min, max, val) \ - if (val < min) min = val; \ - if (val > max) max = val; - if (chk != NULL) - pcb_fprintf(stderr, "Details: %s\n", chk->msg); - pcb_fprintf(stderr, "!!!animator start\n"); - v = pl; - do { - n = v->next; - update_minmax(minx, maxx, v->point[0]); - update_minmax(miny, maxy, v->point[1]); - update_minmax(minx, maxx, n->point[0]); - update_minmax(miny, maxy, n->point[1]); - } - while ((v = v->next) != pl); - pcb_fprintf(stderr, "scale 1 -1\n"); - pcb_fprintf(stderr, "viewport %mm %mm - %mm %mm\n", minx, miny, maxx, maxy); - pcb_fprintf(stderr, "frame\n"); - v = pl; - do { - n = v->next; - pcb_fprintf(stderr, "line %#mm %#mm %#mm %#mm\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=PCB_MM_TO_COORD(0.05); - fprintf(stderr, "color #770000\n"); - for(n = 0; n < chk->marks; n++) { - pcb_fprintf(stderr, "line %#mm %#mm %#mm %#mm\n", chk->x[n]-MR, chk->y[n]-MR, chk->x[n]+MR, chk->y[n]+MR); - pcb_fprintf(stderr, "line %#mm %#mm %#mm %#mm\n", chk->x[n]-MR, chk->y[n]+MR, chk->x[n]+MR, chk->y[n]-MR); - } - } - - if ((chk != NULL) && (chk->lines > 0)) { - int n; - fprintf(stderr, "color #990000\n"); - for(n = 0; n < chk->lines; n++) - pcb_fprintf(stderr, "line %#mm %#mm %#mm %#mm\n", chk->x1[n], chk->y1[n], chk->x2[n], chk->y2[n]); - } - - fprintf(stderr, "flush\n"); - fprintf(stderr, "!!!animator end\n"); - -#undef update_minmax -} -#endif - - -pcb_bool pcb_poly_valid(pcb_polyarea_t * p) -{ - pcb_pline_t *c; - pa_chk_res_t chk; - - if ((p == NULL) || (p->contours == NULL)) { -#if 0 -(disabled for too many false positive) -#ifndef NDEBUG - pcb_fprintf(stderr, "Invalid polyarea: no contours\n"); -#endif -#endif - return pcb_false; - } - - if (p->contours->Flags.orient == PCB_PLF_INV) { -#ifndef NDEBUG - pcb_fprintf(stderr, "Invalid Outer pcb_pline_t: failed orient\n"); - pcb_poly_valid_report(p->contours, p->contours->head, NULL); -#endif - return pcb_false; - } - - if (pcb_polyarea_contour_check_(p->contours, &chk)) { -#ifndef NDEBUG - pcb_fprintf(stderr, "Invalid Outer pcb_pline_t: failed contour check\n"); - pcb_poly_valid_report(p->contours, p->contours->head, &chk); -#endif - return pcb_false; - } - - for (c = p->contours->next; c != NULL; c = c->next) { - if (c->Flags.orient == PCB_PLF_DIR) { -#ifndef NDEBUG - pcb_fprintf(stderr, "Invalid Inner: pcb_pline_t orient = %d\n", c->Flags.orient); - pcb_poly_valid_report(c, c->head, NULL); -#endif - return pcb_false; - } - if (pcb_polyarea_contour_check_(c, &chk)) { -#ifndef NDEBUG - pcb_fprintf(stderr, "Invalid Inner: failed contour check\n"); - pcb_poly_valid_report(c, c->head, &chk); -#endif - return pcb_false; - } - if (!pcb_poly_contour_in_contour(p->contours, c)) { -#ifndef NDEBUG - pcb_fprintf(stderr, "Invalid Inner: overlap with outer\n"); - pcb_poly_valid_report(c, c->head, NULL); -#endif - return pcb_false; - } - } - return pcb_true; -} - - -pcb_vector_t vect_zero = { (long) 0, (long) 0 }; - -/*********************************************************************/ -/* L o n g V e c t o r S t u f f */ -/*********************************************************************/ - -void vect_init(pcb_vector_t v, double x, double y) -{ - v[0] = (long) x; - v[1] = (long) y; -} /* vect_init */ - -#define Vzero(a) ((a)[0] == 0. && (a)[1] == 0.) - -#define Vsub(a,b,c) {(a)[0]=(b)[0]-(c)[0];(a)[1]=(b)[1]-(c)[1];} - -int vect_equal(pcb_vector_t v1, pcb_vector_t v2) -{ - return (v1[0] == v2[0] && v1[1] == v2[1]); -} /* vect_equal */ - - -void vect_sub(pcb_vector_t res, pcb_vector_t v1, pcb_vector_t v2) -{ -Vsub(res, v1, v2)} /* vect_sub */ - -void vect_min(pcb_vector_t v1, pcb_vector_t v2, pcb_vector_t v3) -{ - v1[0] = (v2[0] < v3[0]) ? v2[0] : v3[0]; - v1[1] = (v2[1] < v3[1]) ? v2[1] : v3[1]; -} /* vect_min */ - -void vect_max(pcb_vector_t v1, pcb_vector_t v2, pcb_vector_t v3) -{ - v1[0] = (v2[0] > v3[0]) ? v2[0] : v3[0]; - v1[1] = (v2[1] > v3[1]) ? v2[1] : v3[1]; -} /* vect_max */ - -double pcb_vect_len2(pcb_vector_t v) -{ - return ((double) v[0] * v[0] + (double) v[1] * v[1]); /* why sqrt? only used for compares */ -} - -double pcb_vect_dist2(pcb_vector_t v1, pcb_vector_t v2) -{ - double dx = v1[0] - v2[0]; - double dy = v1[1] - v2[1]; - - return (dx * dx + dy * dy); /* why sqrt */ -} - -/* value has sign of angle between vectors */ -double pcb_vect_det2(pcb_vector_t v1, pcb_vector_t v2) -{ - return (((double) v1[0] * v2[1]) - ((double) v2[0] * v1[1])); -} - -static double vect_m_dist(pcb_vector_t v1, pcb_vector_t v2) -{ - double dx = v1[0] - v2[0]; - double dy = v1[1] - v2[1]; - double dd = (dx * dx + dy * dy); /* sqrt */ - - if (dx > 0) - return +dd; - if (dx < 0) - return -dd; - if (dy > 0) - return +dd; - return -dd; -} /* vect_m_dist */ - -/* -vect_inters2 - (C) 1993 Klamer Schutte - (C) 1997 Michael Leonov, Alexey Nikitin -*/ - -int pcb_vect_inters2(pcb_vector_t p1, pcb_vector_t p2, pcb_vector_t q1, pcb_vector_t q2, pcb_vector_t S1, pcb_vector_t S2) -{ - double s, t, deel; - double rpx, rpy, rqx, rqy; - - if (max(p1[0], p2[0]) < min(q1[0], q2[0]) || - max(q1[0], q2[0]) < min(p1[0], p2[0]) || max(p1[1], p2[1]) < min(q1[1], q2[1]) || max(q1[1], q2[1]) < min(p1[1], p2[1])) - return 0; - - rpx = p2[0] - p1[0]; - rpy = p2[1] - p1[1]; - rqx = q2[0] - q1[0]; - rqy = q2[1] - q1[1]; - - deel = rpy * rqx - rpx * rqy; /* -vect_det(rp,rq); */ - - /* coordinates are 30-bit integers so deel will be exactly zero - * if the lines are parallel - */ - - if (deel == 0) { /* parallel */ - double dc1, dc2, d1, d2, h; /* Check to see whether p1-p2 and q1-q2 are on the same line */ - pcb_vector_t hp1, hq1, hp2, hq2, q1p1, q1q2; - - Vsub2(q1p1, q1, p1); - Vsub2(q1q2, q1, q2); - - - /* If this product is not zero then p1-p2 and q1-q2 are not on same line! */ - if (pcb_vect_det2(q1p1, q1q2) != 0) - return 0; - dc1 = 0; /* m_len(p1 - p1) */ - - dc2 = vect_m_dist(p1, p2); - d1 = vect_m_dist(p1, q1); - d2 = vect_m_dist(p1, q2); - -/* Sorting the independent points from small to large */ - Vcpy2(hp1, p1); - Vcpy2(hp2, p2); - Vcpy2(hq1, q1); - Vcpy2(hq2, q2); - if (dc1 > dc2) { /* hv and h are used as help-variable. */ - Vswp2(hp1, hp2); - h = dc1, dc1 = dc2, dc2 = h; - } - if (d1 > d2) { - Vswp2(hq1, hq2); - h = d1, d1 = d2, d2 = h; - } - -/* Now the line-pieces are compared */ - - if (dc1 < d1) { - if (dc2 < d1) - return 0; - if (dc2 < d2) { - Vcpy2(S1, hp2); - Vcpy2(S2, hq1); - } - else { - Vcpy2(S1, hq1); - Vcpy2(S2, hq2); - }; - } - else { - if (dc1 > d2) - return 0; - if (dc2 < d2) { - Vcpy2(S1, hp1); - Vcpy2(S2, hp2); - } - else { - Vcpy2(S1, hp1); - Vcpy2(S2, hq2); - }; - } - return (Vequ2(S1, S2) ? 1 : 2); - } - else { /* not parallel */ - /* - * We have the lines: - * l1: p1 + s(p2 - p1) - * l2: q1 + t(q2 - q1) - * And we want to know the intersection point. - * Calculate t: - * p1 + s(p2-p1) = q1 + t(q2-q1) - * which is similar to the two equations: - * p1x + s * rpx = q1x + t * rqx - * p1y + s * rpy = q1y + t * rqy - * Multiplying these by rpy resp. rpx gives: - * rpy * p1x + s * rpx * rpy = rpy * q1x + t * rpy * rqx - * rpx * p1y + s * rpx * rpy = rpx * q1y + t * rpx * rqy - * Subtracting these gives: - * rpy * p1x - rpx * p1y = rpy * q1x - rpx * q1y + t * ( rpy * rqx - rpx * rqy ) - * So t can be isolated: - * t = (rpy * ( p1x - q1x ) + rpx * ( - p1y + q1y )) / ( rpy * rqx - rpx * rqy ) - * and s can be found similarly - * s = (rqy * (q1x - p1x) + rqx * (p1y - q1y))/( rqy * rpx - rqx * rpy) - */ - - if (Vequ2(q1, p1) || Vequ2(q1, p2)) { - S1[0] = q1[0]; - S1[1] = q1[1]; - } - else if (Vequ2(q2, p1) || Vequ2(q2, p2)) { - S1[0] = q2[0]; - S1[1] = q2[1]; - } - else { - s = (rqy * (p1[0] - q1[0]) + rqx * (q1[1] - p1[1])) / deel; - if (s < 0 || s > 1.) - return 0; - t = (rpy * (p1[0] - q1[0]) + rpx * (q1[1] - p1[1])) / deel; - if (t < 0 || t > 1.) - return 0; - - S1[0] = q1[0] + ROUND(t * rqx); - S1[1] = q1[1] + ROUND(t * rqy); - } - return 1; - } -} /* vect_inters2 */ - -/* - * pcb_pline_isect_line() - * (C) 2017, 2018 Tibor 'Igor2' Palinkas -*/ - -typedef struct { - pcb_vector_t l1, l2; - pcb_coord_t cx, cy; -} pline_isect_line_t; - -static pcb_r_dir_t pline_isect_line_cb(const pcb_box_t * b, void *cl) -{ - pline_isect_line_t *ctx = (pline_isect_line_t *)cl; - struct seg *s = (struct seg *)b; - pcb_vector_t S1, S2; - - if (pcb_vect_inters2(s->v->point, s->v->next->point, ctx->l1, ctx->l2, S1, S2)) { - ctx->cx = S1[0]; - ctx->cy = S1[1]; - return PCB_R_DIR_CANCEL; /* found */ - } - - return PCB_R_DIR_NOT_FOUND; -} - -pcb_bool pcb_pline_isect_line(pcb_pline_t *pl, pcb_coord_t lx1, pcb_coord_t ly1, pcb_coord_t lx2, pcb_coord_t ly2, pcb_coord_t *cx, pcb_coord_t *cy) -{ - pline_isect_line_t ctx; - pcb_box_t lbx; - ctx.l1[0] = lx1; ctx.l1[1] = ly1; - ctx.l2[0] = lx2; ctx.l2[1] = ly2; - lbx.X1 = MIN(lx1, lx2); - lbx.Y1 = MIN(ly1, ly2); - lbx.X2 = MAX(lx1, lx2); - lbx.Y2 = MAX(ly1, ly2); - - if (pl->tree == NULL) - pl->tree = (pcb_rtree_t *) pcb_poly_make_edge_tree(pl); - - if (pcb_r_search(pl->tree, &lbx, NULL, pline_isect_line_cb, &ctx, NULL) == PCB_R_DIR_CANCEL) { - if (cx != NULL) *cx = ctx.cx; - if (cy != NULL) *cy = ctx.cy; - return pcb_true; - } - return pcb_false; -} - -/* - * pcb_pline_isect_circle() - * (C) 2017 Tibor 'Igor2' Palinkas -*/ - -typedef struct { - pcb_coord_t cx, cy, r; - double r2; -} pline_isect_circ_t; - -static pcb_r_dir_t pline_isect_circ_cb(const pcb_box_t * b, void *cl) -{ - pline_isect_circ_t *ctx = (pline_isect_circ_t *)cl; - struct seg *s = (struct seg *)b; - pcb_vector_t S1, S2; - pcb_vector_t ray1, ray2; - double ox, oy, dx, dy, l; - - /* Cheap: if either line endpoint is within the circle, we sure have an intersection */ - if ((PCB_SQUARE(s->v->point[0] - ctx->cx) + PCB_SQUARE(s->v->point[1] - ctx->cy)) <= ctx->r2) - return PCB_R_DIR_CANCEL; /* found */ - if ((PCB_SQUARE(s->v->next->point[0] - ctx->cx) + PCB_SQUARE(s->v->next->point[1] - ctx->cy)) <= ctx->r2) - return PCB_R_DIR_CANCEL; /* found */ - - dx = s->v->point[0] - s->v->next->point[0]; - dy = s->v->point[1] - s->v->next->point[1]; - l = sqrt(PCB_SQUARE(dx) + PCB_SQUARE(dy)); - ox = -dy / l * (double)ctx->r; - oy = dx / l * (double)ctx->r; - - ray1[0] = ctx->cx - ox; ray1[1] = ctx->cy - oy; - ray2[0] = ctx->cx + ox; ray2[1] = ctx->cy + oy; - - if (pcb_vect_inters2(s->v->point, s->v->next->point, ray1, ray2, S1, S2)) - return PCB_R_DIR_CANCEL; /* found */ - - return PCB_R_DIR_NOT_FOUND; -} - -pcb_bool pcb_pline_isect_circ(pcb_pline_t *pl, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t r) -{ - pline_isect_circ_t ctx; - pcb_box_t cbx; - ctx.cx = cx; ctx.cy = cy; - ctx.r = r; ctx.r2 = (double)r * (double)r; - cbx.X1 = cx - r; cbx.Y1 = cy - r; - cbx.X2 = cx + r; cbx.Y2 = cy + r; - - if (pl->tree == NULL) - pl->tree = (pcb_rtree_t *) pcb_poly_make_edge_tree(pl); - - return pcb_r_search(pl->tree, &cbx, NULL, pline_isect_circ_cb, &ctx, NULL) == PCB_R_DIR_CANCEL; -} - - -/* - * pcb_pline_embraces_circle() - * If the circle does not intersect the polygon (the caller needs to check this) - * return whether the circle is fully within the polygon or not. - * Shoots a ray to the right from center+radius, then one to the left from - * center-radius; if both ray cross odd number of pline segments, we are in - * (or intersecting). - * (C) 2017 Tibor 'Igor2' Palinkas -*/ -static pcb_r_dir_t pline_embraces_circ_cb(const pcb_box_t * b, void *cl) -{ - int *cnt = (int *)cl; - (*cnt)++; - return PCB_R_DIR_NOT_FOUND; -} - -pcb_bool pcb_pline_embraces_circ(pcb_pline_t *pl, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t r) -{ - pcb_box_t bx; - int cnt; - - bx.Y1 = cy; bx.Y2 = cy+1; - if (pl->tree == NULL) - pl->tree = (pcb_rtree_t *) pcb_poly_make_edge_tree(pl); - - /* ray to the right */ - bx.X1 = cx + r; - bx.X2 = COORD_MAX; - cnt = 0; - pcb_r_search(pl->tree, &bx, NULL, pline_embraces_circ_cb, &cnt, NULL); - if ((cnt % 2) == 0) - return pcb_false; - - /* ray to the right */ - bx.X1 = -COORD_MAX; - bx.X2 = cx - r; - cnt = 0; - pcb_r_search(pl->tree, &bx, NULL, pline_embraces_circ_cb, &cnt, NULL); - if ((cnt % 2) == 0) - return pcb_false; - - return pcb_true; -} - -/* - * pcb_pline_isect_circle() - * (C) 2017 Tibor 'Igor2' Palinkas -*/ -pcb_bool pcb_pline_overlaps_circ(pcb_pline_t *pl, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t r) -{ - pcb_box_t cbx, pbx; - cbx.X1 = cx - r; cbx.Y1 = cy - r; - cbx.X2 = cx + r; cbx.Y2 = cy + r; - pbx.X1 = pl->xmin; pbx.Y1 = pl->ymin; - pbx.X2 = pl->xmax; pbx.Y2 = pl->ymax; - - /* if there's no overlap in bounding boxes, don't do any expensive calc */ - if (!(pcb_box_intersect(&cbx, &pbx))) - return pcb_false; - - if (pl->tree == NULL) - pl->tree = (pcb_rtree_t *) pcb_poly_make_edge_tree(pl); - - if (pcb_pline_isect_circ(pl, cx, cy, r)) - return pcb_true; - - return pcb_pline_embraces_circ(pl, cx, cy, r); -} - - -/* - * pcb_is_point_in_convex_quad() - * (C) 2017 Tibor 'Igor2' Palinkas -*/ -pcb_bool_t pcb_is_point_in_convex_quad(pcb_vector_t p, pcb_vector_t *q) -{ - return point_in_triangle(q[0], q[1], q[2], p) || point_in_triangle(q[0], q[3], q[2], p); -} - - -/* - * pcb_polyarea_move() - * (C) 2017 Tibor 'Igor2' Palinkas -*/ -void pcb_polyarea_move(pcb_polyarea_t *pa1, pcb_coord_t dx, pcb_coord_t dy) -{ - int cnt; - pcb_polyarea_t *pa; - - for (pa = pa1, cnt = 0; pa != NULL; pa = pa->f) { - pcb_pline_t *pl; - if (pa == pa1) { - cnt++; - if (cnt > 1) - break; - } - if (pa->contour_tree != NULL) - pcb_r_destroy_tree(&pa->contour_tree); - pa->contour_tree = pcb_r_create_tree(); - for(pl = pa->contours; pl != NULL; pl = pl->next) { - pcb_vnode_t *v; - int cnt2 = 0; - for(v = pl->head; v != NULL; v = v->next) { - if (v == pl->head) { - cnt2++; - if (cnt2 > 1) - break; - } - v->point[0] += dx; - v->point[1] += dy; - } - pl->xmin += dx; - pl->ymin += dy; - pl->xmax += dx; - pl->ymax += dy; - if (pl->tree != NULL) { - pcb_r_free_tree_data(pl->tree, free); - pcb_r_destroy_tree(&pl->tree); - } - pl->tree = (pcb_rtree_t *)pcb_poly_make_edge_tree(pl); - - pcb_r_insert_entry(pa->contour_tree, (pcb_box_t *)pl); - } - } -} - -#include "polygon_selfi.c" - -void pcb_polyarea_get_tree_seg(void *obj, pcb_coord_t *x1, pcb_coord_t *y1, pcb_coord_t *x2, pcb_coord_t *y2) -{ - struct seg *s = obj; - *x1 = s->v->point[0]; - *x2 = s->v->next->point[0]; - *y1 = s->v->point[1]; - *y2 = s->v->next->point[1]; -} - -/* how about expanding polygons so that edges can be arcs rather than - * lines. Consider using the third coordinate to store the radius of the - * arc. The arc would pass through the vertex points. Positive radius - * would indicate the arc bows left (center on right of P1-P2 path) - * negative radius would put the center on the other side. 0 radius - * would mean the edge is a line instead of arc - * The intersections of the two circles centered at the vertex points - * would determine the two possible arc centers. If P2.x > P1.x then - * the center with smaller Y is selected for positive r. If P2.y > P1.y - * then the center with greater X is selected for positive r. - * - * the vec_inters2() routine would then need to handle line-line - * line-arc and arc-arc intersections. - * - * perhaps reverse tracing the arc would require look-ahead to check - * for arcs - */ Index: trunk/src/polyarea.h =================================================================== --- trunk/src/polyarea.h (revision 29282) +++ trunk/src/polyarea.h (nonexistent) @@ -1,204 +0,0 @@ -/* - poly_Boolean: a polygon clip library - Copyright (C) 1997 Alexey Nikitin, Michael Leonov - leonov@propro.iis.nsk.su - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - polyarea.h - (C) 1997 Alexey Nikitin, Michael Leonov - (C) 1997 Klamer Schutte (minor patches) -*/ - -#ifndef PCB_POLYAREA_H -#define PCB_POLYAREA_H - -#define PCB_PLF_DIR 1 -#define PCB_PLF_INV 0 -#define PCB_PLF_MARK 1 - -typedef pcb_coord_t pcb_vertex_t[2]; /* longing point representation of coordinates */ -typedef pcb_vertex_t pcb_vector_t; - -#define pcb_vertex_equ(a,b) (memcmp((a),(b),sizeof(pcb_vector_t))==0) -#define pcb_vertex_cpy(a,b) memcpy((a),(b),sizeof(pcb_vector_t)) - - -extern pcb_vector_t vect_zero; - -enum { - pcb_err_no_memory = 2, - pcb_err_bad_parm = 3, - pcb_err_ok = 0 -}; - - -typedef struct pcb_cvc_list_s pcb_cvc_list_t; -typedef struct pcb_vnode_s pcb_vnode_t; -struct pcb_cvc_list_s { - double angle; - pcb_vnode_t *parent; - pcb_cvc_list_t *prev, *next, *head; - char poly, side; -}; -struct pcb_vnode_s { - pcb_vnode_t *next, *prev, *shared; - struct { - unsigned int status:3; - unsigned int mark:1; - unsigned int in_hub:1; - } Flags; - pcb_cvc_list_t *cvc_prev; - pcb_cvc_list_t *cvc_next; - pcb_vector_t point; -}; - -typedef struct pcb_pline_s pcb_pline_t; -struct pcb_pline_s { - pcb_coord_t xmin, ymin, xmax, ymax; - pcb_pline_t *next; - pcb_vnode_t *head; - unsigned int Count; - double area; - pcb_rtree_t *tree; - pcb_bool is_round; - pcb_coord_t cx, cy; - pcb_coord_t radius; - struct { - unsigned int status:3; - unsigned int orient:1; - } Flags; -}; - -pcb_pline_t *pcb_poly_contour_new(const pcb_vector_t v); - -void pcb_poly_contour_init(pcb_pline_t *c); -void pcb_poly_contour_clear(pcb_pline_t *c); /* clears list of vertices */ -void pcb_poly_contour_del(pcb_pline_t **c); - -pcb_bool pcb_poly_contour_copy(pcb_pline_t **dst, const pcb_pline_t *src); - -void pcb_poly_contour_pre(pcb_pline_t *c, pcb_bool optimize); /* prepare contour */ -void pcb_poly_contour_inv(pcb_pline_t *c); /* invert contour */ - -pcb_vnode_t *pcb_poly_node_create(pcb_vector_t v); - -void pcb_poly_vertex_include(pcb_vnode_t *after, pcb_vnode_t *node); -void pcb_poly_vertex_include_force(pcb_vnode_t *after, pcb_vnode_t *node); /* do not remove nodes even if on the same line */ -void pcb_poly_vertex_exclude(pcb_pline_t *parent, pcb_vnode_t *node); - -/**********************************************************************/ - -struct pcb_polyarea_s { - pcb_polyarea_t *f, *b; - pcb_pline_t *contours; - pcb_rtree_t *contour_tree; -}; - -pcb_bool pcb_polyarea_m_copy0(pcb_polyarea_t **dst, const pcb_polyarea_t *srcfst); -void pcb_polyarea_m_include(pcb_polyarea_t **list, pcb_polyarea_t *a); - -pcb_bool pcb_polyarea_copy0(pcb_polyarea_t **dst, const pcb_polyarea_t *src); -pcb_bool pcb_polyarea_copy1(pcb_polyarea_t *dst, const pcb_polyarea_t *src); - -pcb_bool pcb_polyarea_contour_include(pcb_polyarea_t *p, pcb_pline_t *c); -pcb_bool pcb_polyarea_contour_exclude(pcb_polyarea_t *p, pcb_pline_t *c); - - -pcb_bool pcb_polyarea_contour_check(pcb_pline_t *a); - -pcb_bool pcb_polyarea_contour_inside(pcb_polyarea_t *c, pcb_vector_t v0); -pcb_bool pcb_polyarea_touching(pcb_polyarea_t *p1, pcb_polyarea_t *p2); - -/*** tools for clipping ***/ - -/* checks whether point lies within contour independently of its orientation */ - -int pcb_poly_contour_inside(const pcb_pline_t *c, pcb_vector_t v); -int pcb_poly_contour_in_contour(pcb_pline_t *poly, pcb_pline_t *inner); -pcb_polyarea_t *pcb_polyarea_create(void); - -void pcb_polyarea_free(pcb_polyarea_t **p); -void pcb_polyarea_init(pcb_polyarea_t *p); -void pcb_poly_contours_free(pcb_pline_t **pl); -pcb_bool pcb_poly_valid(pcb_polyarea_t *p); - -enum pcb_poly_bool_op_e { - PCB_PBO_UNITE, - PCB_PBO_ISECT, - PCB_PBO_SUB, - PCB_PBO_XOR -}; - -double pcb_vect_dist2(pcb_vector_t v1, pcb_vector_t v2); -double pcb_vect_det2(pcb_vector_t v1, pcb_vector_t v2); -double pcb_vect_len2(pcb_vector_t v1); - -int pcb_vect_inters2(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D, pcb_vector_t S1, pcb_vector_t S2); - -int pcb_polyarea_boolean(const pcb_polyarea_t *a, const pcb_polyarea_t *b, pcb_polyarea_t **res, int action); -int pcb_polyarea_boolean_free(pcb_polyarea_t *a, pcb_polyarea_t *b, pcb_polyarea_t **res, int action); -int pcb_polyarea_and_subtract_free(pcb_polyarea_t *a, pcb_polyarea_t *b, pcb_polyarea_t **aandb, pcb_polyarea_t **aminusb); -int pcb_polyarea_save(pcb_polyarea_t *PA, char *fname); - -/* calculate the bounding box of a pcb_polyarea_t and save result in b */ -void pcb_polyarea_bbox(pcb_polyarea_t *p, pcb_box_t *b); - -/* Move each point of pa1 by dx and dy */ -void pcb_polyarea_move(pcb_polyarea_t *pa1, pcb_coord_t dx, pcb_coord_t dy); - -/*** Tools for building polygons for common object shapes ***/ - - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif -double pcb_round(double x); /* from math_helper.h */ - -/* Calculate an endpoint of an arc and return the result in *x;*y */ -PCB_INLINE void pcb_arc_get_endpt(pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t astart, pcb_angle_t adelta, int which, pcb_coord_t *x, pcb_coord_t *y) -{ - if (which == 0) { - *x = pcb_round((double)cx - (double)width * cos(astart * (M_PI/180.0))); - *y = pcb_round((double)cy + (double)height * sin(astart * (M_PI/180.0))); - } - else { - *x = pcb_round((double)cx - (double)width * cos((astart + adelta) * (M_PI/180.0))); - *y = pcb_round((double)cy + (double)height * sin((astart + adelta) * (M_PI/180.0))); - } -} - -/*** constants for the poly shape generator ***/ - -/* polygon diverges from modelled arc no more than MAX_ARC_DEVIATION * thick */ -#define PCB_POLY_ARC_MAX_DEVIATION 0.02 - -#define PCB_POLY_CIRC_SEGS 40 -#define PCB_POLY_CIRC_SEGS_F ((float)PCB_POLY_CIRC_SEGS) - -/* adjustment to make the segments outline the circle rather than connect - points on the circle: 1 - cos (\alpha / 2) < (\alpha / 2) ^ 2 / 2 */ -#define PCB_POLY_CIRC_RADIUS_ADJ \ - (1.0 + M_PI / PCB_POLY_CIRC_SEGS_F * M_PI / PCB_POLY_CIRC_SEGS_F / 2.0) - -/*** special purpose, internal tools ***/ -/* Convert a struct seg *obj extracted from a pline->tree into coords */ -void pcb_polyarea_get_tree_seg(void *obj, pcb_coord_t *x1, pcb_coord_t *y1, pcb_coord_t *x2, pcb_coord_t *y2); - -/* create a (pcb_rtree_t *) of each seg derived from src */ -void *pcb_poly_make_edge_tree(pcb_pline_t *src); - - -#endif /* PCB_POLYAREA_H */ Index: trunk/src/rtree.c =================================================================== --- trunk/src/rtree.c (revision 29282) +++ trunk/src/rtree.c (nonexistent) @@ -1,174 +0,0 @@ - /* - * COPYRIGHT - * - * pcb-rnd, interactive printed circuit board design - * Copyright (C) 2017 Tibor 'Igor2' Palinkas - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Contact: - * Project page: http://repo.hu/projects/pcb-rnd - * lead developer: http://repo.hu/projects/pcb-rnd/contact.html - * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") - */ - -#include "config.h" - -#include -#include -#include - -#include -#include "rtree.h" - -#include -#include -#include -#include -#include "rtree2_compat.h" - -/* Temporary compatibility layer for the transition */ -pcb_rtree_t *pcb_r_create_tree(void) -{ - pcb_rtree_t *root = malloc(sizeof(pcb_rtree_t)); - pcb_rtree_init(root); - return root; -} - -void pcb_r_destroy_tree(pcb_rtree_t **tree) -{ - pcb_rtree_uninit(*tree); - free(*tree); - *tree = NULL; -} - -void pcb_r_insert_entry(pcb_rtree_t *rtree, const pcb_box_t *which) -{ - pcb_any_obj_t *obj = (pcb_any_obj_t *)which; /* assumes first field is the bounding box */ - assert(obj != NULL); - pcb_rtree_insert(rtree, obj, (pcb_rtree_box_t *)which); -} - -void pcb_r_insert_array(pcb_rtree_t *rtree, const pcb_box_t *boxlist[], pcb_cardinal_t len) -{ - pcb_cardinal_t n; - - if (len == 0) - return; - - assert(boxlist != 0); - - for(n = 0; n < len; n++) - pcb_r_insert_entry(rtree, boxlist[n]); -} - -pcb_bool pcb_r_delete_entry(pcb_rtree_t *rtree, const pcb_box_t *which) -{ - pcb_any_obj_t *obj = (pcb_any_obj_t *)which; /* assumes first field is the bounding box */ - assert(obj != NULL); - return pcb_rtree_delete(rtree, obj, (pcb_rtree_box_t *)which) == 0; -} - -pcb_bool pcb_r_delete_entry_free_data(pcb_rtree_t *rtree, const pcb_box_t *box, void (*free_data)(void *d)) -{ - pcb_any_obj_t *obj = (pcb_any_obj_t *)box; /* assumes first field is the bounding box */ - assert(obj != NULL); - if (pcb_rtree_delete(rtree, obj, (pcb_rtree_box_t *)box) != 0) - return pcb_false; - free_data(obj); - return pcb_true; -} - -typedef struct { - pcb_r_dir_t (*region_in_search)(const pcb_box_t *region, void *closure); - pcb_r_dir_t (*rectangle_in_region)(const pcb_box_t *box, void *closure); - void *clo; -} r_cb_t; - -static pcb_rtree_dir_t r_cb_node(void *ctx_, void *obj, const pcb_rtree_box_t *box) -{ - r_cb_t *ctx = (r_cb_t *)ctx_; - return ctx->region_in_search((const pcb_box_t *)box, ctx->clo); -} - -static pcb_rtree_dir_t r_cb_obj(void *ctx_, void *obj, const pcb_rtree_box_t *box) -{ - r_cb_t *ctx = (r_cb_t *)ctx_; - return ctx->rectangle_in_region((const pcb_box_t *)obj, ctx->clo); -} - - -pcb_r_dir_t pcb_r_search(pcb_rtree_t *rtree, const pcb_box_t *query, - pcb_r_dir_t (*region_in_search)(const pcb_box_t *region, void *closure), - pcb_r_dir_t (*rectangle_in_region)(const pcb_box_t *box, void *closure), - void *closure, int *num_found) -{ - pcb_r_dir_t res; - pcb_rtree_cardinal_t out_cnt; - r_cb_t ctx; - ctx.region_in_search = region_in_search; - ctx.rectangle_in_region = rectangle_in_region; - ctx.clo = closure; - - res = pcb_rtree_search_any(rtree, (const pcb_rtree_box_t *)query, - (ctx.region_in_search != NULL) ? r_cb_node : NULL, - (ctx.rectangle_in_region != NULL) ? r_cb_obj : NULL, - &ctx, &out_cnt); - - if (num_found != NULL) - *num_found = out_cnt; - - return res; -} - -int pcb_r_region_is_empty(pcb_rtree_t *rtree, const pcb_box_t *region) -{ - return pcb_rtree_is_box_empty(rtree, (const pcb_rtree_box_t *)region); -} - -static void r_print_obj(FILE *f, void *obj) -{ - fprintf(f, "\n", obj); -} - -void pcb_r_dump_tree(pcb_rtree_t *root, int unused) -{ - pcb_rtree_dump_text(stdout, root, r_print_obj); -} - -void pcb_r_free_tree_data(pcb_rtree_t *rtree, void (*free)(void *ptr)) -{ - pcb_rtree_it_t it; - void *o; - - for(o = pcb_rtree_all_first(&it, rtree); o != NULL; o = pcb_rtree_all_next(&it)) - free(o); -} - -pcb_box_t *pcb_r_first(pcb_rtree_t *tree, pcb_rtree_it_t *it) -{ - if (tree == NULL) - return NULL; - return (pcb_box_t *)pcb_rtree_all_first(it, tree); -} - -pcb_box_t *pcb_r_next(pcb_rtree_it_t *it) -{ - return (pcb_box_t *)pcb_rtree_all_next(it); -} - -void pcb_r_end(pcb_rtree_it_t *it) -{ -} Index: trunk/src/rtree.h =================================================================== --- trunk/src/rtree.h (revision 29282) +++ trunk/src/rtree.h (nonexistent) @@ -1,46 +0,0 @@ - /* - * COPYRIGHT - * - * pcb-rnd, interactive printed circuit board design - * Copyright (C) 2017 Tibor 'Igor2' Palinkas - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Contact: - * Project page: http://repo.hu/projects/pcb-rnd - * lead developer: http://repo.hu/projects/pcb-rnd/contact.html - * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") - */ - -#ifndef PCB_RTREE_H -#define PCB_RTREE_H - -#include - -typedef long int pcb_rtree_cardinal_t; -typedef pcb_coord_t pcb_rtree_coord_t; - -/* Instantiate an rtree */ -#define RTR(n) pcb_rtree_ ## n -#define RTRU(n) pcb_RTREE_ ## n -#define pcb_rtree_privfunc static -#define pcb_rtree_size 6 -#define pcb_rtree_stack_max 1024 - -#define RTREE_NO_TREE_TYPEDEFS - -#include - -#endif /* PCB_RTREE_H */ Index: trunk/src/polygon1_gen.c =================================================================== --- trunk/src/polygon1_gen.c (revision 29282) +++ trunk/src/polygon1_gen.c (nonexistent) @@ -1,539 +0,0 @@ -/* - * COPYRIGHT - * - * pcb-rnd, interactive printed circuit board design - * (this file is based on PCB, interactive printed circuit board design) - * Copyright (C) 1994,1995,1996,2010 Thomas Nau - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact: - * Project page: http://repo.hu/projects/pcb-rnd - * lead developer: http://repo.hu/projects/pcb-rnd/contact.html - * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") - * - */ - -#include "config.h" - -#include -#include -#include - -#include -#include "polyarea.h" -#include -#include - -#include "polygon1_gen.h" - -/* kept to ensure nanometer compatibility */ -#define ROUND(x) ((long)(((x) >= 0 ? (x) + 0.5 : (x) - 0.5))) - -static double rotate_circle_seg[4]; -int rotate_circle_seg_inited = 0; - -static void init_rotate_cache(void) -{ - if (!rotate_circle_seg_inited) { - double cos_ang = cos(2.0 * M_PI / PCB_POLY_CIRC_SEGS_F); - double sin_ang = sin(2.0 * M_PI / PCB_POLY_CIRC_SEGS_F); - - rotate_circle_seg[0] = cos_ang; - rotate_circle_seg[1] = -sin_ang; - rotate_circle_seg[2] = sin_ang; - rotate_circle_seg[3] = cos_ang; - rotate_circle_seg_inited = 1; - } -} - -pcb_polyarea_t *pcb_poly_from_contour(pcb_pline_t * contour) -{ - pcb_polyarea_t *p; - pcb_poly_contour_pre(contour, pcb_true); - assert(contour->Flags.orient == PCB_PLF_DIR); - if (!(p = pcb_polyarea_create())) - return NULL; - pcb_polyarea_contour_include(p, contour); - assert(pcb_poly_valid(p)); - return p; -} - -pcb_polyarea_t *pcb_poly_from_contour_autoinv(pcb_pline_t *contour) -{ - pcb_polyarea_t *p; - pcb_poly_contour_pre(contour, pcb_true); - if (contour->Flags.orient != PCB_PLF_DIR) - pcb_poly_contour_inv(contour); - if (!(p = pcb_polyarea_create())) - return NULL; - pcb_polyarea_contour_include(p, contour); - assert(pcb_poly_valid(p)); - return p; -} - - -#define ARC_ANGLE 5 -static pcb_polyarea_t *ArcPolyNoIntersect(pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t astart, pcb_angle_t adelta, pcb_coord_t thick, int end_caps) -{ - pcb_pline_t *contour = NULL; - pcb_polyarea_t *np = NULL; - pcb_vector_t v, v2; - int i, segs; - double ang, da, rx, ry; - long half; - double radius_adj; - pcb_coord_t edx, edy, endx1, endx2, endy1, endy2; - - if (thick <= 0) - return NULL; - if (adelta < 0) { - astart += adelta; - adelta = -adelta; - } - half = (thick + 1) / 2; - - pcb_arc_get_endpt(cx, cy, width, height, astart, adelta, 0, &endx1, &endy1); - pcb_arc_get_endpt(cx, cy, width, height, astart, adelta, 1, &endx2, &endy2); - - /* start with inner radius */ - rx = MAX(width - half, 0); - ry = MAX(height - half, 0); - segs = 1; - if (thick > 0) - segs = MAX(segs, adelta * M_PI / 360 * - sqrt(sqrt((double) rx * rx + (double) ry * ry) / PCB_POLY_ARC_MAX_DEVIATION / 2 / thick)); - segs = MAX(segs, adelta / ARC_ANGLE); - - ang = astart; - da = (1.0 * adelta) / segs; - radius_adj = (M_PI * da / 360) * (M_PI * da / 360) / 2; - v[0] = cx - rx * cos(ang * PCB_M180); - v[1] = cy + ry * sin(ang * PCB_M180); - if ((contour = pcb_poly_contour_new(v)) == NULL) - return 0; - for (i = 0; i < segs - 1; i++) { - ang += da; - v[0] = cx - rx * cos(ang * PCB_M180); - v[1] = cy + ry * sin(ang * PCB_M180); - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - } - /* find last point */ - ang = astart + adelta; - v[0] = cx - rx * cos(ang * PCB_M180) * (1 - radius_adj); - v[1] = cy + ry * sin(ang * PCB_M180) * (1 - radius_adj); - - /* add the round cap at the end */ - if (end_caps) - pcb_poly_frac_circle(contour, endx2, endy2, v, 2); - - /* and now do the outer arc (going backwards) */ - rx = (width + half) * (1 + radius_adj); - ry = (width + half) * (1 + radius_adj); - da = -da; - for (i = 0; i < segs; i++) { - v[0] = cx - rx * cos(ang * PCB_M180); - v[1] = cy + ry * sin(ang * PCB_M180); - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - ang += da; - } - - /* explicitly draw the last point if the manhattan-distance is large enough */ - ang = astart; - v2[0] = cx - rx * cos(ang * PCB_M180) * (1 - radius_adj); - v2[1] = cy + ry * sin(ang * PCB_M180) * (1 - radius_adj); - edx = (v[0] - v2[0]); - edy = (v[1] - v2[1]); - if (edx < 0) edx = -edx; - if (edy < 0) edy = -edy; - if (edx+edy > PCB_MM_TO_COORD(0.001)) - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v2)); - - - /* now add other round cap */ - if (end_caps) - pcb_poly_frac_circle(contour, endx1, endy1, v2, 2); - - /* now we have the whole contour */ - if (!(np = pcb_poly_from_contour(contour))) - return NULL; - return np; -} - -pcb_polyarea_t *pcb_poly_from_rect(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2) -{ - pcb_pline_t *contour = NULL; - pcb_vector_t v; - - /* Return NULL for zero or negatively sized rectangles */ - if (x2 <= x1 || y2 <= y1) - return NULL; - - v[0] = x1; - v[1] = y1; - if ((contour = pcb_poly_contour_new(v)) == NULL) - return NULL; - v[0] = x2; - v[1] = y1; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - v[0] = x2; - v[1] = y2; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - v[0] = x1; - v[1] = y2; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - return pcb_poly_from_contour(contour); -} - -pcb_polyarea_t *pcb_poly_from_octagon(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius, int style) -{ - pcb_pline_t *contour = NULL; - pcb_vector_t v; - double xm[8], ym[8]; - - pcb_poly_square_pin_factors(style, xm, ym); - -TODO(": rewrite this to use the same table as the square/oct pin draw function") - /* point 7 */ - v[0] = x + ROUND(radius * 0.5) * xm[7]; - v[1] = y + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[7]; - if ((contour = pcb_poly_contour_new(v)) == NULL) - return NULL; - /* point 6 */ - v[0] = x + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[6]; - v[1] = y + ROUND(radius * 0.5) * ym[6]; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - /* point 5 */ - v[0] = x - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[5]; - v[1] = y + ROUND(radius * 0.5) * ym[5]; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - /* point 4 */ - v[0] = x - ROUND(radius * 0.5) * xm[4]; - v[1] = y + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[4]; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - /* point 3 */ - v[0] = x - ROUND(radius * 0.5) * xm[3]; - v[1] = y - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[3]; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - /* point 2 */ - v[0] = x - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[2]; - v[1] = y - ROUND(radius * 0.5) * ym[2]; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - /* point 1 */ - v[0] = x + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[1]; - v[1] = y - ROUND(radius * 0.5) * ym[1]; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - /* point 0 */ - v[0] = x + ROUND(radius * 0.5) * xm[0]; - v[1] = y - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[0]; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - return pcb_poly_from_contour(contour); -} - -static void pcb_poly_frac_circle_(pcb_pline_t * c, pcb_coord_t X, pcb_coord_t Y, pcb_vector_t v, int range, int add_last) -{ - double oe1, oe2, e1, e2, t1; - int i, orange = range; - - init_rotate_cache(); - - oe1 = (v[0] - X); - oe2 = (v[1] - Y); - - pcb_poly_vertex_include(c->head->prev, pcb_poly_node_create(v)); - - /* move vector to origin */ - e1 = (v[0] - X) * PCB_POLY_CIRC_RADIUS_ADJ; - e2 = (v[1] - Y) * PCB_POLY_CIRC_RADIUS_ADJ; - - /* NB: the caller adds the last vertex, hence the -1 */ - range = PCB_POLY_CIRC_SEGS / range - 1; - for (i = 0; i < range; i++) { - /* rotate the vector */ - t1 = rotate_circle_seg[0] * e1 + rotate_circle_seg[1] * e2; - e2 = rotate_circle_seg[2] * e1 + rotate_circle_seg[3] * e2; - e1 = t1; - v[0] = X + ROUND(e1); - v[1] = Y + ROUND(e2); - pcb_poly_vertex_include(c->head->prev, pcb_poly_node_create(v)); - } - - if ((add_last) && (orange == 4)) { - v[0] = X - ROUND(oe2); - v[1] = Y + ROUND(oe1); - pcb_poly_vertex_include(c->head->prev, pcb_poly_node_create(v)); - } -} - - -/* add vertices in a fractional-circle starting from v - * centered at X, Y and going counter-clockwise - * does not include the first point - * last argument is 1 for a full circle - * 2 for a half circle - * or 4 for a quarter circle - */ -void pcb_poly_frac_circle(pcb_pline_t * c, pcb_coord_t X, pcb_coord_t Y, pcb_vector_t v, int range) -{ - pcb_poly_frac_circle_(c, X, Y, v, range, 0); -} - -/* same but adds the last vertex */ -void pcb_poly_frac_circle_end(pcb_pline_t * c, pcb_coord_t X, pcb_coord_t Y, pcb_vector_t v, int range) -{ - pcb_poly_frac_circle_(c, X, Y, v, range, 1); -} - - -/* create a circle approximation from lines */ -pcb_polyarea_t *pcb_poly_from_circle(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius) -{ - pcb_pline_t *contour; - pcb_vector_t v; - - if (radius <= 0) - return NULL; - v[0] = x + radius; - v[1] = y; - if ((contour = pcb_poly_contour_new(v)) == NULL) - return NULL; - pcb_poly_frac_circle(contour, x, y, v, 1); - contour->is_round = pcb_true; - contour->cx = x; - contour->cy = y; - contour->radius = radius; - return pcb_poly_from_contour(contour); -} - -/* make a rounded-corner rectangle with radius t beyond x1,x2,y1,y2 rectangle */ -pcb_polyarea_t *RoundRect(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2, pcb_coord_t t) -{ - pcb_pline_t *contour = NULL; - pcb_vector_t v; - - assert(x2 > x1); - assert(y2 > y1); - v[0] = x1 - t; - v[1] = y1; - if ((contour = pcb_poly_contour_new(v)) == NULL) - return NULL; - pcb_poly_frac_circle_end(contour, x1, y1, v, 4); - v[0] = x2; - v[1] = y1 - t; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - pcb_poly_frac_circle_end(contour, x2, y1, v, 4); - v[0] = x2 + t; - v[1] = y2; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - pcb_poly_frac_circle_end(contour, x2, y2, v, 4); - v[0] = x1; - v[1] = y2 + t; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - pcb_poly_frac_circle_end(contour, x1, y2, v, 4); - return pcb_poly_from_contour(contour); -} - - -pcb_polyarea_t *pcb_poly_from_line(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t thick, pcb_bool square) -{ - pcb_pline_t *contour = NULL; - pcb_polyarea_t *np = NULL; - pcb_vector_t v; - double d, dx, dy; - long half; - - if (thick <= 0) - return NULL; - half = (thick + 1) / 2; - d = sqrt(PCB_SQUARE(x1 - x2) + PCB_SQUARE(y1 - y2)); - if (!square) - if (d == 0) /* line is a point */ - return pcb_poly_from_circle(x1, y1, half); - if (d != 0) { - d = half / d; - dx = (y1 - y2) * d; - dy = (x2 - x1) * d; - } - else { - dx = half; - dy = 0; - } - if (square) { /* take into account the ends */ - x1 -= dy; - y1 += dx; - x2 += dy; - y2 -= dx; - } - v[0] = x1 - dx; - v[1] = y1 - dy; - if ((contour = pcb_poly_contour_new(v)) == NULL) - return 0; - v[0] = x2 - dx; - v[1] = y2 - dy; - if (square) - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - else - pcb_poly_frac_circle(contour, x2, y2, v, 2); - v[0] = x2 + dx; - v[1] = y2 + dy; - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - v[0] = x1 + dx; - v[1] = y1 + dy; - if (square) - pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); - else - pcb_poly_frac_circle(contour, x1, y1, v, 2); - /* now we have the line contour */ - if (!(np = pcb_poly_from_contour(contour))) - return NULL; - return np; -} - -#define MIN_CLEARANCE_BEFORE_BISECT 10. -pcb_polyarea_t *pcb_poly_from_arc(pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t astart, pcb_angle_t adelta, pcb_coord_t thick) -{ - double delta; - pcb_coord_t half; - - delta = (adelta < 0) ? -adelta : adelta; - - half = (thick + 1) / 2; - - /* corner case: can't even calculate the end cap properly because radius - is so small that there's no inner arc of the clearance */ - if ((width - half <= 0) || (height - half <= 0)) { - pcb_coord_t lx1, ly1; - pcb_polyarea_t *tmp_arc, *tmp1, *tmp2, *res, *ends; - - tmp_arc = ArcPolyNoIntersect(cx, cy, width, height, astart, adelta, thick, 0); - - pcb_arc_get_endpt(cx, cy, width, height, astart, adelta, 0, &lx1, &ly1); - tmp1 = pcb_poly_from_line(lx1, ly1, lx1, ly1, thick, 0); - - pcb_arc_get_endpt(cx, cy, width, height, astart, adelta, 1, &lx1, &ly1); - tmp2 = pcb_poly_from_line(lx1, ly1, lx1, ly1, thick, 0); - - pcb_polyarea_boolean_free(tmp1, tmp2, &ends, PCB_PBO_UNITE); - pcb_polyarea_boolean_free(ends, tmp_arc, &res, PCB_PBO_UNITE); - return res; - } - - /* If the arc segment would self-intersect, we need to construct it as the union of - two non-intersecting segments */ - if (2 * M_PI * width * (1. - (double) delta / 360.) - thick < MIN_CLEARANCE_BEFORE_BISECT) { - pcb_polyarea_t *tmp1, *tmp2, *res; - int half_delta = adelta / 2; - - tmp1 = ArcPolyNoIntersect(cx, cy, width, height, astart, half_delta, thick, 1); - tmp2 = ArcPolyNoIntersect(cx, cy, width, height, astart+half_delta, adelta-half_delta, thick, 1); - pcb_polyarea_boolean_free(tmp1, tmp2, &res, PCB_PBO_UNITE); - return res; - } - - return ArcPolyNoIntersect(cx, cy, width, height, astart, adelta, thick, 1); -} - - -/* set up x and y multiplier for an octa poly, depending on square pin style - (used in early versions of pcb-rnd, before custom shape padstacks) */ -void pcb_poly_square_pin_factors(int style, double *xm, double *ym) -{ - int i; - const double factor = 2.0; - - /* reset multipliers */ - for (i = 0; i < 8; i++) { - xm[i] = 1; - ym[i] = 1; - } - - style--; - if (style & 1) - xm[0] = xm[1] = xm[6] = xm[7] = factor; - if (style & 2) - xm[2] = xm[3] = xm[4] = xm[5] = factor; - if (style & 4) - ym[4] = ym[5] = ym[6] = ym[7] = factor; - if (style & 8) - ym[0] = ym[1] = ym[2] = ym[3] = factor; -} - -/* NB: This function will free the passed pcb_polyarea_t. - It must only be passed a single pcb_polyarea_t (pa->f == pa->b == pa) */ -static void r_NoHolesPolygonDicer(pcb_polyarea_t * pa, void (*emit) (pcb_pline_t *, void *), void *user_data) -{ - pcb_pline_t *p = pa->contours; - - if (!pa->contours->next) { /* no holes */ - pa->contours = NULL; /* The callback now owns the contour */ - /* Don't bother removing it from the pcb_polyarea_t's rtree - since we're going to free the pcb_polyarea_t below anyway */ - emit(p, user_data); - pcb_polyarea_free(&pa); - return; - } - else { - pcb_polyarea_t *poly2, *left, *right; - - /* make a rectangle of the left region slicing through the middle of the first hole */ - poly2 = pcb_poly_from_rect(p->xmin, (p->next->xmin + p->next->xmax) / 2, p->ymin, p->ymax); - pcb_polyarea_and_subtract_free(pa, poly2, &left, &right); - if (left) { - pcb_polyarea_t *cur, *next; - cur = left; - do { - next = cur->f; - cur->f = cur->b = cur; /* Detach this polygon piece */ - r_NoHolesPolygonDicer(cur, emit, user_data); - /* NB: The pcb_polyarea_t was freed by its use in the recursive dicer */ - } - while ((cur = next) != left); - } - if (right) { - pcb_polyarea_t *cur, *next; - cur = right; - do { - next = cur->f; - cur->f = cur->b = cur; /* Detach this polygon piece */ - r_NoHolesPolygonDicer(cur, emit, user_data); - /* NB: The pcb_polyarea_t was freed by its use in the recursive dicer */ - } - while ((cur = next) != right); - } - } -} - -void pcb_polyarea_no_holes_dicer(pcb_polyarea_t *main_contour, pcb_coord_t clipX1, pcb_coord_t clipY1, pcb_coord_t clipX2, pcb_coord_t clipY2, void (*emit)(pcb_pline_t *, void *), void *user_data) -{ - pcb_polyarea_t *cur, *next; - - /* clip to the bounding box */ - if ((clipX1 != clipX2) || (clipY1 != clipY2)) { - pcb_polyarea_t *cbox = pcb_poly_from_rect(clipX1, clipX2, clipY1, clipY2); - pcb_polyarea_boolean_free(main_contour, cbox, &main_contour, PCB_PBO_ISECT); - } - if (main_contour == NULL) - return; - /* Now dice it up. - * NB: Could be more than one piece (because of the clip above) */ - cur = main_contour; - do { - next = cur->f; - cur->f = cur->b = cur; /* Detach this polygon piece */ - r_NoHolesPolygonDicer(cur, emit, user_data); - /* NB: The pcb_polyarea_t was freed by its use in the recursive dicer */ - } - while ((cur = next) != main_contour); -} Index: trunk/src/polygon1_gen.h =================================================================== --- trunk/src/polygon1_gen.h (revision 29282) +++ trunk/src/polygon1_gen.h (nonexistent) @@ -1,39 +0,0 @@ -#ifndef PCB_POLYGON1_GEN_H -#define PCB_POLYGON1_GEN_H - -#include -#include "polyarea.h" - -void pcb_poly_square_pin_factors(int style, double *xm, double *ym); - -pcb_polyarea_t *pcb_poly_from_contour(pcb_pline_t *pl); -pcb_polyarea_t *pcb_poly_from_contour_autoinv(pcb_pline_t *pl); - -pcb_polyarea_t *pcb_poly_from_circle(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius); -pcb_polyarea_t *pcb_poly_from_octagon(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius, int style); -pcb_polyarea_t *pcb_poly_from_rect(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2); -pcb_polyarea_t *RoundRect(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2, pcb_coord_t t); - - -/* generate a polygon of a round or square cap line of a given thickness */ -pcb_polyarea_t *pcb_poly_from_line(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t thick, pcb_bool square); - -/* generate a polygon of a round cap arc of a given thickness */ -pcb_polyarea_t *pcb_poly_from_arc(pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t astart, pcb_angle_t adelta, pcb_coord_t thick); - -/* Slice up a polyarea-with-holes into a set of polygon islands with no - holes, within the clip area. If the clip area is all-zero, do not clip. - Free's main_contour. */ -void pcb_polyarea_no_holes_dicer(pcb_polyarea_t *main_contour, pcb_coord_t clipX1, pcb_coord_t clipY1, pcb_coord_t clipX2, pcb_coord_t clipY2, void (*emit)(pcb_pline_t *, void *), void *user_data); - -/* Add vertices in a fractional-circle starting from v centered at X, Y and - going counter-clockwise. Does not include the first point. Last argument is: - 1 for a full circle - 2 for a half circle - 4 for a quarter circle */ -void pcb_poly_frac_circle(pcb_pline_t * c, pcb_coord_t X, pcb_coord_t Y, pcb_vector_t v, int range); - -/* same but adds the last vertex */ -void pcb_poly_frac_circle_end(pcb_pline_t * c, pcb_coord_t X, pcb_coord_t Y, pcb_vector_t v, int range); - -#endif Index: trunk/src/Makefile.dep =================================================================== --- trunk/src/Makefile.dep (revision 29282) +++ trunk/src/Makefile.dep (revision 29283) @@ -99,11 +99,11 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h crosshair.h \ vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h layer_grp.h \ idpath.h obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/event.h librnd/core/hidlib.h \ @@ -140,7 +140,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -203,7 +203,7 @@ librnd/core/color.h librnd/core/compat_misc.h librnd/core/event.h \ librnd/core/hidlib.h crosshair.h vtonpoint.h obj_line.h \ ../src_3rd/genlist/gendlist.h obj_common.h flag.h \ - librnd/core/globalconst.h data_parent.h obj_poly.h polyarea.h route.h + librnd/core/globalconst.h data_parent.h obj_poly.h librnd/poly/polyarea.h route.h ../src/librnd/core/hid_dad.o: ../src/librnd/core/hid_dad.c ../config.h \ librnd/core/hid_dad.h librnd/core/compat_misc.h librnd/core/hid_attrib.h \ ../src_3rd/genlist/gendlist.h librnd/core/hid.h \ @@ -431,7 +431,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -440,7 +440,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h layer.h layer_ui.h librnd/core/actions.h \ @@ -450,7 +450,7 @@ ../src_3rd/puplug/error.h search.h polygon.h librnd/core/conf.h \ librnd/core/pcb-printf.h ../src_3rd/liblihata/lihata.h \ librnd/core/list_conf.h conf_core.h librnd/core/compat_misc.h \ - ../src_plugins/acompnet/meshgraph.h rtree.h + ../src_plugins/acompnet/meshgraph.h librnd/poly/rtree.h ../src_plugins/acompnet/meshgraph.o: ../src_plugins/acompnet/meshgraph.c \ ../config.h ../src_3rd/genht/hash.h board.h ../src_3rd/genht/htsp.h \ ../src_3rd/genht/ht.h librnd/core/global_typedefs.h \ @@ -461,7 +461,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h conf_core.h librnd/core/conf.h \ @@ -472,10 +472,10 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h \ - ../src_plugins/acompnet/meshgraph.h rtree.h layer.h route.h + ../src_plugins/acompnet/meshgraph.h librnd/poly/rtree.h layer.h route.h ../src_plugins/act_draw/act_draw.o: ../src_plugins/act_draw/act_draw.c \ ../config.h conf_core.h librnd/core/conf.h librnd/core/global_typedefs.h \ librnd/core/pcb_bool.h librnd/core/pcb-printf.h \ @@ -493,10 +493,10 @@ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h board.h \ vtroutestyle.h layer.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h librnd/core/compat_misc.h flag_str.h obj_arc.h \ - obj_line.h obj_pstk.h obj_pstk_shape.h polygon.h rtree.h \ + obj_line.h obj_pstk.h obj_pstk_shape.h polygon.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h vtpadstack_t.h \ obj_text.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ @@ -507,7 +507,7 @@ crosshair.h vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h \ idpath.h obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ ht_subc.h ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h \ - obj_pstk.h vtpadstack.h thermal.h polygon1_gen.h + obj_pstk.h vtpadstack.h thermal.h librnd/poly/polygon1_gen.h ../src_plugins/act_draw/keywords_sphash.o: \ ../src_plugins/act_draw/keywords_sphash.c ../src_plugins/act_read/act_read.o: ../src_plugins/act_read/act_read.c \ @@ -520,7 +520,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data_parent.h \ @@ -531,7 +531,7 @@ ../src_3rd/puplug/puplug.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/error.h idpath.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h \ ../src_plugins/act_read/keywords_sphash.h \ ../src_plugins/act_read/act_idpath.c ../src_plugins/act_read/act_geo.c \ @@ -555,7 +555,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -564,7 +564,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ @@ -573,7 +573,7 @@ ../src_3rd/puplug/error.h librnd/core/actions.h librnd/core/safe_fs.h \ librnd/core/conf.h librnd/core/pcb-printf.h \ ../src_3rd/liblihata/lihata.h librnd/core/list_conf.h conf_core.h \ - obj_pstk_inlines.h data.h thermal.h polygon1_gen.h \ + obj_pstk_inlines.h data.h thermal.h librnd/poly/polygon1_gen.h \ ../src_plugins/lib_compat_help/pstk_compat.h obj_pstk.h \ ../src_plugins/lib_netmap/netmap.h netlist.h ../src_plugins/asm/asm.o: ../src_plugins/asm/asm.c ../config.h \ @@ -586,7 +586,7 @@ data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -594,7 +594,7 @@ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -618,7 +618,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -627,7 +627,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ @@ -653,7 +653,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/event.h ../src_plugins/autoplace/autoplace.o: \ @@ -667,7 +667,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h \ @@ -677,12 +677,12 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ - vtpadstack_t.h draw.h layer.h intersect.h rtree.h macro.h move.h \ + vtpadstack_t.h draw.h layer.h intersect.h librnd/poly/rtree.h macro.h move.h \ netlist.h remove.h rotate.h librnd/core/rotate.h obj_rat.h obj_term.h \ - obj_pstk_inlines.h data.h thermal.h polygon1_gen.h data_it.h + obj_pstk_inlines.h data.h thermal.h librnd/poly/polygon1_gen.h data_it.h ../src_plugins/autoroute/action.o: ../src_plugins/autoroute/action.c \ ../config.h ../src_plugins/autoroute/autoroute.h board.h \ ../src_3rd/genht/htsp.h ../src_3rd/genht/ht.h \ @@ -694,7 +694,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/plugins.h \ @@ -721,28 +721,28 @@ librnd/core/color.h data.h layer.h librnd/core/attrib.h obj_common.h \ flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h crosshair.h vtonpoint.h librnd/core/hid.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h macro.h \ ../src_plugins/autoroute/autoroute.h board.h vtroutestyle.h rats_patch.h \ - board.h librnd/core/hidlib.h draw.h find.h librnd/core/heap.h rtree.h netlist.h \ + board.h librnd/core/hidlib.h draw.h find.h librnd/core/heap.h librnd/poly/rtree.h netlist.h \ ../src_plugins/autoroute/mtspace.h ../src_plugins/autoroute/vector.h \ polygon.h remove.h obj_pinvia_therm.h undo.h ../src_3rd/libuundo/uundo.h \ undo_old.h layer.h obj_line_draw.h draw.h obj_pstk_draw.h \ - obj_pstk_inlines.h data.h thermal.h polygon1_gen.h \ + obj_pstk_inlines.h data.h thermal.h librnd/poly/polygon1_gen.h \ ../src_plugins/lib_compat_help/pstk_compat.h obj_pstk.h ../src_plugins/autoroute/mtspace.o: ../src_plugins/autoroute/mtspace.c \ ../config.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h \ - librnd/core/misc_util.h librnd/core/unit.h librnd/core/heap.h rtree.h \ + librnd/core/misc_util.h librnd/core/unit.h librnd/core/heap.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ../src_plugins/autoroute/mtspace.h \ - ../src_plugins/autoroute/vector.h rtree2_compat.h rtree.h + ../src_plugins/autoroute/vector.h rtree2_compat.h librnd/poly/rtree.h ../src_plugins/autoroute/vector.o: ../src_plugins/autoroute/vector.c \ ../config.h librnd/core/math_helper.h ../src_plugins/autoroute/vector.h \ macro.h @@ -756,7 +756,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h hid_cam.h librnd/core/hid_attrib.h \ @@ -774,7 +774,7 @@ ../src_plugins/cam/conf_internal.c ../src_plugins/cam/cam_compile.c \ data.h crosshair.h vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h \ idpath.h obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ ../src_plugins/cam/cam_compile.h layer_vis.h librnd/core/event.h \ @@ -791,7 +791,7 @@ ../src_3rd/genvector/genvector_undef.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h @@ -815,12 +815,12 @@ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_plugins/ddraft/centgeo.h obj_line.h \ board.h vtroutestyle.h layer_grp.h rats_patch.h board.h data_it.h data.h \ crosshair.h vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h \ idpath.h obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h \ @@ -845,7 +845,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -854,7 +854,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h data_it.h data.h flag_str.h layer.h \ @@ -890,7 +890,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -899,7 +899,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h @@ -927,7 +927,7 @@ ../src_3rd/genlist/gendlist.h ../src_plugins/dialogs/dlg_test.c board.h \ vtroutestyle.h layer.h librnd/core/globalconst.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h obj_text.h librnd/core/hid_dad_tree.h \ ../src_3rd/genht/hash.h ../src_plugins/dialogs/dlg_about.h \ @@ -941,12 +941,12 @@ ../src_plugins/dialogs/dlg_library.h \ ../src_plugins/dialogs/dlg_loadsave.h \ ../src_plugins/dialogs/dlg_padstack.h obj_pstk.h obj_pstk_shape.h \ - polygon.h rtree.h ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h \ + polygon.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h \ vtpadstack_t.h ../src_plugins/dialogs/dlg_pinout.c build_run.h \ obj_subc_parent.h data.h crosshair.h vtonpoint.h route.h buffer.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ ../src_3rd/libminuid/libminuid.h ht_subc.h ../src_3rd/genht/ht.h \ - obj_pstk_list.h obj_pstk.h vtpadstack.h draw.h obj_term.h rtree.h \ + obj_pstk_list.h obj_pstk.h vtpadstack.h draw.h obj_term.h librnd/poly/rtree.h \ search.h search_r.h netlist.h ../src_plugins/dialogs/dlg_search.h \ ../src_plugins/dialogs/dlg_undo.c ../src_3rd/libuundo/uundo.h \ librnd/core/event.h undo.h undo_old.h \ @@ -990,11 +990,11 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ route.h buffer.h obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h \ - obj_subc.h ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + obj_subc.h ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -1022,7 +1022,7 @@ vtroutestyle.h layer.h obj_common.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h undo.h ../src_3rd/libuundo/uundo.h \ undo_old.h search.h funchash_core.h librnd/core/funchash.h \ @@ -1042,7 +1042,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h change.h conf_core.h \ librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -1066,7 +1066,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/hid_dad.h \ librnd/core/compat_misc.h librnd/core/hid_attrib.h \ @@ -1090,11 +1090,11 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ route.h buffer.h obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h \ - obj_subc.h ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + obj_subc.h ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -1115,7 +1115,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/actions.h \ @@ -1140,11 +1140,11 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h crosshair.h \ vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h layer_grp.h \ idpath.h obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h obj_subc.h vtpadstack.h librnd/core/hid_inlines.h \ @@ -1152,7 +1152,7 @@ librnd/core/pcb-printf.h librnd/core/hid_dad_spin.h \ librnd/core/hid_dad_tree.h obj_pstk.h obj_pstk_inlines.h board.h \ vtroutestyle.h rats_patch.h librnd/core/hidlib.h data.h thermal.h \ - polygon1_gen.h obj_text_draw.h draw.h obj_pstk_draw.h undo_old.h \ + librnd/poly/polygon1_gen.h obj_text_draw.h draw.h obj_pstk_draw.h undo_old.h \ select.h operation.h search.h ../src_plugins/dialogs/dlg_padstack.h \ ../src_plugins/dialogs/dlg_lib_pstk.h ../src_plugins/dialogs/dlg_library.o: \ @@ -1171,7 +1171,7 @@ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h buffer.h conf_core.h librnd/core/conf.h \ librnd/core/pcb-printf.h ../src_3rd/liblihata/lihata.h \ @@ -1178,7 +1178,7 @@ ../src_3rd/genvector/vtp0.h librnd/core/list_conf.h data.h crosshair.h \ vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h librnd/core/event.h \ obj_subc.h plug_footprint.h vtlibrary.h data.h tool.h undo.h \ @@ -1205,11 +1205,11 @@ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h route.h buffer.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -1239,8 +1239,8 @@ librnd/core/globalconst.h data_parent.h layer.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ - ../src_3rd/genht/htip.h obj_pstk_shape.h polygon.h rtree.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ + ../src_3rd/genht/htip.h obj_pstk_shape.h polygon.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h vtpadstack_t.h \ obj_pstk_op.h operation.h obj_pstk_inlines.h board.h vtroutestyle.h \ layer_grp.h rats_patch.h librnd/core/hidlib.h data.h crosshair.h \ @@ -1247,7 +1247,7 @@ vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ - vtpadstack.h thermal.h polygon1_gen.h obj_subc_parent.h search.h \ + vtpadstack.h thermal.h librnd/poly/polygon1_gen.h obj_subc_parent.h search.h \ operation.h ../src_plugins/dialogs/dlg_lib_pstk.h \ ../src_plugins/dialogs/dlg_padstack.h ../src_plugins/dialogs/dlg_pref.o: ../src_plugins/dialogs/dlg_pref.c \ @@ -1280,7 +1280,7 @@ ../src_plugins/dialogs/dlg_pref_sizes.c board.h vtroutestyle.h layer.h \ librnd/core/globalconst.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h layer_grp.h rats_patch.h board.h conf_core.h \ ../src_plugins/dialogs/dlg_pref_board.c \ ../src_plugins/dialogs/dlg_pref_general.c \ @@ -1311,7 +1311,7 @@ librnd/core/hid_dad_spin.h librnd/core/event.h librnd/core/hidlib.h \ board.h vtroutestyle.h layer.h librnd/core/globalconst.h obj_common.h \ flag.h data_parent.h obj_arc_list.h obj_arc.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h layer_grp.h rats_patch.h board.h \ ../src_plugins/dialogs/dlg_search_tab.h \ ../src_plugins/dialogs/dlg_search_edit.c librnd/core/hid_dad_tree.h \ @@ -1331,7 +1331,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h conf_core.h librnd/core/conf.h \ librnd/core/pcb-printf.h ../src_3rd/liblihata/lihata.h \ @@ -1352,7 +1352,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -1361,10 +1361,10 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ - vtpadstack_t.h rtree.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ + vtpadstack_t.h librnd/poly/rtree.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ move.h draw.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ @@ -1381,7 +1381,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -1390,10 +1390,10 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ - vtpadstack_t.h rtree.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ + vtpadstack_t.h librnd/poly/rtree.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ move.h draw.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ @@ -1415,7 +1415,7 @@ librnd/core/color.h librnd/core/hidlib_conf.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -1422,7 +1422,7 @@ librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h remove.h move.h draw.h undo.h \ @@ -1432,7 +1432,7 @@ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/error.h librnd/core/actions.h \ ../src_plugins/djopt/djopt_conf.h obj_line.h librnd/core/event.h macro.h \ - obj_pstk_inlines.h data.h thermal.h polygon1_gen.h \ + obj_pstk_inlines.h data.h thermal.h librnd/poly/polygon1_gen.h \ ../src_plugins/djopt/djopt_conf_fields.h ../src_plugins/draw_csect/draw_csect.o: \ ../src_plugins/draw_csect/draw_csect.c ../config.h board.h \ @@ -1445,7 +1445,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -1454,7 +1454,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ @@ -1473,7 +1473,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h build_run.h \ @@ -1483,7 +1483,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h ../src_plugins/draw_fab/../report/drill.h \ @@ -1494,7 +1494,7 @@ ../src_plugins/draw_fab/draw_fab_conf.h librnd/core/conf.h \ librnd/core/pcb-printf.h ../src_3rd/liblihata/lihata.h \ librnd/core/list_conf.h conf_core.h librnd/core/hidlib_conf.h macro.h \ - obj_pstk_inlines.h data.h thermal.h polygon1_gen.h \ + obj_pstk_inlines.h data.h thermal.h librnd/poly/polygon1_gen.h \ librnd/core/hid_inlines.h funchash_core.h librnd/core/funchash.h \ funchash_core_list.h obj_text_draw.h \ ../src_plugins/draw_fab/draw_fab_conf_fields.h @@ -1509,7 +1509,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h build_run.h data.h crosshair.h \ @@ -1518,7 +1518,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h font.h librnd/core/actions.h librnd/core/plugins.h \ @@ -1539,7 +1539,7 @@ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ view.h data_it.h data.h layer.h librnd/core/color.h obj_arc_list.h \ obj_arc.h obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h \ - polyarea.h obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ + librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ ../src_3rd/genht/ht.h crosshair.h vtonpoint.h librnd/core/hid.h \ ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ ../src_3rd/liblihata/parser.h ../src_3rd/genht/htsp.h \ @@ -1546,7 +1546,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h conf_core.h librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -1571,13 +1571,13 @@ ../src_3rd/genlist/gendlist.h data.h librnd/core/globalconst.h layer.h \ librnd/core/attrib.h librnd/core/color.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h \ buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h change.h board.h \ @@ -1600,7 +1600,7 @@ librnd/core/color.h ../src_3rd/genvector/vts0.h build_run.h board.h \ vtroutestyle.h librnd/core/attrib.h layer.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ layer_grp.h rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h \ @@ -1607,7 +1607,7 @@ vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/plugins.h \ @@ -1627,7 +1627,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -1635,7 +1635,7 @@ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -1649,7 +1649,7 @@ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ librnd/core/hid_attrib.h hid_cam.h librnd/core/plugins.h \ ../src_3rd/puplug/error.h obj_line.h obj_pstk_inlines.h data.h thermal.h \ - polygon1_gen.h + librnd/poly/polygon1_gen.h ../src_plugins/export_dxf/dxf.o: ../src_plugins/export_dxf/dxf.c \ ../config.h conf_core.h librnd/core/conf.h librnd/core/global_typedefs.h \ librnd/core/pcb_bool.h librnd/core/pcb-printf.h \ @@ -1664,7 +1664,7 @@ librnd/core/color.h librnd/core/math_helper.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -1671,7 +1671,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h layer.h \ layer_vis.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ @@ -1708,7 +1708,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/pcb-printf.h \ @@ -1741,7 +1741,7 @@ librnd/core/color.h ../src_3rd/genht/htsi.h librnd/core/math_helper.h \ board.h vtroutestyle.h librnd/core/attrib.h layer.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/misc_util.h layer_grp.h rats_patch.h \ board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -1748,7 +1748,7 @@ librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h layer_vis.h \ @@ -1776,7 +1776,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/safe_fs.h \ librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -1784,7 +1784,7 @@ librnd/core/list_conf.h funchash_core.h librnd/core/funchash.h \ funchash_core_list.h layer.h librnd/core/hid_nogui.h \ librnd/core/hid_init.h librnd/core/hid_attrib.h hid_cam.h \ - ../src_plugins/millpath/toolpath.h layer_grp.h polygon.h rtree.h \ + ../src_plugins/millpath/toolpath.h layer_grp.h polygon.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h ../src_plugins/export_gerber/gerber.o: \ ../src_plugins/export_gerber/gerber.c ../config.h \ @@ -1797,7 +1797,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/misc_util.h \ ../src_3rd/genvector/gds_char.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h build_run.h data.h crosshair.h vtonpoint.h \ @@ -1806,7 +1806,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h layer.h layer_vis.h librnd/core/pcb-printf.h \ @@ -1836,7 +1836,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -1845,7 +1845,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/safe_fs.h librnd/core/conf.h \ @@ -1853,7 +1853,7 @@ librnd/core/list_conf.h conf_core.h librnd/core/hidlib_conf.h \ librnd/core/compat_misc.h netlist.h layer.h obj_arc.h obj_line.h \ obj_poly.h obj_subc.h obj_pstk.h obj_pstk_inlines.h data.h thermal.h \ - polygon1_gen.h librnd/core/hid_nogui.h hid_cam.h \ + librnd/poly/polygon1_gen.h librnd/core/hid_nogui.h hid_cam.h \ librnd/core/hid_attrib.h librnd/core/hid_init.h \ ../src_3rd/puplug/puplug.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ @@ -1867,7 +1867,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -1876,7 +1876,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -1906,12 +1906,12 @@ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h board.h \ vtroutestyle.h layer.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h librnd/core/compat_fs.h data.h crosshair.h \ vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h data_it.h data.h \ draw.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ @@ -1936,7 +1936,7 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -1943,7 +1943,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h data_it.h data.h \ draw.h librnd/core/compat_misc.h librnd/core/plugins.h \ @@ -1951,7 +1951,7 @@ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/error.h librnd/core/safe_fs.h \ layer_vis.h obj_subc_parent.h obj_pstk_inlines.h thermal.h \ - polygon1_gen.h librnd/core/actions.h librnd/core/hid_nogui.h hid_cam.h \ + librnd/poly/polygon1_gen.h librnd/core/actions.h librnd/core/hid_nogui.h hid_cam.h \ librnd/core/hid_attrib.h librnd/core/hid_init.h \ ../src_plugins/lib_polyhelp/topoly.h obj_common.h \ ../src_plugins/export_openems/mesh.h layer.h librnd/core/vtc0.h vtr0.h \ @@ -1967,7 +1967,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h librnd/core/vtc0.h vtr0.h \ @@ -1978,7 +1978,7 @@ librnd/core/error.h board.h vtroutestyle.h layer.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ route.h buffer.h obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h \ - obj_subc.h ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + obj_subc.h ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/hid_dad.h \ @@ -2002,7 +2002,7 @@ librnd/core/compat_misc.h board.h vtroutestyle.h librnd/core/attrib.h \ layer.h obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -2009,7 +2009,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h layer.h \ layer_vis.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ @@ -2016,7 +2016,7 @@ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/error.h librnd/core/safe_fs.h obj_pstk_inlines.h \ - data.h thermal.h polygon1_gen.h funchash_core.h librnd/core/funchash.h \ + data.h thermal.h librnd/poly/polygon1_gen.h funchash_core.h librnd/core/funchash.h \ funchash_core_list.h librnd/core/hid_nogui.h librnd/core/hid_init.h \ librnd/core/actions.h librnd/core/hid_attrib.h hid_cam.h \ ../src_plugins/export_openscad/scad_draw.c \ @@ -2036,7 +2036,7 @@ librnd/core/color.h ../src_3rd/genht/htpp.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h color_cache.h \ @@ -2043,7 +2043,7 @@ ../src_3rd/genht/hash.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ obj_pstk_list.h obj_pstk.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h layer.h layer_vis.h librnd/core/compat_misc.h \ @@ -2070,7 +2070,7 @@ librnd/core/color.h librnd/core/math_helper.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -2077,7 +2077,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h layer.h \ layer_vis.h librnd/core/safe_fs.h librnd/core/hid_nogui.h \ @@ -2096,7 +2096,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/misc_util.h \ ../src_3rd/genvector/gds_char.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -2104,7 +2104,7 @@ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -2134,13 +2134,13 @@ librnd/core/math_helper.h board.h vtroutestyle.h librnd/core/attrib.h \ layer.h obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/misc_util.h \ layer_grp.h rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h \ vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ obj_pstk_list.h obj_pstk.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h data_it.h data.h netlist.h librnd/core/plugins.h \ @@ -2148,7 +2148,7 @@ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/error.h \ librnd/core/compat_misc.h plug_io.h librnd/core/safe_fs.h \ - obj_pstk_inlines.h thermal.h polygon1_gen.h librnd/core/hid_nogui.h \ + obj_pstk_inlines.h thermal.h librnd/poly/polygon1_gen.h librnd/core/hid_nogui.h \ librnd/core/hid_init.h librnd/core/hid_attrib.h hid_cam.h ../src_plugins/export_stl/export_stl.o: \ ../src_plugins/export_stl/export_stl.c ../config.h librnd/core/actions.h \ @@ -2168,7 +2168,7 @@ librnd/core/globalconst.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ ../src_3rd/genvector/gds_char.h librnd/core/hid_nogui.h \ librnd/core/safe_fs.h librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -2192,7 +2192,7 @@ librnd/core/color.h librnd/core/math_helper.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -2199,7 +2199,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h layer.h \ layer_vis.h librnd/core/compat_misc.h librnd/core/plugins.h \ @@ -2224,7 +2224,7 @@ librnd/core/color.h build_run.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -2231,7 +2231,7 @@ librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/plugins.h \ @@ -2256,7 +2256,7 @@ librnd/core/color.h build_run.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -2263,7 +2263,7 @@ librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/plugins.h \ @@ -2288,7 +2288,7 @@ librnd/core/color.h build_run.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -2295,7 +2295,7 @@ librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/plugins.h \ @@ -2319,7 +2319,7 @@ ../src_3rd/genvector/vts0.h librnd/core/math_helper.h build_run.h \ board.h vtroutestyle.h librnd/core/attrib.h layer.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/misc_util.h layer_grp.h rats_patch.h \ board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -2326,7 +2326,7 @@ librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h data_it.h data.h \ @@ -2334,7 +2334,7 @@ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/error.h librnd/core/compat_misc.h obj_pstk_inlines.h \ - thermal.h polygon1_gen.h obj_subc_op.h operation.h layer.h netlist.h \ + thermal.h librnd/poly/polygon1_gen.h obj_subc_op.h operation.h layer.h netlist.h \ librnd/core/safe_fs.h macro.h operation.h \ ../src_plugins/export_xy/xy_conf.h librnd/core/hid_nogui.h \ librnd/core/hid_attrib.h hid_cam.h librnd/core/hid_init.h \ @@ -2361,7 +2361,7 @@ librnd/core/globalconst.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/compat_fs.h \ conf_core.h librnd/core/conf.h ../src_3rd/liblihata/lihata.h \ @@ -2368,7 +2368,7 @@ ../src_3rd/genvector/vtp0.h librnd/core/list_conf.h data.h crosshair.h \ vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h buffer.h \ librnd/core/paths.h remove.h librnd/core/safe_fs.h search.h undo.h \ @@ -2386,7 +2386,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -2395,7 +2395,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ @@ -2426,7 +2426,7 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -2433,10 +2433,10 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h flag.h \ - layer.h move.h remove.h rtree.h flag_str.h undo.h \ + layer.h move.h remove.h librnd/poly/rtree.h flag_str.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h librnd/core/plugins.h \ ../src_3rd/puplug/puplug.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ @@ -2455,7 +2455,7 @@ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -2464,7 +2464,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -2483,7 +2483,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -2492,7 +2492,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/paths.h librnd/core/plugins.h \ @@ -2515,7 +2515,7 @@ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h librnd/core/unit.h crosshair.h vtonpoint.h \ librnd/core/hid.h ../src_3rd/liblihata/dom.h \ @@ -2522,7 +2522,7 @@ ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h route.h \ buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ obj_pstk_list.h obj_pstk.h ../src_3rd/genvector/vtp0.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/conf.h \ @@ -2542,7 +2542,7 @@ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -2551,7 +2551,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -2576,7 +2576,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h librnd/core/unit.h crosshair.h vtonpoint.h \ librnd/core/hid.h ../src_3rd/liblihata/dom.h \ @@ -2583,7 +2583,7 @@ ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h route.h \ buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ obj_pstk_list.h obj_pstk.h ../src_3rd/genvector/vtp0.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/conf.h \ @@ -2618,7 +2618,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/hid.h \ @@ -2627,7 +2627,7 @@ vtonpoint.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h layer.h librnd/core/pcb-printf.h librnd/core/plugins.h \ @@ -2654,7 +2654,7 @@ vtonpoint.h librnd/core/hid.h librnd/core/error.h librnd/core/attrib.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ obj_line.h ../src_3rd/genlist/gendlist.h obj_common.h flag.h \ - librnd/core/globalconst.h data_parent.h obj_poly.h polyarea.h route.h \ + librnd/core/globalconst.h data_parent.h obj_poly.h librnd/poly/polyarea.h route.h \ draw.h layer.h obj_arc_list.h obj_arc.h obj_line_list.h obj_poly_list.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/grid.h color_cache.h ../src_3rd/genht/hash.h \ @@ -2715,7 +2715,7 @@ ../src_3rd/genht/ht.h librnd/core/error.h librnd/core/attrib.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ librnd/core/unit.h obj_line.h ../src_3rd/genlist/gendlist.h obj_common.h \ - flag.h librnd/core/globalconst.h data_parent.h obj_poly.h polyarea.h \ + flag.h librnd/core/globalconst.h data_parent.h obj_poly.h librnd/poly/polyarea.h \ route.h draw.h layer.h librnd/core/color.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_poly_list.h \ @@ -2803,13 +2803,13 @@ librnd/core/globalconst.h layer.h librnd/core/attrib.h obj_common.h \ flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h crosshair.h vtonpoint.h librnd/core/hid.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ librnd/core/event.h librnd/core/hidlib.h build_run.h crosshair.h layer.h \ @@ -2846,7 +2846,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genvector/gds_char.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h ../src_plugins/hid_lesstif/ltf_stdarg.h \ librnd/core/hid_dad.h librnd/core/compat_misc.h librnd/core/hid_attrib.h \ @@ -2868,13 +2868,13 @@ librnd/core/color.h librnd/core/compat_misc.h data.h layer.h \ librnd/core/attrib.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h crosshair.h vtonpoint.h librnd/core/hid.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ librnd/core/actions.h buffer.h plug_footprint.h vtlibrary.h data.h \ @@ -2906,12 +2906,12 @@ librnd/core/pixmap.h data.h layer.h librnd/core/attrib.h obj_common.h \ flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/misc_util.h \ crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h \ buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h color_cache.h \ @@ -2948,13 +2948,13 @@ librnd/core/color.h data.h layer.h librnd/core/attrib.h obj_common.h \ flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h crosshair.h vtonpoint.h librnd/core/hid.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h layer.h \ librnd/core/hid_cfg.h librnd/core/hid_cfg_action.h \ @@ -2974,7 +2974,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -2983,7 +2983,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -3029,7 +3029,7 @@ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ ../src_3rd/genht/ht.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h layer.h @@ -3043,7 +3043,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/hid.h \ @@ -3052,7 +3052,7 @@ vtonpoint.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h layer.h librnd/core/pcb-printf.h \ @@ -3073,7 +3073,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -3082,7 +3082,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/pcb-printf.h librnd/core/compat_misc.h \ @@ -3103,7 +3103,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -3112,7 +3112,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h polygon.h librnd/core/safe_fs.h librnd/core/conf.h \ @@ -3132,7 +3132,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/misc_util.h \ ../src_3rd/genvector/gds_char.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -3140,7 +3140,7 @@ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -3162,7 +3162,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -3171,7 +3171,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ @@ -3191,7 +3191,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -3200,7 +3200,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/pcb-printf.h librnd/core/compat_misc.h \ @@ -3220,7 +3220,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h conf_core.h librnd/core/conf.h \ @@ -3231,7 +3231,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h buffer.h \ librnd/core/compat_misc.h librnd/core/safe_fs.h librnd/core/actions.h \ @@ -3250,7 +3250,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -3259,7 +3259,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/safe_fs.h librnd/core/conf.h \ @@ -3268,7 +3268,7 @@ librnd/core/actions.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ - ../src_3rd/puplug/error.h rtree.h \ + ../src_3rd/puplug/error.h librnd/poly/rtree.h \ ../src_plugins/lib_compat_help/pstk_help.h obj_pstk.h ../src_plugins/import_ltspice/ltspice.o: \ ../src_plugins/import_ltspice/ltspice.c ../config.h \ @@ -3281,7 +3281,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -3290,7 +3290,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/pcb-printf.h librnd/core/compat_misc.h \ @@ -3310,7 +3310,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -3319,7 +3319,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/pcb-printf.h librnd/core/compat_misc.h \ @@ -3366,7 +3366,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -3375,7 +3375,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/pcb-printf.h librnd/core/compat_misc.h \ @@ -3396,7 +3396,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/plugins.h \ @@ -3411,7 +3411,7 @@ librnd/core/hid.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h rats_patch.h \ librnd/core/compat_misc.h librnd/core/paths.h librnd/core/safe_fs.h \ @@ -3463,7 +3463,7 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -3470,7 +3470,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h change.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h librnd/core/plugins.h \ @@ -3492,7 +3492,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -3501,7 +3501,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/pcb-printf.h librnd/core/compat_misc.h \ @@ -3524,7 +3524,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -3533,7 +3533,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/actions.h librnd/core/plugins.h \ @@ -3562,13 +3562,13 @@ librnd/core/globalconst.h layer.h librnd/core/attrib.h \ librnd/core/color.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h crosshair.h vtonpoint.h librnd/core/hid.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ ../src_plugins/io_autotrax/read.h librnd/core/actions.h board.h \ @@ -3585,7 +3585,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h plug_io.h librnd/core/conf.h \ @@ -3596,7 +3596,7 @@ vtonpoint.h librnd/core/hid.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h \ @@ -3616,7 +3616,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h plug_io.h librnd/core/conf.h \ @@ -3627,7 +3627,7 @@ vtonpoint.h librnd/core/hid.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h \ @@ -3663,7 +3663,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -3672,7 +3672,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h plug_io.h librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -3694,13 +3694,13 @@ librnd/core/attrib.h layer.h librnd/core/globalconst.h \ librnd/core/color.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ route.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h layer.h layer_grp.h \ @@ -3734,7 +3734,7 @@ vtroutestyle.h layer.h librnd/core/globalconst.h librnd/core/color.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h ../src_plugins/io_eagle/read_dru.h \ librnd/core/actions.h ../src_3rd/libfungw/fungw.h \ @@ -3749,7 +3749,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -3758,12 +3758,12 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h ../src_plugins/io_eagle/read.h librnd/core/conf.h \ librnd/core/pcb-printf.h ../src_3rd/liblihata/lihata.h \ - librnd/core/list_conf.h plug_io.h conf_core.h polygon.h rtree.h \ + librnd/core/list_conf.h plug_io.h conf_core.h polygon.h librnd/poly/rtree.h \ librnd/core/actions.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ librnd/core/compat_misc.h ../src_plugins/io_eagle/trparse.h \ ../src_plugins/io_eagle/trparse_xml.h \ @@ -3787,7 +3787,7 @@ librnd/core/color.h librnd/core/safe_fs.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h layer_grp.h \ @@ -3830,7 +3830,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h @@ -3844,7 +3844,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h ../src_plugins/io_hyp/hyp_l.h @@ -3871,7 +3871,7 @@ ../src_plugins/io_hyp/parser.h board.h vtroutestyle.h layer.h \ librnd/core/globalconst.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h layer_grp.h rats_patch.h board.h \ ../src_plugins/io_hyp/write.h obj_rat.h idpath.h ../src_plugins/io_hyp/parser.o: ../src_plugins/io_hyp/parser.c \ @@ -3884,12 +3884,12 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h ../src_plugins/io_hyp/hyp_l.h \ ../src_plugins/io_hyp/hyp_y.h librnd/core/error.h \ - librnd/core/pcb-printf.h flag_str.h polygon.h rtree.h \ + librnd/core/pcb-printf.h flag_str.h polygon.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h layer.h data.h \ crosshair.h vtonpoint.h librnd/core/hid.h ../src_3rd/liblihata/dom.h \ ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h route.h \ @@ -3918,7 +3918,7 @@ librnd/core/attrib.h layer.h librnd/core/globalconst.h \ librnd/core/color.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -3925,11 +3925,11 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ librnd/core/compat_misc.h polygon.h obj_subc_parent.h data.h \ - obj_pstk_inlines.h thermal.h polygon1_gen.h \ + obj_pstk_inlines.h thermal.h librnd/poly/polygon1_gen.h \ ../src_plugins/lib_netmap/netmap.h netlist.h funchash_core.h \ librnd/core/funchash.h funchash_core_list.h ../src_3rd/genht/htpi.h ../src_plugins/io_kicad/io_kicad.o: ../src_plugins/io_kicad/io_kicad.c \ @@ -3949,13 +3949,13 @@ librnd/core/globalconst.h layer.h librnd/core/attrib.h \ librnd/core/color.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h crosshair.h vtonpoint.h librnd/core/hid.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ ../src_plugins/io_kicad/read.h ../src_plugins/io_kicad/read_net.h \ @@ -3969,7 +3969,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h @@ -3986,7 +3986,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h plug_io.h librnd/core/conf.h \ @@ -3996,13 +3996,13 @@ librnd/core/error.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ route.h buffer.h ../src_3rd/libfungw/fungw.h obj_rat_list.h obj_rat.h \ idpath.h obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ ../src_plugins/io_kicad/read.h layer.h polygon.h plug_footprint.h \ vtlibrary.h data.h conf_core.h move.h macro.h rotate.h \ librnd/core/rotate.h librnd/core/safe_fs.h netlist.h obj_pstk_inlines.h \ - thermal.h polygon1_gen.h ../src_plugins/lib_compat_help/pstk_compat.h \ + thermal.h librnd/poly/polygon1_gen.h ../src_plugins/lib_compat_help/pstk_compat.h \ obj_pstk.h ../src_plugins/lib_compat_help/pstk_help.h \ ../src_plugins/lib_compat_help/subc_help.h obj_subc.h \ ../src_plugins/lib_compat_help/media.h ../src_plugins/shape/shape.h \ @@ -4020,7 +4020,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -4028,7 +4028,7 @@ ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h \ librnd/core/error.h route.h buffer.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/pcb-printf.h librnd/core/compat_misc.h \ @@ -4050,7 +4050,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h plug_io.h librnd/core/conf.h \ @@ -4062,11 +4062,11 @@ librnd/core/hid.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ ../src_plugins/io_kicad/write.h layer.h netlist.h obj_pstk_inlines.h \ - data.h thermal.h polygon1_gen.h funchash_core.h librnd/core/funchash.h \ + data.h thermal.h librnd/poly/polygon1_gen.h funchash_core.h librnd/core/funchash.h \ funchash_core_list.h ../src_plugins/lib_compat_help/pstk_compat.h \ obj_pstk.h ../src_plugins/io_kicad_legacy/io_kicad_legacy.o: \ @@ -4087,13 +4087,13 @@ data.h librnd/core/globalconst.h layer.h librnd/core/attrib.h \ librnd/core/color.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h crosshair.h vtonpoint.h librnd/core/hid.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h ../src_plugins/io_kicad_legacy/write.o: \ @@ -4107,7 +4107,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h plug_io.h librnd/core/conf.h \ @@ -4118,12 +4118,12 @@ vtonpoint.h librnd/core/hid.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h \ ../src_plugins/io_kicad_legacy/write.h layer.h netlist.h macro.h \ - obj_pstk_inlines.h data.h thermal.h polygon1_gen.h \ + obj_pstk_inlines.h data.h thermal.h librnd/poly/polygon1_gen.h \ ../src_plugins/io_kicad_legacy/../io_kicad/uniq_name.h \ ../src_plugins/lib_compat_help/pstk_compat.h obj_pstk.h ../src_plugins/io_lihata/common.o: ../src_plugins/io_lihata/common.c \ @@ -4135,7 +4135,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -4144,12 +4144,12 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h macro.h ../src_plugins/io_lihata/common.h thermal.h \ - polygon1_gen.h + librnd/poly/polygon1_gen.h ../src_plugins/io_lihata/io_lihata.o: \ ../src_plugins/io_lihata/io_lihata.c ../config.h librnd/core/plugins.h \ ../src_3rd/puplug/puplug.h ../src_3rd/puplug/libs.h \ @@ -4181,13 +4181,13 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ - obj_rat.h idpath.h obj_subc_list.h obj_subc.h rtree2_compat.h rtree.h \ + obj_rat.h idpath.h obj_subc_list.h obj_subc.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -4198,7 +4198,7 @@ librnd/core/pcb-printf.h ../src_3rd/liblihata/lihata.h \ librnd/core/list_conf.h flag_str.h librnd/core/compat_misc.h macro.h \ layer.h ../src_plugins/io_lihata/common.h polygon.h conf_core.h \ - obj_subc.h pcb_minuid.h thermal.h polygon1_gen.h \ + obj_subc.h pcb_minuid.h thermal.h librnd/poly/polygon1_gen.h \ ../src_plugins/io_lihata/io_lihata.h ../src_plugins/io_lihata/lht_conf.h \ librnd/core/safe_fs.h plug_footprint.h vtlibrary.h data.h vtpadstack.h \ obj_pstk_inlines.h thermal.h netlist.h \ @@ -4218,7 +4218,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h conf_core.h librnd/core/conf.h \ @@ -4226,7 +4226,7 @@ ../src_3rd/genvector/vtp0.h librnd/core/list_conf.h data.h crosshair.h \ vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ - obj_rat.h idpath.h obj_subc_list.h obj_subc.h rtree2_compat.h rtree.h \ + obj_rat.h idpath.h obj_subc_list.h obj_subc.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/plugins.h \ @@ -4238,7 +4238,7 @@ ../src_plugins/io_lihata/write_style.h ../src_3rd/liblhtpers/lhtpers.h \ ../src_plugins/io_lihata/io_lihata.h ../src_plugins/io_lihata/lht_conf.h \ librnd/core/paths.h obj_subc_list.h pcb_minuid.h librnd/core/safe_fs.h \ - thermal.h polygon1_gen.h funchash_core.h librnd/core/funchash.h \ + thermal.h librnd/poly/polygon1_gen.h funchash_core.h librnd/core/funchash.h \ funchash_core_list.h netlist.h librnd/core/hid_dad.h \ librnd/core/hid_attrib.h librnd/core/hid_dad_spin.h \ ../src_plugins/lib_compat_help/pstk_compat.h obj_pstk.h @@ -4279,7 +4279,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -4287,7 +4287,7 @@ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -4313,7 +4313,7 @@ librnd/core/attrib.h layer.h librnd/core/globalconst.h \ librnd/core/color.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h librnd/core/compat_misc.h @@ -4332,22 +4332,22 @@ flag.h librnd/core/attrib.h data_parent.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h change.h board.h vtroutestyle.h layer.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h crosshair.h vtonpoint.h \ librnd/core/hid.h librnd/core/error.h route.h data.h crosshair.h \ buffer.h obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h ../src_plugins/io_pcb/file.h \ board.h plug_io.h layer.h layer_grp.h move.h \ - ../src_plugins/io_pcb/parse_common.h polygon.h polygon1_gen.h remove.h \ + ../src_plugins/io_pcb/parse_common.h polygon.h librnd/poly/polygon1_gen.h remove.h \ flag_str.h librnd/core/compat_fs.h librnd/core/compat_misc.h \ librnd/core/paths.h rats_patch.h librnd/core/actions.h \ ../src_plugins/io_pcb/attribs.h route_style.h obj_poly.h thermal.h \ - polygon1_gen.h librnd/core/event.h macro.h funchash_core.h \ + librnd/poly/polygon1_gen.h librnd/core/event.h macro.h funchash_core.h \ librnd/core/funchash.h funchash_core_list.h netlist.h \ ../src_plugins/lib_compat_help/layer_compat.h \ ../src_plugins/lib_compat_help/pstk_compat.h obj_pstk.h \ @@ -4371,7 +4371,7 @@ vtroutestyle.h librnd/core/attrib.h layer.h librnd/core/globalconst.h \ librnd/core/color.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h @@ -4390,12 +4390,12 @@ librnd/core/hid.h librnd/core/error.h librnd/core/attrib.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ obj_line.h ../src_3rd/genlist/gendlist.h obj_common.h data_parent.h \ - obj_poly.h polyarea.h route.h data.h layer.h obj_arc_list.h obj_arc.h \ + obj_poly.h librnd/poly/polyarea.h route.h data.h layer.h obj_arc_list.h obj_arc.h \ obj_line_list.h obj_poly_list.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h crosshair.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ ../src_plugins/io_pcb/file.h board.h vtroutestyle.h rats_patch.h board.h \ @@ -4413,7 +4413,7 @@ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ ../src_3rd/genvector/gds_char.h layer_grp.h rats_patch.h board.h \ @@ -4425,11 +4425,11 @@ librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h ../src_plugins/io_pcb/file.h \ - plug_io.h ../src_plugins/io_pcb/parse_l.h polygon.h remove.h rtree.h \ + plug_io.h ../src_plugins/io_pcb/parse_l.h polygon.h remove.h librnd/poly/rtree.h \ flag_str.h obj_pinvia_therm.h rats_patch.h route_style.h \ librnd/core/compat_misc.h ../src_plugins/lib_compat_help/pstk_compat.h \ obj_pstk.h netlist.h ../src_plugins/io_pcb/parse_y.h @@ -4444,7 +4444,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ librnd/core/unit.h ../src_3rd/genvector/gds_char.h crosshair.h \ vtonpoint.h librnd/core/hid.h ../src_3rd/liblihata/dom.h \ @@ -4452,7 +4452,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h ../src_plugins/io_tedax/parse.h board.h vtroutestyle.h \ @@ -4459,7 +4459,7 @@ rats_patch.h board.h librnd/core/hidlib.h librnd/core/pcb-printf.h \ librnd/core/compat_misc.h librnd/core/safe_fs.h librnd/core/conf.h \ ../src_3rd/liblihata/lihata.h librnd/core/list_conf.h obj_line.h \ - obj_arc.h obj_pstk.h obj_pstk_inlines.h data.h thermal.h polygon1_gen.h \ + obj_arc.h obj_pstk.h obj_pstk_inlines.h data.h thermal.h librnd/poly/polygon1_gen.h \ ../src_plugins/lib_compat_help/subc_help.h obj_subc.h layer.h \ ../src_plugins/lib_compat_help/pstk_help.h ../src_plugins/io_tedax/io_tedax.o: ../src_plugins/io_tedax/io_tedax.c \ @@ -4471,7 +4471,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -4480,7 +4480,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -4510,7 +4510,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ ../src_3rd/genvector/gds_char.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h ../src_3rd/genvector/vtp0.h \ @@ -4531,7 +4531,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -4540,7 +4540,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h ht_subc.h ../src_plugins/io_tedax/tboard.h \ @@ -4560,7 +4560,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h \ @@ -4580,7 +4580,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -4589,14 +4589,14 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h ../src_plugins/io_tedax/parse.h librnd/core/safe_fs.h \ librnd/core/conf.h librnd/core/pcb-printf.h \ ../src_3rd/liblihata/lihata.h librnd/core/list_conf.h \ - ../src_plugins/io_tedax/tetest.h rtree.h obj_subc_parent.h data.h \ - obj_pstk.h obj_pstk_inlines.h thermal.h polygon1_gen.h netlist.h \ + ../src_plugins/io_tedax/tetest.h librnd/poly/rtree.h obj_subc_parent.h data.h \ + obj_pstk.h obj_pstk_inlines.h thermal.h librnd/poly/polygon1_gen.h netlist.h \ librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ @@ -4612,7 +4612,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -4621,7 +4621,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h ../src_plugins/io_tedax/tlayer.h board.h vtroutestyle.h \ @@ -4640,7 +4640,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -4649,7 +4649,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/pcb-printf.h librnd/core/compat_misc.h \ @@ -4667,7 +4667,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -4676,11 +4676,11 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ - vtpadstack_t.h rtree.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ - polygon.h polygon1_gen.h remove.h librnd/core/pcb-printf.h \ + vtpadstack_t.h librnd/poly/rtree.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ + polygon.h librnd/poly/polygon1_gen.h remove.h librnd/core/pcb-printf.h \ librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ @@ -4701,12 +4701,12 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h \ ../src_plugins/lib_compat_help/pstk_compat.h obj_pstk.h \ - ../src_3rd/genvector/vtp0.h layer.h obj_pstk_shape.h polygon.h rtree.h \ + ../src_3rd/genvector/vtp0.h layer.h obj_pstk_shape.h polygon.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h vtpadstack_t.h \ board.h ../src_3rd/genht/htsp.h vtroutestyle.h layer_grp.h rats_patch.h \ board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -4717,8 +4717,8 @@ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h ../src_plugins/lib_compat_help/pstk_compat.c \ - obj_pstk_inlines.h data.h thermal.h polygon1_gen.h \ - librnd/core/compat_misc.h polygon1_gen.h plug_io.h librnd/core/conf.h \ + obj_pstk_inlines.h data.h thermal.h librnd/poly/polygon1_gen.h \ + librnd/core/compat_misc.h librnd/poly/polygon1_gen.h plug_io.h librnd/core/conf.h \ librnd/core/pcb-printf.h ../src_3rd/liblihata/lihata.h \ librnd/core/list_conf.h ../src_plugins/lib_compat_help/pstk_help.c \ ../src_plugins/lib_compat_help/pstk_help.h search.h remove.h find.h \ @@ -4752,7 +4752,7 @@ librnd/core/attrib.h layer.h librnd/core/globalconst.h obj_common.h \ flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -4792,7 +4792,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/pcb-printf.h \ @@ -4927,7 +4927,7 @@ librnd/core/hidlib.h conf_core.h librnd/core/globalconst.h \ librnd/core/hidlib_conf.h board.h vtroutestyle.h layer.h obj_common.h \ flag.h data_parent.h obj_arc_list.h obj_arc.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ layer_grp.h rats_patch.h board.h crosshair.h vtonpoint.h route.h \ librnd/core/actions.h ../src_3rd/libfungw/fungw.h \ ../src_plugins/lib_gtk_common/dlg_attribute.h \ @@ -5056,7 +5056,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h crosshair.h vtonpoint.h \ route.h conf_core.h librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -5176,11 +5176,11 @@ ../src_plugins/lib_gtk_common/glue_common.h \ ../src_plugins/lib_hid_pcbui/util.h data.h librnd/core/globalconst.h \ layer.h obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h crosshair.h vtonpoint.h route.h \ buffer.h ../src_3rd/libfungw/fungw.h obj_rat_list.h obj_rat.h \ layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h @@ -5301,11 +5301,11 @@ ../src_plugins/lib_gtk_common/ui_zoompan.h board.h vtroutestyle.h \ layer.h librnd/core/globalconst.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h layer_grp.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h layer_grp.h \ rats_patch.h board.h data.h crosshair.h vtonpoint.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h ../src_plugins/lib_hid_common/act_dad.o: \ @@ -5354,7 +5354,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/hid_dad.h \ librnd/core/compat_misc.h librnd/core/hid_attrib.h \ @@ -5451,7 +5451,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -5458,7 +5458,7 @@ librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ obj_pstk_list.h obj_pstk.h ../src_3rd/genvector/vtp0.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h board.h vtroutestyle.h \ @@ -5481,7 +5481,7 @@ board.h vtroutestyle.h librnd/core/attrib.h layer.h \ librnd/core/globalconst.h librnd/core/color.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ layer_grp.h rats_patch.h board.h librnd/core/safe_fs.h \ @@ -5505,7 +5505,7 @@ ../src_3rd/genlist/gendlist.h librnd/core/color.h librnd/core/grid.h \ librnd/core/hid.h librnd/core/error.h librnd/core/attrib.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ - ../src_plugins/lib_hid_gl/hidgl.h rtree.h \ + ../src_plugins/lib_hid_gl/hidgl.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h librnd/core/hidlib.h \ ../src_plugins/lib_hid_gl/draw_gl.c \ ../src_plugins/lib_hid_gl/stencil_gl.h \ @@ -5533,7 +5533,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/compat_misc.h \ librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -5541,7 +5541,7 @@ librnd/core/list_conf.h conf_core.h librnd/core/hidlib_conf.h draw.h \ layer_vis.h search.h obj_subc_parent.h data.h crosshair.h vtonpoint.h \ route.h buffer.h obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h \ - obj_subc.h ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + obj_subc.h ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h \ @@ -5558,7 +5558,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -5567,7 +5567,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h conf_core.h librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -5594,11 +5594,11 @@ data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h route.h buffer.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/event.h layer.h \ @@ -5633,10 +5633,10 @@ data.h librnd/core/globalconst.h layer.h librnd/core/color.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h crosshair.h vtonpoint.h route.h buffer.h \ obj_rat_list.h obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h data_it.h data.h flag.h \ @@ -5655,7 +5655,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/conf.h \ @@ -5680,7 +5680,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h librnd/core/hid.h ../src_3rd/liblihata/dom.h \ @@ -5692,7 +5692,7 @@ ../src_3rd/liblihata/lihata.h ../src_3rd/genvector/vtp0.h \ librnd/core/list_conf.h librnd/core/hidlib_conf.h crosshair.h \ vtonpoint.h route.h layer.h search.h find.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h obj_subc_parent.h data.h crosshair.h \ buffer.h ../src_3rd/libfungw/fungw.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ht_subc.h ../src_3rd/genht/ht.h \ @@ -5718,7 +5718,7 @@ data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h librnd/core/hidlib_conf.h librnd/core/conf.h \ ../src_3rd/liblihata/lihata.h librnd/core/list_conf.h \ @@ -5734,7 +5734,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h netlist.h \ @@ -5743,7 +5743,7 @@ ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h find.h \ @@ -5762,7 +5762,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -5771,7 +5771,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h ht_subc.h @@ -5781,7 +5781,7 @@ ../src_3rd/genlist/gendlist.h obj_common.h flag.h \ librnd/core/globalconst.h librnd/core/attrib.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h data_parent.h \ - polyarea.h polygon.h rtree.h ../src_3rd/genrtree/genrtree_api.h \ + librnd/poly/polyarea.h polygon.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h \ librnd/core/math_helper.h rtree2_compat.h librnd/core/plugins.h \ ../src_3rd/puplug/puplug.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ @@ -5821,16 +5821,16 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h obj_common.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h librnd/core/error.h \ - rtree.h ../src_3rd/genrtree/genrtree_api.h data.h crosshair.h \ + librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h data.h crosshair.h \ vtonpoint.h librnd/core/hid.h ../src_3rd/liblihata/dom.h \ ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h route.h \ buffer.h obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h ht_subc.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h obj_arc.h \ obj_line.h obj_poly.h obj_poly_draw.h draw.h polygon.h search.h \ @@ -5850,7 +5850,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -5859,7 +5859,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ @@ -5908,13 +5908,13 @@ ../src_3rd/genlist/gendlist.h data.h librnd/core/globalconst.h layer.h \ librnd/core/attrib.h librnd/core/color.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h \ buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h change.h board.h \ @@ -5942,9 +5942,9 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ - layer.h polygon.h rtree.h ../src_3rd/genrtree/genrtree_api.h \ + layer.h polygon.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h \ rtree2_compat.h board.h vtroutestyle.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h route.h buffer.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ @@ -5962,10 +5962,10 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ - ../src_3rd/genvector/gds_char.h layer_grp.h layer.h polygon.h rtree.h \ + ../src_3rd/genvector/gds_char.h layer_grp.h layer.h polygon.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h board.h \ ../src_3rd/genht/htsp.h vtroutestyle.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -5977,8 +5977,8 @@ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h flag.h layer_ui.h obj_line.h obj_line_op.h operation.h \ - obj_arc.h obj_poly.h obj_poly_op.h obj_text_draw.h draw.h polygon1_gen.h \ - funchash_core.h librnd/core/funchash.h funchash_core_list.h rtree.h \ + obj_arc.h obj_poly.h obj_poly_op.h obj_text_draw.h draw.h librnd/poly/polygon1_gen.h \ + funchash_core.h librnd/core/funchash.h funchash_core_list.h librnd/poly/rtree.h \ ../src_plugins/lib_polyhelp/polyhelp.h ../src_plugins/ddraft/centgeo.h ../src_plugins/mincut/pcb-mincut/graph.o: \ ../src_plugins/mincut/pcb-mincut/graph.c \ @@ -6000,7 +6000,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -6009,7 +6009,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h librnd/core/event.h plug_io.h librnd/core/conf.h \ @@ -6040,13 +6040,13 @@ ../src_3rd/genlist/gendlist.h data.h librnd/core/globalconst.h layer.h \ librnd/core/attrib.h librnd/core/color.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h \ buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/event.h \ @@ -6071,11 +6071,11 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ route.h buffer.h obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h \ - obj_subc.h ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + obj_subc.h ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -6101,7 +6101,7 @@ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/pcb-printf.h \ @@ -6130,7 +6130,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -6139,10 +6139,10 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ - vtpadstack_t.h macro.h remove.h rtree.h polygon.h polyarea.h flag_str.h \ + vtpadstack_t.h macro.h remove.h librnd/poly/rtree.h polygon.h librnd/poly/polyarea.h flag_str.h \ find.h draw.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ @@ -6159,7 +6159,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -6168,10 +6168,10 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ - vtpadstack_t.h macro.h remove.h rtree.h draw.h polygon.h \ + vtpadstack_t.h macro.h remove.h librnd/poly/rtree.h draw.h polygon.h \ librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ @@ -6187,7 +6187,7 @@ librnd/core/color.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ layer_grp.h rats_patch.h board.h librnd/core/hidlib.h \ @@ -6211,7 +6211,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -6220,7 +6220,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ @@ -6243,7 +6243,7 @@ data_parent.h librnd/core/color.h ../src_3rd/genht/ht.h \ ../src_plugins/propedit/propsel.h librnd/core/compat_misc.h board.h \ vtroutestyle.h librnd/core/unit.h layer.h obj_arc_list.h obj_arc.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ ../src_3rd/genvector/gds_char.h layer_grp.h rats_patch.h board.h \ @@ -6261,7 +6261,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -6270,7 +6270,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -6279,7 +6279,7 @@ change.h board.h vtroutestyle.h rats_patch.h librnd/core/hidlib.h \ flag_str.h librnd/core/compat_misc.h undo.h ../src_3rd/libuundo/uundo.h \ undo_old.h rotate.h librnd/core/rotate.h obj_pstk_inlines.h thermal.h \ - polygon1_gen.h librnd/core/pcb-printf.h conf_core.h librnd/core/conf.h \ + librnd/poly/polygon1_gen.h librnd/core/pcb-printf.h conf_core.h librnd/core/conf.h \ ../src_3rd/liblihata/lihata.h librnd/core/list_conf.h \ librnd/core/hidlib_conf.h netlist.h obj_line_op.h operation.h \ obj_arc_op.h obj_text_op.h obj_pstk_op.h obj_subc_op.h @@ -6297,7 +6297,7 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -6304,16 +6304,16 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h move.h \ - remove.h rtree.h flag_str.h undo.h ../src_3rd/libuundo/uundo.h \ + remove.h librnd/poly/rtree.h flag_str.h undo.h ../src_3rd/libuundo/uundo.h \ undo_old.h layer.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/error.h librnd/core/actions.h \ librnd/core/compat_misc.h obj_pstk_inlines.h data.h thermal.h \ - polygon1_gen.h funchash_core.h librnd/core/funchash.h \ + librnd/poly/polygon1_gen.h funchash_core.h librnd/core/funchash.h \ funchash_core_list.h search.h find.h ../src_plugins/query/basic_fnc.o: ../src_plugins/query/basic_fnc.c \ ../config.h data.h librnd/core/globalconst.h \ @@ -6324,7 +6324,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -6333,7 +6333,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -6358,13 +6358,13 @@ librnd/core/globalconst.h layer.h librnd/core/attrib.h \ librnd/core/color.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h crosshair.h vtonpoint.h librnd/core/hid.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h change.h board.h \ vtroutestyle.h rats_patch.h librnd/core/hidlib.h undo.h \ @@ -6388,7 +6388,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/misc_util.h \ ../src_3rd/genvector/gds_char.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -6396,7 +6396,7 @@ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -6405,7 +6405,7 @@ ../src_3rd/genregex/regex_se.h ../src_3rd/genregex/regex_templ.h \ ../src_3rd/genregex/regex.h ../src_plugins/query/fields_sphash.h \ obj_common.h layer.h flag_str.h ../src_plugins/query/query_exec.h \ - obj_pstk_inlines.h data.h thermal.h polygon1_gen.h obj_subc_parent.h + obj_pstk_inlines.h data.h thermal.h librnd/poly/polygon1_gen.h obj_subc_parent.h ../src_plugins/query/query_act.o: ../src_plugins/query/query_act.c \ ../config.h conf_core.h librnd/core/conf.h librnd/core/global_typedefs.h \ librnd/core/pcb_bool.h librnd/core/pcb-printf.h \ @@ -6426,7 +6426,7 @@ ../src_3rd/genregex/regex.h ../src_plugins/query/fields_sphash.h \ obj_common.h flag.h data_parent.h layer.h obj_common.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h flag_str.h ../src_plugins/query/query_y.h \ ../src_plugins/query/query_exec.h ../src_plugins/query/query_access.h \ draw.h layer.h select.h operation.h board.h vtroutestyle.h layer_grp.h \ @@ -6441,7 +6441,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -6450,7 +6450,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -6471,7 +6471,7 @@ librnd/core/color.h obj_common.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ ../src_3rd/genvector/gds_char.h flag_str.h \ @@ -6488,7 +6488,7 @@ librnd/core/color.h obj_common.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ ../src_3rd/genvector/gds_char.h flag_str.h \ @@ -6503,7 +6503,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -6512,7 +6512,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h change.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ @@ -6534,7 +6534,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h librnd/core/actions.h \ @@ -6543,10 +6543,10 @@ librnd/core/error.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ data.h crosshair.h vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h \ idpath.h obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ - vtpadstack_t.h rtree.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ + vtpadstack_t.h librnd/poly/rtree.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ change.h conf_core.h librnd/core/conf.h librnd/core/pcb-printf.h \ ../src_3rd/liblihata/lihata.h librnd/core/list_conf.h ../src_plugins/report/drill.o: ../src_plugins/report/drill.c ../config.h \ @@ -6557,7 +6557,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -6566,13 +6566,13 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h ../src_plugins/report/drill.h macro.h obj_pstk_inlines.h \ board.h vtroutestyle.h rats_patch.h librnd/core/hidlib.h data.h \ - thermal.h polygon1_gen.h + thermal.h librnd/poly/polygon1_gen.h ../src_plugins/report/report.o: ../src_plugins/report/report.c \ ../config.h conf_core.h librnd/core/conf.h librnd/core/global_typedefs.h \ librnd/core/pcb_bool.h librnd/core/pcb-printf.h \ @@ -6589,17 +6589,17 @@ vtonpoint.h librnd/core/hid.h librnd/core/error.h librnd/core/attrib.h \ librnd/core/box.h librnd/core/misc_util.h obj_line.h \ ../src_3rd/genlist/gendlist.h obj_common.h flag.h data_parent.h \ - obj_poly.h polyarea.h route.h board.h vtroutestyle.h layer.h \ + obj_poly.h librnd/poly/polyarea.h route.h board.h vtroutestyle.h layer.h \ obj_arc_list.h obj_arc.h obj_line_list.h obj_poly_list.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h layer_grp.h rats_patch.h \ board.h librnd/core/hidlib.h data.h crosshair.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h data_it.h data.h \ - ../src_plugins/report/drill.h search.h rtree.h flag_str.h macro.h undo.h \ + ../src_plugins/report/drill.h search.h librnd/poly/rtree.h flag_str.h macro.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h find.h draw.h \ librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ @@ -6606,7 +6606,7 @@ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/error.h librnd/core/actions.h \ ../src_plugins/report/report_conf.h librnd/core/compat_misc.h layer.h \ - obj_term.h obj_pstk.h obj_pstk_inlines.h thermal.h polygon1_gen.h \ + obj_term.h obj_pstk.h obj_pstk_inlines.h thermal.h librnd/poly/polygon1_gen.h \ obj_subc_parent.h librnd/core/hid_dad.h librnd/core/hid_attrib.h \ librnd/core/hid_dad_spin.h netlist.h ../src_3rd/genregex/regex_sei.h \ ../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h \ @@ -6627,7 +6627,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -6636,7 +6636,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h data_it.h data.h data_list.h librnd/core/event.h undo.h \ @@ -6643,7 +6643,7 @@ ../src_3rd/libuundo/uundo.h undo_old.h operation.h rotate.h \ librnd/core/rotate.h librnd/core/compat_misc.h draw.h draw_wireframe.h \ crosshair.h obj_rat_draw.h obj_line_op.h operation.h obj_line_draw.h \ - draw.h obj_pstk_inlines.h thermal.h polygon1_gen.h route_draw.h \ + draw.h obj_pstk_inlines.h thermal.h librnd/poly/polygon1_gen.h route_draw.h \ librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ @@ -6721,17 +6721,17 @@ librnd/core/error.h librnd/core/attrib.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h obj_line.h \ ../src_3rd/genlist/gendlist.h obj_common.h flag.h data_parent.h \ - obj_poly.h polyarea.h route.h board.h vtroutestyle.h layer.h \ + obj_poly.h librnd/poly/polyarea.h route.h board.h vtroutestyle.h layer.h \ obj_arc_list.h obj_arc.h obj_line_list.h obj_poly_list.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h layer_grp.h rats_patch.h \ board.h librnd/core/hidlib.h data.h crosshair.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h data_it.h data.h search.h \ - tool.h rtree.h flag_str.h macro.h undo.h ../src_3rd/libuundo/uundo.h \ + tool.h librnd/poly/rtree.h flag_str.h macro.h undo.h ../src_3rd/libuundo/uundo.h \ undo_old.h find.h draw.h draw_wireframe.h librnd/core/plugins.h \ ../src_3rd/puplug/puplug.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ @@ -6752,7 +6752,7 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h build_run.h buffer.h ../src_3rd/libfungw/fungw.h \ @@ -6759,7 +6759,7 @@ ../src_3rd/genht/htpp.h ../src_plugins/shand_cmd/command.h data.h \ crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h \ buffer.h obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/event.h plug_io.h \ @@ -6778,7 +6778,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -6787,7 +6787,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h layer.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ @@ -6886,7 +6886,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h conf_core.h librnd/core/conf.h \ librnd/core/pcb-printf.h ../src_3rd/liblihata/lihata.h \ @@ -6893,11 +6893,11 @@ ../src_3rd/genvector/vtp0.h librnd/core/list_conf.h data.h crosshair.h \ vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ librnd/core/event.h list_common.h obj_line_list.h obj_pstk.h \ - obj_pstk_inlines.h data.h thermal.h polygon1_gen.h obj_subc_parent.h \ + obj_pstk_inlines.h data.h thermal.h librnd/poly/polygon1_gen.h obj_subc_parent.h \ search.h tool.h layer_ui.h netlist.h \ ../src_plugins/sketch_route/sktypedefs.h \ ../src_plugins/sketch_route/wire.h \ @@ -6965,7 +6965,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -6974,10 +6974,10 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ - vtpadstack_t.h rtree.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ + vtpadstack_t.h librnd/poly/rtree.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ netlist.h move.h draw.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ @@ -6994,7 +6994,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h conf_core.h librnd/core/conf.h \ @@ -7022,7 +7022,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/misc_util.h \ ../src_3rd/genvector/gds_char.h layer_grp.h rats_patch.h board.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -7030,16 +7030,16 @@ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ - vtpadstack_t.h rtree.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ + vtpadstack_t.h librnd/poly/rtree.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/error.h librnd/core/actions.h obj_pstk_inlines.h \ - data.h thermal.h polygon1_gen.h + data.h thermal.h librnd/poly/polygon1_gen.h ../src_plugins/vendordrill/vendor.o: ../src_plugins/vendordrill/vendor.c \ ../config.h conf_core.h librnd/core/conf.h librnd/core/global_typedefs.h \ librnd/core/pcb_bool.h librnd/core/pcb-printf.h \ @@ -7055,7 +7055,7 @@ ../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h change.h \ board.h vtroutestyle.h librnd/core/attrib.h layer.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ layer_grp.h rats_patch.h librnd/core/hidlib.h board.h data.h crosshair.h \ @@ -7062,7 +7062,7 @@ vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h undo.h \ @@ -7072,7 +7072,7 @@ ../src_3rd/puplug/libs.h ../src_3rd/puplug/error.h librnd/core/actions.h \ librnd/core/hid_cfg.h ../src_plugins/vendordrill/vendor_conf.h \ librnd/core/compat_misc.h obj_pstk_inlines.h data.h thermal.h \ - polygon1_gen.h librnd/core/event.h macro.h ../src_3rd/liblihata/tree.h \ + librnd/poly/polygon1_gen.h librnd/core/event.h macro.h ../src_3rd/liblihata/tree.h \ ../src_plugins/vendordrill/vendor_conf_fields.h ../src_3rd/gensexpr/gsx_parse.o: ../src_3rd/gensexpr/gsx_parse.c \ ../src_3rd/gensexpr/gsx_parse.h @@ -7236,11 +7236,11 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h route.h \ buffer.h obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -7256,7 +7256,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -7265,7 +7265,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h conf_core.h librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -7274,7 +7274,7 @@ librnd/core/actions.h librnd/core/paths.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h draw.h librnd/core/event.h \ librnd/core/safe_fs.h tool.h netlist.h defpcb_internal.c \ - obj_pstk_inlines.h thermal.h polygon1_gen.h + obj_pstk_inlines.h thermal.h librnd/poly/polygon1_gen.h brave.o: brave.c ../config.h ../src_3rd/genvector/gds_char.h \ ../src_3rd/genvector/genvector_impl.h \ ../src_3rd/genvector/genvector_undef.h board.h ../src_3rd/genht/htsp.h \ @@ -7285,7 +7285,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ brave.h librnd/core/actions.h librnd/core/hid.h \ @@ -7312,13 +7312,13 @@ data_parent.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ board.h vtroutestyle.h layer.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ move.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ librnd/core/error.h route.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h plug_io.h \ rotate.h librnd/core/rotate.h librnd/core/compat_misc.h remove.h \ @@ -7343,7 +7343,7 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ build_run.h librnd/core/hid_init.h ../src_3rd/puplug/puplug.h \ @@ -7370,7 +7370,7 @@ librnd/core/color.h change.h board.h vtroutestyle.h librnd/core/attrib.h \ layer.h obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ librnd/core/compat_misc.h data.h crosshair.h vtonpoint.h \ @@ -7377,7 +7377,7 @@ librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h select.h operation.h \ @@ -7398,13 +7398,13 @@ librnd/core/color.h data.h layer.h librnd/core/attrib.h obj_common.h \ flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h crosshair.h vtonpoint.h librnd/core/hid.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h funchash_core.h \ librnd/core/funchash.h funchash_core_list.h board.h vtroutestyle.h \ @@ -7421,7 +7421,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h librnd/core/actions.h \ @@ -7464,7 +7464,7 @@ librnd/core/color.h librnd/core/hidlib_conf.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h crosshair.h vtonpoint.h \ @@ -7471,7 +7471,7 @@ librnd/core/hid.h librnd/core/error.h route.h data.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h draw_wireframe.h \ @@ -7489,7 +7489,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -7498,7 +7498,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h data_list.h data_it.h list_common.h \ @@ -7521,7 +7521,7 @@ librnd/core/color.h librnd/core/hidlib_conf.h librnd/core/math_helper.h \ board.h vtroutestyle.h librnd/core/attrib.h layer.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/misc_util.h layer_grp.h rats_patch.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -7528,7 +7528,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h \ librnd/core/event.h rotate.h librnd/core/rotate.h \ @@ -7550,7 +7550,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h drc.h view.h idpath.h \ librnd/core/hidlib_conf.h librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -7566,7 +7566,7 @@ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ librnd/core/unit.h ../src_3rd/genvector/gds_char.h crosshair.h \ @@ -7575,7 +7575,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ obj_pstk_list.h obj_pstk.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h data_list.h remove.h undo.h ../src_3rd/libuundo/uundo.h \ @@ -7600,12 +7600,12 @@ librnd/core/hid_attrib.h ../src_3rd/genlist/gendlist.h \ librnd/core/hid_dad_spin.h search.h layer.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h tool.h extobj.h board.h vtroutestyle.h \ layer_grp.h rats_patch.h librnd/core/hidlib.h data.h crosshair.h \ vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h obj_subc_parent.h \ draw.h @@ -7618,7 +7618,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h build_run.h conf_core.h \ @@ -7630,7 +7630,7 @@ vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h plug_io.h plug_import.h \ @@ -7649,7 +7649,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -7658,12 +7658,12 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h find_geo.c macro.h \ obj_arc_ui.h obj_pstk_inlines.h board.h vtroutestyle.h rats_patch.h \ - librnd/core/hidlib.h thermal.h polygon1_gen.h search.h find_any_isect.c + librnd/core/hidlib.h thermal.h librnd/poly/polygon1_gen.h search.h find_any_isect.c flag.o: flag.c ../config.h flag.h librnd/core/globalconst.h operation.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h flag_str.o: flag_str.c ../config.h flag_str.h flag.h \ @@ -7674,7 +7674,7 @@ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h obj_poly.h \ ../src_3rd/genlist/gendlist.h obj_common.h flag.h \ - librnd/core/globalconst.h librnd/core/attrib.h data_parent.h polyarea.h \ + librnd/core/globalconst.h librnd/core/attrib.h data_parent.h librnd/poly/polyarea.h \ obj_poly_list.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ obj_arc.h obj_arc_list.h librnd/core/box.h librnd/core/math_helper.h \ @@ -7700,7 +7700,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h librnd/core/actions.h \ @@ -7719,7 +7719,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h build_run.h conf_core.h \ @@ -7731,7 +7731,7 @@ librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h tool.h librnd/core/grid.h \ @@ -7754,7 +7754,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -7763,7 +7763,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h hid_cam.h librnd/core/hid_attrib.h \ @@ -7779,7 +7779,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h tool.h ../src_3rd/genvector/vtp0.h @@ -7792,10 +7792,10 @@ ../src_3rd/genvector/genvector_undef.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h librnd/core/unit.h \ - ../src_3rd/genvector/gds_char.h rtree2_compat.h rtree.h \ + ../src_3rd/genvector/gds_char.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h ../src_3rd/genht/ht.c \ ../src_3rd/genht/ht_inlines.h @@ -7809,7 +7809,7 @@ ../src_3rd/genvector/genvector_impl.h \ ../src_3rd/genvector/genvector_undef.h layer.h librnd/core/color.h \ obj_arc_list.h obj_arc.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -7817,7 +7817,7 @@ ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h obj_subc_list.h \ - obj_subc.h ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + obj_subc.h ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -7836,13 +7836,13 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ data.h crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h \ route.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h select.h operation.h undo.h \ @@ -7860,7 +7860,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -7869,7 +7869,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h conf_core.h librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -7877,7 +7877,7 @@ librnd/core/compat_misc.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ librnd/core/event.h layer_ui.h layer_vis.h funchash_core.h \ librnd/core/funchash.h funchash_core_list.h obj_pstk_inlines.h thermal.h \ - polygon1_gen.h list_common.h + librnd/poly/polygon1_gen.h list_common.h layer_addr.o: layer_addr.c ../config.h ../src_3rd/genvector/gds_char.h \ ../src_3rd/genvector/genvector_impl.h \ ../src_3rd/genvector/genvector_undef.h board.h ../src_3rd/genht/htsp.h \ @@ -7888,7 +7888,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -7896,7 +7896,7 @@ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -7910,7 +7910,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -7919,7 +7919,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/compat_misc.h librnd/core/event.h \ @@ -7933,7 +7933,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h librnd/core/event.h \ @@ -7947,7 +7947,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -7956,7 +7956,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h conf_core.h librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -7973,7 +7973,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h brave.h data.h crosshair.h vtonpoint.h \ @@ -7981,7 +7981,7 @@ ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ - obj_subc_list.h obj_subc.h rtree2_compat.h rtree.h \ + obj_subc_list.h obj_subc.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -8007,7 +8007,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -8016,7 +8016,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/compat_misc.h librnd/core/actions.h \ @@ -8041,13 +8041,13 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ data.h crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h \ route.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h move.h select.h \ @@ -8066,7 +8066,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -8075,7 +8075,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h data_it.h librnd/core/event.h librnd/core/compat_misc.h \ @@ -8084,7 +8084,7 @@ librnd/core/list_conf.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ obj_rat_draw.h obj_subc_parent.h search.h remove.h draw.h netlist.h \ ../src_3rd/genlist/gentdlist_impl.c netlist_geo.c obj_pstk_inlines.h \ - thermal.h polygon1_gen.h + thermal.h librnd/poly/polygon1_gen.h netlist_act.o: netlist_act.c ../config.h ../src_3rd/genregex/regex_sei.h \ ../src_3rd/genregex/regex_templ.h ../src_3rd/genregex/regex.h \ funchash_core.h librnd/core/funchash.h funchash_core_list.h data.h \ @@ -8095,7 +8095,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -8104,7 +8104,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -8122,7 +8122,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -8131,7 +8131,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h rotate.h \ @@ -8155,7 +8155,7 @@ ../src_3rd/genht/ht.h librnd/core/error.h librnd/core/attrib.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ librnd/core/unit.h obj_line.h ../src_3rd/genlist/gendlist.h obj_common.h \ - flag.h librnd/core/globalconst.h data_parent.h obj_poly.h polyarea.h \ + flag.h librnd/core/globalconst.h data_parent.h obj_poly.h librnd/poly/polyarea.h \ route.h obj_arc.h obj_common.o: obj_common.c ../config.h conf_core.h librnd/core/conf.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h \ @@ -8172,9 +8172,9 @@ librnd/core/attrib.h data_parent.h obj_arc_ui.h crosshair.h vtonpoint.h \ librnd/core/hid.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h obj_line.h ../src_3rd/genlist/gendlist.h \ - obj_poly.h polyarea.h route.h obj_pstk.h layer.h obj_arc_list.h \ + obj_poly.h librnd/poly/polyarea.h route.h obj_pstk.h layer.h obj_arc_list.h \ obj_arc.h obj_line_list.h obj_poly_list.h obj_text_list.h obj_text.h \ - font.h ../src_3rd/genht/htip.h obj_pstk_shape.h polygon.h rtree.h \ + font.h ../src_3rd/genht/htip.h obj_pstk_shape.h polygon.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h vtpadstack_t.h \ obj_subc.h ../src_3rd/libminuid/libminuid.h obj_subc_parent.h data.h \ buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ @@ -8192,7 +8192,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -8201,7 +8201,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h move.h search.h conf_core.h librnd/core/conf.h \ @@ -8225,13 +8225,13 @@ librnd/core/color.h librnd/core/math_helper.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ data.h crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h \ route.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h find.h macro.h @@ -8251,11 +8251,11 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ - rats_patch.h librnd/core/hidlib.h polygon.h rtree.h \ - ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h polygon1_gen.h \ + rats_patch.h librnd/core/hidlib.h polygon.h librnd/poly/rtree.h \ + ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h librnd/poly/polygon1_gen.h \ obj_pinvia_therm.h obj_poly.o: obj_poly.c ../config.h board.h ../src_3rd/genht/htsp.h \ ../src_3rd/genht/ht.h librnd/core/global_typedefs.h \ @@ -8266,7 +8266,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -8275,11 +8275,11 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ - polygon1_gen.h polygon_offs.h rotate.h librnd/core/rotate.h \ + librnd/poly/polygon1_gen.h polygon_offs.h rotate.h librnd/core/rotate.h \ librnd/core/compat_misc.h search.h librnd/core/hid_inlines.h conf_core.h \ librnd/core/conf.h librnd/core/pcb-printf.h \ ../src_3rd/liblihata/lihata.h librnd/core/list_conf.h obj_poly_op.h \ @@ -8289,7 +8289,7 @@ ../src_3rd/genlist/gendlist.h obj_common.h flag.h \ librnd/core/globalconst.h librnd/core/attrib.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h data_parent.h \ - polyarea.h ../src_3rd/genlist/gentdlist_impl.h \ + librnd/poly/polyarea.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ ../src_3rd/genlist/gentdlist_impl.c obj_pstk.o: obj_pstk.c ../config.h board.h ../src_3rd/genht/htsp.h \ @@ -8301,7 +8301,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h conf_core.h librnd/core/conf.h \ @@ -8312,11 +8312,11 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h data_list.h \ draw.h draw_wireframe.h obj_pstk_draw.h obj_pstk_inlines.h thermal.h \ - polygon1_gen.h obj_pstk_op.h operation.h obj_subc_parent.h obj_hash.h \ + librnd/poly/polygon1_gen.h obj_pstk_op.h operation.h obj_subc_parent.h obj_hash.h \ librnd/core/compat_misc.h search.h undo.h ../src_3rd/libuundo/uundo.h \ undo_old.h librnd/core/event.h librnd/core/hid_inlines.h polygon_offs.h \ obj_pstk_op.c rotate.h librnd/core/rotate.h @@ -8329,10 +8329,10 @@ layer.h librnd/core/color.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ - ../src_3rd/genvector/gds_char.h obj_pstk_shape.h polygon.h rtree.h \ + ../src_3rd/genvector/gds_char.h obj_pstk_shape.h polygon.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h vtpadstack_t.h \ obj_pstk_inlines.h board.h ../src_3rd/genht/htsp.h vtroutestyle.h \ layer_grp.h rats_patch.h librnd/core/hidlib.h data.h crosshair.h \ @@ -8342,7 +8342,7 @@ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h \ - vtpadstack.h thermal.h polygon1_gen.h funchash_core.h \ + vtpadstack.h thermal.h librnd/poly/polygon1_gen.h funchash_core.h \ librnd/core/funchash.h funchash_core_list.h conf_core.h \ librnd/core/conf.h librnd/core/pcb-printf.h \ ../src_3rd/liblihata/lihata.h librnd/core/list_conf.h \ @@ -8365,7 +8365,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h buffer.h ../src_3rd/libfungw/fungw.h \ @@ -8376,11 +8376,11 @@ ../src_3rd/genvector/vtp0.h librnd/core/list_conf.h data.h crosshair.h \ vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h data_list.h obj_pstk_inlines.h \ - thermal.h polygon1_gen.h rotate.h librnd/core/rotate.h undo.h \ + thermal.h librnd/poly/polygon1_gen.h rotate.h librnd/core/rotate.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h obj_hash.h funchash_core.h \ librnd/core/funchash.h funchash_core_list.h polygon_offs.h obj_rat.o: obj_rat.c ../config.h board.h ../src_3rd/genht/htsp.h \ @@ -8392,7 +8392,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -8401,7 +8401,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h data_it.h conf_core.h librnd/core/conf.h \ @@ -8417,7 +8417,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h obj_rat.h idpath.h obj_rat_list.h \ @@ -8432,7 +8432,7 @@ librnd/core/unit.h layer.h librnd/core/color.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ ../src_3rd/genvector/gds_char.h layer_grp.h rats_patch.h \ @@ -8440,12 +8440,12 @@ ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h brave.h data.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h obj_subc_op.h operation.h \ obj_subc_parent.h obj_poly_op.h obj_pstk_inlines.h thermal.h \ - polygon1_gen.h obj_pstk_draw.h draw.h obj_line_op.h obj_term.h \ + librnd/poly/polygon1_gen.h obj_pstk_draw.h draw.h obj_line_op.h obj_term.h \ obj_text_draw.h draw_wireframe.h undo.h ../src_3rd/libuundo/uundo.h \ undo_old.h macro.h librnd/core/compat_misc.h pcb_minuid.h conf_core.h \ librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -8459,7 +8459,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -8468,7 +8468,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -8482,10 +8482,10 @@ ../src_3rd/genvector/genvector_undef.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h librnd/core/unit.h \ - ../src_3rd/genvector/gds_char.h rtree2_compat.h rtree.h \ + ../src_3rd/genvector/gds_char.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h obj_subc_list.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h \ ../src_3rd/genlist/gentdlist_impl.c @@ -8499,7 +8499,7 @@ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h librnd/core/compat_misc.h obj_term.h \ @@ -8508,7 +8508,7 @@ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/pcb-printf.h \ @@ -8523,7 +8523,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -8532,7 +8532,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/hid_inlines.h undo.h \ @@ -8545,7 +8545,7 @@ ../src_3rd/genlist/gendlist.h obj_common.h flag.h \ librnd/core/globalconst.h librnd/core/attrib.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h data_parent.h \ - polyarea.h ../src_3rd/genlist/gentdlist_impl.h \ + librnd/poly/polyarea.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ obj_arc_list.h obj_arc.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ @@ -8567,13 +8567,13 @@ librnd/core/color.h librnd/core/hidlib_conf.h data.h layer.h \ librnd/core/attrib.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h crosshair.h vtonpoint.h librnd/core/hid.h \ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h board.h \ vtroutestyle.h rats_patch.h librnd/core/hidlib.h tool.h change.h undo.h \ @@ -8591,7 +8591,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -8600,7 +8600,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h conf_core.h librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -8621,7 +8621,7 @@ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -8630,7 +8630,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -8655,12 +8655,12 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h plug_footprint.h vtlibrary.h data.h \ crosshair.h vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h \ idpath.h obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/conf.h librnd/core/pcb-printf.h \ @@ -8695,7 +8695,7 @@ librnd/core/color.h librnd/core/hidlib_conf.h change.h board.h \ vtroutestyle.h librnd/core/attrib.h layer.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ layer_grp.h rats_patch.h librnd/core/hidlib.h data.h crosshair.h \ @@ -8702,7 +8702,7 @@ vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h plug_io.h remove.h \ @@ -8727,31 +8727,31 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ data.h crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h \ route.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h remove.h search.h \ - thermal.h polygon1_gen.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ + thermal.h librnd/poly/polygon1_gen.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ obj_poly_draw.h obj_text_draw.h polygon_selfi.h librnd/core/event.h \ polygon_offs.c librnd/core/compat_misc.h polygon_offs.h -polygon1.o: polygon1.c ../config.h rtree.h librnd/core/global_typedefs.h \ +polygon1.o: polygon1.c ../config.h librnd/poly/rtree.h librnd/core/global_typedefs.h \ librnd/core/pcb_bool.h ../src_3rd/genrtree/genrtree_api.h \ librnd/core/math_helper.h librnd/core/heap.h librnd/core/compat_cc.h librnd/core/pcb-printf.h \ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \ - ../src_3rd/genvector/genvector_undef.h librnd/core/unit.h polyarea.h \ + ../src_3rd/genvector/genvector_undef.h librnd/core/unit.h librnd/poly/polyarea.h \ obj_common.h flag.h librnd/core/globalconst.h librnd/core/attrib.h \ data_parent.h macro.h librnd/core/box.h librnd/core/misc_util.h \ rtree2_compat.h polygon_selfi.c polygon_selfi.h \ ../src_3rd/genvector/vtp0.h polygon1_gen.o: polygon1_gen.c ../config.h librnd/core/global_typedefs.h \ - librnd/core/pcb_bool.h polyarea.h librnd/core/math_helper.h \ - librnd/core/unit.h polygon1_gen.h + librnd/core/pcb_bool.h librnd/poly/polyarea.h librnd/core/math_helper.h \ + librnd/core/unit.h librnd/poly/polygon1_gen.h polygon_act.o: polygon_act.c ../config.h librnd/core/hidlib_conf.h \ librnd/core/conf.h librnd/core/global_typedefs.h librnd/core/pcb_bool.h \ librnd/core/pcb-printf.h ../src_3rd/genvector/gds_char.h \ @@ -8766,13 +8766,13 @@ librnd/core/attrib.h layer.h librnd/core/globalconst.h obj_common.h \ flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ data.h crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h \ route.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h undo.h \ @@ -8793,13 +8793,13 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ data.h crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h \ route.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h undo.h \ @@ -8816,7 +8816,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ librnd/core/hidlib.h ../src_3rd/genht/hash.h librnd/core/actions.h \ @@ -8825,7 +8825,7 @@ librnd/core/error.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ data.h crosshair.h vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h \ idpath.h obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h move.h librnd/core/compat_misc.h librnd/core/safe_fs.h \ @@ -8847,7 +8847,7 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ draw.h librnd/core/hid.h librnd/core/error.h extobj.h data.h crosshair.h \ @@ -8854,7 +8854,7 @@ vtonpoint.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h obj_subc_parent.h \ remove.h select.h operation.h undo.h ../src_3rd/libuundo/uundo.h \ @@ -8868,7 +8868,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ ../src_3rd/genvector/gds_char.h crosshair.h vtonpoint.h \ @@ -8877,7 +8877,7 @@ ../src_3rd/genht/htsp.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h layer_grp.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ @@ -8893,7 +8893,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -8902,7 +8902,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h rotate.h librnd/core/rotate.h \ @@ -8926,7 +8926,7 @@ librnd/core/color.h librnd/core/hidlib_conf.h librnd/core/math_helper.h \ board.h vtroutestyle.h librnd/core/attrib.h layer.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ librnd/core/box.h librnd/core/misc_util.h layer_grp.h rats_patch.h \ librnd/core/hidlib.h data.h crosshair.h vtonpoint.h librnd/core/hid.h \ @@ -8933,7 +8933,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h extobj.h \ obj_subc_parent.h draw.h find.h undo.h ../src_3rd/libuundo/uundo.h \ @@ -8953,12 +8953,12 @@ librnd/core/misc_util.h board.h layer.h librnd/core/globalconst.h \ librnd/core/color.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ layer_grp.h rats_patch.h librnd/core/hidlib.h funchash_core.h \ librnd/core/funchash.h funchash_core_list.h conf_core.h rtree.o: rtree.c ../config.h librnd/core/unit.h \ - librnd/core/global_typedefs.h librnd/core/pcb_bool.h rtree.h \ + librnd/core/global_typedefs.h librnd/core/pcb_bool.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ../src_3rd/genrtree/genrtree_impl.h \ ../src_3rd/genrtree/genrtree_search.h \ ../src_3rd/genrtree/genrtree_delete.h \ @@ -8977,17 +8977,17 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ data.h crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h \ route.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h find.h search.h \ - obj_subc_parent.h obj_pstk_inlines.h thermal.h polygon1_gen.h + obj_subc_parent.h obj_pstk_inlines.h thermal.h librnd/poly/polygon1_gen.h select.o: select.c ../config.h conf_core.h librnd/core/conf.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h \ librnd/core/pcb-printf.h ../src_3rd/genvector/gds_char.h \ @@ -9002,7 +9002,7 @@ librnd/core/color.h librnd/core/hidlib_conf.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h data.h crosshair.h vtonpoint.h \ @@ -9009,7 +9009,7 @@ librnd/core/hid.h librnd/core/error.h route.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h data_it.h draw.h search.h \ @@ -9032,13 +9032,13 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ data.h crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h \ route.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h undo.h \ @@ -9058,7 +9058,7 @@ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genvector/gds_char.h obj_text_draw.h stub_stroke.o: stub_stroke.c librnd/core/error.h \ librnd/core/global_typedefs.h ../config.h librnd/core/pcb_bool.h @@ -9069,11 +9069,11 @@ ../src_3rd/genvector/genvector_undef.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_impl.h \ ../src_3rd/genlist/gendlist.h ../src_3rd/genlist/gentdlist_undef.h \ - obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h polyarea.h \ + obj_line_list.h obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h \ obj_text_list.h obj_text.h font.h ../src_3rd/genht/htip.h \ ../src_3rd/genht/ht.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h librnd/core/unit.h \ - ../src_3rd/genvector/gds_char.h polygon1_gen.h librnd/core/compat_misc.h \ + ../src_3rd/genvector/gds_char.h librnd/poly/polygon1_gen.h librnd/core/compat_misc.h \ data.h crosshair.h vtonpoint.h librnd/core/hid.h \ ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ ../src_3rd/liblihata/parser.h ../src_3rd/genht/htsp.h \ @@ -9080,7 +9080,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h layer_grp.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h obj_pstk_inlines.h board.h vtroutestyle.h rats_patch.h \ @@ -9096,7 +9096,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h librnd/core/hidlib_conf.h \ @@ -9107,7 +9107,7 @@ librnd/core/hid.h librnd/core/error.h route.h data.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h librnd/core/event.h \ @@ -9130,7 +9130,7 @@ librnd/core/color.h librnd/core/hidlib_conf.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h crosshair.h vtonpoint.h \ @@ -9137,7 +9137,7 @@ librnd/core/hid.h librnd/core/error.h route.h data.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h draw_wireframe.h \ @@ -9157,13 +9157,13 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h crosshair.h \ vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h data.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/actions.h remove.h \ @@ -9183,7 +9183,7 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ @@ -9190,7 +9190,7 @@ librnd/core/compat_misc.h data.h crosshair.h vtonpoint.h \ librnd/core/hid.h librnd/core/error.h route.h obj_rat_list.h obj_rat.h \ idpath.h obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ librnd/core/actions.h search.h tool.h undo.h ../src_3rd/libuundo/uundo.h \ @@ -9204,7 +9204,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h move.h crosshair.h vtonpoint.h \ @@ -9220,13 +9220,13 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h crosshair.h vtonpoint.h \ librnd/core/hid.h ../src_3rd/liblihata/dom.h \ ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h \ - librnd/core/error.h route.h insert.h polygon.h rtree.h \ + librnd/core/error.h route.h insert.h polygon.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h search.h tool.h \ ../src_3rd/genvector/vtp0.h tool_line.o: tool_line.c ../config.h conf_core.h librnd/core/conf.h \ @@ -9243,7 +9243,7 @@ librnd/core/color.h librnd/core/hidlib_conf.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h crosshair.h vtonpoint.h \ @@ -9250,7 +9250,7 @@ librnd/core/hid.h librnd/core/error.h route.h data.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h draw_wireframe.h find.h \ @@ -9266,7 +9266,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h change.h data.h crosshair.h \ @@ -9275,7 +9275,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h librnd/core/actions.h search.h tool.h tool_lock.h @@ -9288,7 +9288,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h move.h crosshair.h vtonpoint.h \ @@ -9298,7 +9298,7 @@ extobj.h data.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h obj_subc_parent.h \ draw.h @@ -9317,8 +9317,8 @@ librnd/core/error.h librnd/core/attrib.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h obj_line.h \ ../src_3rd/genlist/gendlist.h obj_common.h flag.h data_parent.h \ - obj_poly.h polyarea.h route.h librnd/core/actions.h \ - ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h polygon.h rtree.h \ + obj_poly.h librnd/poly/polyarea.h route.h librnd/core/actions.h \ + ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h polygon.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h tool.h board.h \ vtroutestyle.h layer.h obj_arc_list.h obj_arc.h obj_line_list.h \ obj_poly_list.h obj_text_list.h obj_text.h font.h \ @@ -9338,8 +9338,8 @@ librnd/core/error.h librnd/core/attrib.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h obj_line.h \ ../src_3rd/genlist/gendlist.h obj_common.h flag.h data_parent.h \ - obj_poly.h polyarea.h route.h librnd/core/actions.h \ - ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h polygon.h rtree.h \ + obj_poly.h librnd/poly/polyarea.h route.h librnd/core/actions.h \ + ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h polygon.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h search.h layer.h \ obj_arc_list.h obj_arc.h obj_line_list.h obj_poly_list.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h tool.h board.h vtroutestyle.h \ @@ -9358,13 +9358,13 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h \ data.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h tool.h undo.h \ @@ -9378,7 +9378,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h librnd/core/event.h \ @@ -9404,7 +9404,7 @@ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h board.h \ vtroutestyle.h layer.h obj_common.h flag.h data_parent.h obj_arc_list.h \ obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ rotate.h librnd/core/rotate.h librnd/core/compat_misc.h tool.h tool_text.o: tool_text.c ../config.h conf_core.h librnd/core/conf.h \ @@ -9421,13 +9421,13 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ data.h crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h \ route.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h librnd/core/actions.h \ @@ -9442,7 +9442,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h change.h data.h crosshair.h \ @@ -9451,10 +9451,10 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ - vtpadstack_t.h librnd/core/actions.h search.h thermal.h polygon1_gen.h \ + vtpadstack_t.h librnd/core/actions.h search.h thermal.h librnd/poly/polygon1_gen.h \ tool.h tool_via.o: tool_via.c ../config.h conf_core.h librnd/core/conf.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h \ @@ -9470,7 +9470,7 @@ librnd/core/color.h librnd/core/hidlib_conf.h board.h vtroutestyle.h \ librnd/core/attrib.h layer.h obj_common.h flag.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h obj_line_list.h \ - obj_line.h obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h \ + obj_line.h obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h change.h librnd/core/hid_inlines.h \ @@ -9477,7 +9477,7 @@ librnd/core/hid.h librnd/core/error.h data.h crosshair.h vtonpoint.h \ route.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h rtree2_compat.h rtree.h \ + ../src_3rd/libminuid/libminuid.h rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h tool.h tool_thermal.h \ @@ -9493,7 +9493,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h change.h data.h crosshair.h \ @@ -9502,7 +9502,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h librnd/core/event.h insert.h remove.h rotate.h \ @@ -9524,7 +9524,7 @@ librnd/core/color.h board.h vtroutestyle.h librnd/core/attrib.h layer.h \ obj_common.h flag.h data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gendlist.h obj_line_list.h obj_line.h obj_poly_list.h \ - obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h layer_grp.h rats_patch.h librnd/core/hidlib.h \ librnd/core/actions.h librnd/core/hid.h librnd/core/error.h \ @@ -9531,7 +9531,7 @@ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h data.h crosshair.h \ vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ librnd/core/compat_misc.h funchash_core.h librnd/core/funchash.h \ @@ -9547,7 +9547,7 @@ obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h librnd/core/box.h librnd/core/math_helper.h \ librnd/core/misc_util.h ../src_3rd/genvector/gds_char.h layer_grp.h \ rats_patch.h librnd/core/hidlib.h change.h data.h crosshair.h \ @@ -9556,7 +9556,7 @@ librnd/core/error.h route.h buffer.h ../src_3rd/libfungw/fungw.h \ ../src_3rd/genht/htpp.h obj_rat_list.h obj_rat.h idpath.h \ obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ - rtree2_compat.h rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ + rtree2_compat.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h move.h extobj.h obj_subc_parent.h insert.h \ @@ -9597,10 +9597,10 @@ layer.h librnd/core/color.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h polyarea.h obj_text_list.h obj_text.h font.h \ + obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h obj_text.h font.h \ ../src_3rd/genht/htip.h ../src_3rd/genht/ht.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h librnd/core/unit.h \ - ../src_3rd/genvector/gds_char.h obj_pstk_shape.h polygon.h rtree.h \ + ../src_3rd/genvector/gds_char.h obj_pstk_shape.h polygon.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h rtree2_compat.h vtpadstack_t.h \ vtpadstack.h ../src_3rd/genvector/genvector_impl.c vtpadstack_t.o: vtpadstack_t.c ../src_3rd/genvector/vtp0.h \ @@ -9608,8 +9608,8 @@ ../src_3rd/genvector/genvector_undef.h ../src_3rd/genvector/gds_char.h \ librnd/core/color.h librnd/core/global_typedefs.h ../config.h \ librnd/core/pcb_bool.h vtpadstack_t.h obj_pstk_shape.h \ - librnd/core/unit.h polygon.h flag.h librnd/core/globalconst.h rtree.h \ - ../src_3rd/genrtree/genrtree_api.h librnd/core/math_helper.h polyarea.h \ + librnd/core/unit.h polygon.h flag.h librnd/core/globalconst.h librnd/poly/rtree.h \ + ../src_3rd/genrtree/genrtree_api.h librnd/core/math_helper.h librnd/poly/polyarea.h \ rtree2_compat.h layer.h librnd/core/attrib.h obj_common.h data_parent.h \ obj_arc_list.h obj_arc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (revision 29282) +++ trunk/src/Makefile.in (revision 29283) @@ -107,9 +107,9 @@ @] put /local/pcb/OBJS_POLYLIB [@ - polygon1.o - polygon1_gen.o - rtree.o + $(LIBRND)/poly/polyarea.o + $(LIBRND)/poly/polygon1_gen.o + $(LIBRND)/poly/rtree.o @] append /local/pcb/OBJS_3RDLIB [@ @@ -580,7 +580,7 @@ $(SCCBOX) $(HOW) "default_font" "$(DATADIR)/default_font"@/local/pcb/rules/install_@ install_librnd: librnd - $(SCCBOX) mkdir -p "$(HL_LIBDIR)/librnd" "$(HL_INCDIR)/core" "$(HL_INCDIR)/src_3rd/liblihata" "$(HL_INCDIR)/src_3rd/liblhtpers" "$(HL_INCDIR)/src_3rd/puplug" "$(HL_INCDIR)/src_3rd/libfungw" "$(HL_INCDIR)/src_3rd/genvector" "$(HL_INCDIR)/src_3rd/genregex" "$(HL_INCDIR)/src_3rd/genrtree" "$(HL_INCDIR)/src_3rd/genlist" "$(HL_INCDIR)/src_3rd/genht" "$(HL_INCDIR)/src_3rd/libfungwbind/c" "$(HL_SHAREDIR)" + $(SCCBOX) mkdir -p "$(HL_LIBDIR)/librnd" "$(HL_INCDIR)/core" "$(HL_INCDIR)/poly" "$(HL_INCDIR)/src_3rd/liblihata" "$(HL_INCDIR)/src_3rd/liblhtpers" "$(HL_INCDIR)/src_3rd/puplug" "$(HL_INCDIR)/src_3rd/libfungw" "$(HL_INCDIR)/src_3rd/genvector" "$(HL_INCDIR)/src_3rd/genregex" "$(HL_INCDIR)/src_3rd/genrtree" "$(HL_INCDIR)/src_3rd/genlist" "$(HL_INCDIR)/src_3rd/genht" "$(HL_INCDIR)/src_3rd/libfungwbind/c" "$(HL_SHAREDIR)" $(SCCBOX) $(HOW) "librnd-hid.so.$(PCB_RND_VER)" "$(HL_LIBDIR)/librnd-hid.so.$(PCB_RND_VER)" $(SCCBOX) $(HOW) "librnd-hid.a" "$(HL_LIBDIR)/librnd-hid.a" $(SCCBOX) $(HOW) "librnd-3rd.so.$(PCB_RND_VER)" "$(HL_LIBDIR)/librnd-3rd.so.$(PCB_RND_VER)" @@ -606,7 +606,7 @@ # rndlib: corner case: some headers are not derived from the objects sub /local/pcb/HDRS_HIDLIB {$(LIBRND)/core/hid_dlg.h } {} sub /local/pcb/HDRS_HIDLIB {polygon1.h } {} -append /local/pcb/HDRS_HIDLIB {$(LIBRND)/core/hid.h polyarea.h $(LIBRND)/core/global_typedefs.h $(LIBRND)/core/globalconst.h $(LIBRND)/core/math_helper.h $(LIBRND)/core/buildin.hidlib.h $(LIBRND)/core/hid_inlines.h $(LIBRND)/core/rotate.h $(LIBRND)/core/fptr_cast.h $(LIBRND)/core/safe_fs_dir.h $(LIBRND)/core/compat_inc.h } +append /local/pcb/HDRS_HIDLIB {$(LIBRND)/core/hid.h $(LIBRND)/core/global_typedefs.h $(LIBRND)/core/globalconst.h $(LIBRND)/core/math_helper.h $(LIBRND)/core/buildin.hidlib.h $(LIBRND)/core/hid_inlines.h $(LIBRND)/core/rotate.h $(LIBRND)/core/fptr_cast.h $(LIBRND)/core/safe_fs_dir.h $(LIBRND)/core/compat_inc.h } gsub /local/pcb/HDRS_3RDLIB {../src_3rd/liblihata/dom_[^ ]*.h } {} gsub /local/pcb/HDRS_3RDLIB {../src_3rd/liblihata/tree_[^ ]*.h } {} gsub /local/pcb/HDRS_3RDLIB {../src_3rd/libfungw/fungw_ptr.h ../src_3rd/libfungw/fungw_debug.h ../src_3rd/libfungw/fungw_call.h } {} Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 29282) +++ trunk/src/board.c (revision 29283) @@ -34,7 +34,7 @@ #include #include #include -#include "rtree.h" +#include #include "undo.h" #include "draw.h" #include Index: trunk/src/data.c =================================================================== --- trunk/src/data.c (revision 29282) +++ trunk/src/data.c (revision 29283) @@ -36,7 +36,7 @@ #include "data.h" #include "data_list.h" #include "data_it.h" -#include "rtree.h" +#include #include "list_common.h" #include #include "layer_it.h" Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 29282) +++ trunk/src/draw.c (revision 29283) @@ -37,7 +37,7 @@ #include "draw.h" #include #include "rotate.h" -#include "rtree.h" +#include #include "stub_draw.h" #include "layer_ui.h" #include Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 29282) +++ trunk/src/layer.c (revision 29283) @@ -38,7 +38,7 @@ #include "layer_ui.h" #include "layer_vis.h" #include "funchash_core.h" -#include "rtree.h" +#include #include "obj_pstk_inlines.h" #include "list_common.h" Index: trunk/src/librnd/poly/polyarea.c =================================================================== --- trunk/src/librnd/poly/polyarea.c (nonexistent) +++ trunk/src/librnd/poly/polyarea.c (revision 29283) @@ -0,0 +1,3612 @@ +/* + polygon clipping functions. harry eaton implemented the algorithm + described in "A Closed Set of Algorithms for Performing Set + Operations on Polygonal Regions in the Plane" which the original + code did not do. I also modified it for integer coordinates + and faster computation. The license for this modified copy was + switched to the GPL per term (3) of the original LGPL license. + Copyright (C) 2006 harry eaton + + based on: + poly_Boolean: a polygon clip library + Copyright (C) 1997 Alexey Nikitin, Michael Leonov + (also the authors of the paper describing the actual algorithm) + leonov@propro.iis.nsk.su + + in turn based on: + nclip: a polygon clip library + Copyright (C) 1993 Klamer Schutte + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + polygon1.c + (C) 1997 Alexey Nikitin, Michael Leonov + (C) 1993 Klamer Schutte + + all cases where original (Klamer Schutte) code is present + are marked +*/ + +#include +#include +#include +#include +#include + +#include "config.h" +#include +#include +#include +#include +#include +#include +#include "obj_common.h" +#include "macro.h" +#include +#include "rtree2_compat.h" + + +#define ROUND(a) (long)((a) > 0 ? ((a) + 0.5) : ((a) - 0.5)) + +#define EPSILON (1E-8) +#define IsZero(a, b) (fabs((a) - (b)) < EPSILON) + +#undef min +#undef max +#define min(x, y) ((x) < (y) ? (x) : (y)) +#define max(x, y) ((x) > (y) ? (x) : (y)) + +/*********************************************************************/ +/* L o n g V e c t o r S t u f f */ +/*********************************************************************/ + +#define Vcopy(a,b) {(a)[0]=(b)[0];(a)[1]=(b)[1];} +int vect_equal(pcb_vector_t v1, pcb_vector_t v2); +void vect_init(pcb_vector_t v, double x, double y); +void vect_sub(pcb_vector_t res, pcb_vector_t v2, pcb_vector_t v3); + +void vect_min(pcb_vector_t res, pcb_vector_t v2, pcb_vector_t v3); +void vect_max(pcb_vector_t res, pcb_vector_t v2, pcb_vector_t v3); + +double pcb_vect_dist2(pcb_vector_t v1, pcb_vector_t v2); +double pcb_vect_det2(pcb_vector_t v1, pcb_vector_t v2); +double pcb_vect_len2(pcb_vector_t v1); + +int pcb_vect_inters2(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D, pcb_vector_t S1, pcb_vector_t S2); + +/* note that a vertex v's Flags.status represents the edge defined by + * v to v->next (i.e. the edge is forward of v) + */ +#define ISECTED 3 +#define UNKNWN 0 +#define INSIDE 1 +#define OUTSIDE 2 +#define SHARED 3 +#define SHARED2 4 + +#define TOUCHES 99 + +#define NODE_LABEL(n) ((n)->Flags.status) +#define LABEL_NODE(n,l) ((n)->Flags.status = (l)) + +#define error(code) longjmp(*(e), code) + +#define MemGet(ptr, type) \ + if (PCB_UNLIKELY(((ptr) = (type *)malloc(sizeof(type))) == NULL)) \ + error(pcb_err_no_memory); + +#undef DEBUG_LABEL +#undef DEBUG_ALL_LABELS +#undef DEBUG_JUMP +#undef DEBUG_GATHER +#undef DEBUG_ANGLE +#undef DEBUG + +#ifndef NDEBUG +#include +PCB_INLINE void DEBUGP(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + pcb_vfprintf(stderr, fmt, ap); + va_end(ap); +} +#else +PCB_INLINE void DEBUGP(const char *fmt, ...) { } +#endif + +/* ///////////////////////////////////////////////////////////////////////////// * / +/ * 2-Dimensional stuff +/ * ///////////////////////////////////////////////////////////////////////////// */ + +#define Vsub2(r,a,b) {(r)[0] = (a)[0] - (b)[0]; (r)[1] = (a)[1] - (b)[1];} +#define Vadd2(r,a,b) {(r)[0] = (a)[0] + (b)[0]; (r)[1] = (a)[1] + (b)[1];} +#define Vsca2(r,a,s) {(r)[0] = (a)[0] * (s); (r)[1] = (a)[1] * (s);} +#define Vcpy2(r,a) {(r)[0] = (a)[0]; (r)[1] = (a)[1];} +#define Vequ2(a,b) ((a)[0] == (b)[0] && (a)[1] == (b)[1]) +#define Vadds(r,a,b,s) {(r)[0] = ((a)[0] + (b)[0]) * (s); (r)[1] = ((a)[1] + (b)[1]) * (s);} +#define Vswp2(a,b) { long t; \ + t = (a)[0], (a)[0] = (b)[0], (b)[0] = t; \ + t = (a)[1], (a)[1] = (b)[1], (b)[1] = t; \ +} + +#ifdef DEBUG +static char *theState(pcb_vnode_t * v); + +static void pline_dump(pcb_vnode_t * v) +{ + pcb_vnode_t *s, *n; + + s = v; + do { + n = v->next; + pcb_fprintf(stderr, "Line [%#mS %#mS %#mS %#mS 10 10 \"%s\"]\n", + v->point[0], v->point[1], n->point[0], n->point[1], theState(v)); + } + while ((v = v->next) != s); +} + +static void poly_dump(pcb_polyarea_t * p) +{ + pcb_polyarea_t *f = p; + pcb_pline_t *pl; + + do { + pl = p->contours; + do { + pline_dump(pl->head); + fprintf(stderr, "NEXT pcb_pline_t\n"); + } + while ((pl = pl->next) != NULL); + fprintf(stderr, "NEXT POLY\n"); + } + while ((p = p->f) != f); +} +#endif + +/***************************************************************/ +/* routines for processing intersections */ + +/* +node_add + (C) 1993 Klamer Schutte + (C) 1997 Alexey Nikitin, Michael Leonov + (C) 2006 harry eaton + + returns a bit field in new_point that indicates where the + point was. + 1 means a new node was created and inserted + 4 means the intersection was not on the dest point +*/ +static pcb_vnode_t *node_add_single(pcb_vnode_t * dest, pcb_vector_t po) +{ + pcb_vnode_t *p; + + if (vect_equal(po, dest->point)) + return dest; + if (vect_equal(po, dest->next->point)) + return dest->next; + p = pcb_poly_node_create(po); + if (p == NULL) + return NULL; + p->cvc_prev = p->cvc_next = NULL; + p->Flags.status = UNKNWN; + return p; +} /* node_add */ + +#define ISECT_BAD_PARAM (-1) +#define ISECT_NO_MEMORY (-2) + + +/* +new_descriptor + (C) 2006 harry eaton +*/ +static pcb_cvc_list_t *new_descriptor(pcb_vnode_t * a, char poly, char side) +{ + pcb_cvc_list_t *l = (pcb_cvc_list_t *) malloc(sizeof(pcb_cvc_list_t)); + pcb_vector_t v; + register double ang, dx, dy; + + if (!l) + return NULL; + l->head = NULL; + l->parent = a; + l->poly = poly; + l->side = side; + l->next = l->prev = l; + if (side == 'P') /* previous */ + vect_sub(v, a->prev->point, a->point); + else /* next */ + vect_sub(v, a->next->point, a->point); + /* Uses slope/(slope+1) in quadrant 1 as a proxy for the angle. + * It still has the same monotonic sort result + * and is far less expensive to compute than the real angle. + */ + if (vect_equal(v, vect_zero)) { + if (side == 'P') { + if (a->prev->cvc_prev == (pcb_cvc_list_t *) - 1) + a->prev->cvc_prev = a->prev->cvc_next = NULL; + pcb_poly_vertex_exclude(NULL, a->prev); + vect_sub(v, a->prev->point, a->point); + } + else { + if (a->next->cvc_prev == (pcb_cvc_list_t *) - 1) + a->next->cvc_prev = a->next->cvc_next = NULL; + pcb_poly_vertex_exclude(NULL, a->next); + vect_sub(v, a->next->point, a->point); + } + } + assert(!vect_equal(v, vect_zero)); + dx = fabs((double) v[0]); + dy = fabs((double) v[1]); + ang = dy / (dy + dx); + /* now move to the actual quadrant */ + if (v[0] < 0 && v[1] >= 0) + ang = 2.0 - ang; /* 2nd quadrant */ + else if (v[0] < 0 && v[1] < 0) + ang += 2.0; /* 3rd quadrant */ + else if (v[0] >= 0 && v[1] < 0) + ang = 4.0 - ang; /* 4th quadrant */ + l->angle = ang; + assert(ang >= 0.0 && ang <= 4.0); +#ifdef DEBUG_ANGLE + DEBUGP("node on %c at %#mD assigned angle %g on side %c\n", poly, a->point[0], a->point[1], ang, side); +#endif + return l; +} + +/* +insert_descriptor + (C) 2006 harry eaton + + argument a is a cross-vertex node. + argument poly is the polygon it comes from ('A' or 'B') + argument side is the side this descriptor goes on ('P' for previous + 'N' for next. + argument start is the head of the list of cvclists +*/ +static pcb_cvc_list_t *insert_descriptor(pcb_vnode_t * a, char poly, char side, pcb_cvc_list_t * start) +{ + pcb_cvc_list_t *l, *newone, *big, *small; + + if (!(newone = new_descriptor(a, poly, side))) + return NULL; + /* search for the pcb_cvc_list_t for this point */ + if (!start) { + start = newone; /* return is also new, so we know where start is */ + start->head = newone; /* circular list */ + return newone; + } + else { + l = start; + do { + assert(l->head); + if (l->parent->point[0] == a->point[0] + && l->parent->point[1] == a->point[1]) { /* this pcb_cvc_list_t is at our point */ + start = l; + newone->head = l->head; + break; + } + if (l->head->parent->point[0] == start->parent->point[0] + && l->head->parent->point[1] == start->parent->point[1]) { + /* this seems to be a new point */ + /* link this cvclist to the list of all cvclists */ + for (; l->head != newone; l = l->next) + l->head = newone; + newone->head = start; + return newone; + } + l = l->head; + } + while (1); + } + assert(start); + l = big = small = start; + do { + if (l->next->angle < l->angle) { /* find start/end of list */ + small = l->next; + big = l; + } + else if (newone->angle >= l->angle && newone->angle <= l->next->angle) { + /* insert new cvc if it lies between existing points */ + newone->prev = l; + newone->next = l->next; + l->next = l->next->prev = newone; + return newone; + } + } + while ((l = l->next) != start); + /* didn't find it between points, it must go on an end */ + if (big->angle <= newone->angle) { + newone->prev = big; + newone->next = big->next; + big->next = big->next->prev = newone; + return newone; + } + assert(small->angle >= newone->angle); + newone->next = small; + newone->prev = small->prev; + small->prev = small->prev->next = newone; + return newone; +} + +/* +node_add_point + (C) 1993 Klamer Schutte + (C) 1997 Alexey Nikitin, Michael Leonov + + return 1 if new node in b, 2 if new node in a and 3 if new node in both +*/ + +static pcb_vnode_t *node_add_single_point(pcb_vnode_t * a, pcb_vector_t p) +{ + pcb_vnode_t *next_a, *new_node; + + next_a = a->next; + + new_node = node_add_single(a, p); + assert(new_node != NULL); + + new_node->cvc_prev = new_node->cvc_next = (pcb_cvc_list_t *) - 1; + + if (new_node == a || new_node == next_a) + return NULL; + + return new_node; +} /* node_add_point */ + +/* +node_label + (C) 2006 harry eaton +*/ +static unsigned int node_label(pcb_vnode_t * pn) +{ + pcb_cvc_list_t *first_l, *l; + char this_poly; + int region = UNKNWN; + + assert(pn); + assert(pn->cvc_next); + this_poly = pn->cvc_next->poly; + /* search counter-clockwise in the cross vertex connectivity (CVC) list + * + * check for shared edges (that could be prev or next in the list since the angles are equal) + * and check if this edge (pn -> pn->next) is found between the other poly's entry and exit + */ + if (pn->cvc_next->angle == pn->cvc_next->prev->angle) + l = pn->cvc_next->prev; + else + l = pn->cvc_next->next; + + first_l = l; + while ((l->poly == this_poly) && (l != first_l->prev)) + l = l->next; + assert(l->poly != this_poly); + + assert(l && l->angle >= 0 && l->angle <= 4.0); + if (l->poly != this_poly) { + if (l->side == 'P') { + if (l->parent->prev->point[0] == pn->next->point[0] && l->parent->prev->point[1] == pn->next->point[1]) { + region = SHARED2; + pn->shared = l->parent->prev; + } + else + region = INSIDE; + } + else { + if (l->angle == pn->cvc_next->angle) { + assert(l->parent->next->point[0] == pn->next->point[0] && l->parent->next->point[1] == pn->next->point[1]); + region = SHARED; + pn->shared = l->parent; + } + else + region = OUTSIDE; + } + } + if (region == UNKNWN) { + for (l = l->next; l != pn->cvc_next; l = l->next) { + if (l->poly != this_poly) { + if (l->side == 'P') + region = INSIDE; + else + region = OUTSIDE; + break; + } + } + } + assert(region != UNKNWN); + assert(NODE_LABEL(pn) == UNKNWN || NODE_LABEL(pn) == region); + LABEL_NODE(pn, region); + if (region == SHARED || region == SHARED2) + return UNKNWN; + return region; +} /* node_label */ + +/* + add_descriptors + (C) 2006 harry eaton +*/ +static pcb_cvc_list_t *add_descriptors(pcb_pline_t * pl, char poly, pcb_cvc_list_t * list) +{ + pcb_vnode_t *node = pl->head; + + do { + if (node->cvc_prev) { + assert(node->cvc_prev == (pcb_cvc_list_t *) - 1 && node->cvc_next == (pcb_cvc_list_t *) - 1); + list = node->cvc_prev = insert_descriptor(node, poly, 'P', list); + if (!node->cvc_prev) + return NULL; + list = node->cvc_next = insert_descriptor(node, poly, 'N', list); + if (!node->cvc_next) + return NULL; + } + } + while ((node = node->next) != pl->head); + return list; +} + +static inline void cntrbox_adjust(pcb_pline_t * c, const pcb_vector_t p) +{ + c->xmin = min(c->xmin, p[0]); + c->xmax = max(c->xmax, p[0] + 1); + c->ymin = min(c->ymin, p[1]); + c->ymax = max(c->ymax, p[1] + 1); +} + +/* some structures for handling segment intersections using the rtrees */ + +typedef struct seg { + pcb_box_t box; + pcb_vnode_t *v; + pcb_pline_t *p; + int intersected; +} seg; + +typedef struct _insert_node_task insert_node_task; + +struct _insert_node_task { + insert_node_task *next; + seg *node_seg; + pcb_vnode_t *new_node; +}; + +typedef struct info { + double m, b; + pcb_rtree_t *tree; + pcb_vnode_t *v; + struct seg *s; + jmp_buf *env, sego, *touch; + int need_restart; + insert_node_task *node_insert_list; +} info; + +typedef struct contour_info { + pcb_pline_t *pa; + jmp_buf restart; + jmp_buf *getout; + int need_restart; + insert_node_task *node_insert_list; +} contour_info; + + +/* + * adjust_tree() + * (C) 2006 harry eaton + * This replaces the segment in the tree with the two new segments after + * a vertex has been added + */ +static int adjust_tree(pcb_rtree_t * tree, struct seg *s) +{ + struct seg *q; + + q = (seg *) malloc(sizeof(struct seg)); + if (!q) + return 1; + q->intersected = 0; + q->v = s->v; + q->p = s->p; + q->box.X1 = min(q->v->point[0], q->v->next->point[0]); + q->box.X2 = max(q->v->point[0], q->v->next->point[0]) + 1; + q->box.Y1 = min(q->v->point[1], q->v->next->point[1]); + q->box.Y2 = max(q->v->point[1], q->v->next->point[1]) + 1; + pcb_r_insert_entry(tree, (const pcb_box_t *) q); + q = (seg *) malloc(sizeof(struct seg)); + if (!q) + return 1; + q->intersected = 0; + q->v = s->v->next; + q->p = s->p; + q->box.X1 = min(q->v->point[0], q->v->next->point[0]); + q->box.X2 = max(q->v->point[0], q->v->next->point[0]) + 1; + q->box.Y1 = min(q->v->point[1], q->v->next->point[1]); + q->box.Y2 = max(q->v->point[1], q->v->next->point[1]) + 1; + pcb_r_insert_entry(tree, (const pcb_box_t *) q); + pcb_r_delete_entry(tree, (const pcb_box_t *) s); + free(s); + return 0; +} + +/* + * seg_in_region() + * (C) 2006, harry eaton + * This prunes the search for boxes that don't intersect the segment. + */ +static pcb_r_dir_t seg_in_region(const pcb_box_t * b, void *cl) +{ + struct info *i = (struct info *) cl; + double y1, y2; + /* for zero slope the search is aligned on the axis so it is already pruned */ + if (i->m == 0.) + return PCB_R_DIR_FOUND_CONTINUE; + y1 = i->m * b->X1 + i->b; + y2 = i->m * b->X2 + i->b; + if (min(y1, y2) >= b->Y2) + return PCB_R_DIR_NOT_FOUND; + if (max(y1, y2) < b->Y1) + return PCB_R_DIR_NOT_FOUND; + return PCB_R_DIR_FOUND_CONTINUE; /* might intersect */ +} + +/* Prepend a deferred node-insertion task to a list */ +static insert_node_task *prepend_insert_node_task(insert_node_task * list, seg * seg, pcb_vnode_t * new_node) +{ + insert_node_task *task = (insert_node_task *) malloc(sizeof(*task)); + task->node_seg = seg; + task->new_node = new_node; + task->next = list; + return task; +} + +/* + * seg_in_seg() + * (C) 2006 harry eaton + * This routine checks if the segment in the tree intersect the search segment. + * If it does, the plines are marked as intersected and the point is marked for + * the cvclist. If the point is not already a vertex, a new vertex is inserted + * and the search for intersections starts over at the beginning. + * That is potentially a significant time penalty, but it does solve the snap rounding + * problem. There are efficient algorithms for finding intersections with snap + * rounding, but I don't have time to implement them right now. + */ +static pcb_r_dir_t seg_in_seg(const pcb_box_t * b, void *cl) +{ + struct info *i = (struct info *) cl; + struct seg *s = (struct seg *) b; + pcb_vector_t s1, s2; + int cnt; + pcb_vnode_t *new_node; + + /* When new nodes are added at the end of a pass due to an intersection + * the segments may be altered. If either segment we're looking at has + * already been intersected this pass, skip it until the next pass. + */ + if (s->intersected || i->s->intersected) + return PCB_R_DIR_NOT_FOUND; + + cnt = pcb_vect_inters2(s->v->point, s->v->next->point, i->v->point, i->v->next->point, s1, s2); + if (!cnt) + return PCB_R_DIR_NOT_FOUND; + if (i->touch) /* if checking touches one find and we're done */ + longjmp(*i->touch, TOUCHES); + i->s->p->Flags.status = ISECTED; + s->p->Flags.status = ISECTED; + for (; cnt; cnt--) { + pcb_bool done_insert_on_i = pcb_false; + new_node = node_add_single_point(i->v, cnt > 1 ? s2 : s1); + if (new_node != NULL) { +#ifdef DEBUG_INTERSECT + DEBUGP("new intersection on segment \"i\" at %#mD\n", cnt > 1 ? s2[0] : s1[0], cnt > 1 ? s2[1] : s1[1]); +#endif + i->node_insert_list = prepend_insert_node_task(i->node_insert_list, i->s, new_node); + i->s->intersected = 1; + done_insert_on_i = pcb_true; + } + new_node = node_add_single_point(s->v, cnt > 1 ? s2 : s1); + if (new_node != NULL) { +#ifdef DEBUG_INTERSECT + DEBUGP("new intersection on segment \"s\" at %#mD\n", cnt > 1 ? s2[0] : s1[0], cnt > 1 ? s2[1] : s1[1]); +#endif + i->node_insert_list = prepend_insert_node_task(i->node_insert_list, s, new_node); + s->intersected = 1; + return PCB_R_DIR_NOT_FOUND; /* Keep looking for intersections with segment "i" */ + } + /* Skip any remaining r_search hits against segment i, as any further + * intersections will be rejected until the next pass anyway. + */ + if (done_insert_on_i) + longjmp(*i->env, 1); + } + return PCB_R_DIR_NOT_FOUND; +} + +void *pcb_poly_make_edge_tree(pcb_pline_t *pb) +{ + struct seg *s; + pcb_vnode_t *bv; + pcb_rtree_t *ans = pcb_r_create_tree(); + bv = pb->head; + do { + s = (seg *) malloc(sizeof(struct seg)); + s->intersected = 0; + if (bv->point[0] < bv->next->point[0]) { + s->box.X1 = bv->point[0]; + s->box.X2 = bv->next->point[0] + 1; + } + else { + s->box.X2 = bv->point[0] + 1; + s->box.X1 = bv->next->point[0]; + } + if (bv->point[1] < bv->next->point[1]) { + s->box.Y1 = bv->point[1]; + s->box.Y2 = bv->next->point[1] + 1; + } + else { + s->box.Y2 = bv->point[1] + 1; + s->box.Y1 = bv->next->point[1]; + } + s->v = bv; + s->p = pb; + pcb_r_insert_entry(ans, (const pcb_box_t *) s); + } + while ((bv = bv->next) != pb->head); + return (void *) ans; +} + +static pcb_r_dir_t get_seg(const pcb_box_t * b, void *cl) +{ + struct info *i = (struct info *) cl; + struct seg *s = (struct seg *) b; + if (i->v == s->v) { + i->s = s; + return PCB_R_DIR_CANCEL; /* found */ + } + return PCB_R_DIR_NOT_FOUND; +} + +/* + * intersect() (and helpers) + * (C) 2006, harry eaton + * This uses an rtree to find A-B intersections. Whenever a new vertex is + * added, the search for intersections is re-started because the rounding + * could alter the topology otherwise. + * This should use a faster algorithm for snap rounding intersection finding. + * The best algorithm is probably found in: + * + * "Improved output-sensitive snap rounding," John Hershberger, Proceedings + * of the 22nd annual symposium on Computational geometry, 2006, pp 357-366. + * http://doi.acm.org/10.1145/1137856.1137909 + * + * Algorithms described by de Berg, or Goodrich or Halperin, or Hobby would + * probably work as well. + * + */ + +static pcb_r_dir_t contour_bounds_touch(const pcb_box_t * b, void *cl) +{ + contour_info *c_info = (contour_info *) cl; + pcb_pline_t *pa = c_info->pa; + pcb_pline_t *pb = (pcb_pline_t *) b; + pcb_pline_t *rtree_over; + pcb_pline_t *looping_over; + pcb_vnode_t *av; /* node iterators */ + struct info info; + pcb_box_t box; + jmp_buf restart; + + /* Have seg_in_seg return to our desired location if it touches */ + info.env = &restart; + info.touch = c_info->getout; + info.need_restart = 0; + info.node_insert_list = c_info->node_insert_list; + + /* Pick which contour has the fewer points, and do the loop + * over that. The r_tree makes hit-testing against a contour + * faster, so we want to do that on the bigger contour. + */ + if (pa->Count < pb->Count) { + rtree_over = pb; + looping_over = pa; + } + else { + rtree_over = pa; + looping_over = pb; + } + + av = looping_over->head; + do { /* Loop over the nodes in the smaller contour */ + pcb_r_dir_t rres; + /* check this edge for any insertions */ + double dx; + info.v = av; + /* compute the slant for region trimming */ + dx = av->next->point[0] - av->point[0]; + if (dx == 0) + info.m = 0; + else { + info.m = (av->next->point[1] - av->point[1]) / dx; + info.b = av->point[1] - info.m * av->point[0]; + } + box.X2 = (box.X1 = av->point[0]) + 1; + box.Y2 = (box.Y1 = av->point[1]) + 1; + + /* fill in the segment in info corresponding to this node */ + rres = pcb_r_search(looping_over->tree, &box, NULL, get_seg, &info, NULL); + assert(rres == PCB_R_DIR_CANCEL); + + /* If we're going to have another pass anyway, skip this */ + if (info.s->intersected && info.node_insert_list != NULL) + continue; + + if (setjmp(restart)) + continue; + + /* NB: If this actually hits anything, we are teleported back to the beginning */ + info.tree = rtree_over->tree; + if (info.tree) { + int seen; + pcb_r_search(info.tree, &info.s->box, seg_in_region, seg_in_seg, &info, &seen); + if (PCB_UNLIKELY(seen)) + assert(0); /* XXX: Memory allocation failure */ + } + } + while ((av = av->next) != looping_over->head); + + c_info->node_insert_list = info.node_insert_list; + if (info.need_restart) + c_info->need_restart = 1; + return PCB_R_DIR_NOT_FOUND; +} + +static int intersect_impl(jmp_buf * jb, pcb_polyarea_t * b, pcb_polyarea_t * a, int add) +{ + pcb_polyarea_t *t; + pcb_pline_t *pa; + contour_info c_info; + int need_restart = 0; + insert_node_task *task; + c_info.need_restart = 0; + c_info.node_insert_list = NULL; + + /* Search the r-tree of the object with most contours + * We loop over the contours of "a". Swap if necessary. + */ + if (a->contour_tree->size > b->contour_tree->size) { + t = b; + b = a; + a = t; + } + + for (pa = a->contours; pa; pa = pa->next) { /* Loop over the contours of pcb_polyarea_t "a" */ + pcb_box_t sb; + jmp_buf out; + int retval; + + c_info.getout = NULL; + c_info.pa = pa; + + if (!add) { + retval = setjmp(out); + if (retval) { + /* The intersection test short-circuited back here, + * we need to clean up, then longjmp to jb */ + longjmp(*jb, retval); + } + c_info.getout = &out; + } + + sb.X1 = pa->xmin; + sb.Y1 = pa->ymin; + sb.X2 = pa->xmax + 1; + sb.Y2 = pa->ymax + 1; + + pcb_r_search(b->contour_tree, &sb, NULL, contour_bounds_touch, &c_info, NULL); + if (c_info.need_restart) + need_restart = 1; + } + + /* Process any deferred node insertions */ + task = c_info.node_insert_list; + while (task != NULL) { + insert_node_task *next = task->next; + + /* Do insertion */ + task->new_node->prev = task->node_seg->v; + task->new_node->next = task->node_seg->v->next; + task->node_seg->v->next->prev = task->new_node; + task->node_seg->v->next = task->new_node; + task->node_seg->p->Count++; + + cntrbox_adjust(task->node_seg->p, task->new_node->point); + if (adjust_tree(task->node_seg->p->tree, task->node_seg)) + assert(0); /* XXX: Memory allocation failure */ + + need_restart = 1; /* Any new nodes could intersect */ + + free(task); + task = next; + } + + return need_restart; +} + +static int intersect(jmp_buf * jb, pcb_polyarea_t * b, pcb_polyarea_t * a, int add) +{ + int call_count = 1; + while (intersect_impl(jb, b, a, add)) + call_count++; + return 0; +} + +static void M_pcb_polyarea_t_intersect(jmp_buf * e, pcb_polyarea_t * afst, pcb_polyarea_t * bfst, int add) +{ + pcb_polyarea_t *a = afst, *b = bfst; + pcb_pline_t *curcA, *curcB; + pcb_cvc_list_t *the_list = NULL; + + if (a == NULL || b == NULL) + error(pcb_err_bad_parm); + do { + do { + if (a->contours->xmax >= b->contours->xmin && + a->contours->ymax >= b->contours->ymin && + a->contours->xmin <= b->contours->xmax && a->contours->ymin <= b->contours->ymax) { + if (PCB_UNLIKELY(intersect(e, a, b, add))) + error(pcb_err_no_memory); + } + } + while (add && (a = a->f) != afst); + for (curcB = b->contours; curcB != NULL; curcB = curcB->next) + if (curcB->Flags.status == ISECTED) { + the_list = add_descriptors(curcB, 'B', the_list); + if (PCB_UNLIKELY(the_list == NULL)) + error(pcb_err_no_memory); + } + } + while (add && (b = b->f) != bfst); + do { + for (curcA = a->contours; curcA != NULL; curcA = curcA->next) + if (curcA->Flags.status == ISECTED) { + the_list = add_descriptors(curcA, 'A', the_list); + if (PCB_UNLIKELY(the_list == NULL)) + error(pcb_err_no_memory); + } + } + while (add && (a = a->f) != afst); +} /* M_pcb_polyarea_t_intersect */ + +static inline int cntrbox_inside(pcb_pline_t * c1, pcb_pline_t * c2) +{ + assert(c1 != NULL && c2 != NULL); + return ((c1->xmin >= c2->xmin) && (c1->ymin >= c2->ymin) && (c1->xmax <= c2->xmax) && (c1->ymax <= c2->ymax)); +} + +/*****************************************************************/ +/* Routines for making labels */ + +static pcb_r_dir_t count_contours_i_am_inside(const pcb_box_t * b, void *cl) +{ + pcb_pline_t *me = (pcb_pline_t *) cl; + pcb_pline_t *check = (pcb_pline_t *) b; + + if (pcb_poly_contour_in_contour(check, me)) + return PCB_R_DIR_FOUND_CONTINUE; + return PCB_R_DIR_NOT_FOUND; +} + +/* cntr_in_M_pcb_polyarea_t +returns poly is inside outfst ? pcb_true : pcb_false */ +static int cntr_in_M_pcb_polyarea_t(pcb_pline_t * poly, pcb_polyarea_t * outfst, pcb_bool test) +{ + pcb_polyarea_t *outer = outfst; + pcb_heap_t *heap; + + assert(poly != NULL); + assert(outer != NULL); + + heap = pcb_heap_create(); + do { + if (cntrbox_inside(poly, outer->contours)) + pcb_heap_insert(heap, outer->contours->area, (void *) outer); + } + /* if checking touching, use only the first polygon */ + while (!test && (outer = outer->f) != outfst); + /* we need only check the smallest poly container + * but we must loop in case the box container is not + * the poly container */ + do { + int cnt; + + if (pcb_heap_is_empty(heap)) + break; + outer = (pcb_polyarea_t *) pcb_heap_remove_smallest(heap); + + pcb_r_search(outer->contour_tree, (pcb_box_t *) poly, NULL, count_contours_i_am_inside, poly, &cnt); + switch (cnt) { + case 0: /* Didn't find anything in this piece, Keep looking */ + break; + case 1: /* Found we are inside this piece, and not any of its holes */ + pcb_heap_destroy(&heap); + return pcb_true; + case 2: /* Found inside a hole in the smallest polygon so far. No need to check the other polygons */ + pcb_heap_destroy(&heap); + return pcb_false; + default: + printf("Something strange here\n"); + break; + } + } + while (1); + pcb_heap_destroy(&heap); + return pcb_false; +} /* cntr_in_M_pcb_polyarea_t */ + +#ifdef DEBUG + +static char *theState(pcb_vnode_t * v) +{ + static char u[] = "UNKNOWN"; + static char i[] = "INSIDE"; + static char o[] = "OUTSIDE"; + static char s[] = "SHARED"; + static char s2[] = "SHARED2"; + + switch (NODE_LABEL(v)) { + case INSIDE: + return i; + case OUTSIDE: + return o; + case SHARED: + return s; + case SHARED2: + return s2; + default: + return u; + } +} + +#ifdef DEBUG_ALL_LABELS +static void print_labels(pcb_pline_t * a) +{ + pcb_vnode_t *c = a->head; + + do { + DEBUGP("%#mD->%#mD labeled %s\n", c->point[0], c->point[1], c->next->point[0], c->next->point[1], theState(c)); + } + while ((c = c->next) != a->head); +} +#endif +#endif + +/* +label_contour + (C) 2006 harry eaton + (C) 1993 Klamer Schutte + (C) 1997 Alexey Nikitin, Michael Leonov +*/ + +static pcb_bool label_contour(pcb_pline_t * a) +{ + pcb_vnode_t *cur = a->head; + pcb_vnode_t *first_labelled = NULL; + int label = UNKNWN; + + do { + if (cur->cvc_next) { /* examine cross vertex */ + label = node_label(cur); + if (first_labelled == NULL) + first_labelled = cur; + continue; + } + + if (first_labelled == NULL) + continue; + + /* This labels nodes which aren't cross-connected */ + assert(label == INSIDE || label == OUTSIDE); + LABEL_NODE(cur, label); + } + while ((cur = cur->next) != first_labelled); +#ifdef DEBUG_ALL_LABELS + print_labels(a); + DEBUGP("\n\n"); +#endif + return pcb_false; +} /* label_contour */ + +static pcb_bool cntr_label_pcb_polyarea_t(pcb_pline_t * poly, pcb_polyarea_t * ppl, pcb_bool test) +{ + assert(ppl != NULL && ppl->contours != NULL); + if (poly->Flags.status == ISECTED) { + label_contour(poly); /* should never get here when pcb_bool is pcb_true */ + } + else if (cntr_in_M_pcb_polyarea_t(poly, ppl, test)) { + if (test) + return pcb_true; + poly->Flags.status = INSIDE; + } + else { + if (test) + return pcb_false; + poly->Flags.status = OUTSIDE; + } + return pcb_false; +} /* cntr_label_pcb_polyarea_t */ + +static pcb_bool M_pcb_polyarea_t_label_separated(pcb_pline_t * afst, pcb_polyarea_t * b, pcb_bool touch) +{ + pcb_pline_t *curc = afst; + + for (curc = afst; curc != NULL; curc = curc->next) { + if (cntr_label_pcb_polyarea_t(curc, b, touch) && touch) + return pcb_true; + } + return pcb_false; +} + +static pcb_bool M_pcb_polyarea_t_label(pcb_polyarea_t * afst, pcb_polyarea_t * b, pcb_bool touch) +{ + pcb_polyarea_t *a = afst; + pcb_pline_t *curc; + + assert(a != NULL); + do { + for (curc = a->contours; curc != NULL; curc = curc->next) + if (cntr_label_pcb_polyarea_t(curc, b, touch)) { + if (touch) + return pcb_true; + } + } + while (!touch && (a = a->f) != afst); + return pcb_false; +} + +/****************************************************************/ + +/* routines for temporary storing resulting contours */ +static void InsCntr(jmp_buf * e, pcb_pline_t * c, pcb_polyarea_t ** dst) +{ + pcb_polyarea_t *newp; + + if (*dst == NULL) { + MemGet(*dst, pcb_polyarea_t); + (*dst)->f = (*dst)->b = *dst; + newp = *dst; + } + else { + MemGet(newp, pcb_polyarea_t); + newp->f = *dst; + newp->b = (*dst)->b; + newp->f->b = newp->b->f = newp; + } + newp->contours = c; + newp->contour_tree = pcb_r_create_tree(); + pcb_r_insert_entry(newp->contour_tree, (pcb_box_t *) c); + c->next = NULL; +} /* InsCntr */ + +static void +PutContour(jmp_buf * e, pcb_pline_t * cntr, pcb_polyarea_t ** contours, pcb_pline_t ** holes, + pcb_polyarea_t * owner, pcb_polyarea_t * parent, pcb_pline_t * parent_contour) +{ + assert(cntr != NULL); + assert(cntr->Count > 2); + cntr->next = NULL; + + if (cntr->Flags.orient == PCB_PLF_DIR) { + if (owner != NULL) + pcb_r_delete_entry(owner->contour_tree, (pcb_box_t *) cntr); + InsCntr(e, cntr, contours); + } + /* put hole into temporary list */ + else { + /* if we know this belongs inside the parent, put it there now */ + if (parent_contour) { + cntr->next = parent_contour->next; + parent_contour->next = cntr; + if (owner != parent) { + if (owner != NULL) + pcb_r_delete_entry(owner->contour_tree, (pcb_box_t *) cntr); + pcb_r_insert_entry(parent->contour_tree, (pcb_box_t *) cntr); + } + } + else { + cntr->next = *holes; + *holes = cntr; /* let cntr be 1st hole in list */ + /* We don't insert the holes into an r-tree, + * they just form a linked list */ + if (owner != NULL) + pcb_r_delete_entry(owner->contour_tree, (pcb_box_t *) cntr); + } + } +} /* PutContour */ + +static inline void remove_contour(pcb_polyarea_t * piece, pcb_pline_t * prev_contour, pcb_pline_t * contour, int remove_rtree_entry) +{ + if (piece->contours == contour) + piece->contours = contour->next; + else if (prev_contour != NULL) { + assert(prev_contour->next == contour); + prev_contour->next = contour->next; + } + + contour->next = NULL; + + if (remove_rtree_entry) + pcb_r_delete_entry(piece->contour_tree, (pcb_box_t *) contour); +} + +struct polyarea_info { + pcb_box_t BoundingBox; + pcb_polyarea_t *pa; +}; + +static pcb_r_dir_t heap_it(const pcb_box_t * b, void *cl) +{ + pcb_heap_t *heap = (pcb_heap_t *) cl; + struct polyarea_info *pa_info = (struct polyarea_info *) b; + pcb_pline_t *p = pa_info->pa->contours; + if (p->Count == 0) + return PCB_R_DIR_NOT_FOUND; /* how did this happen? */ + pcb_heap_insert(heap, p->area, pa_info); + return PCB_R_DIR_FOUND_CONTINUE; +} + +struct find_inside_info { + jmp_buf jb; + pcb_pline_t *want_inside; + pcb_pline_t *result; +}; + +static pcb_r_dir_t find_inside(const pcb_box_t * b, void *cl) +{ + struct find_inside_info *info = (struct find_inside_info *) cl; + pcb_pline_t *check = (pcb_pline_t *) b; + /* Do test on check to see if it inside info->want_inside */ + /* If it is: */ + if (check->Flags.orient == PCB_PLF_DIR) { + return PCB_R_DIR_NOT_FOUND; + } + if (pcb_poly_contour_in_contour(info->want_inside, check)) { + info->result = check; + longjmp(info->jb, 1); + } + return PCB_R_DIR_NOT_FOUND; +} + +void pcb_poly_insert_holes(jmp_buf * e, pcb_polyarea_t * dest, pcb_pline_t ** src) +{ + pcb_polyarea_t *curc; + pcb_pline_t *curh, *container; + pcb_heap_t *heap; + pcb_rtree_t *tree; + int i; + int num_polyareas = 0; + struct polyarea_info *all_pa_info, *pa_info; + + if (*src == NULL) + return; /* empty hole list */ + if (dest == NULL) + error(pcb_err_bad_parm); /* empty contour list */ + + /* Count dest polyareas */ + curc = dest; + do { + num_polyareas++; + } + while ((curc = curc->f) != dest); + + /* make a polyarea info table */ + /* make an rtree of polyarea info table */ + all_pa_info = (struct polyarea_info *) malloc(sizeof(struct polyarea_info) * num_polyareas); + tree = pcb_r_create_tree(); + i = 0; + curc = dest; + do { + all_pa_info[i].BoundingBox.X1 = curc->contours->xmin; + all_pa_info[i].BoundingBox.Y1 = curc->contours->ymin; + all_pa_info[i].BoundingBox.X2 = curc->contours->xmax; + all_pa_info[i].BoundingBox.Y2 = curc->contours->ymax; + all_pa_info[i].pa = curc; + pcb_r_insert_entry(tree, (const pcb_box_t *) &all_pa_info[i]); + i++; + } + while ((curc = curc->f) != dest); + + /* loop through the holes and put them where they belong */ + while ((curh = *src) != NULL) { + *src = curh->next; + + container = NULL; + /* build a heap of all of the polys that the hole is inside its bounding box */ + heap = pcb_heap_create(); + pcb_r_search(tree, (pcb_box_t *) curh, NULL, heap_it, heap, NULL); + if (pcb_heap_is_empty(heap)) { +#ifndef NDEBUG +#ifdef DEBUG + poly_dump(dest); +#endif +#endif + pcb_poly_contour_del(&curh); + error(pcb_err_bad_parm); + } + /* Now search the heap for the container. If there was only one item + * in the heap, assume it is the container without the expense of + * proving it. + */ + pa_info = (struct polyarea_info *) pcb_heap_remove_smallest(heap); + if (pcb_heap_is_empty(heap)) { /* only one possibility it must be the right one */ + assert(pcb_poly_contour_in_contour(pa_info->pa->contours, curh)); + container = pa_info->pa->contours; + } + else { + do { + if (pcb_poly_contour_in_contour(pa_info->pa->contours, curh)) { + container = pa_info->pa->contours; + break; + } + if (pcb_heap_is_empty(heap)) + break; + pa_info = (struct polyarea_info *) pcb_heap_remove_smallest(heap); + } + while (1); + } + pcb_heap_destroy(&heap); + if (container == NULL) { + /* bad input polygons were given */ +#ifndef NDEBUG +#ifdef DEBUG + poly_dump(dest); +#endif +#endif + curh->next = NULL; + pcb_poly_contour_del(&curh); + error(pcb_err_bad_parm); + } + else { + /* Need to check if this new hole means we need to kick out any old ones for reprocessing */ + while (1) { + struct find_inside_info info; + pcb_pline_t *prev; + + info.want_inside = curh; + + /* Set jump return */ + if (setjmp(info.jb)) { + /* Returned here! */ + } + else { + info.result = NULL; + /* Rtree search, calling back a routine to longjmp back with data about any hole inside the added one */ + /* Be sure not to bother jumping back to report the main contour! */ + pcb_r_search(pa_info->pa->contour_tree, (pcb_box_t *) curh, NULL, find_inside, &info, NULL); + + /* Nothing found? */ + break; + } + + /* We need to find the contour before it, so we can update its next pointer */ + prev = container; + while (prev->next != info.result) { + prev = prev->next; + } + + /* Remove hole from the contour */ + remove_contour(pa_info->pa, prev, info.result, pcb_true); + + /* Add hole as the next on the list to be processed in this very function */ + info.result->next = *src; + *src = info.result; + } + /* End check for kicked out holes */ + + /* link at front of hole list */ + curh->next = container->next; + container->next = curh; + pcb_r_insert_entry(pa_info->pa->contour_tree, (pcb_box_t *) curh); + + } + } + pcb_r_destroy_tree(&tree); + free(all_pa_info); +} /* pcb_poly_insert_holes */ + + +/****************************************************************/ +/* routines for collecting result */ + +typedef enum { + FORW, BACKW +} DIRECTION; + +/* Start Rule */ +typedef int (*S_Rule) (pcb_vnode_t *, DIRECTION *); + +/* Jump Rule */ +typedef int (*J_Rule) (char, pcb_vnode_t *, DIRECTION *); + +static int UniteS_Rule(pcb_vnode_t * cur, DIRECTION * initdir) +{ + *initdir = FORW; + return (NODE_LABEL(cur) == OUTSIDE) || (NODE_LABEL(cur) == SHARED); +} + +static int IsectS_Rule(pcb_vnode_t * cur, DIRECTION * initdir) +{ + *initdir = FORW; + return (NODE_LABEL(cur) == INSIDE) || (NODE_LABEL(cur) == SHARED); +} + +static int SubS_Rule(pcb_vnode_t * cur, DIRECTION * initdir) +{ + *initdir = FORW; + return (NODE_LABEL(cur) == OUTSIDE) || (NODE_LABEL(cur) == SHARED2); +} + +static int XorS_Rule(pcb_vnode_t * cur, DIRECTION * initdir) +{ + if (cur->Flags.status == INSIDE) { + *initdir = BACKW; + return pcb_true; + } + if (cur->Flags.status == OUTSIDE) { + *initdir = FORW; + return pcb_true; + } + return pcb_false; +} + +static int IsectJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir) +{ + assert(*cdir == FORW); + return (v->Flags.status == INSIDE || v->Flags.status == SHARED); +} + +static int UniteJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir) +{ + assert(*cdir == FORW); + return (v->Flags.status == OUTSIDE || v->Flags.status == SHARED); +} + +static int XorJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir) +{ + if (v->Flags.status == INSIDE) { + *cdir = BACKW; + return pcb_true; + } + if (v->Flags.status == OUTSIDE) { + *cdir = FORW; + return pcb_true; + } + return pcb_false; +} + +static int SubJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir) +{ + if (p == 'B' && v->Flags.status == INSIDE) { + *cdir = BACKW; + return pcb_true; + } + if (p == 'A' && v->Flags.status == OUTSIDE) { + *cdir = FORW; + return pcb_true; + } + if (v->Flags.status == SHARED2) { + if (p == 'A') + *cdir = FORW; + else + *cdir = BACKW; + return pcb_true; + } + return pcb_false; +} + +/* return the edge that comes next. + * if the direction is BACKW, then we return the next vertex + * so that prev vertex has the flags for the edge + * + * returns pcb_true if an edge is found, pcb_false otherwise + */ +static int jump(pcb_vnode_t ** cur, DIRECTION * cdir, J_Rule rule) +{ + pcb_cvc_list_t *d, *start; + pcb_vnode_t *e; + DIRECTION newone; + + if (!(*cur)->cvc_prev) { /* not a cross-vertex */ + if (*cdir == FORW ? (*cur)->Flags.mark : (*cur)->prev->Flags.mark) + return pcb_false; + return pcb_true; + } +#ifdef DEBUG_JUMP + DEBUGP("jump entering node at %$mD\n", (*cur)->point[0], (*cur)->point[1]); +#endif + if (*cdir == FORW) + d = (*cur)->cvc_prev->prev; + else + d = (*cur)->cvc_next->prev; + start = d; + do { + e = d->parent; + if (d->side == 'P') + e = e->prev; + newone = *cdir; + if (!e->Flags.mark && rule(d->poly, e, &newone)) { + if ((d->side == 'N' && newone == FORW) || (d->side == 'P' && newone == BACKW)) { +#ifdef DEBUG_JUMP + if (newone == FORW) + DEBUGP("jump leaving node at %#mD\n", e->next->point[0], e->next->point[1]); + else + DEBUGP("jump leaving node at %#mD\n", e->point[0], e->point[1]); +#endif + *cur = d->parent; + *cdir = newone; + return pcb_true; + } + } + } + while ((d = d->prev) != start); + return pcb_false; +} + +static int Gather(pcb_vnode_t * start, pcb_pline_t ** result, J_Rule v_rule, DIRECTION initdir) +{ + pcb_vnode_t *cur = start, *newn; + DIRECTION dir = initdir; +#ifdef DEBUG_GATHER + DEBUGP("gather direction = %d\n", dir); +#endif + assert(*result == NULL); + do { + /* see where to go next */ + if (!jump(&cur, &dir, v_rule)) + break; + /* add edge to polygon */ + if (!*result) { + *result = pcb_poly_contour_new(cur->point); + if (*result == NULL) + return pcb_err_no_memory; + } + else { + if ((newn = pcb_poly_node_create(cur->point)) == NULL) + return pcb_err_no_memory; + pcb_poly_vertex_include((*result)->head->prev, newn); + } +#ifdef DEBUG_GATHER + DEBUGP("gather vertex at %#mD\n", cur->point[0], cur->point[1]); +#endif + /* Now mark the edge as included. */ + newn = (dir == FORW ? cur : cur->prev); + newn->Flags.mark = 1; + /* for SHARED edge mark both */ + if (newn->shared) + newn->shared->Flags.mark = 1; + + /* Advance to the next edge. */ + cur = (dir == FORW ? cur->next : cur->prev); + } + while (1); + return pcb_err_ok; +} /* Gather */ + +static void Collect1(jmp_buf * e, pcb_vnode_t * cur, DIRECTION dir, pcb_polyarea_t ** contours, pcb_pline_t ** holes, J_Rule j_rule) +{ + pcb_pline_t *p = NULL; /* start making contour */ + int errc = pcb_err_ok; + if ((errc = Gather(dir == FORW ? cur : cur->next, &p, j_rule, dir)) != pcb_err_ok) { + if (p != NULL) + pcb_poly_contour_del(&p); + error(errc); + } + if (!p) + return; + pcb_poly_contour_pre(p, pcb_true); + if (p->Count > 2) { +#ifdef DEBUG_GATHER + DEBUGP("adding contour with %d vertices and direction %c\n", p->Count, p->Flags.orient ? 'F' : 'B'); +#endif + PutContour(e, p, contours, holes, NULL, NULL, NULL); + } + else { + /* some sort of computation error ? */ +#ifdef DEBUG_GATHER + DEBUGP("Bad contour! Not enough points!!\n"); +#endif + pcb_poly_contour_del(&p); + } +} + +static void Collect(jmp_buf * e, pcb_pline_t * a, pcb_polyarea_t ** contours, pcb_pline_t ** holes, S_Rule s_rule, J_Rule j_rule) +{ + pcb_vnode_t *cur, *other; + DIRECTION dir; + + cur = a->head; + do { + if (s_rule(cur, &dir) && cur->Flags.mark == 0) + Collect1(e, cur, dir, contours, holes, j_rule); + other = cur; + if ((other->cvc_prev && jump(&other, &dir, j_rule))) + Collect1(e, other, dir, contours, holes, j_rule); + } + while ((cur = cur->next) != a->head); +} /* Collect */ + + +static int +cntr_Collect(jmp_buf * e, pcb_pline_t ** A, pcb_polyarea_t ** contours, pcb_pline_t ** holes, + int action, pcb_polyarea_t * owner, pcb_polyarea_t * parent, pcb_pline_t * parent_contour) +{ + pcb_pline_t *tmprev; + + if ((*A)->Flags.status == ISECTED) { + switch (action) { + case PCB_PBO_UNITE: + Collect(e, *A, contours, holes, UniteS_Rule, UniteJ_Rule); + break; + case PCB_PBO_ISECT: + Collect(e, *A, contours, holes, IsectS_Rule, IsectJ_Rule); + break; + case PCB_PBO_XOR: + Collect(e, *A, contours, holes, XorS_Rule, XorJ_Rule); + break; + case PCB_PBO_SUB: + Collect(e, *A, contours, holes, SubS_Rule, SubJ_Rule); + break; + }; + } + else { + switch (action) { + case PCB_PBO_ISECT: + if ((*A)->Flags.status == INSIDE) { + tmprev = *A; + /* disappear this contour (rtree entry removed in PutContour) */ + *A = tmprev->next; + tmprev->next = NULL; + PutContour(e, tmprev, contours, holes, owner, NULL, NULL); + return pcb_true; + } + break; + case PCB_PBO_XOR: + if ((*A)->Flags.status == INSIDE) { + tmprev = *A; + /* disappear this contour (rtree entry removed in PutContour) */ + *A = tmprev->next; + tmprev->next = NULL; + pcb_poly_contour_inv(tmprev); + PutContour(e, tmprev, contours, holes, owner, NULL, NULL); + return pcb_true; + } + /* break; *//* Fall through (I think this is correct! pcjc2) */ + case PCB_PBO_UNITE: + case PCB_PBO_SUB: + if ((*A)->Flags.status == OUTSIDE) { + tmprev = *A; + /* disappear this contour (rtree entry removed in PutContour) */ + *A = tmprev->next; + tmprev->next = NULL; + PutContour(e, tmprev, contours, holes, owner, parent, parent_contour); + return pcb_true; + } + break; + } + } + return pcb_false; +} /* cntr_Collect */ + +static void M_B_AREA_Collect(jmp_buf * e, pcb_polyarea_t * bfst, pcb_polyarea_t ** contours, pcb_pline_t ** holes, int action) +{ + pcb_polyarea_t *b = bfst; + pcb_pline_t **cur, **next, *tmp; + + assert(b != NULL); + do { + for (cur = &b->contours; *cur != NULL; cur = next) { + next = &((*cur)->next); + if ((*cur)->Flags.status == ISECTED) + continue; + + if ((*cur)->Flags.status == INSIDE) + switch (action) { + case PCB_PBO_XOR: + case PCB_PBO_SUB: + pcb_poly_contour_inv(*cur); + case PCB_PBO_ISECT: + tmp = *cur; + *cur = tmp->next; + next = cur; + tmp->next = NULL; + tmp->Flags.status = UNKNWN; + PutContour(e, tmp, contours, holes, b, NULL, NULL); + break; + case PCB_PBO_UNITE: + break; /* nothing to do - already included */ + } + else if ((*cur)->Flags.status == OUTSIDE) + switch (action) { + case PCB_PBO_XOR: + case PCB_PBO_UNITE: + /* include */ + tmp = *cur; + *cur = tmp->next; + next = cur; + tmp->next = NULL; + tmp->Flags.status = UNKNWN; + PutContour(e, tmp, contours, holes, b, NULL, NULL); + break; + case PCB_PBO_ISECT: + case PCB_PBO_SUB: + break; /* do nothing, not included */ + } + } + } + while ((b = b->f) != bfst); +} + + +static inline int contour_is_first(pcb_polyarea_t * a, pcb_pline_t * cur) +{ + return (a->contours == cur); +} + + +static inline int contour_is_last(pcb_pline_t * cur) +{ + return (cur->next == NULL); +} + + +static inline void remove_polyarea(pcb_polyarea_t ** list, pcb_polyarea_t * piece) +{ + /* If this item was the start of the list, advance that pointer */ + if (*list == piece) + *list = (*list)->f; + + /* But reset it to NULL if it wraps around and hits us again */ + if (*list == piece) + *list = NULL; + + piece->b->f = piece->f; + piece->f->b = piece->b; + piece->f = piece->b = piece; +} + +static void M_pcb_polyarea_separate_isected(jmp_buf * e, pcb_polyarea_t ** pieces, pcb_pline_t ** holes, pcb_pline_t ** isected) +{ + pcb_polyarea_t *a = *pieces; + pcb_polyarea_t *anext; + pcb_pline_t *curc, *next, *prev; + int finished; + + if (a == NULL) + return; + + /* TODO: STASH ENOUGH INFORMATION EARLIER ON, SO WE CAN REMOVE THE INTERSECTED + CONTOURS WITHOUT HAVING TO WALK THE FULL DATA-STRUCTURE LOOKING FOR THEM. */ + + do { + int hole_contour = 0; + int is_outline = 1; + + anext = a->f; + finished = (anext == *pieces); + + prev = NULL; + for (curc = a->contours; curc != NULL; curc = next, is_outline = 0) { + int is_first = contour_is_first(a, curc); + int is_last = contour_is_last(curc); + int isect_contour = (curc->Flags.status == ISECTED); + + next = curc->next; + + if (isect_contour || hole_contour) { + + /* Reset the intersection flags, since we keep these pieces */ + if (curc->Flags.status != ISECTED) + curc->Flags.status = UNKNWN; + + remove_contour(a, prev, curc, !(is_first && is_last)); + + if (isect_contour) { + /* Link into the list of intersected contours */ + curc->next = *isected; + *isected = curc; + } + else if (hole_contour) { + /* Link into the list of holes */ + curc->next = *holes; + *holes = curc; + } + else { + assert(0); + } + + if (is_first && is_last) { + remove_polyarea(pieces, a); + pcb_polyarea_free(&a); /* NB: Sets a to NULL */ + } + + } + else { + /* Note the item we just didn't delete as the next + candidate for having its "next" pointer adjusted. + Saves walking the contour list when we delete one. */ + prev = curc; + } + + /* If we move or delete an outer contour, we need to move any holes + we wish to keep within that contour to the holes list. */ + if (is_outline && isect_contour) + hole_contour = 1; + + } + + /* If we deleted all the pieces of the polyarea, *pieces is NULL */ + } + while ((a = anext), *pieces != NULL && !finished); +} + + +struct find_inside_m_pa_info { + jmp_buf jb; + pcb_polyarea_t *want_inside; + pcb_pline_t *result; +}; + +static pcb_r_dir_t find_inside_m_pa(const pcb_box_t * b, void *cl) +{ + struct find_inside_m_pa_info *info = (struct find_inside_m_pa_info *) cl; + pcb_pline_t *check = (pcb_pline_t *) b; + /* Don't report for the main contour */ + if (check->Flags.orient == PCB_PLF_DIR) + return PCB_R_DIR_NOT_FOUND; + /* Don't look at contours marked as being intersected */ + if (check->Flags.status == ISECTED) + return PCB_R_DIR_NOT_FOUND; + if (cntr_in_M_pcb_polyarea_t(check, info->want_inside, pcb_false)) { + info->result = check; + longjmp(info->jb, 1); + } + return PCB_R_DIR_NOT_FOUND; +} + + +static void M_pcb_polyarea_t_update_primary(jmp_buf * e, pcb_polyarea_t ** pieces, pcb_pline_t ** holes, int action, pcb_polyarea_t * bpa) +{ + pcb_polyarea_t *a = *pieces; + pcb_polyarea_t *b; + pcb_polyarea_t *anext; + pcb_pline_t *curc, *next, *prev; + pcb_box_t box; + /* int inv_inside = 0; */ + int del_inside = 0; + int del_outside = 0; + int finished; + + if (a == NULL) + return; + + switch (action) { + case PCB_PBO_ISECT: + del_outside = 1; + break; + case PCB_PBO_UNITE: + case PCB_PBO_SUB: + del_inside = 1; + break; + case PCB_PBO_XOR: /* NOT IMPLEMENTED OR USED */ + /* inv_inside = 1; */ + assert(0); + break; + } + + box = *((pcb_box_t *) bpa->contours); + b = bpa; + while ((b = b->f) != bpa) { + pcb_box_t *b_box = (pcb_box_t *) b->contours; + PCB_MAKE_MIN(box.X1, b_box->X1); + PCB_MAKE_MIN(box.Y1, b_box->Y1); + PCB_MAKE_MAX(box.X2, b_box->X2); + PCB_MAKE_MAX(box.Y2, b_box->Y2); + } + + if (del_inside) { + + do { + anext = a->f; + finished = (anext == *pieces); + + /* Test the outer contour first, as we may need to remove all children */ + + /* We've not yet split intersected contours out, just ignore them */ + if (a->contours->Flags.status != ISECTED && + /* Pre-filter on bounding box */ + ((a->contours->xmin >= box.X1) && (a->contours->ymin >= box.Y1) + && (a->contours->xmax <= box.X2) + && (a->contours->ymax <= box.Y2)) && + /* Then test properly */ + cntr_in_M_pcb_polyarea_t(a->contours, bpa, pcb_false)) { + + /* Delete this contour, all children -> holes queue */ + + /* Delete the outer contour */ + curc = a->contours; + remove_contour(a, NULL, curc, pcb_false); /* Rtree deleted in poly_Free below */ + /* a->contours now points to the remaining holes */ + pcb_poly_contour_del(&curc); + + if (a->contours != NULL) { + /* Find the end of the list of holes */ + curc = a->contours; + while (curc->next != NULL) + curc = curc->next; + + /* Take the holes and prepend to the holes queue */ + curc->next = *holes; + *holes = a->contours; + a->contours = NULL; + } + + remove_polyarea(pieces, a); + pcb_polyarea_free(&a); /* NB: Sets a to NULL */ + + continue; + } + + /* Loop whilst we find INSIDE contours to delete */ + while (1) { + struct find_inside_m_pa_info info; + pcb_pline_t *prev; + + info.want_inside = bpa; + + /* Set jump return */ + if (setjmp(info.jb)) { + /* Returned here! */ + } + else { + info.result = NULL; + /* r-tree search, calling back a routine to longjmp back with + * data about any hole inside the B polygon. + * NB: Does not jump back to report the main contour! + */ + pcb_r_search(a->contour_tree, &box, NULL, find_inside_m_pa, &info, NULL); + + /* Nothing found? */ + break; + } + + /* We need to find the contour before it, so we can update its next pointer */ + prev = a->contours; + while (prev->next != info.result) { + prev = prev->next; + } + + /* Remove hole from the contour */ + remove_contour(a, prev, info.result, pcb_true); + pcb_poly_contour_del(&info.result); + } + /* End check for deleted holes */ + + /* If we deleted all the pieces of the polyarea, *pieces is NULL */ + } + while ((a = anext), *pieces != NULL && !finished); + + return; + } + else { + /* This path isn't optimised for speed */ + } + + do { + int hole_contour = 0; + int is_outline = 1; + + anext = a->f; + finished = (anext == *pieces); + + prev = NULL; + for (curc = a->contours; curc != NULL; curc = next, is_outline = 0) { + int is_first = contour_is_first(a, curc); + int is_last = contour_is_last(curc); + int del_contour = 0; + + next = curc->next; + + if (del_outside) + del_contour = curc->Flags.status != ISECTED && !cntr_in_M_pcb_polyarea_t(curc, bpa, pcb_false); + + /* Skip intersected contours */ + if (curc->Flags.status == ISECTED) { + prev = curc; + continue; + } + + /* Reset the intersection flags, since we keep these pieces */ + curc->Flags.status = UNKNWN; + + if (del_contour || hole_contour) { + + remove_contour(a, prev, curc, !(is_first && is_last)); + + if (del_contour) { + /* Delete the contour */ + pcb_poly_contour_del(&curc); /* NB: Sets curc to NULL */ + } + else if (hole_contour) { + /* Link into the list of holes */ + curc->next = *holes; + *holes = curc; + } + else { + assert(0); + } + + if (is_first && is_last) { + remove_polyarea(pieces, a); + pcb_polyarea_free(&a); /* NB: Sets a to NULL */ + } + + } + else { + /* Note the item we just didn't delete as the next + candidate for having its "next" pointer adjusted. + Saves walking the contour list when we delete one. */ + prev = curc; + } + + /* If we move or delete an outer contour, we need to move any holes + we wish to keep within that contour to the holes list. */ + if (is_outline && del_contour) + hole_contour = 1; + + } + + /* If we deleted all the pieces of the polyarea, *pieces is NULL */ + } + while ((a = anext), *pieces != NULL && !finished); +} + +static void +M_pcb_polyarea_t_Collect_separated(jmp_buf * e, pcb_pline_t * afst, pcb_polyarea_t ** contours, pcb_pline_t ** holes, int action, pcb_bool maybe) +{ + pcb_pline_t **cur, **next; + + for (cur = &afst; *cur != NULL; cur = next) { + next = &((*cur)->next); + /* if we disappear a contour, don't advance twice */ + if (cntr_Collect(e, cur, contours, holes, action, NULL, NULL, NULL)) + next = cur; + } +} + +static void M_pcb_polyarea_t_Collect(jmp_buf * e, pcb_polyarea_t * afst, pcb_polyarea_t ** contours, pcb_pline_t ** holes, int action, pcb_bool maybe) +{ + pcb_polyarea_t *a = afst; + pcb_polyarea_t *parent = NULL; /* Quiet compiler warning */ + pcb_pline_t **cur, **next, *parent_contour; + + assert(a != NULL); + while ((a = a->f) != afst); + /* now the non-intersect parts are collected in temp/holes */ + do { + if (maybe && a->contours->Flags.status != ISECTED) + parent_contour = a->contours; + else + parent_contour = NULL; + + /* Take care of the first contour - so we know if we + * can shortcut reparenting some of its children + */ + cur = &a->contours; + if (*cur != NULL) { + next = &((*cur)->next); + /* if we disappear a contour, don't advance twice */ + if (cntr_Collect(e, cur, contours, holes, action, a, NULL, NULL)) { + parent = (*contours)->b; /* InsCntr inserts behind the head */ + next = cur; + } + else + parent = a; + cur = next; + } + for (; *cur != NULL; cur = next) { + next = &((*cur)->next); + /* if we disappear a contour, don't advance twice */ + if (cntr_Collect(e, cur, contours, holes, action, a, parent, parent_contour)) + next = cur; + } + } + while ((a = a->f) != afst); +} + +/* determine if two polygons touch or overlap */ +pcb_bool pcb_polyarea_touching(pcb_polyarea_t * a, pcb_polyarea_t * b) +{ + jmp_buf e; + int code; + + if ((code = setjmp(e)) == 0) { +#ifdef DEBUG + if (!pcb_poly_valid(a)) + return -1; + if (!pcb_poly_valid(b)) + return -1; +#endif + M_pcb_polyarea_t_intersect(&e, a, b, pcb_false); + + if (M_pcb_polyarea_t_label(a, b, pcb_true)) + return pcb_true; + if (M_pcb_polyarea_t_label(b, a, pcb_true)) + return pcb_true; + } + else if (code == TOUCHES) + return pcb_true; + return pcb_false; +} + +/* the main clipping routines */ +int pcb_polyarea_boolean(const pcb_polyarea_t * a_org, const pcb_polyarea_t * b_org, pcb_polyarea_t ** res, int action) +{ + pcb_polyarea_t *a = NULL, *b = NULL; + + if (!pcb_polyarea_m_copy0(&a, a_org) || !pcb_polyarea_m_copy0(&b, b_org)) + return pcb_err_no_memory; + + return pcb_polyarea_boolean_free(a, b, res, action); +} /* poly_Boolean */ + +/* just like poly_Boolean but frees the input polys */ +int pcb_polyarea_boolean_free(pcb_polyarea_t * ai, pcb_polyarea_t * bi, pcb_polyarea_t ** res, int action) +{ + pcb_polyarea_t *a = ai, *b = bi; + pcb_pline_t *a_isected = NULL; + pcb_pline_t *p, *holes = NULL; + jmp_buf e; + int code; + + *res = NULL; + + if (!a) { + switch (action) { + case PCB_PBO_XOR: + case PCB_PBO_UNITE: + *res = bi; + return pcb_err_ok; + case PCB_PBO_SUB: + case PCB_PBO_ISECT: + if (b != NULL) + pcb_polyarea_free(&b); + return pcb_err_ok; + } + } + if (!b) { + switch (action) { + case PCB_PBO_SUB: + case PCB_PBO_XOR: + case PCB_PBO_UNITE: + *res = ai; + return pcb_err_ok; + case PCB_PBO_ISECT: + if (a != NULL) + pcb_polyarea_free(&a); + return pcb_err_ok; + } + } + + if ((code = setjmp(e)) == 0) { +#ifdef DEBUG + assert(pcb_poly_valid(a)); + assert(pcb_poly_valid(b)); +#endif + + /* intersect needs to make a list of the contours in a and b which are intersected */ + M_pcb_polyarea_t_intersect(&e, a, b, pcb_true); + + /* We could speed things up a lot here if we only processed the relevant contours */ + /* NB: Relevant parts of a are labeled below */ + M_pcb_polyarea_t_label(b, a, pcb_false); + + *res = a; + M_pcb_polyarea_t_update_primary(&e, res, &holes, action, b); + M_pcb_polyarea_separate_isected(&e, res, &holes, &a_isected); + M_pcb_polyarea_t_label_separated(a_isected, b, pcb_false); + M_pcb_polyarea_t_Collect_separated(&e, a_isected, res, &holes, action, pcb_false); + M_B_AREA_Collect(&e, b, res, &holes, action); + pcb_polyarea_free(&b); + + /* free a_isected */ + while ((p = a_isected) != NULL) { + a_isected = p->next; + pcb_poly_contour_del(&p); + } + + pcb_poly_insert_holes(&e, *res, &holes); + } + /* delete holes if any left */ + while ((p = holes) != NULL) { + holes = p->next; + pcb_poly_contour_del(&p); + } + + if (code) { + pcb_polyarea_free(res); + return code; + } + assert(!*res || pcb_poly_valid(*res)); + return code; +} /* poly_Boolean_free */ + +static void clear_marks(pcb_polyarea_t * p) +{ + pcb_polyarea_t *n = p; + pcb_pline_t *c; + pcb_vnode_t *v; + + do { + for (c = n->contours; c; c = c->next) { + v = c->head; + do { + v->Flags.mark = 0; + } + while ((v = v->next) != c->head); + } + } + while ((n = n->f) != p); +} + +/* compute the intersection and subtraction (divides "a" into two pieces) + * and frees the input polys. This assumes that bi is a single simple polygon. + */ +int pcb_polyarea_and_subtract_free(pcb_polyarea_t * ai, pcb_polyarea_t * bi, pcb_polyarea_t ** aandb, pcb_polyarea_t ** aminusb) +{ + pcb_polyarea_t *a = ai, *b = bi; + pcb_pline_t *p, *holes = NULL; + jmp_buf e; + int code; + + *aandb = NULL; + *aminusb = NULL; + + if ((code = setjmp(e)) == 0) { + +#ifdef DEBUG + if (!pcb_poly_valid(a)) + return -1; + if (!pcb_poly_valid(b)) + return -1; +#endif + M_pcb_polyarea_t_intersect(&e, a, b, pcb_true); + + M_pcb_polyarea_t_label(a, b, pcb_false); + M_pcb_polyarea_t_label(b, a, pcb_false); + + M_pcb_polyarea_t_Collect(&e, a, aandb, &holes, PCB_PBO_ISECT, pcb_false); + pcb_poly_insert_holes(&e, *aandb, &holes); + assert(pcb_poly_valid(*aandb)); + /* delete holes if any left */ + while ((p = holes) != NULL) { + holes = p->next; + pcb_poly_contour_del(&p); + } + holes = NULL; + clear_marks(a); + clear_marks(b); + M_pcb_polyarea_t_Collect(&e, a, aminusb, &holes, PCB_PBO_SUB, pcb_false); + pcb_poly_insert_holes(&e, *aminusb, &holes); + pcb_polyarea_free(&a); + pcb_polyarea_free(&b); + assert(pcb_poly_valid(*aminusb)); + } + /* delete holes if any left */ + while ((p = holes) != NULL) { + holes = p->next; + pcb_poly_contour_del(&p); + } + + + if (code) { + pcb_polyarea_free(aandb); + pcb_polyarea_free(aminusb); + return code; + } + assert(!*aandb || pcb_poly_valid(*aandb)); + assert(!*aminusb || pcb_poly_valid(*aminusb)); + return code; +} /* poly_AndSubtract_free */ + +static inline int cntrbox_pointin(const pcb_pline_t *c, const pcb_vector_t p) +{ + return (p[0] >= c->xmin && p[1] >= c->ymin && p[0] <= c->xmax && p[1] <= c->ymax); +} + +static inline int node_neighbours(pcb_vnode_t * a, pcb_vnode_t * b) +{ + return (a == b) || (a->next == b) || (b->next == a) || (a->next == b->next); +} + +pcb_vnode_t *pcb_poly_node_create(pcb_vector_t v) +{ + pcb_vnode_t *res; + pcb_coord_t *c; + + assert(v); + res = (pcb_vnode_t *) calloc(1, sizeof(pcb_vnode_t)); + if (res == NULL) + return NULL; + /* bzero (res, sizeof (pcb_vnode_t) - sizeof(pcb_vector_t)); */ + c = res->point; + *c++ = *v++; + *c = *v; + return res; +} + +void pcb_poly_contour_init(pcb_pline_t * c) +{ + if (c == NULL) + return; + /* bzero (c, sizeof(pcb_pline_t)); */ + if (c->head == NULL) + c->head = calloc(sizeof(pcb_vnode_t), 1); + c->head->next = c->head->prev = c->head; + c->xmin = c->ymin = COORD_MAX; + c->xmax = c->ymax = -COORD_MAX-1; + c->is_round = pcb_false; + c->cx = 0; + c->cy = 0; + c->radius = 0; +} + +pcb_pline_t *pcb_poly_contour_new(const pcb_vector_t v) +{ + pcb_pline_t *res; + + res = (pcb_pline_t *) calloc(1, sizeof(pcb_pline_t)); + if (res == NULL) + return NULL; + + pcb_poly_contour_init(res); + + if (v != NULL) { + res->head = calloc(sizeof(pcb_vnode_t), 1); + res->head->next = res->head->prev = res->head; + Vcopy(res->head->point, v); + cntrbox_adjust(res, v); + } + + return res; +} + +void pcb_poly_contour_clear(pcb_pline_t * c) +{ + pcb_vnode_t *cur; + + assert(c != NULL); + while ((cur = c->head->next) != c->head) { + pcb_poly_vertex_exclude(NULL, cur); + free(cur); + } + free(c->head); + c->head = NULL; + pcb_poly_contour_init(c); +} + +void pcb_poly_contour_del(pcb_pline_t ** c) +{ + pcb_vnode_t *cur, *prev; + + if (*c == NULL) + return; + for (cur = (*c)->head->prev; cur != (*c)->head; cur = prev) { + prev = cur->prev; + if (cur->cvc_next != NULL) { + free(cur->cvc_next); + free(cur->cvc_prev); + } + free(cur); + } + if ((*c)->head->cvc_next != NULL) { + free((*c)->head->cvc_next); + free((*c)->head->cvc_prev); + } + /* FIXME -- strict aliasing violation. */ + if ((*c)->tree) { + pcb_rtree_t *r = (*c)->tree; + pcb_r_free_tree_data(r, free); + pcb_r_destroy_tree(&r); + } + free((*c)->head); + free(*c), *c = NULL; +} + +void pcb_poly_contour_pre(pcb_pline_t * C, pcb_bool optimize) +{ + double area = 0; + pcb_vnode_t *p, *c; + pcb_vector_t p1, p2; + + assert(C != NULL); + + if (optimize) { + for (c = (p = C->head)->next; c != C->head; c = (p = c)->next) { + /* if the previous node is on the same line with this one, we should remove it */ + Vsub2(p1, c->point, p->point); + Vsub2(p2, c->next->point, c->point); + /* If the product below is zero then + * the points on either side of c + * are on the same line! + * So, remove the point c + */ + + if (pcb_vect_det2(p1, p2) == 0) { + pcb_poly_vertex_exclude(C, c); + free(c); + c = p; + } + } + } + C->Count = 0; + C->xmin = C->xmax = C->head->point[0]; + C->ymin = C->ymax = C->head->point[1]; + + p = (c = C->head)->prev; + if (c != p) { + do { + /* calculate area for orientation */ + area += (double) (p->point[0] - c->point[0]) * (p->point[1] + c->point[1]); + cntrbox_adjust(C, c->point); + C->Count++; + } + while ((c = (p = c)->next) != C->head); + } + C->area = PCB_ABS(area); + if (C->Count > 2) + C->Flags.orient = ((area < 0) ? PCB_PLF_INV : PCB_PLF_DIR); + C->tree = (pcb_rtree_t *) pcb_poly_make_edge_tree(C); +} /* poly_PreContour */ + +static pcb_r_dir_t flip_cb(const pcb_box_t * b, void *cl) +{ + struct seg *s = (struct seg *) b; + s->v = s->v->prev; + return PCB_R_DIR_FOUND_CONTINUE; +} + +void pcb_poly_contour_inv(pcb_pline_t * c) +{ + pcb_vnode_t *cur, *next; + int r; + + assert(c != NULL); + cur = c->head; + do { + next = cur->next; + cur->next = cur->prev; + cur->prev = next; + /* fix the segment tree */ + } + while ((cur = next) != c->head); + c->Flags.orient ^= 1; + if (c->tree) { + pcb_r_search(c->tree, NULL, NULL, flip_cb, NULL, &r); + assert(r == c->Count); + } +} + +void pcb_poly_vertex_exclude(pcb_pline_t *parent, pcb_vnode_t * node) +{ + assert(node != NULL); + if (parent != NULL) { + if (parent->head == node) /* if node is excluded from a pline, it can not remain the head */ + parent->head = node->next; + } + if (node->cvc_next) { + free(node->cvc_next); + free(node->cvc_prev); + } + node->prev->next = node->next; + node->next->prev = node->prev; + + if (parent != NULL) { + if (parent->head == node) /* special case: removing head which was the last node in pline */ + parent->head = NULL; + } +} + +PCB_INLINE void pcb_poly_vertex_include_force_(pcb_vnode_t *after, pcb_vnode_t *node) +{ + assert(after != NULL); + assert(node != NULL); + + node->prev = after; + node->next = after->next; + after->next = after->next->prev = node; +} + +void pcb_poly_vertex_include_force(pcb_vnode_t *after, pcb_vnode_t *node) +{ + pcb_poly_vertex_include_force_(after, node); +} + +void pcb_poly_vertex_include(pcb_vnode_t *after, pcb_vnode_t *node) +{ + double a, b; + + pcb_poly_vertex_include_force_(after, node); + + /* remove points on same line */ + if (node->prev->prev == node) + return; /* we don't have 3 points in the poly yet */ + a = (node->point[1] - node->prev->prev->point[1]); + a *= (node->prev->point[0] - node->prev->prev->point[0]); + b = (node->point[0] - node->prev->prev->point[0]); + b *= (node->prev->point[1] - node->prev->prev->point[1]); + if (fabs(a - b) < EPSILON) { + pcb_vnode_t *t = node->prev; + t->prev->next = node; + node->prev = t->prev; + free(t); + } +} + +pcb_bool pcb_poly_contour_copy(pcb_pline_t **dst, const pcb_pline_t *src) +{ + pcb_vnode_t *cur, *newnode; + + assert(src != NULL); + *dst = NULL; + *dst = pcb_poly_contour_new(src->head->point); + if (*dst == NULL) + return pcb_false; + + (*dst)->Count = src->Count; + (*dst)->Flags.orient = src->Flags.orient; + (*dst)->xmin = src->xmin, (*dst)->xmax = src->xmax; + (*dst)->ymin = src->ymin, (*dst)->ymax = src->ymax; + (*dst)->area = src->area; + + for (cur = src->head->next; cur != src->head; cur = cur->next) { + if ((newnode = pcb_poly_node_create(cur->point)) == NULL) + return pcb_false; + /* newnode->Flags = cur->Flags; */ + pcb_poly_vertex_include((*dst)->head->prev, newnode); + } + (*dst)->tree = (pcb_rtree_t *) pcb_poly_make_edge_tree(*dst); + return pcb_true; +} + +/**********************************************************************/ +/* polygon routines */ + +pcb_bool pcb_polyarea_copy0(pcb_polyarea_t ** dst, const pcb_polyarea_t * src) +{ + *dst = NULL; + if (src != NULL) + *dst = (pcb_polyarea_t *) calloc(1, sizeof(pcb_polyarea_t)); + if (*dst == NULL) + return pcb_false; + (*dst)->contour_tree = pcb_r_create_tree(); + + return pcb_polyarea_copy1(*dst, src); +} + +pcb_bool pcb_polyarea_copy1(pcb_polyarea_t * dst, const pcb_polyarea_t * src) +{ + pcb_pline_t *cur, **last = &dst->contours; + + *last = NULL; + dst->f = dst->b = dst; + + for (cur = src->contours; cur != NULL; cur = cur->next) { + if (!pcb_poly_contour_copy(last, cur)) + return pcb_false; + pcb_r_insert_entry(dst->contour_tree, (pcb_box_t *) * last); + last = &(*last)->next; + } + return pcb_true; +} + +void pcb_polyarea_m_include(pcb_polyarea_t ** list, pcb_polyarea_t * a) +{ + if (*list == NULL) + a->f = a->b = a, *list = a; + else { + a->f = *list; + a->b = (*list)->b; + (*list)->b = (*list)->b->f = a; + } +} + +pcb_bool pcb_polyarea_m_copy0(pcb_polyarea_t ** dst, const pcb_polyarea_t * srcfst) +{ + const pcb_polyarea_t *src = srcfst; + pcb_polyarea_t *di; + + *dst = NULL; + if (src == NULL) + return pcb_false; + do { + if ((di = pcb_polyarea_create()) == NULL || !pcb_polyarea_copy1(di, src)) + return pcb_false; + pcb_polyarea_m_include(dst, di); + } + while ((src = src->f) != srcfst); + return pcb_true; +} + +pcb_bool pcb_polyarea_contour_include(pcb_polyarea_t * p, pcb_pline_t * c) +{ + pcb_pline_t *tmp; + + if ((c == NULL) || (p == NULL)) + return pcb_false; + if (c->Flags.orient == PCB_PLF_DIR) { + if (p->contours != NULL) + return pcb_false; + p->contours = c; + } + else { + if (p->contours == NULL) + return pcb_false; + /* link at front of hole list */ + tmp = p->contours->next; + p->contours->next = c; + c->next = tmp; + } + pcb_r_insert_entry(p->contour_tree, (pcb_box_t *) c); + return pcb_true; +} + +typedef struct pip { + int f; + pcb_vector_t p; + jmp_buf env; +} pip; + + +static pcb_r_dir_t crossing(const pcb_box_t * b, void *cl) +{ + struct seg *s = (struct seg *) b; + struct pip *p = (struct pip *) cl; + + if (s->v->point[1] <= p->p[1]) { + if (s->v->next->point[1] > p->p[1]) { + pcb_vector_t v1, v2; + pcb_long64_t cross; + Vsub2(v1, s->v->next->point, s->v->point); + Vsub2(v2, p->p, s->v->point); + cross = (pcb_long64_t) v1[0] * v2[1] - (pcb_long64_t) v2[0] * v1[1]; + if (cross == 0) { + p->f = 1; + longjmp(p->env, 1); + } + if (cross > 0) + p->f += 1; + } + } + else { + if (s->v->next->point[1] <= p->p[1]) { + pcb_vector_t v1, v2; + pcb_long64_t cross; + Vsub2(v1, s->v->next->point, s->v->point); + Vsub2(v2, p->p, s->v->point); + cross = (pcb_long64_t) v1[0] * v2[1] - (pcb_long64_t) v2[0] * v1[1]; + if (cross == 0) { + p->f = 1; + longjmp(p->env, 1); + } + if (cross < 0) + p->f -= 1; + } + } + return PCB_R_DIR_FOUND_CONTINUE; +} + +int pcb_poly_contour_inside(const pcb_pline_t *c, pcb_vector_t p) +{ + struct pip info; + pcb_box_t ray; + + if (!cntrbox_pointin(c, p)) + return pcb_false; + info.f = 0; + info.p[0] = ray.X1 = p[0]; + info.p[1] = ray.Y1 = p[1]; + ray.X2 = COORD_MAX; + ray.Y2 = p[1] + 1; + if (setjmp(info.env) == 0) + pcb_r_search(c->tree, &ray, NULL, crossing, &info, NULL); + return info.f; +} + +pcb_bool pcb_polyarea_contour_inside(pcb_polyarea_t * p, pcb_vector_t v0) +{ + pcb_pline_t *cur; + + if ((p == NULL) || (v0 == NULL) || (p->contours == NULL)) + return pcb_false; + cur = p->contours; + if (pcb_poly_contour_inside(cur, v0)) { + for (cur = cur->next; cur != NULL; cur = cur->next) + if (pcb_poly_contour_inside(cur, v0)) + return pcb_false; + return pcb_true; + } + return pcb_false; +} + +pcb_bool poly_M_CheckInside(pcb_polyarea_t * p, pcb_vector_t v0) +{ + pcb_polyarea_t *cur; + + if ((p == NULL) || (v0 == NULL)) + return pcb_false; + cur = p; + do { + if (pcb_polyarea_contour_inside(cur, v0)) + return pcb_true; + } + while ((cur = cur->f) != p); + return pcb_false; +} + +static double dot(pcb_vector_t A, pcb_vector_t B) +{ + return (double) A[0] * (double) B[0] + (double) A[1] * (double) B[1]; +} + +/* Compute whether point is inside a triangle formed by 3 other points */ +/* Algorithm from http://www.blackpawn.com/texts/pointinpoly/default.html */ +static int point_in_triangle(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t P) +{ + pcb_vector_t v0, v1, v2; + double dot00, dot01, dot02, dot11, dot12; + double invDenom; + double u, v; + + /* Compute vectors */ + v0[0] = C[0] - A[0]; + v0[1] = C[1] - A[1]; + v1[0] = B[0] - A[0]; + v1[1] = B[1] - A[1]; + v2[0] = P[0] - A[0]; + v2[1] = P[1] - A[1]; + + /* Compute dot products */ + dot00 = dot(v0, v0); + dot01 = dot(v0, v1); + dot02 = dot(v0, v2); + dot11 = dot(v1, v1); + dot12 = dot(v1, v2); + + /* Compute barycentric coordinates */ + invDenom = 1. / (dot00 * dot11 - dot01 * dot01); + u = (dot11 * dot02 - dot01 * dot12) * invDenom; + v = (dot00 * dot12 - dot01 * dot02) * invDenom; + + /* Check if point is in triangle */ + return (u > 0.0) && (v > 0.0) && (u + v < 1.0); +} + + +/* Returns the dot product of pcb_vector_t A->B, and a vector + * orthogonal to pcb_vector_t C->D. The result is not normalised, so will be + * weighted by the magnitude of the C->D vector. + */ +static double dot_orthogonal_to_direction(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D) +{ + pcb_vector_t l1, l2, l3; + l1[0] = B[0] - A[0]; + l1[1] = B[1] - A[1]; + l2[0] = D[0] - C[0]; + l2[1] = D[1] - C[1]; + + l3[0] = -l2[1]; + l3[1] = l2[0]; + + return dot(l1, l3); +} + +/* Algorithm from http://www.exaflop.org/docs/cgafaq/cga2.html + * + * "Given a simple polygon, find some point inside it. Here is a method based + * on the proof that there exists an internal diagonal, in [O'Rourke, 13-14]. + * The idea is that the midpoint of a diagonal is interior to the polygon. + * + * 1. Identify a convex vertex v; let its adjacent vertices be a and b. + * 2. For each other vertex q do: + * 2a. If q is inside avb, compute distance to v (orthogonal to ab). + * 2b. Save point q if distance is a new min. + * 3. If no point is inside, return midpoint of ab, or centroid of avb. + * 4. Else if some point inside, qv is internal: return its midpoint." + * + * [O'Rourke]: Computational Geometry in C (2nd Ed.) + * Joseph O'Rourke, Cambridge University Press 1998, + * ISBN 0-521-64010-5 Pbk, ISBN 0-521-64976-5 Hbk + */ +static void poly_ComputeInteriorPoint(pcb_pline_t * poly, pcb_vector_t v) +{ + pcb_vnode_t *pt1, *pt2, *pt3, *q; + pcb_vnode_t *min_q = NULL; + double dist; + double min_dist = 0.0; + double dir = (poly->Flags.orient == PCB_PLF_DIR) ? 1. : -1; + + /* Find a convex node on the polygon */ + pt1 = poly->head; + do { + double dot_product; + + pt2 = pt1->next; + pt3 = pt2->next; + + dot_product = dot_orthogonal_to_direction(pt1->point, pt2->point, pt3->point, pt2->point); + + if (dot_product * dir > 0.) + break; + } + while ((pt1 = pt1->next) != poly->head); + + /* Loop over remaining vertices */ + q = pt3; + do { + /* Is current vertex "q" outside pt1 pt2 pt3 triangle? */ + if (!point_in_triangle(pt1->point, pt2->point, pt3->point, q->point)) + continue; + + /* NO: compute distance to pt2 (v) orthogonal to pt1 - pt3) */ + /* Record minimum */ + dist = dot_orthogonal_to_direction(q->point, pt2->point, pt1->point, pt3->point); + if (min_q == NULL || dist < min_dist) { + min_dist = dist; + min_q = q; + } + } + while ((q = q->next) != pt2); + + /* Were any "q" found inside pt1 pt2 pt3? */ + if (min_q == NULL) { + /* NOT FOUND: Return midpoint of pt1 pt3 */ + v[0] = (pt1->point[0] + pt3->point[0]) / 2; + v[1] = (pt1->point[1] + pt3->point[1]) / 2; + } + else { + /* FOUND: Return mid point of min_q, pt2 */ + v[0] = (pt2->point[0] + min_q->point[0]) / 2; + v[1] = (pt2->point[1] + min_q->point[1]) / 2; + } +} + + +/* NB: This function assumes the caller _knows_ the contours do not + * intersect. If the contours intersect, the result is undefined. + * It will return the correct result if the two contours share + * common points between their contours. (Identical contours + * are treated as being inside each other). + */ +int pcb_poly_contour_in_contour(pcb_pline_t * poly, pcb_pline_t * inner) +{ + pcb_vector_t point; + assert(poly != NULL); + assert(inner != NULL); + if (cntrbox_inside(inner, poly)) { + /* We need to prove the "inner" contour is not outside + * "poly" contour. If it is outside, we can return. + */ + if (!pcb_poly_contour_inside(poly, inner->head->point)) + return 0; + + poly_ComputeInteriorPoint(inner, point); + return pcb_poly_contour_inside(poly, point); + } + return 0; +} + +void pcb_polyarea_init(pcb_polyarea_t * p) +{ + p->f = p->b = p; + p->contours = NULL; + p->contour_tree = pcb_r_create_tree(); +} + +pcb_polyarea_t *pcb_polyarea_create(void) +{ + pcb_polyarea_t *res; + + if ((res = (pcb_polyarea_t *) malloc(sizeof(pcb_polyarea_t))) != NULL) + pcb_polyarea_init(res); + return res; +} + +void pcb_poly_contours_free(pcb_pline_t ** pline) +{ + pcb_pline_t *pl; + + while ((pl = *pline) != NULL) { + *pline = pl->next; + pcb_poly_contour_del(&pl); + } +} + +void pcb_polyarea_free(pcb_polyarea_t ** p) +{ + pcb_polyarea_t *cur; + + if (*p == NULL) + return; + for (cur = (*p)->f; cur != *p; cur = (*p)->f) { + pcb_poly_contours_free(&cur->contours); + pcb_r_destroy_tree(&cur->contour_tree); + cur->f->b = cur->b; + cur->b->f = cur->f; + free(cur); + } + pcb_poly_contours_free(&cur->contours); + pcb_r_destroy_tree(&cur->contour_tree); + free(*p), *p = NULL; +} + +static pcb_bool inside_sector(pcb_vnode_t * pn, pcb_vector_t p2) +{ + pcb_vector_t cdir, ndir, pdir; + int p_c, n_c, p_n; + + assert(pn != NULL); + vect_sub(cdir, p2, pn->point); + vect_sub(pdir, pn->point, pn->prev->point); + vect_sub(ndir, pn->next->point, pn->point); + + p_c = pcb_vect_det2(pdir, cdir) >= 0; + n_c = pcb_vect_det2(ndir, cdir) >= 0; + p_n = pcb_vect_det2(pdir, ndir) >= 0; + + if ((p_n && p_c && n_c) || ((!p_n) && (p_c || n_c))) + return pcb_true; + else + return pcb_false; +} /* inside_sector */ + +/* returns pcb_true if bad contour */ +typedef struct { + int marks, lines; +#ifndef NDEBUG + pcb_coord_t x[8], y[8]; + pcb_coord_t x1[8], y1[8], x2[8], y2[8]; + char msg[256]; +#endif +} pa_chk_res_t; + + +#ifndef NDEBUG +#define PA_CHK_MARK(x_, y_) \ +do { \ + if (res->marks < sizeof(res->x) / sizeof(res->x[0])) { \ + res->x[res->marks] = x_; \ + res->y[res->marks] = y_; \ + res->marks++; \ + } \ +} while(0) +#define PA_CHK_LINE(x1_, y1_, x2_, y2_) \ +do { \ + if (res->lines < sizeof(res->x1) / sizeof(res->x1[0])) { \ + res->x1[res->lines] = x1_; \ + res->y1[res->lines] = y1_; \ + res->x2[res->lines] = x2_; \ + res->y2[res->lines] = y2_; \ + res->lines++; \ + } \ +} while(0) +#else +#define PA_CHK_MARK(x, y) +#define PA_CHK_LINE(x1, y1, x2, y2) +#endif + + +PCB_INLINE pcb_bool PA_CHK_ERROR(pa_chk_res_t *res, const char *fmt, ...) +{ +#ifndef NDEBUG + va_list ap; + va_start(ap, fmt); + pcb_vsnprintf(res->msg, sizeof(res->msg), fmt, ap); + va_end(ap); +#endif + return pcb_true; +} + +pcb_bool pcb_polyarea_contour_check_(pcb_pline_t *a, pa_chk_res_t *res) +{ + pcb_vnode_t *a1, *a2, *hit1, *hit2; + pcb_vector_t i1, i2; + int icnt; + +#ifndef NDEBUG + *res->msg = '\0'; +#endif + res->marks = res->lines = 0; + + assert(a != NULL); + a1 = a->head; + do { + a2 = a1; + do { + if (!node_neighbours(a1, a2) && (icnt = pcb_vect_inters2(a1->point, a1->next->point, a2->point, a2->next->point, i1, i2)) > 0) { + if (icnt > 1) { + PA_CHK_MARK(a1->point[0], a1->point[1]); + PA_CHK_MARK(a2->point[0], a2->point[1]); + return PA_CHK_ERROR(res, "icnt > 1 (%d) at %mm;%mm or %mm;%mm", icnt, a1->point[0], a1->point[1], a2->point[0], a2->point[1]); + } + +TODO(": ugly workaround: test where exactly the intersection happens and tune the endpoint of the line") + /* EPSILON^2 for endpoint matching; the bool algebra code is not + perfect and causes tiny self intersections at the end of sharp + spikes. Accept at most 10 nanometer of such intersection */ +# define ENDP_EPSILON 100 + + if (pcb_vect_dist2(i1, a1->point) < ENDP_EPSILON) + hit1 = a1; + else if (pcb_vect_dist2(i1, a1->next->point) < ENDP_EPSILON) + hit1 = a1->next; + else + hit1 = NULL; + + if (pcb_vect_dist2(i1, a2->point) < ENDP_EPSILON) + hit2 = a2; + else if (pcb_vect_dist2(i1, a2->next->point) < ENDP_EPSILON) + hit2 = a2->next; + else + hit2 = NULL; + + if ((hit1 == NULL) && (hit2 == NULL)) { + /* If the intersection didn't land on an end-point of either + * line, we know the lines cross and we return pcb_true. + */ + PA_CHK_LINE(a1->point[0], a1->point[1], a1->next->point[0], a1->next->point[1]); + PA_CHK_LINE(a2->point[0], a2->point[1], a2->next->point[0], a2->next->point[1]); + return PA_CHK_ERROR(res, "lines cross between %mm;%mm and %mm;%mm", a1->point[0], a1->point[1], a2->point[0], a2->point[1]); + } + else if (hit1 == NULL) { + /* An end-point of the second line touched somewhere along the + length of the first line. Check where the second line leads. */ + if (inside_sector(hit2, a1->point) != inside_sector(hit2, a1->next->point)) { + PA_CHK_MARK(a1->point[0], a1->point[1]); + PA_CHK_MARK(hit2->point[0], hit2->point[1]); + return PA_CHK_ERROR(res, "lines is inside sector (1) at %mm;%mm", a1->point[0], a1->point[1]); + } + } + else if (hit2 == NULL) { + /* An end-point of the first line touched somewhere along the + length of the second line. Check where the first line leads. */ + if (inside_sector(hit1, a2->point) != inside_sector(hit1, a2->next->point)) { + PA_CHK_MARK(a2->point[0], a2->point[1]); + PA_CHK_MARK(hit1->point[0], hit1->point[1]); + return PA_CHK_ERROR(res, "lines is inside sector (2) at %mm;%mm", a2->point[0], a2->point[1]); + } + } + else { + /* Both lines intersect at an end-point. Check where they lead. */ + if (inside_sector(hit1, hit2->prev->point) != inside_sector(hit1, hit2->next->point)) { + PA_CHK_MARK(hit1->point[0], hit2->point[1]); + PA_CHK_MARK(hit2->point[0], hit2->point[1]); + return PA_CHK_ERROR(res, "lines is inside sector (3) at %mm;%mm or %mm;%mm", hit1->point[0], hit1->point[1], hit2->point[0], hit2->point[1]); + } + } + } + } + while ((a2 = a2->next) != a->head); + } + while ((a1 = a1->next) != a->head); + return pcb_false; +} + +pcb_bool pcb_polyarea_contour_check(pcb_pline_t *a) +{ + pa_chk_res_t res; + return pcb_polyarea_contour_check_(a, &res); +} + +void pcb_polyarea_bbox(pcb_polyarea_t * p, pcb_box_t * b) +{ + pcb_pline_t *n; + /*int cnt;*/ + + n = p->contours; + b->X1 = b->X2 = n->xmin; + b->Y1 = b->Y2 = n->ymin; + + for (/*cnt = 0*/; /*cnt < 2 */ n != NULL; n = n->next) { + if (n->xmin < b->X1) + b->X1 = n->xmin; + if (n->ymin < b->Y1) + b->Y1 = n->ymin; + if (n->xmax > b->X2) + b->X2 = n->xmax; + if (n->ymax > b->Y2) + b->Y2 = n->ymax; +/* if (n == p->contours) + cnt++;*/ + } +} + +#ifndef NDEBUG +static void pcb_poly_valid_report(pcb_pline_t *c, pcb_vnode_t *pl, pa_chk_res_t *chk) +{ + pcb_vnode_t *v, *n; + pcb_coord_t minx = COORD_MAX, miny = COORD_MAX, maxx = -COORD_MAX, maxy = -COORD_MAX; + +#define update_minmax(min, max, val) \ + if (val < min) min = val; \ + if (val > max) max = val; + if (chk != NULL) + pcb_fprintf(stderr, "Details: %s\n", chk->msg); + pcb_fprintf(stderr, "!!!animator start\n"); + v = pl; + do { + n = v->next; + update_minmax(minx, maxx, v->point[0]); + update_minmax(miny, maxy, v->point[1]); + update_minmax(minx, maxx, n->point[0]); + update_minmax(miny, maxy, n->point[1]); + } + while ((v = v->next) != pl); + pcb_fprintf(stderr, "scale 1 -1\n"); + pcb_fprintf(stderr, "viewport %mm %mm - %mm %mm\n", minx, miny, maxx, maxy); + pcb_fprintf(stderr, "frame\n"); + v = pl; + do { + n = v->next; + pcb_fprintf(stderr, "line %#mm %#mm %#mm %#mm\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=PCB_MM_TO_COORD(0.05); + fprintf(stderr, "color #770000\n"); + for(n = 0; n < chk->marks; n++) { + pcb_fprintf(stderr, "line %#mm %#mm %#mm %#mm\n", chk->x[n]-MR, chk->y[n]-MR, chk->x[n]+MR, chk->y[n]+MR); + pcb_fprintf(stderr, "line %#mm %#mm %#mm %#mm\n", chk->x[n]-MR, chk->y[n]+MR, chk->x[n]+MR, chk->y[n]-MR); + } + } + + if ((chk != NULL) && (chk->lines > 0)) { + int n; + fprintf(stderr, "color #990000\n"); + for(n = 0; n < chk->lines; n++) + pcb_fprintf(stderr, "line %#mm %#mm %#mm %#mm\n", chk->x1[n], chk->y1[n], chk->x2[n], chk->y2[n]); + } + + fprintf(stderr, "flush\n"); + fprintf(stderr, "!!!animator end\n"); + +#undef update_minmax +} +#endif + + +pcb_bool pcb_poly_valid(pcb_polyarea_t * p) +{ + pcb_pline_t *c; + pa_chk_res_t chk; + + if ((p == NULL) || (p->contours == NULL)) { +#if 0 +(disabled for too many false positive) +#ifndef NDEBUG + pcb_fprintf(stderr, "Invalid polyarea: no contours\n"); +#endif +#endif + return pcb_false; + } + + if (p->contours->Flags.orient == PCB_PLF_INV) { +#ifndef NDEBUG + pcb_fprintf(stderr, "Invalid Outer pcb_pline_t: failed orient\n"); + pcb_poly_valid_report(p->contours, p->contours->head, NULL); +#endif + return pcb_false; + } + + if (pcb_polyarea_contour_check_(p->contours, &chk)) { +#ifndef NDEBUG + pcb_fprintf(stderr, "Invalid Outer pcb_pline_t: failed contour check\n"); + pcb_poly_valid_report(p->contours, p->contours->head, &chk); +#endif + return pcb_false; + } + + for (c = p->contours->next; c != NULL; c = c->next) { + if (c->Flags.orient == PCB_PLF_DIR) { +#ifndef NDEBUG + pcb_fprintf(stderr, "Invalid Inner: pcb_pline_t orient = %d\n", c->Flags.orient); + pcb_poly_valid_report(c, c->head, NULL); +#endif + return pcb_false; + } + if (pcb_polyarea_contour_check_(c, &chk)) { +#ifndef NDEBUG + pcb_fprintf(stderr, "Invalid Inner: failed contour check\n"); + pcb_poly_valid_report(c, c->head, &chk); +#endif + return pcb_false; + } + if (!pcb_poly_contour_in_contour(p->contours, c)) { +#ifndef NDEBUG + pcb_fprintf(stderr, "Invalid Inner: overlap with outer\n"); + pcb_poly_valid_report(c, c->head, NULL); +#endif + return pcb_false; + } + } + return pcb_true; +} + + +pcb_vector_t vect_zero = { (long) 0, (long) 0 }; + +/*********************************************************************/ +/* L o n g V e c t o r S t u f f */ +/*********************************************************************/ + +void vect_init(pcb_vector_t v, double x, double y) +{ + v[0] = (long) x; + v[1] = (long) y; +} /* vect_init */ + +#define Vzero(a) ((a)[0] == 0. && (a)[1] == 0.) + +#define Vsub(a,b,c) {(a)[0]=(b)[0]-(c)[0];(a)[1]=(b)[1]-(c)[1];} + +int vect_equal(pcb_vector_t v1, pcb_vector_t v2) +{ + return (v1[0] == v2[0] && v1[1] == v2[1]); +} /* vect_equal */ + + +void vect_sub(pcb_vector_t res, pcb_vector_t v1, pcb_vector_t v2) +{ +Vsub(res, v1, v2)} /* vect_sub */ + +void vect_min(pcb_vector_t v1, pcb_vector_t v2, pcb_vector_t v3) +{ + v1[0] = (v2[0] < v3[0]) ? v2[0] : v3[0]; + v1[1] = (v2[1] < v3[1]) ? v2[1] : v3[1]; +} /* vect_min */ + +void vect_max(pcb_vector_t v1, pcb_vector_t v2, pcb_vector_t v3) +{ + v1[0] = (v2[0] > v3[0]) ? v2[0] : v3[0]; + v1[1] = (v2[1] > v3[1]) ? v2[1] : v3[1]; +} /* vect_max */ + +double pcb_vect_len2(pcb_vector_t v) +{ + return ((double) v[0] * v[0] + (double) v[1] * v[1]); /* why sqrt? only used for compares */ +} + +double pcb_vect_dist2(pcb_vector_t v1, pcb_vector_t v2) +{ + double dx = v1[0] - v2[0]; + double dy = v1[1] - v2[1]; + + return (dx * dx + dy * dy); /* why sqrt */ +} + +/* value has sign of angle between vectors */ +double pcb_vect_det2(pcb_vector_t v1, pcb_vector_t v2) +{ + return (((double) v1[0] * v2[1]) - ((double) v2[0] * v1[1])); +} + +static double vect_m_dist(pcb_vector_t v1, pcb_vector_t v2) +{ + double dx = v1[0] - v2[0]; + double dy = v1[1] - v2[1]; + double dd = (dx * dx + dy * dy); /* sqrt */ + + if (dx > 0) + return +dd; + if (dx < 0) + return -dd; + if (dy > 0) + return +dd; + return -dd; +} /* vect_m_dist */ + +/* +vect_inters2 + (C) 1993 Klamer Schutte + (C) 1997 Michael Leonov, Alexey Nikitin +*/ + +int pcb_vect_inters2(pcb_vector_t p1, pcb_vector_t p2, pcb_vector_t q1, pcb_vector_t q2, pcb_vector_t S1, pcb_vector_t S2) +{ + double s, t, deel; + double rpx, rpy, rqx, rqy; + + if (max(p1[0], p2[0]) < min(q1[0], q2[0]) || + max(q1[0], q2[0]) < min(p1[0], p2[0]) || max(p1[1], p2[1]) < min(q1[1], q2[1]) || max(q1[1], q2[1]) < min(p1[1], p2[1])) + return 0; + + rpx = p2[0] - p1[0]; + rpy = p2[1] - p1[1]; + rqx = q2[0] - q1[0]; + rqy = q2[1] - q1[1]; + + deel = rpy * rqx - rpx * rqy; /* -vect_det(rp,rq); */ + + /* coordinates are 30-bit integers so deel will be exactly zero + * if the lines are parallel + */ + + if (deel == 0) { /* parallel */ + double dc1, dc2, d1, d2, h; /* Check to see whether p1-p2 and q1-q2 are on the same line */ + pcb_vector_t hp1, hq1, hp2, hq2, q1p1, q1q2; + + Vsub2(q1p1, q1, p1); + Vsub2(q1q2, q1, q2); + + + /* If this product is not zero then p1-p2 and q1-q2 are not on same line! */ + if (pcb_vect_det2(q1p1, q1q2) != 0) + return 0; + dc1 = 0; /* m_len(p1 - p1) */ + + dc2 = vect_m_dist(p1, p2); + d1 = vect_m_dist(p1, q1); + d2 = vect_m_dist(p1, q2); + +/* Sorting the independent points from small to large */ + Vcpy2(hp1, p1); + Vcpy2(hp2, p2); + Vcpy2(hq1, q1); + Vcpy2(hq2, q2); + if (dc1 > dc2) { /* hv and h are used as help-variable. */ + Vswp2(hp1, hp2); + h = dc1, dc1 = dc2, dc2 = h; + } + if (d1 > d2) { + Vswp2(hq1, hq2); + h = d1, d1 = d2, d2 = h; + } + +/* Now the line-pieces are compared */ + + if (dc1 < d1) { + if (dc2 < d1) + return 0; + if (dc2 < d2) { + Vcpy2(S1, hp2); + Vcpy2(S2, hq1); + } + else { + Vcpy2(S1, hq1); + Vcpy2(S2, hq2); + }; + } + else { + if (dc1 > d2) + return 0; + if (dc2 < d2) { + Vcpy2(S1, hp1); + Vcpy2(S2, hp2); + } + else { + Vcpy2(S1, hp1); + Vcpy2(S2, hq2); + }; + } + return (Vequ2(S1, S2) ? 1 : 2); + } + else { /* not parallel */ + /* + * We have the lines: + * l1: p1 + s(p2 - p1) + * l2: q1 + t(q2 - q1) + * And we want to know the intersection point. + * Calculate t: + * p1 + s(p2-p1) = q1 + t(q2-q1) + * which is similar to the two equations: + * p1x + s * rpx = q1x + t * rqx + * p1y + s * rpy = q1y + t * rqy + * Multiplying these by rpy resp. rpx gives: + * rpy * p1x + s * rpx * rpy = rpy * q1x + t * rpy * rqx + * rpx * p1y + s * rpx * rpy = rpx * q1y + t * rpx * rqy + * Subtracting these gives: + * rpy * p1x - rpx * p1y = rpy * q1x - rpx * q1y + t * ( rpy * rqx - rpx * rqy ) + * So t can be isolated: + * t = (rpy * ( p1x - q1x ) + rpx * ( - p1y + q1y )) / ( rpy * rqx - rpx * rqy ) + * and s can be found similarly + * s = (rqy * (q1x - p1x) + rqx * (p1y - q1y))/( rqy * rpx - rqx * rpy) + */ + + if (Vequ2(q1, p1) || Vequ2(q1, p2)) { + S1[0] = q1[0]; + S1[1] = q1[1]; + } + else if (Vequ2(q2, p1) || Vequ2(q2, p2)) { + S1[0] = q2[0]; + S1[1] = q2[1]; + } + else { + s = (rqy * (p1[0] - q1[0]) + rqx * (q1[1] - p1[1])) / deel; + if (s < 0 || s > 1.) + return 0; + t = (rpy * (p1[0] - q1[0]) + rpx * (q1[1] - p1[1])) / deel; + if (t < 0 || t > 1.) + return 0; + + S1[0] = q1[0] + ROUND(t * rqx); + S1[1] = q1[1] + ROUND(t * rqy); + } + return 1; + } +} /* vect_inters2 */ + +/* + * pcb_pline_isect_line() + * (C) 2017, 2018 Tibor 'Igor2' Palinkas +*/ + +typedef struct { + pcb_vector_t l1, l2; + pcb_coord_t cx, cy; +} pline_isect_line_t; + +static pcb_r_dir_t pline_isect_line_cb(const pcb_box_t * b, void *cl) +{ + pline_isect_line_t *ctx = (pline_isect_line_t *)cl; + struct seg *s = (struct seg *)b; + pcb_vector_t S1, S2; + + if (pcb_vect_inters2(s->v->point, s->v->next->point, ctx->l1, ctx->l2, S1, S2)) { + ctx->cx = S1[0]; + ctx->cy = S1[1]; + return PCB_R_DIR_CANCEL; /* found */ + } + + return PCB_R_DIR_NOT_FOUND; +} + +pcb_bool pcb_pline_isect_line(pcb_pline_t *pl, pcb_coord_t lx1, pcb_coord_t ly1, pcb_coord_t lx2, pcb_coord_t ly2, pcb_coord_t *cx, pcb_coord_t *cy) +{ + pline_isect_line_t ctx; + pcb_box_t lbx; + ctx.l1[0] = lx1; ctx.l1[1] = ly1; + ctx.l2[0] = lx2; ctx.l2[1] = ly2; + lbx.X1 = MIN(lx1, lx2); + lbx.Y1 = MIN(ly1, ly2); + lbx.X2 = MAX(lx1, lx2); + lbx.Y2 = MAX(ly1, ly2); + + if (pl->tree == NULL) + pl->tree = (pcb_rtree_t *) pcb_poly_make_edge_tree(pl); + + if (pcb_r_search(pl->tree, &lbx, NULL, pline_isect_line_cb, &ctx, NULL) == PCB_R_DIR_CANCEL) { + if (cx != NULL) *cx = ctx.cx; + if (cy != NULL) *cy = ctx.cy; + return pcb_true; + } + return pcb_false; +} + +/* + * pcb_pline_isect_circle() + * (C) 2017 Tibor 'Igor2' Palinkas +*/ + +typedef struct { + pcb_coord_t cx, cy, r; + double r2; +} pline_isect_circ_t; + +static pcb_r_dir_t pline_isect_circ_cb(const pcb_box_t * b, void *cl) +{ + pline_isect_circ_t *ctx = (pline_isect_circ_t *)cl; + struct seg *s = (struct seg *)b; + pcb_vector_t S1, S2; + pcb_vector_t ray1, ray2; + double ox, oy, dx, dy, l; + + /* Cheap: if either line endpoint is within the circle, we sure have an intersection */ + if ((PCB_SQUARE(s->v->point[0] - ctx->cx) + PCB_SQUARE(s->v->point[1] - ctx->cy)) <= ctx->r2) + return PCB_R_DIR_CANCEL; /* found */ + if ((PCB_SQUARE(s->v->next->point[0] - ctx->cx) + PCB_SQUARE(s->v->next->point[1] - ctx->cy)) <= ctx->r2) + return PCB_R_DIR_CANCEL; /* found */ + + dx = s->v->point[0] - s->v->next->point[0]; + dy = s->v->point[1] - s->v->next->point[1]; + l = sqrt(PCB_SQUARE(dx) + PCB_SQUARE(dy)); + ox = -dy / l * (double)ctx->r; + oy = dx / l * (double)ctx->r; + + ray1[0] = ctx->cx - ox; ray1[1] = ctx->cy - oy; + ray2[0] = ctx->cx + ox; ray2[1] = ctx->cy + oy; + + if (pcb_vect_inters2(s->v->point, s->v->next->point, ray1, ray2, S1, S2)) + return PCB_R_DIR_CANCEL; /* found */ + + return PCB_R_DIR_NOT_FOUND; +} + +pcb_bool pcb_pline_isect_circ(pcb_pline_t *pl, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t r) +{ + pline_isect_circ_t ctx; + pcb_box_t cbx; + ctx.cx = cx; ctx.cy = cy; + ctx.r = r; ctx.r2 = (double)r * (double)r; + cbx.X1 = cx - r; cbx.Y1 = cy - r; + cbx.X2 = cx + r; cbx.Y2 = cy + r; + + if (pl->tree == NULL) + pl->tree = (pcb_rtree_t *) pcb_poly_make_edge_tree(pl); + + return pcb_r_search(pl->tree, &cbx, NULL, pline_isect_circ_cb, &ctx, NULL) == PCB_R_DIR_CANCEL; +} + + +/* + * pcb_pline_embraces_circle() + * If the circle does not intersect the polygon (the caller needs to check this) + * return whether the circle is fully within the polygon or not. + * Shoots a ray to the right from center+radius, then one to the left from + * center-radius; if both ray cross odd number of pline segments, we are in + * (or intersecting). + * (C) 2017 Tibor 'Igor2' Palinkas +*/ +static pcb_r_dir_t pline_embraces_circ_cb(const pcb_box_t * b, void *cl) +{ + int *cnt = (int *)cl; + (*cnt)++; + return PCB_R_DIR_NOT_FOUND; +} + +pcb_bool pcb_pline_embraces_circ(pcb_pline_t *pl, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t r) +{ + pcb_box_t bx; + int cnt; + + bx.Y1 = cy; bx.Y2 = cy+1; + if (pl->tree == NULL) + pl->tree = (pcb_rtree_t *) pcb_poly_make_edge_tree(pl); + + /* ray to the right */ + bx.X1 = cx + r; + bx.X2 = COORD_MAX; + cnt = 0; + pcb_r_search(pl->tree, &bx, NULL, pline_embraces_circ_cb, &cnt, NULL); + if ((cnt % 2) == 0) + return pcb_false; + + /* ray to the right */ + bx.X1 = -COORD_MAX; + bx.X2 = cx - r; + cnt = 0; + pcb_r_search(pl->tree, &bx, NULL, pline_embraces_circ_cb, &cnt, NULL); + if ((cnt % 2) == 0) + return pcb_false; + + return pcb_true; +} + +/* + * pcb_pline_isect_circle() + * (C) 2017 Tibor 'Igor2' Palinkas +*/ +pcb_bool pcb_pline_overlaps_circ(pcb_pline_t *pl, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t r) +{ + pcb_box_t cbx, pbx; + cbx.X1 = cx - r; cbx.Y1 = cy - r; + cbx.X2 = cx + r; cbx.Y2 = cy + r; + pbx.X1 = pl->xmin; pbx.Y1 = pl->ymin; + pbx.X2 = pl->xmax; pbx.Y2 = pl->ymax; + + /* if there's no overlap in bounding boxes, don't do any expensive calc */ + if (!(pcb_box_intersect(&cbx, &pbx))) + return pcb_false; + + if (pl->tree == NULL) + pl->tree = (pcb_rtree_t *) pcb_poly_make_edge_tree(pl); + + if (pcb_pline_isect_circ(pl, cx, cy, r)) + return pcb_true; + + return pcb_pline_embraces_circ(pl, cx, cy, r); +} + + +/* + * pcb_is_point_in_convex_quad() + * (C) 2017 Tibor 'Igor2' Palinkas +*/ +pcb_bool_t pcb_is_point_in_convex_quad(pcb_vector_t p, pcb_vector_t *q) +{ + return point_in_triangle(q[0], q[1], q[2], p) || point_in_triangle(q[0], q[3], q[2], p); +} + + +/* + * pcb_polyarea_move() + * (C) 2017 Tibor 'Igor2' Palinkas +*/ +void pcb_polyarea_move(pcb_polyarea_t *pa1, pcb_coord_t dx, pcb_coord_t dy) +{ + int cnt; + pcb_polyarea_t *pa; + + for (pa = pa1, cnt = 0; pa != NULL; pa = pa->f) { + pcb_pline_t *pl; + if (pa == pa1) { + cnt++; + if (cnt > 1) + break; + } + if (pa->contour_tree != NULL) + pcb_r_destroy_tree(&pa->contour_tree); + pa->contour_tree = pcb_r_create_tree(); + for(pl = pa->contours; pl != NULL; pl = pl->next) { + pcb_vnode_t *v; + int cnt2 = 0; + for(v = pl->head; v != NULL; v = v->next) { + if (v == pl->head) { + cnt2++; + if (cnt2 > 1) + break; + } + v->point[0] += dx; + v->point[1] += dy; + } + pl->xmin += dx; + pl->ymin += dy; + pl->xmax += dx; + pl->ymax += dy; + if (pl->tree != NULL) { + pcb_r_free_tree_data(pl->tree, free); + pcb_r_destroy_tree(&pl->tree); + } + pl->tree = (pcb_rtree_t *)pcb_poly_make_edge_tree(pl); + + pcb_r_insert_entry(pa->contour_tree, (pcb_box_t *)pl); + } + } +} + +#include "polygon_selfi.c" + +void pcb_polyarea_get_tree_seg(void *obj, pcb_coord_t *x1, pcb_coord_t *y1, pcb_coord_t *x2, pcb_coord_t *y2) +{ + struct seg *s = obj; + *x1 = s->v->point[0]; + *x2 = s->v->next->point[0]; + *y1 = s->v->point[1]; + *y2 = s->v->next->point[1]; +} + +/* how about expanding polygons so that edges can be arcs rather than + * lines. Consider using the third coordinate to store the radius of the + * arc. The arc would pass through the vertex points. Positive radius + * would indicate the arc bows left (center on right of P1-P2 path) + * negative radius would put the center on the other side. 0 radius + * would mean the edge is a line instead of arc + * The intersections of the two circles centered at the vertex points + * would determine the two possible arc centers. If P2.x > P1.x then + * the center with smaller Y is selected for positive r. If P2.y > P1.y + * then the center with greater X is selected for positive r. + * + * the vec_inters2() routine would then need to handle line-line + * line-arc and arc-arc intersections. + * + * perhaps reverse tracing the arc would require look-ahead to check + * for arcs + */ Index: trunk/src/librnd/poly/polyarea.h =================================================================== --- trunk/src/librnd/poly/polyarea.h (nonexistent) +++ trunk/src/librnd/poly/polyarea.h (revision 29283) @@ -0,0 +1,204 @@ +/* + poly_Boolean: a polygon clip library + Copyright (C) 1997 Alexey Nikitin, Michael Leonov + leonov@propro.iis.nsk.su + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + polyarea.h + (C) 1997 Alexey Nikitin, Michael Leonov + (C) 1997 Klamer Schutte (minor patches) +*/ + +#ifndef PCB_POLYAREA_H +#define PCB_POLYAREA_H + +#define PCB_PLF_DIR 1 +#define PCB_PLF_INV 0 +#define PCB_PLF_MARK 1 + +typedef pcb_coord_t pcb_vertex_t[2]; /* longing point representation of coordinates */ +typedef pcb_vertex_t pcb_vector_t; + +#define pcb_vertex_equ(a,b) (memcmp((a),(b),sizeof(pcb_vector_t))==0) +#define pcb_vertex_cpy(a,b) memcpy((a),(b),sizeof(pcb_vector_t)) + + +extern pcb_vector_t vect_zero; + +enum { + pcb_err_no_memory = 2, + pcb_err_bad_parm = 3, + pcb_err_ok = 0 +}; + + +typedef struct pcb_cvc_list_s pcb_cvc_list_t; +typedef struct pcb_vnode_s pcb_vnode_t; +struct pcb_cvc_list_s { + double angle; + pcb_vnode_t *parent; + pcb_cvc_list_t *prev, *next, *head; + char poly, side; +}; +struct pcb_vnode_s { + pcb_vnode_t *next, *prev, *shared; + struct { + unsigned int status:3; + unsigned int mark:1; + unsigned int in_hub:1; + } Flags; + pcb_cvc_list_t *cvc_prev; + pcb_cvc_list_t *cvc_next; + pcb_vector_t point; +}; + +typedef struct pcb_pline_s pcb_pline_t; +struct pcb_pline_s { + pcb_coord_t xmin, ymin, xmax, ymax; + pcb_pline_t *next; + pcb_vnode_t *head; + unsigned int Count; + double area; + pcb_rtree_t *tree; + pcb_bool is_round; + pcb_coord_t cx, cy; + pcb_coord_t radius; + struct { + unsigned int status:3; + unsigned int orient:1; + } Flags; +}; + +pcb_pline_t *pcb_poly_contour_new(const pcb_vector_t v); + +void pcb_poly_contour_init(pcb_pline_t *c); +void pcb_poly_contour_clear(pcb_pline_t *c); /* clears list of vertices */ +void pcb_poly_contour_del(pcb_pline_t **c); + +pcb_bool pcb_poly_contour_copy(pcb_pline_t **dst, const pcb_pline_t *src); + +void pcb_poly_contour_pre(pcb_pline_t *c, pcb_bool optimize); /* prepare contour */ +void pcb_poly_contour_inv(pcb_pline_t *c); /* invert contour */ + +pcb_vnode_t *pcb_poly_node_create(pcb_vector_t v); + +void pcb_poly_vertex_include(pcb_vnode_t *after, pcb_vnode_t *node); +void pcb_poly_vertex_include_force(pcb_vnode_t *after, pcb_vnode_t *node); /* do not remove nodes even if on the same line */ +void pcb_poly_vertex_exclude(pcb_pline_t *parent, pcb_vnode_t *node); + +/**********************************************************************/ + +struct pcb_polyarea_s { + pcb_polyarea_t *f, *b; + pcb_pline_t *contours; + pcb_rtree_t *contour_tree; +}; + +pcb_bool pcb_polyarea_m_copy0(pcb_polyarea_t **dst, const pcb_polyarea_t *srcfst); +void pcb_polyarea_m_include(pcb_polyarea_t **list, pcb_polyarea_t *a); + +pcb_bool pcb_polyarea_copy0(pcb_polyarea_t **dst, const pcb_polyarea_t *src); +pcb_bool pcb_polyarea_copy1(pcb_polyarea_t *dst, const pcb_polyarea_t *src); + +pcb_bool pcb_polyarea_contour_include(pcb_polyarea_t *p, pcb_pline_t *c); +pcb_bool pcb_polyarea_contour_exclude(pcb_polyarea_t *p, pcb_pline_t *c); + + +pcb_bool pcb_polyarea_contour_check(pcb_pline_t *a); + +pcb_bool pcb_polyarea_contour_inside(pcb_polyarea_t *c, pcb_vector_t v0); +pcb_bool pcb_polyarea_touching(pcb_polyarea_t *p1, pcb_polyarea_t *p2); + +/*** tools for clipping ***/ + +/* checks whether point lies within contour independently of its orientation */ + +int pcb_poly_contour_inside(const pcb_pline_t *c, pcb_vector_t v); +int pcb_poly_contour_in_contour(pcb_pline_t *poly, pcb_pline_t *inner); +pcb_polyarea_t *pcb_polyarea_create(void); + +void pcb_polyarea_free(pcb_polyarea_t **p); +void pcb_polyarea_init(pcb_polyarea_t *p); +void pcb_poly_contours_free(pcb_pline_t **pl); +pcb_bool pcb_poly_valid(pcb_polyarea_t *p); + +enum pcb_poly_bool_op_e { + PCB_PBO_UNITE, + PCB_PBO_ISECT, + PCB_PBO_SUB, + PCB_PBO_XOR +}; + +double pcb_vect_dist2(pcb_vector_t v1, pcb_vector_t v2); +double pcb_vect_det2(pcb_vector_t v1, pcb_vector_t v2); +double pcb_vect_len2(pcb_vector_t v1); + +int pcb_vect_inters2(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D, pcb_vector_t S1, pcb_vector_t S2); + +int pcb_polyarea_boolean(const pcb_polyarea_t *a, const pcb_polyarea_t *b, pcb_polyarea_t **res, int action); +int pcb_polyarea_boolean_free(pcb_polyarea_t *a, pcb_polyarea_t *b, pcb_polyarea_t **res, int action); +int pcb_polyarea_and_subtract_free(pcb_polyarea_t *a, pcb_polyarea_t *b, pcb_polyarea_t **aandb, pcb_polyarea_t **aminusb); +int pcb_polyarea_save(pcb_polyarea_t *PA, char *fname); + +/* calculate the bounding box of a pcb_polyarea_t and save result in b */ +void pcb_polyarea_bbox(pcb_polyarea_t *p, pcb_box_t *b); + +/* Move each point of pa1 by dx and dy */ +void pcb_polyarea_move(pcb_polyarea_t *pa1, pcb_coord_t dx, pcb_coord_t dy); + +/*** Tools for building polygons for common object shapes ***/ + + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif +double pcb_round(double x); /* from math_helper.h */ + +/* Calculate an endpoint of an arc and return the result in *x;*y */ +PCB_INLINE void pcb_arc_get_endpt(pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t astart, pcb_angle_t adelta, int which, pcb_coord_t *x, pcb_coord_t *y) +{ + if (which == 0) { + *x = pcb_round((double)cx - (double)width * cos(astart * (M_PI/180.0))); + *y = pcb_round((double)cy + (double)height * sin(astart * (M_PI/180.0))); + } + else { + *x = pcb_round((double)cx - (double)width * cos((astart + adelta) * (M_PI/180.0))); + *y = pcb_round((double)cy + (double)height * sin((astart + adelta) * (M_PI/180.0))); + } +} + +/*** constants for the poly shape generator ***/ + +/* polygon diverges from modelled arc no more than MAX_ARC_DEVIATION * thick */ +#define PCB_POLY_ARC_MAX_DEVIATION 0.02 + +#define PCB_POLY_CIRC_SEGS 40 +#define PCB_POLY_CIRC_SEGS_F ((float)PCB_POLY_CIRC_SEGS) + +/* adjustment to make the segments outline the circle rather than connect + points on the circle: 1 - cos (\alpha / 2) < (\alpha / 2) ^ 2 / 2 */ +#define PCB_POLY_CIRC_RADIUS_ADJ \ + (1.0 + M_PI / PCB_POLY_CIRC_SEGS_F * M_PI / PCB_POLY_CIRC_SEGS_F / 2.0) + +/*** special purpose, internal tools ***/ +/* Convert a struct seg *obj extracted from a pline->tree into coords */ +void pcb_polyarea_get_tree_seg(void *obj, pcb_coord_t *x1, pcb_coord_t *y1, pcb_coord_t *x2, pcb_coord_t *y2); + +/* create a (pcb_rtree_t *) of each seg derived from src */ +void *pcb_poly_make_edge_tree(pcb_pline_t *src); + + +#endif /* PCB_POLYAREA_H */ Index: trunk/src/librnd/poly/polygon1_gen.c =================================================================== --- trunk/src/librnd/poly/polygon1_gen.c (nonexistent) +++ trunk/src/librnd/poly/polygon1_gen.c (revision 29283) @@ -0,0 +1,539 @@ +/* + * COPYRIGHT + * + * pcb-rnd, interactive printed circuit board design + * (this file is based on PCB, interactive printed circuit board design) + * Copyright (C) 1994,1995,1996,2010 Thomas Nau + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Contact: + * Project page: http://repo.hu/projects/pcb-rnd + * lead developer: http://repo.hu/projects/pcb-rnd/contact.html + * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") + * + */ + +#include "config.h" + +#include +#include +#include + +#include +#include +#include +#include + +#include + +/* kept to ensure nanometer compatibility */ +#define ROUND(x) ((long)(((x) >= 0 ? (x) + 0.5 : (x) - 0.5))) + +static double rotate_circle_seg[4]; +int rotate_circle_seg_inited = 0; + +static void init_rotate_cache(void) +{ + if (!rotate_circle_seg_inited) { + double cos_ang = cos(2.0 * M_PI / PCB_POLY_CIRC_SEGS_F); + double sin_ang = sin(2.0 * M_PI / PCB_POLY_CIRC_SEGS_F); + + rotate_circle_seg[0] = cos_ang; + rotate_circle_seg[1] = -sin_ang; + rotate_circle_seg[2] = sin_ang; + rotate_circle_seg[3] = cos_ang; + rotate_circle_seg_inited = 1; + } +} + +pcb_polyarea_t *pcb_poly_from_contour(pcb_pline_t * contour) +{ + pcb_polyarea_t *p; + pcb_poly_contour_pre(contour, pcb_true); + assert(contour->Flags.orient == PCB_PLF_DIR); + if (!(p = pcb_polyarea_create())) + return NULL; + pcb_polyarea_contour_include(p, contour); + assert(pcb_poly_valid(p)); + return p; +} + +pcb_polyarea_t *pcb_poly_from_contour_autoinv(pcb_pline_t *contour) +{ + pcb_polyarea_t *p; + pcb_poly_contour_pre(contour, pcb_true); + if (contour->Flags.orient != PCB_PLF_DIR) + pcb_poly_contour_inv(contour); + if (!(p = pcb_polyarea_create())) + return NULL; + pcb_polyarea_contour_include(p, contour); + assert(pcb_poly_valid(p)); + return p; +} + + +#define ARC_ANGLE 5 +static pcb_polyarea_t *ArcPolyNoIntersect(pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t astart, pcb_angle_t adelta, pcb_coord_t thick, int end_caps) +{ + pcb_pline_t *contour = NULL; + pcb_polyarea_t *np = NULL; + pcb_vector_t v, v2; + int i, segs; + double ang, da, rx, ry; + long half; + double radius_adj; + pcb_coord_t edx, edy, endx1, endx2, endy1, endy2; + + if (thick <= 0) + return NULL; + if (adelta < 0) { + astart += adelta; + adelta = -adelta; + } + half = (thick + 1) / 2; + + pcb_arc_get_endpt(cx, cy, width, height, astart, adelta, 0, &endx1, &endy1); + pcb_arc_get_endpt(cx, cy, width, height, astart, adelta, 1, &endx2, &endy2); + + /* start with inner radius */ + rx = MAX(width - half, 0); + ry = MAX(height - half, 0); + segs = 1; + if (thick > 0) + segs = MAX(segs, adelta * M_PI / 360 * + sqrt(sqrt((double) rx * rx + (double) ry * ry) / PCB_POLY_ARC_MAX_DEVIATION / 2 / thick)); + segs = MAX(segs, adelta / ARC_ANGLE); + + ang = astart; + da = (1.0 * adelta) / segs; + radius_adj = (M_PI * da / 360) * (M_PI * da / 360) / 2; + v[0] = cx - rx * cos(ang * PCB_M180); + v[1] = cy + ry * sin(ang * PCB_M180); + if ((contour = pcb_poly_contour_new(v)) == NULL) + return 0; + for (i = 0; i < segs - 1; i++) { + ang += da; + v[0] = cx - rx * cos(ang * PCB_M180); + v[1] = cy + ry * sin(ang * PCB_M180); + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + } + /* find last point */ + ang = astart + adelta; + v[0] = cx - rx * cos(ang * PCB_M180) * (1 - radius_adj); + v[1] = cy + ry * sin(ang * PCB_M180) * (1 - radius_adj); + + /* add the round cap at the end */ + if (end_caps) + pcb_poly_frac_circle(contour, endx2, endy2, v, 2); + + /* and now do the outer arc (going backwards) */ + rx = (width + half) * (1 + radius_adj); + ry = (width + half) * (1 + radius_adj); + da = -da; + for (i = 0; i < segs; i++) { + v[0] = cx - rx * cos(ang * PCB_M180); + v[1] = cy + ry * sin(ang * PCB_M180); + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + ang += da; + } + + /* explicitly draw the last point if the manhattan-distance is large enough */ + ang = astart; + v2[0] = cx - rx * cos(ang * PCB_M180) * (1 - radius_adj); + v2[1] = cy + ry * sin(ang * PCB_M180) * (1 - radius_adj); + edx = (v[0] - v2[0]); + edy = (v[1] - v2[1]); + if (edx < 0) edx = -edx; + if (edy < 0) edy = -edy; + if (edx+edy > PCB_MM_TO_COORD(0.001)) + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v2)); + + + /* now add other round cap */ + if (end_caps) + pcb_poly_frac_circle(contour, endx1, endy1, v2, 2); + + /* now we have the whole contour */ + if (!(np = pcb_poly_from_contour(contour))) + return NULL; + return np; +} + +pcb_polyarea_t *pcb_poly_from_rect(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2) +{ + pcb_pline_t *contour = NULL; + pcb_vector_t v; + + /* Return NULL for zero or negatively sized rectangles */ + if (x2 <= x1 || y2 <= y1) + return NULL; + + v[0] = x1; + v[1] = y1; + if ((contour = pcb_poly_contour_new(v)) == NULL) + return NULL; + v[0] = x2; + v[1] = y1; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + v[0] = x2; + v[1] = y2; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + v[0] = x1; + v[1] = y2; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + return pcb_poly_from_contour(contour); +} + +pcb_polyarea_t *pcb_poly_from_octagon(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius, int style) +{ + pcb_pline_t *contour = NULL; + pcb_vector_t v; + double xm[8], ym[8]; + + pcb_poly_square_pin_factors(style, xm, ym); + +TODO(": rewrite this to use the same table as the square/oct pin draw function") + /* point 7 */ + v[0] = x + ROUND(radius * 0.5) * xm[7]; + v[1] = y + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[7]; + if ((contour = pcb_poly_contour_new(v)) == NULL) + return NULL; + /* point 6 */ + v[0] = x + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[6]; + v[1] = y + ROUND(radius * 0.5) * ym[6]; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + /* point 5 */ + v[0] = x - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[5]; + v[1] = y + ROUND(radius * 0.5) * ym[5]; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + /* point 4 */ + v[0] = x - ROUND(radius * 0.5) * xm[4]; + v[1] = y + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[4]; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + /* point 3 */ + v[0] = x - ROUND(radius * 0.5) * xm[3]; + v[1] = y - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[3]; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + /* point 2 */ + v[0] = x - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[2]; + v[1] = y - ROUND(radius * 0.5) * ym[2]; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + /* point 1 */ + v[0] = x + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[1]; + v[1] = y - ROUND(radius * 0.5) * ym[1]; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + /* point 0 */ + v[0] = x + ROUND(radius * 0.5) * xm[0]; + v[1] = y - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[0]; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + return pcb_poly_from_contour(contour); +} + +static void pcb_poly_frac_circle_(pcb_pline_t * c, pcb_coord_t X, pcb_coord_t Y, pcb_vector_t v, int range, int add_last) +{ + double oe1, oe2, e1, e2, t1; + int i, orange = range; + + init_rotate_cache(); + + oe1 = (v[0] - X); + oe2 = (v[1] - Y); + + pcb_poly_vertex_include(c->head->prev, pcb_poly_node_create(v)); + + /* move vector to origin */ + e1 = (v[0] - X) * PCB_POLY_CIRC_RADIUS_ADJ; + e2 = (v[1] - Y) * PCB_POLY_CIRC_RADIUS_ADJ; + + /* NB: the caller adds the last vertex, hence the -1 */ + range = PCB_POLY_CIRC_SEGS / range - 1; + for (i = 0; i < range; i++) { + /* rotate the vector */ + t1 = rotate_circle_seg[0] * e1 + rotate_circle_seg[1] * e2; + e2 = rotate_circle_seg[2] * e1 + rotate_circle_seg[3] * e2; + e1 = t1; + v[0] = X + ROUND(e1); + v[1] = Y + ROUND(e2); + pcb_poly_vertex_include(c->head->prev, pcb_poly_node_create(v)); + } + + if ((add_last) && (orange == 4)) { + v[0] = X - ROUND(oe2); + v[1] = Y + ROUND(oe1); + pcb_poly_vertex_include(c->head->prev, pcb_poly_node_create(v)); + } +} + + +/* add vertices in a fractional-circle starting from v + * centered at X, Y and going counter-clockwise + * does not include the first point + * last argument is 1 for a full circle + * 2 for a half circle + * or 4 for a quarter circle + */ +void pcb_poly_frac_circle(pcb_pline_t * c, pcb_coord_t X, pcb_coord_t Y, pcb_vector_t v, int range) +{ + pcb_poly_frac_circle_(c, X, Y, v, range, 0); +} + +/* same but adds the last vertex */ +void pcb_poly_frac_circle_end(pcb_pline_t * c, pcb_coord_t X, pcb_coord_t Y, pcb_vector_t v, int range) +{ + pcb_poly_frac_circle_(c, X, Y, v, range, 1); +} + + +/* create a circle approximation from lines */ +pcb_polyarea_t *pcb_poly_from_circle(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius) +{ + pcb_pline_t *contour; + pcb_vector_t v; + + if (radius <= 0) + return NULL; + v[0] = x + radius; + v[1] = y; + if ((contour = pcb_poly_contour_new(v)) == NULL) + return NULL; + pcb_poly_frac_circle(contour, x, y, v, 1); + contour->is_round = pcb_true; + contour->cx = x; + contour->cy = y; + contour->radius = radius; + return pcb_poly_from_contour(contour); +} + +/* make a rounded-corner rectangle with radius t beyond x1,x2,y1,y2 rectangle */ +pcb_polyarea_t *RoundRect(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2, pcb_coord_t t) +{ + pcb_pline_t *contour = NULL; + pcb_vector_t v; + + assert(x2 > x1); + assert(y2 > y1); + v[0] = x1 - t; + v[1] = y1; + if ((contour = pcb_poly_contour_new(v)) == NULL) + return NULL; + pcb_poly_frac_circle_end(contour, x1, y1, v, 4); + v[0] = x2; + v[1] = y1 - t; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + pcb_poly_frac_circle_end(contour, x2, y1, v, 4); + v[0] = x2 + t; + v[1] = y2; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + pcb_poly_frac_circle_end(contour, x2, y2, v, 4); + v[0] = x1; + v[1] = y2 + t; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + pcb_poly_frac_circle_end(contour, x1, y2, v, 4); + return pcb_poly_from_contour(contour); +} + + +pcb_polyarea_t *pcb_poly_from_line(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t thick, pcb_bool square) +{ + pcb_pline_t *contour = NULL; + pcb_polyarea_t *np = NULL; + pcb_vector_t v; + double d, dx, dy; + long half; + + if (thick <= 0) + return NULL; + half = (thick + 1) / 2; + d = sqrt(PCB_SQUARE(x1 - x2) + PCB_SQUARE(y1 - y2)); + if (!square) + if (d == 0) /* line is a point */ + return pcb_poly_from_circle(x1, y1, half); + if (d != 0) { + d = half / d; + dx = (y1 - y2) * d; + dy = (x2 - x1) * d; + } + else { + dx = half; + dy = 0; + } + if (square) { /* take into account the ends */ + x1 -= dy; + y1 += dx; + x2 += dy; + y2 -= dx; + } + v[0] = x1 - dx; + v[1] = y1 - dy; + if ((contour = pcb_poly_contour_new(v)) == NULL) + return 0; + v[0] = x2 - dx; + v[1] = y2 - dy; + if (square) + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + else + pcb_poly_frac_circle(contour, x2, y2, v, 2); + v[0] = x2 + dx; + v[1] = y2 + dy; + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + v[0] = x1 + dx; + v[1] = y1 + dy; + if (square) + pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); + else + pcb_poly_frac_circle(contour, x1, y1, v, 2); + /* now we have the line contour */ + if (!(np = pcb_poly_from_contour(contour))) + return NULL; + return np; +} + +#define MIN_CLEARANCE_BEFORE_BISECT 10. +pcb_polyarea_t *pcb_poly_from_arc(pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t astart, pcb_angle_t adelta, pcb_coord_t thick) +{ + double delta; + pcb_coord_t half; + + delta = (adelta < 0) ? -adelta : adelta; + + half = (thick + 1) / 2; + + /* corner case: can't even calculate the end cap properly because radius + is so small that there's no inner arc of the clearance */ + if ((width - half <= 0) || (height - half <= 0)) { + pcb_coord_t lx1, ly1; + pcb_polyarea_t *tmp_arc, *tmp1, *tmp2, *res, *ends; + + tmp_arc = ArcPolyNoIntersect(cx, cy, width, height, astart, adelta, thick, 0); + + pcb_arc_get_endpt(cx, cy, width, height, astart, adelta, 0, &lx1, &ly1); + tmp1 = pcb_poly_from_line(lx1, ly1, lx1, ly1, thick, 0); + + pcb_arc_get_endpt(cx, cy, width, height, astart, adelta, 1, &lx1, &ly1); + tmp2 = pcb_poly_from_line(lx1, ly1, lx1, ly1, thick, 0); + + pcb_polyarea_boolean_free(tmp1, tmp2, &ends, PCB_PBO_UNITE); + pcb_polyarea_boolean_free(ends, tmp_arc, &res, PCB_PBO_UNITE); + return res; + } + + /* If the arc segment would self-intersect, we need to construct it as the union of + two non-intersecting segments */ + if (2 * M_PI * width * (1. - (double) delta / 360.) - thick < MIN_CLEARANCE_BEFORE_BISECT) { + pcb_polyarea_t *tmp1, *tmp2, *res; + int half_delta = adelta / 2; + + tmp1 = ArcPolyNoIntersect(cx, cy, width, height, astart, half_delta, thick, 1); + tmp2 = ArcPolyNoIntersect(cx, cy, width, height, astart+half_delta, adelta-half_delta, thick, 1); + pcb_polyarea_boolean_free(tmp1, tmp2, &res, PCB_PBO_UNITE); + return res; + } + + return ArcPolyNoIntersect(cx, cy, width, height, astart, adelta, thick, 1); +} + + +/* set up x and y multiplier for an octa poly, depending on square pin style + (used in early versions of pcb-rnd, before custom shape padstacks) */ +void pcb_poly_square_pin_factors(int style, double *xm, double *ym) +{ + int i; + const double factor = 2.0; + + /* reset multipliers */ + for (i = 0; i < 8; i++) { + xm[i] = 1; + ym[i] = 1; + } + + style--; + if (style & 1) + xm[0] = xm[1] = xm[6] = xm[7] = factor; + if (style & 2) + xm[2] = xm[3] = xm[4] = xm[5] = factor; + if (style & 4) + ym[4] = ym[5] = ym[6] = ym[7] = factor; + if (style & 8) + ym[0] = ym[1] = ym[2] = ym[3] = factor; +} + +/* NB: This function will free the passed pcb_polyarea_t. + It must only be passed a single pcb_polyarea_t (pa->f == pa->b == pa) */ +static void r_NoHolesPolygonDicer(pcb_polyarea_t * pa, void (*emit) (pcb_pline_t *, void *), void *user_data) +{ + pcb_pline_t *p = pa->contours; + + if (!pa->contours->next) { /* no holes */ + pa->contours = NULL; /* The callback now owns the contour */ + /* Don't bother removing it from the pcb_polyarea_t's rtree + since we're going to free the pcb_polyarea_t below anyway */ + emit(p, user_data); + pcb_polyarea_free(&pa); + return; + } + else { + pcb_polyarea_t *poly2, *left, *right; + + /* make a rectangle of the left region slicing through the middle of the first hole */ + poly2 = pcb_poly_from_rect(p->xmin, (p->next->xmin + p->next->xmax) / 2, p->ymin, p->ymax); + pcb_polyarea_and_subtract_free(pa, poly2, &left, &right); + if (left) { + pcb_polyarea_t *cur, *next; + cur = left; + do { + next = cur->f; + cur->f = cur->b = cur; /* Detach this polygon piece */ + r_NoHolesPolygonDicer(cur, emit, user_data); + /* NB: The pcb_polyarea_t was freed by its use in the recursive dicer */ + } + while ((cur = next) != left); + } + if (right) { + pcb_polyarea_t *cur, *next; + cur = right; + do { + next = cur->f; + cur->f = cur->b = cur; /* Detach this polygon piece */ + r_NoHolesPolygonDicer(cur, emit, user_data); + /* NB: The pcb_polyarea_t was freed by its use in the recursive dicer */ + } + while ((cur = next) != right); + } + } +} + +void pcb_polyarea_no_holes_dicer(pcb_polyarea_t *main_contour, pcb_coord_t clipX1, pcb_coord_t clipY1, pcb_coord_t clipX2, pcb_coord_t clipY2, void (*emit)(pcb_pline_t *, void *), void *user_data) +{ + pcb_polyarea_t *cur, *next; + + /* clip to the bounding box */ + if ((clipX1 != clipX2) || (clipY1 != clipY2)) { + pcb_polyarea_t *cbox = pcb_poly_from_rect(clipX1, clipX2, clipY1, clipY2); + pcb_polyarea_boolean_free(main_contour, cbox, &main_contour, PCB_PBO_ISECT); + } + if (main_contour == NULL) + return; + /* Now dice it up. + * NB: Could be more than one piece (because of the clip above) */ + cur = main_contour; + do { + next = cur->f; + cur->f = cur->b = cur; /* Detach this polygon piece */ + r_NoHolesPolygonDicer(cur, emit, user_data); + /* NB: The pcb_polyarea_t was freed by its use in the recursive dicer */ + } + while ((cur = next) != main_contour); +} Index: trunk/src/librnd/poly/polygon1_gen.h =================================================================== --- trunk/src/librnd/poly/polygon1_gen.h (nonexistent) +++ trunk/src/librnd/poly/polygon1_gen.h (revision 29283) @@ -0,0 +1,39 @@ +#ifndef PCB_POLYGON1_GEN_H +#define PCB_POLYGON1_GEN_H + +#include +#include + +void pcb_poly_square_pin_factors(int style, double *xm, double *ym); + +pcb_polyarea_t *pcb_poly_from_contour(pcb_pline_t *pl); +pcb_polyarea_t *pcb_poly_from_contour_autoinv(pcb_pline_t *pl); + +pcb_polyarea_t *pcb_poly_from_circle(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius); +pcb_polyarea_t *pcb_poly_from_octagon(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius, int style); +pcb_polyarea_t *pcb_poly_from_rect(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2); +pcb_polyarea_t *RoundRect(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2, pcb_coord_t t); + + +/* generate a polygon of a round or square cap line of a given thickness */ +pcb_polyarea_t *pcb_poly_from_line(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t thick, pcb_bool square); + +/* generate a polygon of a round cap arc of a given thickness */ +pcb_polyarea_t *pcb_poly_from_arc(pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t astart, pcb_angle_t adelta, pcb_coord_t thick); + +/* Slice up a polyarea-with-holes into a set of polygon islands with no + holes, within the clip area. If the clip area is all-zero, do not clip. + Free's main_contour. */ +void pcb_polyarea_no_holes_dicer(pcb_polyarea_t *main_contour, pcb_coord_t clipX1, pcb_coord_t clipY1, pcb_coord_t clipX2, pcb_coord_t clipY2, void (*emit)(pcb_pline_t *, void *), void *user_data); + +/* Add vertices in a fractional-circle starting from v centered at X, Y and + going counter-clockwise. Does not include the first point. Last argument is: + 1 for a full circle + 2 for a half circle + 4 for a quarter circle */ +void pcb_poly_frac_circle(pcb_pline_t * c, pcb_coord_t X, pcb_coord_t Y, pcb_vector_t v, int range); + +/* same but adds the last vertex */ +void pcb_poly_frac_circle_end(pcb_pline_t * c, pcb_coord_t X, pcb_coord_t Y, pcb_vector_t v, int range); + +#endif Index: trunk/src/librnd/poly/rtree.c =================================================================== --- trunk/src/librnd/poly/rtree.c (nonexistent) +++ trunk/src/librnd/poly/rtree.c (revision 29283) @@ -0,0 +1,174 @@ + /* + * COPYRIGHT + * + * pcb-rnd, interactive printed circuit board design + * Copyright (C) 2017 Tibor 'Igor2' Palinkas + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Contact: + * Project page: http://repo.hu/projects/pcb-rnd + * lead developer: http://repo.hu/projects/pcb-rnd/contact.html + * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") + */ + +#include "config.h" + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include "rtree2_compat.h" + +/* Temporary compatibility layer for the transition */ +pcb_rtree_t *pcb_r_create_tree(void) +{ + pcb_rtree_t *root = malloc(sizeof(pcb_rtree_t)); + pcb_rtree_init(root); + return root; +} + +void pcb_r_destroy_tree(pcb_rtree_t **tree) +{ + pcb_rtree_uninit(*tree); + free(*tree); + *tree = NULL; +} + +void pcb_r_insert_entry(pcb_rtree_t *rtree, const pcb_box_t *which) +{ + pcb_any_obj_t *obj = (pcb_any_obj_t *)which; /* assumes first field is the bounding box */ + assert(obj != NULL); + pcb_rtree_insert(rtree, obj, (pcb_rtree_box_t *)which); +} + +void pcb_r_insert_array(pcb_rtree_t *rtree, const pcb_box_t *boxlist[], pcb_cardinal_t len) +{ + pcb_cardinal_t n; + + if (len == 0) + return; + + assert(boxlist != 0); + + for(n = 0; n < len; n++) + pcb_r_insert_entry(rtree, boxlist[n]); +} + +pcb_bool pcb_r_delete_entry(pcb_rtree_t *rtree, const pcb_box_t *which) +{ + pcb_any_obj_t *obj = (pcb_any_obj_t *)which; /* assumes first field is the bounding box */ + assert(obj != NULL); + return pcb_rtree_delete(rtree, obj, (pcb_rtree_box_t *)which) == 0; +} + +pcb_bool pcb_r_delete_entry_free_data(pcb_rtree_t *rtree, const pcb_box_t *box, void (*free_data)(void *d)) +{ + pcb_any_obj_t *obj = (pcb_any_obj_t *)box; /* assumes first field is the bounding box */ + assert(obj != NULL); + if (pcb_rtree_delete(rtree, obj, (pcb_rtree_box_t *)box) != 0) + return pcb_false; + free_data(obj); + return pcb_true; +} + +typedef struct { + pcb_r_dir_t (*region_in_search)(const pcb_box_t *region, void *closure); + pcb_r_dir_t (*rectangle_in_region)(const pcb_box_t *box, void *closure); + void *clo; +} r_cb_t; + +static pcb_rtree_dir_t r_cb_node(void *ctx_, void *obj, const pcb_rtree_box_t *box) +{ + r_cb_t *ctx = (r_cb_t *)ctx_; + return ctx->region_in_search((const pcb_box_t *)box, ctx->clo); +} + +static pcb_rtree_dir_t r_cb_obj(void *ctx_, void *obj, const pcb_rtree_box_t *box) +{ + r_cb_t *ctx = (r_cb_t *)ctx_; + return ctx->rectangle_in_region((const pcb_box_t *)obj, ctx->clo); +} + + +pcb_r_dir_t pcb_r_search(pcb_rtree_t *rtree, const pcb_box_t *query, + pcb_r_dir_t (*region_in_search)(const pcb_box_t *region, void *closure), + pcb_r_dir_t (*rectangle_in_region)(const pcb_box_t *box, void *closure), + void *closure, int *num_found) +{ + pcb_r_dir_t res; + pcb_rtree_cardinal_t out_cnt; + r_cb_t ctx; + ctx.region_in_search = region_in_search; + ctx.rectangle_in_region = rectangle_in_region; + ctx.clo = closure; + + res = pcb_rtree_search_any(rtree, (const pcb_rtree_box_t *)query, + (ctx.region_in_search != NULL) ? r_cb_node : NULL, + (ctx.rectangle_in_region != NULL) ? r_cb_obj : NULL, + &ctx, &out_cnt); + + if (num_found != NULL) + *num_found = out_cnt; + + return res; +} + +int pcb_r_region_is_empty(pcb_rtree_t *rtree, const pcb_box_t *region) +{ + return pcb_rtree_is_box_empty(rtree, (const pcb_rtree_box_t *)region); +} + +static void r_print_obj(FILE *f, void *obj) +{ + fprintf(f, "\n", obj); +} + +void pcb_r_dump_tree(pcb_rtree_t *root, int unused) +{ + pcb_rtree_dump_text(stdout, root, r_print_obj); +} + +void pcb_r_free_tree_data(pcb_rtree_t *rtree, void (*free)(void *ptr)) +{ + pcb_rtree_it_t it; + void *o; + + for(o = pcb_rtree_all_first(&it, rtree); o != NULL; o = pcb_rtree_all_next(&it)) + free(o); +} + +pcb_box_t *pcb_r_first(pcb_rtree_t *tree, pcb_rtree_it_t *it) +{ + if (tree == NULL) + return NULL; + return (pcb_box_t *)pcb_rtree_all_first(it, tree); +} + +pcb_box_t *pcb_r_next(pcb_rtree_it_t *it) +{ + return (pcb_box_t *)pcb_rtree_all_next(it); +} + +void pcb_r_end(pcb_rtree_it_t *it) +{ +} Index: trunk/src/librnd/poly/rtree.h =================================================================== --- trunk/src/librnd/poly/rtree.h (nonexistent) +++ trunk/src/librnd/poly/rtree.h (revision 29283) @@ -0,0 +1,46 @@ + /* + * COPYRIGHT + * + * pcb-rnd, interactive printed circuit board design + * Copyright (C) 2017 Tibor 'Igor2' Palinkas + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Contact: + * Project page: http://repo.hu/projects/pcb-rnd + * lead developer: http://repo.hu/projects/pcb-rnd/contact.html + * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") + */ + +#ifndef PCB_RTREE_H +#define PCB_RTREE_H + +#include + +typedef long int pcb_rtree_cardinal_t; +typedef pcb_coord_t pcb_rtree_coord_t; + +/* Instantiate an rtree */ +#define RTR(n) pcb_rtree_ ## n +#define RTRU(n) pcb_RTREE_ ## n +#define pcb_rtree_privfunc static +#define pcb_rtree_size 6 +#define pcb_rtree_stack_max 1024 + +#define RTREE_NO_TREE_TYPEDEFS + +#include + +#endif /* PCB_RTREE_H */ Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 29282) +++ trunk/src/obj_line_drcenf.c (revision 29283) @@ -37,7 +37,7 @@ #include "board.h" #include "data.h" #include "find.h" -#include "rtree.h" +#include #include "macro.h" void pcb_line_adjust_attached(void) Index: trunk/src/obj_pinvia_therm.c =================================================================== --- trunk/src/obj_pinvia_therm.c (revision 29282) +++ trunk/src/obj_pinvia_therm.c (revision 29283) @@ -38,7 +38,7 @@ #include "board.h" #include "polygon.h" -#include "polygon1_gen.h" +#include #include "obj_pinvia_therm.h" static pcb_polyarea_t *pcb_pa_diag_line(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t l, pcb_coord_t w, pcb_bool rt) Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 29282) +++ trunk/src/obj_poly.c (revision 29283) @@ -35,7 +35,7 @@ #include "data.h" #include "undo.h" #include "polygon.h" -#include "polygon1_gen.h" +#include #include "polygon_offs.h" #include "rotate.h" #include "search.h" Index: trunk/src/obj_poly.h =================================================================== --- trunk/src/obj_poly.h (revision 29282) +++ trunk/src/obj_poly.h (revision 29283) @@ -34,7 +34,7 @@ #include "config.h" #include #include "obj_common.h" -#include "polyarea.h" +#include struct pcb_poly_s { /* holds information about a polygon */ PCB_ANY_PRIMITIVE_FIELDS; Index: trunk/src/obj_rat.c =================================================================== --- trunk/src/obj_rat.c (revision 29282) +++ trunk/src/obj_rat.c (revision 29283) @@ -33,7 +33,7 @@ #include "conf_core.h" #include #include "undo.h" -#include "rtree.h" +#include #include "search.h" #include "obj_line_draw.h" Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 29282) +++ trunk/src/obj_subc.c (revision 29283) @@ -44,7 +44,7 @@ #include "obj_line_op.h" #include "obj_term.h" #include "obj_text_draw.h" -#include "rtree.h" +#include #include "draw.h" #include "draw_wireframe.h" #include "flag.h" Index: trunk/src/obj_subc.h =================================================================== --- trunk/src/obj_subc.h (revision 29282) +++ trunk/src/obj_subc.h (revision 29283) @@ -110,7 +110,7 @@ Return NULL on error. */ pcb_layer_t *pcb_subc_get_layer(pcb_subc_t *sc, pcb_layer_type_t lyt, pcb_layer_combining_t comb, pcb_bool_t alloc, const char *name, pcb_bool req_name_match); -#include "rtree.h" +#include pcb_r_dir_t pcb_draw_subc_mark(const pcb_box_t *b, void *cl); /* low level version, does not do extobj */ pcb_r_dir_t draw_subc_mark_callback(const pcb_box_t *b, void *cl); pcb_r_dir_t draw_subc_label_callback(const pcb_box_t *b, void *cl); Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 29282) +++ trunk/src/polygon.c (revision 29283) @@ -51,7 +51,7 @@ #include "obj_poly_draw.h" #include "obj_text_draw.h" #include "polygon_selfi.h" -#include "polygon1_gen.h" +#include #include #define UNSUBTRACT_BLOAT 10 Index: trunk/src/polygon.h =================================================================== --- trunk/src/polygon.h (revision 29282) +++ trunk/src/polygon.h (revision 29283) @@ -34,9 +34,9 @@ #include "config.h" #include "flag.h" -#include "rtree.h" +#include #include -#include "polyarea.h" +#include #include "rtree2_compat.h" Index: trunk/src/polygon_selfi.h =================================================================== --- trunk/src/polygon_selfi.h (revision 29282) +++ trunk/src/polygon_selfi.h (revision 29283) @@ -27,7 +27,7 @@ /* Resolve polygon self intersections */ #include -#include "polyarea.h" +#include /* Returns whether a polyline is self-intersecting. O(n^2) */ pcb_bool pcb_pline_is_selfint(pcb_pline_t *pl); Index: trunk/src/route.c =================================================================== --- trunk/src/route.c (revision 29282) +++ trunk/src/route.c (revision 29283) @@ -37,7 +37,7 @@ #include "extobj.h" #include "find.h" #include "polygon.h" -#include "rtree.h" +#include #include "route.h" #include "undo.h" #include "obj_line_draw.h" Index: trunk/src/rtree2_compat.h =================================================================== --- trunk/src/rtree2_compat.h (revision 29282) +++ trunk/src/rtree2_compat.h (revision 29283) @@ -41,7 +41,7 @@ #ifndef PCB_RTREE2_COMPAT_H #define PCB_RTREE2_COMPAT_H -#include "rtree.h" +#include /* callback direction to the search engine */ typedef enum pcb_r_dir_e { Index: trunk/src/search_r.h =================================================================== --- trunk/src/search_r.h (revision 29282) +++ trunk/src/search_r.h (revision 29283) @@ -29,7 +29,7 @@ #ifndef PCB_SEARCH_R_H #define PCB_SEARCH_R_H -#include "rtree.h" +#include /* Search data for given object types within a box using the usual rtree conventions for the callback */ pcb_r_dir_t pcb_search_data_by_loc(pcb_data_t *data, pcb_objtype_t type, const pcb_box_t *query_box, pcb_r_dir_t (*cb_)(void *closure, pcb_any_obj_t *obj, void *box), void *closure); Index: trunk/src/thermal.h =================================================================== --- trunk/src/thermal.h (revision 29282) +++ trunk/src/thermal.h (revision 29283) @@ -29,7 +29,7 @@ #include "obj_common.h" #include "layer.h" -#include "polygon1_gen.h" +#include typedef enum pcb_thermal_e { /* bit 0 and 1: shape */ Index: trunk/src/tool_buffer.c =================================================================== --- trunk/src/tool_buffer.c (revision 29282) +++ trunk/src/tool_buffer.c (revision 29283) @@ -40,7 +40,7 @@ #include #include "data.h" #include -#include "rtree.h" +#include #include "search.h" #include "tool.h" #include "undo.h" Index: trunk/src_plugins/acompnet/meshgraph.h =================================================================== --- trunk/src_plugins/acompnet/meshgraph.h (revision 29282) +++ trunk/src_plugins/acompnet/meshgraph.h (revision 29283) @@ -1,6 +1,6 @@ #ifndef PCB_ACOMPNET_MESHGRAPH_H #define PCB_ACOMPNET_MESHGRAPH_H -#include "rtree.h" +#include #include #include Index: trunk/src_plugins/autoplace/autoplace.c =================================================================== --- trunk/src_plugins/autoplace/autoplace.c (revision 29282) +++ trunk/src_plugins/autoplace/autoplace.c (revision 29283) @@ -57,7 +57,7 @@ #include #include "layer.h" #include "intersect.h" -#include "rtree.h" +#include #include "macro.h" #include "move.h" #include "netlist.h" Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 29282) +++ trunk/src_plugins/autoroute/autoroute.c (revision 29283) @@ -73,7 +73,7 @@ #include #include "find.h" #include -#include "rtree.h" +#include #include "netlist.h" #include "mtspace.h" #include "polygon.h" Index: trunk/src_plugins/autoroute/mtspace.c =================================================================== --- trunk/src_plugins/autoroute/mtspace.c (revision 29282) +++ trunk/src_plugins/autoroute/mtspace.c (revision 29283) @@ -49,7 +49,7 @@ #include #include -#include "rtree.h" +#include #include "mtspace.h" #include "vector.h" #include "rtree2_compat.h" Index: trunk/src_plugins/dialogs/dlg_pinout.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pinout.c (revision 29282) +++ trunk/src_plugins/dialogs/dlg_pinout.c (revision 29283) @@ -30,7 +30,7 @@ #include "obj_subc_parent.h" #include "draw.h" #include "obj_term.h" -#include "rtree.h" +#include #include "search.h" #include "search_r.h" #include "netlist.h" Index: trunk/src_plugins/distalign/distalign.c =================================================================== --- trunk/src_plugins/distalign/distalign.c (revision 29282) +++ trunk/src_plugins/distalign/distalign.c (revision 29283) @@ -21,7 +21,7 @@ #include "config.h" #include "data.h" #include -#include "rtree.h" +#include #include "undo.h" #include #include "move.h" Index: trunk/src_plugins/distaligntext/distaligntext.c =================================================================== --- trunk/src_plugins/distaligntext/distaligntext.c (revision 29282) +++ trunk/src_plugins/distaligntext/distaligntext.c (revision 29283) @@ -24,7 +24,7 @@ #include "board.h" #include "data.h" #include -#include "rtree.h" +#include #include "undo.h" #include #include "move.h" Index: trunk/src_plugins/fontmode/fontmode.c =================================================================== --- trunk/src_plugins/fontmode/fontmode.c (revision 29282) +++ trunk/src_plugins/fontmode/fontmode.c (revision 29283) @@ -47,7 +47,7 @@ #include "layer.h" #include "move.h" #include "remove.h" -#include "rtree.h" +#include #include "flag_str.h" #include "undo.h" #include Index: trunk/src_plugins/import_ipcd356/ipcd356.c =================================================================== --- trunk/src_plugins/import_ipcd356/ipcd356.c (revision 29282) +++ trunk/src_plugins/import_ipcd356/ipcd356.c (revision 29283) @@ -40,7 +40,7 @@ #include #include #include -#include "rtree.h" +#include #include "../src_plugins/lib_compat_help/pstk_help.h" Index: trunk/src_plugins/io_eagle/read.c =================================================================== --- trunk/src_plugins/io_eagle/read.c (revision 29282) +++ trunk/src_plugins/io_eagle/read.c (revision 29283) @@ -38,7 +38,7 @@ #include "conf_core.h" #include #include "polygon.h" -#include "rtree.h" +#include #include #include "undo.h" #include Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 29282) +++ trunk/src_plugins/io_pcb/file.c (revision 29283) @@ -53,7 +53,7 @@ #include "parse_common.h" #include #include "polygon.h" -#include "polygon1_gen.h" +#include #include "remove.h" #include "flag_str.h" #include Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 29282) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 29283) @@ -118,7 +118,7 @@ #include "parse_l.h" #include "polygon.h" #include "remove.h" -#include "rtree.h" +#include #include "flag_str.h" #include "obj_pinvia_therm.h" #include "rats_patch.h" Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 29282) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 29283) @@ -41,7 +41,7 @@ #include "parse_l.h" #include "polygon.h" #include "remove.h" -#include "rtree.h" +#include #include "flag_str.h" #include "obj_pinvia_therm.h" #include "rats_patch.h" Index: trunk/src_plugins/io_tedax/tetest.c =================================================================== --- trunk/src_plugins/io_tedax/tetest.c (revision 29282) +++ trunk/src_plugins/io_tedax/tetest.c (revision 29283) @@ -37,7 +37,7 @@ #include #include #include "tetest.h" -#include "rtree.h" +#include #include "obj_subc_parent.h" #include "obj_pstk.h" #include "obj_pstk_inlines.h" Index: trunk/src_plugins/jostle/jostle.c =================================================================== --- trunk/src_plugins/jostle/jostle.c (revision 29282) +++ trunk/src_plugins/jostle/jostle.c (revision 29283) @@ -21,10 +21,10 @@ #include "board.h" #include "data.h" #include -#include "rtree.h" +#include #include "undo.h" #include "polygon.h" -#include "polygon1_gen.h" +#include #include "remove.h" #include #include Index: trunk/src_plugins/lib_compat_help/pstk_compat.c =================================================================== --- trunk/src_plugins/lib_compat_help/pstk_compat.c (revision 29282) +++ trunk/src_plugins/lib_compat_help/pstk_compat.c (revision 29283) @@ -31,7 +31,7 @@ #include "pstk_compat.h" #include "obj_pstk_inlines.h" #include -#include "polygon1_gen.h" +#include #include "plug_io.h" Index: trunk/src_plugins/lib_hid_gl/hidgl.c =================================================================== --- trunk/src_plugins/lib_hid_gl/hidgl.c (revision 29282) +++ trunk/src_plugins/lib_hid_gl/hidgl.c (revision 29283) @@ -37,7 +37,7 @@ #include #include #include "hidgl.h" -#include "rtree.h" +#include #include #include "draw_gl.c" Index: trunk/src_plugins/lib_polyhelp/topoly.c =================================================================== --- trunk/src_plugins/lib_polyhelp/topoly.c (revision 29282) +++ trunk/src_plugins/lib_polyhelp/topoly.c (revision 29283) @@ -32,7 +32,7 @@ #include "topoly.h" #include -#include "rtree.h" +#include #include "data.h" #include "obj_arc.h" #include "obj_line.h" Index: trunk/src_plugins/millpath/toolpath.c =================================================================== --- trunk/src_plugins/millpath/toolpath.c (revision 29282) +++ trunk/src_plugins/millpath/toolpath.c (revision 29283) @@ -44,9 +44,9 @@ #include "obj_poly_op.h" #include "obj_text_draw.h" #include "polygon.h" -#include "polygon1_gen.h" +#include #include "funchash_core.h" -#include "rtree.h" +#include #include "src_plugins/lib_polyhelp/polyhelp.h" #include "src_plugins/ddraft/centgeo.h" Index: trunk/src_plugins/polycombine/polycombine.c =================================================================== --- trunk/src_plugins/polycombine/polycombine.c (revision 29282) +++ trunk/src_plugins/polycombine/polycombine.c (revision 29283) @@ -20,9 +20,9 @@ #include "remove.h" #include #include -#include "rtree.h" +#include #include "polygon.h" -#include "polyarea.h" +#include #include "assert.h" #include "flag_str.h" #include "find.h" Index: trunk/src_plugins/polystitch/polystitch.c =================================================================== --- trunk/src_plugins/polystitch/polystitch.c (revision 29282) +++ trunk/src_plugins/polystitch/polystitch.c (revision 29283) @@ -22,7 +22,7 @@ #include "remove.h" #include #include -#include "rtree.h" +#include #include "draw.h" #include "polygon.h" #include Index: trunk/src_plugins/puller/puller.c =================================================================== --- trunk/src_plugins/puller/puller.c (revision 29282) +++ trunk/src_plugins/puller/puller.c (revision 29283) @@ -66,7 +66,7 @@ #include "move.h" #include #include "remove.h" -#include "rtree.h" +#include #include "flag_str.h" #include "undo.h" #include "layer.h" Index: trunk/src_plugins/renumber/renumberblock.c =================================================================== --- trunk/src_plugins/renumber/renumberblock.c (revision 29282) +++ trunk/src_plugins/renumber/renumberblock.c (revision 29283) @@ -19,7 +19,7 @@ #include #include "data.h" #include -#include "rtree.h" +#include #include "undo.h" #include #include "change.h" Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 29282) +++ trunk/src_plugins/report/report.c (revision 29283) @@ -47,7 +47,7 @@ #include "drill.h" #include #include "search.h" -#include "rtree.h" +#include #include "flag_str.h" #include "macro.h" #include "undo.h" Index: trunk/src_plugins/serpentine/serpentine.c =================================================================== --- trunk/src_plugins/serpentine/serpentine.c (revision 29282) +++ trunk/src_plugins/serpentine/serpentine.c (revision 29283) @@ -36,7 +36,7 @@ #include #include "search.h" #include "tool.h" -#include "rtree.h" +#include #include "flag_str.h" #include "macro.h" #include "undo.h" Index: trunk/src_plugins/smartdisperse/smartdisperse.c =================================================================== --- trunk/src_plugins/smartdisperse/smartdisperse.c (revision 29282) +++ trunk/src_plugins/smartdisperse/smartdisperse.c (revision 29283) @@ -23,7 +23,7 @@ #include "board.h" #include "data.h" #include -#include "rtree.h" +#include #include "undo.h" #include "netlist.h" #include Index: trunk/src_plugins/teardrops/teardrops.c =================================================================== --- trunk/src_plugins/teardrops/teardrops.c (revision 29282) +++ trunk/src_plugins/teardrops/teardrops.c (revision 29283) @@ -20,7 +20,7 @@ #include "board.h" #include "data.h" #include -#include "rtree.h" +#include #include "undo.h" #include #include Index: trunk/tests/librnd/inc_all.h.in =================================================================== --- trunk/tests/librnd/inc_all.h.in (revision 29282) +++ trunk/tests/librnd/inc_all.h.in (revision 29283) @@ -2,7 +2,7 @@ gsub /local/objs { } {\n} foreach /local/h in /local/objs - sub /local/h {^[$](LIBRND)/core/} {} - print [@#include + sub /local/h {^[$](LIBRND)/} {} + print [@#include @] end Index: trunk/tests/librnd/librnd_test.c =================================================================== --- trunk/tests/librnd/librnd_test.c (revision 29282) +++ trunk/tests/librnd/librnd_test.c (revision 29283) @@ -6,7 +6,7 @@ #include #include #include -#include +#include /*** hidlib glue ***/