Index: trunk/src/libcschem/intersect.c =================================================================== --- trunk/src/libcschem/intersect.c (revision 2240) +++ trunk/src/libcschem/intersect.c (revision 2241) @@ -41,6 +41,7 @@ csch_inline void isc_append(g2d_vect_t **dst, long *dst_len, g2d_vect_t *src, long src_len) { long n; + for(n = 0; n < src_len; n++) { if (*dst_len == 0) return; @@ -53,18 +54,26 @@ csch_inline long isc_ll(csch_line_t *l1, csch_line_t *l2, g2d_vect_t *iscp, long iscp_len) { - g2d_vect_t ip[2]; - int res = g2d_iscp_cline_cline(&l1->inst.c, &l2->inst.c, ip, NULL); - isc_append(&iscp, &iscp_len, ip, res); - return res; + if (iscp != NULL) { + g2d_vect_t ip[2]; + int res = g2d_iscp_cline_cline(&l1->inst.c, &l2->inst.c, ip, NULL); + isc_append(&iscp, &iscp_len, ip, res); + return res; + } + else + return g2d_isc_sline_sline(&l1->inst, &l2->inst); } csch_inline long isc_la(csch_line_t *l, csch_arc_t *a, g2d_vect_t *iscp, long iscp_len) { - g2d_vect_t ip[2]; - int res = g2d_iscp_cline_carc(&l->inst.c, &a->inst.c, ip, NULL, 0); - isc_append(&iscp, &iscp_len, ip, res); - return 0; + if (iscp != NULL) { + g2d_vect_t ip[2]; + int res = g2d_iscp_cline_carc(&l->inst.c, &a->inst.c, ip, NULL, 0); + isc_append(&iscp, &iscp_len, ip, res); + return 0; + } + else + return g2d_isc_sline_sarc(&l->inst, &a->inst); } csch_inline long isc_aa(csch_arc_t *a1, csch_arc_t *a2, g2d_vect_t *iscp, long iscp_len) @@ -79,6 +88,7 @@ csch_inline long isc_pp(csch_cpoly_t *p1, csch_cpoly_t *p2, g2d_vect_t *iscp, long iscp_len) { + return 0; } Index: trunk/src/libcschem/intersect.h =================================================================== --- trunk/src/libcschem/intersect.h (revision 2240) +++ trunk/src/libcschem/intersect.h (revision 2241) @@ -27,5 +27,10 @@ #include /* Return number of intersections between o1 and o2; optionally loads iscp - with intersection points, up to iscp_len */ + with intersection points, up to iscp_len. If iscp is NULL, precise + intersection caclulation is done usign thickness of objects and the number + of different object-object intersections is returned. If iscp is not NULL, + only centerline-intersections are considered and iscp coords are all on + object centerlines (number of total centerline iscs returned, may be + larger than iscp_len) */ long csch_obj_intersect_obj(csch_sheet_t *sheet, csch_chdr_t *o1, csch_chdr_t *o2, g2d_vect_t *iscp, long iscp_len);