star-3dut

Generate meshes of simple geometric shapes
git clone git://git.meso-star.fr/star-3dut.git
Log | Files | Refs | README | LICENSE

commit 73e8141584499c43109af684e56e1696e2274421
parent 088b3fc08a1e7d29818a77b5cbe96964db5e5c5d
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Mon,  9 Oct 2017 15:57:49 +0200

Change an offset from unsigned to size_t + adequate cleaning.

Diffstat:
Msrc/s3dut_cylinder.c | 12++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/s3dut_cylinder.c b/src/s3dut_cylinder.c @@ -73,7 +73,7 @@ setup_cylinder_coords static size_t* setup_cylinder_indices (size_t* ids, - const unsigned offset, + const size_t offset, const unsigned nslices, const unsigned nstacks, const int close_bottom, @@ -260,23 +260,19 @@ s3dut_create_thick_cylinder id_offset = coords_in - coords_out; ASSERT(id_offset % 3 == 0); id_offset /= 3; - ASSERT(id_offset <= UINT_MAX); setup_cylinder_coords(coords_in, radius - thickness, close_bottom ? -0.5*height + thickness : -0.5*height, close_top ? +0.5*height -thickness : +0.5*height, nslices, nstacks, close_bottom, close_top); ids_walls = setup_cylinder_indices - (ids_in, (unsigned)id_offset, nslices, nstacks, close_bottom, close_top, 0); + (ids_in, id_offset, nslices, nstacks, close_bottom, close_top, 0); /* Close walls where the cylinder is open */ - ASSERT((coords_in - coords_out) % 3 == 0); if(!close_bottom) { - ids_walls = close_wall(ids_walls, 0, (coords_in - coords_out) / 3, - nslices, nstacks, 1); + ids_walls = close_wall(ids_walls, 0, id_offset, nslices, nstacks, 1); } if(!close_top) { - close_wall(ids_walls, nstacks, (coords_in - coords_out) / 3 + nstacks, - nslices, nstacks, 0); + close_wall(ids_walls, nstacks, id_offset + nstacks, nslices, nstacks, 0); } exit: