foo
[meshfrac] / src / geom.c
index 81e9df4..4e30628 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <assert.h>
 #include "geom.h"
 #include "dynarr.h"
 
@@ -130,6 +131,12 @@ float ray_poly(const cgm_ray *ray, const struct poly *poly)
        return t;
 }
 
+int init_poly(struct poly *p)
+{
+       p->verts = dynarr_alloc(0, sizeof *p->verts);
+       assert(p->verts);
+       return p->verts ? 0 : -1;
+}
 
 /* returns:
  *  1 -> both inside