city_generator2

Generated conformal 3D meshes representing a city
git clone git://git.meso-star.fr/city_generator2.git
Log | Files | Refs | README | LICENSE

commit 0961df4c3b1edc1119551d3b8938effcc2ca241c
parent 963a84d7a81787682958668796a7d66a3c138131
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Thu, 26 Jan 2023 15:35:20 +0100

Spacing

Diffstat:
Msrc/cg_ground.c | 19+++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/cg_ground.c b/src/cg_ground.c @@ -37,7 +37,6 @@ ground_build_cad struct scad_geometry** list = NULL; struct scad_geometry* surface = NULL; size_t i, count = 0; - ASSERT(city && ground); @@ -58,10 +57,10 @@ ground_build_cad ERR(scad_geometry_boundary(NULL, &ground->box, 1, &bound)); ERR(scad_geometry_explode(bound, NULL, &list, &count)); - - ground->boundary = MEM_CALLOC(allocator, 6, sizeof(struct scad_geometry*)); - for (i = 0; i < count; i++){ + ground->boundary = MEM_CALLOC(allocator, 6, sizeof(struct scad_geometry*)); + + for (i = 0; i < count; i++) { double center[3]; size_t center_n; double N[3]; @@ -73,7 +72,7 @@ ground_build_cad ERR(scad_geometry_normal(list[i], center, N, NULL, &surface)); if (N[0] == 0 && N[1] == 0 && N[2] == -1) { - ERR(scad_geometry_copy(surface, "ground_B_bottom", &ground->boundary[0])); + ERR(scad_geometry_copy(surface, "ground_B_bottom", &ground->boundary[0])); } if (N[0] == 0 && N[1] == 0 && N[2] == 1) { @@ -82,21 +81,21 @@ ground_build_cad } if (N[0] == -1 && N[1] == 0 && N[2] == 0) { - ERR(scad_geometry_copy(surface, "ground_B_lateral_0", &ground->boundary[2])); + ERR(scad_geometry_copy(surface, "ground_B_lateral_0", &ground->boundary[2])); } if (N[0] == 1 && N[1] == 0 && N[2] == 0) { - ERR(scad_geometry_copy(surface, "ground_B_lateral_1", &ground->boundary[3])); + ERR(scad_geometry_copy(surface, "ground_B_lateral_1", &ground->boundary[3])); } if (N[0] == 0 && N[1] == -1 && N[2] == 0) { - ERR(scad_geometry_copy(surface, "ground_B_lateral_2", &ground->boundary[4])); + ERR(scad_geometry_copy(surface, "ground_B_lateral_2", &ground->boundary[4])); } if (N[0] == 0 && N[1] == 1 && N[2] == 0) { - ERR(scad_geometry_copy(surface, "ground_B_lateral_3", &ground->boundary[5])); + ERR(scad_geometry_copy(surface, "ground_B_lateral_3", &ground->boundary[5])); } - } + } exit: