Permalink
Browse files

update ct-head, minor updates hull, isec, polygon

  • Loading branch information...
Karsten Schmidt
Karsten Schmidt committed Sep 21, 2016
1 parent 68ae847 commit 9c0762b115fffe81a705a1d5d59f1c19e033203e
Showing with 6 additions and 5 deletions.
  1. +1 −1 ext/ct-head
  2. +1 −1 src/geom/hull.c
  3. +3 −2 src/geom/isec.c
  4. +1 −1 src/geom/polygon.c
Submodule ct-head updated 3 files
+3 −2 cleanup
+10 −0 features.h
+18 −2 math.h
View
@@ -3,7 +3,7 @@
static size_t hull2f(CT_Vec2f *points, size_t num, CT_Vector *h) {
size_t len = 0;
for (size_t i = 0; i < num; i++) {
while (len >= 2 &&
while (CT_LIKELY(len >= 2) &&
ct_cross2fv3(&((CT_Vec2f *)h->buffer)[h->num - 2],
&((CT_Vec2f *)h->buffer)[h->num - 1],
&points[i]) >= 0) {
View
@@ -18,10 +18,11 @@ ct_export int ct_intersect_lines(const CT_Vec2f *a,
if (det == 0) {
return -1;
}
det = 1 / det;
float acx = a->x - c->x;
float acy = a->y - c->y;
*alpha = (dcx * acy - dcy * acx) / det;
*beta = (bax * acy - bay * acx) / det;
*alpha = (dcx * acy - dcy * acx) * det;
*beta = (bax * acy - bay * acx) * det;
ct_mix2fv(a, b, *alpha, isec);
return (0 < *alpha && *alpha < 1) && (0 < *beta && *beta < 1);
}
View
@@ -362,7 +362,7 @@ static CT_Cons *compute_offset_vertices(CT_PolyOffsetContext *ctx,
}
const int outward = dist > 0;
const int meterLimit = 1 - (ctx->res < 0);
CT_INFO("res: %d, ml: %d", ctx->res, meterLimit);
CT_DEBUG("res: %d, ml: %d", ctx->res, meterLimit);
dist = fabs(dist);
CT_Cons *vertices = NULL, *vcurr = NULL;
for (i = 0; i < numE; i++) {

0 comments on commit 9c0762b

Please sign in to comment.