commit 69465ea04d1d86073aad996ecbe66a2030ee8aa8
parent a5fea5bfd300b77d9995f190e357b0f1c9c3ee23
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Mon, 21 Oct 2024 15:08:16 +0200
Make glazing thickness a parameter
Its value is defined in config.mk.
Diffstat:
5 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
@@ -76,6 +76,7 @@ src/cg_default.h: config.mk src/cg_default.h.in
-e 's/@CG2_CLOSE_NEIGHBOR_DISTANCE@/$(CG2_CLOSE_NEIGHBOR_DISTANCE)/' \
-e 's/@CG2_MIN_DISTANCE_TO_MAP_LIMITS@/$(CG2_MIN_DISTANCE_TO_MAP_LIMITS)/' \
-e 's/@CG2_MIN_WINDOWS_WIDTH@/$(CG2_MIN_WINDOWS_WIDTH)/' \
+ -e 's/@CG2_GLAZING_THICKNESS@/$(CG2_GLAZING_THICKNESS)/' \
$@.in > $@
src/cg_version.h: config.mk src/cg_version.h.in
diff --git a/config.mk b/config.mk
@@ -23,6 +23,8 @@ CG2_CLOSE_NEIGHBOR_DISTANCE = 2
CG2_MIN_DISTANCE_TO_MAP_LIMITS = 2
# Minimum width for windows or they are not created (in m)
CG2_MIN_WINDOWS_WIDTH = 0.1
+# Glazing thickness
+CG2_GLAZING_THICKNESS = 0.024
################################################################################
# Tools
diff --git a/src/cg_construction_mode_1.c b/src/cg_construction_mode_1.c
@@ -955,7 +955,7 @@ build_windows
ERR(darray_geometries_push_back(&hole_array, &hole));
ERR(scad_geometry_ref_put(hole));
hole = NULL;
- d3_muld(dir, N, 0.024);
+ d3_muld(dir, N, CG2_GLAZING_THICKNESS);
ERR(str_printf(&name, "glass_%lu", (long unsigned)i));
ERR(scad_geometry_extrude(win_surface, str_cget(&name), dir, &glass));
ERR(darray_geometries_push_back(&glass_array, &glass));
@@ -1330,7 +1330,7 @@ build_fake_ground
struct scad_geometry* footprint = NULL;
struct scad_geometry* geom = NULL;
- ASSERT(cad && ground );
+ ASSERT(cad && ground);
darray_geometries_init(cad->building->city->allocator, &array);
diff --git a/src/cg_construction_mode_2.c b/src/cg_construction_mode_2.c
@@ -1028,7 +1028,7 @@ build_windows
ERR(str_printf(&name, "hole_%lu_w%lu", (long unsigned)i, (long unsigned)n));
ERR(scad_geometry_extrude(win_surface, str_cget(&name), dir, &hole));
ERR(darray_geometries_push_back(&hole_array, &hole));
- d3_muld(dir, N, 0.024);
+ d3_muld(dir, N, CG2_GLAZING_THICKNESS);
ERR(str_printf(&name, "glass_%lu_w%lu", (long unsigned)i, (long unsigned)n));
ERR(scad_geometry_extrude(win_surface, str_cget(&name), dir, &glass));
ERR(darray_geometries_push_back(&glass_array, &glass));
diff --git a/src/cg_default.h.in b/src/cg_default.h.in
@@ -24,5 +24,6 @@
#define CG2_CLOSE_NEIGHBOR_DISTANCE @CG2_CLOSE_NEIGHBOR_DISTANCE@
#define CG2_MIN_DISTANCE_TO_MAP_LIMITS @CG2_MIN_DISTANCE_TO_MAP_LIMITS@
#define CG2_MIN_WINDOWS_WIDTH @CG2_MIN_WINDOWS_WIDTH@
+#define CG2_GLAZING_THICKNESS @CG2_GLAZING_THICKNESS@
#endif