#ifndef cirpack_H #define cirpack_H /* Routines for circle packing. */ /* Last edited on 2005-02-04 06:30:43 by stolfi */ #include #include #include #include #include #include #include #include r2_vec_t cpk_get_valid_points ( r2_t o, /* Grid's reference point. */ r2_t u, /* Grid's X axis. */ double step, /* Grid step. */ r2_vec_t R, /* Vertices of polygon, ccw around interior. */ r2_vec_t P, /* Forbidden points. */ double dP, /* Minimum distance from forbidden points. */ r2_vec_t L, /* Vertices of forbidden polygonal lines. */ double dL /* Minimum distance from forbidden lines. */ ); /* Returns the list {V} of all points from a certain grid {G} that lie inside a given polygon {R}, are at least {dP} away from a given set of points {P}, and at least {dL} away from given polygonal line(s) {L}. The grid {G} is an hexagonal grid that includes the point {o} and such that the distance between nearest points is {step} along the direction of vector {u}. The enclosing polygon is specified by its vertices {R[0..]}. The even-odd rule is used to determine the interior points, so holes can be obtained by including their vertices too in the list {R}. The list {R} is assumed to be circular, so the polygon is always closed. Similarly, the forbidden polygonal lines are defined by their vertices {L[0..]}. Like {R}, the list {L} is implicitly closed. However open and/or multiple lines can be specified by inserting a dummy vertex with infinite coordinates after each connected piece. */ i2_vec_t cpk_incompat_edges (r2_vec_t V, double d_min); /* Given a list of points {V[0..]}, returns a list of all pairs {(i,j)} such that {i