From 883926daacb6e2e30300abc7ecb413c787eca911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Fri, 24 Aug 2018 10:54:49 +0300 Subject: [PATCH] Triang lattice generation fixes; now finally working Former-commit-id: 27a609231d8a262ebbf93e68f400c664480f5f06 --- qpms/lattices.h | 2 ++ qpms/lattices2d.c | 1 + 2 files changed, 3 insertions(+) diff --git a/qpms/lattices.h b/qpms/lattices.h index d8c063d..f0bc038 100644 --- a/qpms/lattices.h +++ b/qpms/lattices.h @@ -16,6 +16,7 @@ static inline point2d point2d_fromxy(const double x, const double y) { point2d p; p.x = x; p.y = y; + return p; } /* @@ -40,6 +41,7 @@ typedef struct { // returns a copy but scaled by a factor points2d_rordered_t *points2d_rordered_scale(const points2d_rordered_t *orig, double factor); + void points2d_rordered_free(points2d_rordered_t *); // use only for result of points2d_rordered_scale static inline point2d points2d_rordered_get_point(const points2d_rordered_t *ps, int r_order, int i) { diff --git a/qpms/lattices2d.c b/qpms/lattices2d.c index d5b9f20..2a4c480 100644 --- a/qpms/lattices2d.c +++ b/qpms/lattices2d.c @@ -295,6 +295,7 @@ static void trilatgen_sort_pointlist(triangular_lattice_gen_t *g) { triangular_lattice_gen_t * triangular_lattice_gen_init(double a, TriangularLatticeOrientation ori, bool include_origin) { triangular_lattice_gen_t *g = malloc(sizeof(triangular_lattice_gen_t)); + g->a = a; g->orientation = ori; g->includes_origin = include_origin; g->ps.nrs = 0;