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 d82bffd1aa4bdfbdb9b8dc555c2cab1ebb3e0119
parent 69465ea04d1d86073aad996ecbe66a2030ee8aa8
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Fri, 20 Dec 2024 16:17:50 +0100

Improve windows Z positioning

Diffstat:
Msrc/cg_construction_mode_2.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/cg_construction_mode_2.c b/src/cg_construction_mode_2.c @@ -878,6 +878,7 @@ build_windows #define CG2_MODE2_WINDOWS_MAX_WIDTH 3.0 #define CG2_MODE2_WINDOWS_MIN_SPACING 0.4 #define CG2_MODE2_WINDOWS_HEIGHT_RATIO 0.6 +#define CG2_MODE2_WINDOWS_WALL_FRACTION_ABOVE 0.1 if(!removed_wall) { double window_height, expected_total_width_from_ratio; @@ -953,8 +954,9 @@ build_windows + best_wc_spacing + (double)n * (best_wc_spacing + best_wc_width); dxdydz[0] = -N[1] * offset; dxdydz[1] = N[0] * offset; - /* Windows are in the upper part of the wall (not vertically centered) */ - dxdydz[2] = (wall_height - window_height) * 0.2; + /* Apply requested Z positioning */ + dxdydz[2] = (wall_height - window_height) * 0.5 + - CG2_MODE2_WINDOWS_WALL_FRACTION_ABOVE * wall_height; ERR(str_printf(&name, "surface+_%lu_w%lu", (long unsigned)i, (long unsigned)n)); /* surface_ is used to check for neighbor compatibility with a slitghly