star-enclosures-3d

Extract enclosures from 3D geometry
git clone git://git.meso-star.fr/star-enclosures-3d.git
Log | Files | Refs | README | LICENSE

commit 3f7451e5466f6d867b003563a003fe87ac1d9fa7
parent 014908213d57220cdf6803703527211d552f37c7
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Fri, 16 Mar 2018 13:44:34 +0100

Change many triangles test to increase #triangle and decrease #enclosure

Diffstat:
Msrc/test_senc_many_triangles.c | 13+++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/test_senc_many_triangles.c b/src/test_senc_many_triangles.c @@ -74,6 +74,7 @@ main(int argc, char** argv) struct senc_scene* scn = NULL; struct s3dut_mesh* cyl = NULL; struct s3dut_context ctx; + unsigned m0 = 0, m1; unsigned count; unsigned cyl_trg_count, cyl_vrtx_count, i; char dump[64]; @@ -84,7 +85,7 @@ main(int argc, char** argv) CHK(senc_device_create (NULL, &allocator, SENC_NTHREADS_DEFAULT, 1, &dev) == RES_OK); -#define NB_CYL 8 +#define NB_CYL 4 /* Create the scene */ CHK(senc_scene_create(dev, NB_CYL+1, &scn) == RES_OK); @@ -93,17 +94,17 @@ main(int argc, char** argv) ctx.ctx.scale = 1; ctx.ctx.reverse_vrtx = 0; ctx.ctx.reverse_med = 0; - ctx.ctx.back_media = medium0; - /* Create a cylinder (320 K trg, 160 K vrtx). */ - CHK(s3dut_create_cylinder(&allocator, 1, 2, 640, 500, &cyl) == RES_OK); + ctx.ctx.back_media = &m0; + ctx.ctx.front_media = &m1; + /* A 2,562,560 triangles 1,281,282 vertices cylinder template */ + CHK(s3dut_create_cylinder(&allocator, 1, 2, 1280, 1000, &cyl) == RES_OK); S3DUT(mesh_get_data(cyl, &ctx.data)); ASSERT(ctx.data.nprimitives < UINT_MAX); ASSERT(ctx.data.nvertices < UINT_MAX); cyl_trg_count = (unsigned)ctx.data.nprimitives; cyl_vrtx_count = (unsigned)ctx.data.nvertices; FOR_EACH(i, 0, NB_CYL) { - unsigned mmm = i; - ctx.ctx.front_media = &mmm; + m1 = i; d3(ctx.ctx.offset, 0, 0, i * 10); CHK(senc_scene_add_geometry(scn, cyl_trg_count, get_s3dut_indices, get_s3dut_media, NULL, cyl_vrtx_count, get_s3dut_position, &ctx)