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 0088efdaab3a8ded2b626fdabdeccb2cdddf6512
parent 462e39a5b33b73c773dd2909f9be3536ac620efc
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Wed,  6 Sep 2023 10:43:39 +0200

Merge branch 'release_0.5.5'

Diffstat:
MREADME.md | 5+++++
Mcmake/CMakeLists.txt | 3++-
Msrc/senc3d.h | 2+-
Msrc/senc3d_scene_analyze.c | 75+++++++++++++++++++++++++++++++++++++++------------------------------------
Asrc/test_senc3d_bad_grouping.c | 623+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/test_senc3d_cube_behind_cube.c | 2+-
Msrc/test_senc3d_enclosure.c | 2+-
Msrc/test_senc3d_scene.c | 2+-
Msrc/test_senc3d_unspecified_medium.c | 4++--
9 files changed, 675 insertions(+), 43 deletions(-)

diff --git a/README.md b/README.md @@ -39,6 +39,11 @@ variable the install directories of its dependencies. Release notes ------------- +### Version 0.5.5 + +- Fixes a crash linked to numerical accuracy that caused connex components + grouping to loop forever. + ### Version 0.5.4 - Fixes the (rare) situation where temporary local variables could be used in diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -64,7 +64,7 @@ endif() ############################################################################### set(VERSION_MAJOR 0) set(VERSION_MINOR 5) -set(VERSION_PATCH 4) +set(VERSION_PATCH 5) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) set(SENC3D_FILES_SRC @@ -148,6 +148,7 @@ if(NOT NO_TEST) register_test(${_name} ${_name}) endfunction() + new_test(test_senc3d_bad_grouping) new_test(test_senc3d_cube_behind_cube) new_test(test_senc3d_cube_in_cube) new_test(test_senc3d_cube_on_cube) diff --git a/src/senc3d.h b/src/senc3d.h @@ -94,7 +94,7 @@ struct senc3d_enclosure_header { * If the two sides of a triangle are part of the enclosure, the triangle is * counted as 0. */ double volume; - /* The area of the enclosure, in m^2. + /* The area of the enclosure, in m^2. * If the two sides of a triangle are part of the enclosure, the triangle is * counted twice. */ double area; diff --git a/src/senc3d_scene_analyze.c b/src/senc3d_scene_analyze.c @@ -44,12 +44,12 @@ { TRG_NULL__, 0}\ } #ifdef COMPILER_GCC - #pragma GCC diagnostic push + #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif const struct cc_descriptor CC_DESCRIPTOR_NULL = CC_DESCRIPTOR_NULL__; #ifdef COMPILER_GCC - #pragma GCC diagnostic pop + #pragma GCC diagnostic pop #endif #define DARRAY_NAME component_id @@ -163,17 +163,18 @@ self_hit_filter { struct filter_ctx* fctx_ = ray_data; struct filter_ctx1* fctx; - const struct triangle_comp* components; + const struct triangle_comp* trg_comp; const component_id_t* hit_comp; float s = 0; enum senc3d_side hit_side; int i; - double mz = -INF; + double org_z, mz = -INF; const struct triangle_in* triangles; const struct triangle_in* trg = NULL; const union double3* vertices; + struct cc_descriptor* const* comp_descriptors; - (void)ray_org; (void)ray_dir; (void)ray_range; (void)filter_data; + (void)ray_dir; (void)ray_range; (void)filter_data; ASSERT(hit && fctx_); if(fctx_->type == FCTX2) { @@ -182,8 +183,8 @@ self_hit_filter struct filter_ctx2* ctx2 = &fctx_->c.ctx2; ASSERT(hit->prim.prim_id < darray_triangle_comp_size_get(ctx2->triangles_comp)); - components = darray_triangle_comp_cdata_get(ctx2->triangles_comp); - hit_comp = components[hit->prim.prim_id].component; + trg_comp = darray_triangle_comp_cdata_get(ctx2->triangles_comp); + hit_comp = trg_comp[hit->prim.prim_id].component; if(hit_comp[SENC3D_FRONT] == ctx2->component || hit_comp[SENC3D_BACK] == ctx2->component) { @@ -193,11 +194,11 @@ self_hit_filter } /* The filter is called from a point query on successive hits found from - * ray_org, that belongs to origin_component. It can keep or reject the hit. + * ray_org, that belongs to origin_component. It can keep or reject the hit. * Hits are only submitted inside a certain radius from ray_org, that is * decreased to the hit distance for every hit that is kept. * At the end, the last kept hit (= the closest), determines a component to - * which origin_component is linked. At a later stage the algorithm proceeds + * which origin_component is linked. At a later stage the algorithm process * linked components to determine their relative inclusions. * * For each hit, the filter computes if the hit is on a component above @@ -211,8 +212,9 @@ self_hit_filter * and remains undetected by star enclosures). */ ASSERT(fctx_->type == FCTX1); fctx = &fctx_->c.ctx1; - components = darray_triangle_comp_cdata_get(fctx->triangles_comp); - hit_comp = components[hit->prim.prim_id].component; + comp_descriptors = darray_ptr_component_descriptor_cdata_get(fctx->components); + trg_comp = darray_triangle_comp_cdata_get(fctx->triangles_comp); + hit_comp = trg_comp[hit->prim.prim_id].component; triangles = darray_triangle_in_cdata_get(&fctx->scn->triangles_in); vertices = darray_position_cdata_get(&fctx->scn->vertices); ASSERT(hit->prim.prim_id @@ -226,10 +228,8 @@ self_hit_filter return 1; /* Reject */ if(hit->distance == 0) { - /* origin_component is in contact with some other components + /* origin_component is in contact with some other components * We will need further exploration to know if they should be considered */ - struct cc_descriptor* const* descriptors - = darray_ptr_component_descriptor_cdata_get(fctx->components); int n; /* If same component, process only once */ @@ -242,14 +242,14 @@ self_hit_filter struct s3d_hit hit2 = S3D_HIT_NULL; struct filter_ctx fctx2; ASSERT(c < darray_ptr_component_descriptor_size_get(fctx->components)); - if(descriptors[c]->is_outer_border) { - if(fabs(descriptors[c]->_6volume) - <= fabs(descriptors[fctx->origin_component]->_6volume)) + if(comp_descriptors[c]->is_outer_border) { + if(fabs(comp_descriptors[c]->_6volume) + <= fabs(comp_descriptors[fctx->origin_component]->_6volume)) /* Component is not large enough to include origin_component */ continue; } else { - vrtx_id_t c_z_id = descriptors[c]->max_z_vrtx_id; - vrtx_id_t o_z_id = descriptors[fctx->origin_component]->max_z_vrtx_id; + vrtx_id_t c_z_id = comp_descriptors[c]->max_z_vrtx_id; + vrtx_id_t o_z_id = comp_descriptors[fctx->origin_component]->max_z_vrtx_id; ASSERT(c_z_id < darray_position_size_get(&fctx->scn->vertices)); ASSERT(o_z_id < darray_position_size_get(&fctx->scn->vertices)); if(vertices[c_z_id].pos.z <= vertices[o_z_id].pos.z) @@ -260,14 +260,14 @@ self_hit_filter * overlap, testing a single point is OK, as long as the point is not on * c boundary (can be on origin_component boundary, though). * As this case is supposed to be rare, we go for a basic algorithm */ - for(side = descriptors[fctx->origin_component]->side_range.first; - side <= descriptors[fctx->origin_component]->side_range.last; + for(side = comp_descriptors[fctx->origin_component]->side_range.first; + side <= comp_descriptors[fctx->origin_component]->side_range.last; side++) { /* Find a triangle on origin_component boundary that is not on c * boundary (the 2 components cannot share all their triangles) */ trg_id_t t = TRGSIDE_2_TRG(side); - const component_id_t* candidate_comp = components[t].component; + const component_id_t* candidate_comp = trg_comp[t].component; if(candidate_comp[SENC3D_FRONT] != fctx->origin_component && candidate_comp[SENC3D_BACK] != fctx->origin_component) continue; @@ -296,8 +296,8 @@ self_hit_filter ASSERT(S3D_HIT_NONE(&hit2)); /* The ray is supposed to go to infinity */ /* origin_component is linked_to an outer component if cpt is odd, * linked_to an inner component if cpt is even */ - if(descriptors[c]->is_outer_border == (fctx2.c.ctx2.cpt % 2)) { - double v = fabs(descriptors[c]->_6volume); + if(comp_descriptors[c]->is_outer_border == (fctx2.c.ctx2.cpt % 2)) { + double v = fabs(comp_descriptors[c]->_6volume); /* If origin_component is inside several components, the one we are * looking for is the smallest one */ if(v >= fctx->current_6volume) continue; @@ -311,10 +311,10 @@ self_hit_filter } /* Reject hits with < Z */ - ASSERT(hit->prim.prim_id < + ASSERT(hit->prim.prim_id < darray_triangle_in_size_get(&fctx->scn->triangles_in)); trg = triangles + hit->prim.prim_id; - /* Check if the hit is above ray_org (hit[2] > ray_org[2]) + /* Check if the hit is above ray_org (hit[2] > ray_org[2]) * As we cannot rely on numerical accuracy when computing hit positions, * we use the triangle vertices to check if some part of the hit triangle * is above ray_org */ @@ -324,7 +324,10 @@ self_hit_filter ASSERT(v < darray_position_size_get(&fctx->scn->vertices)); if(i == 0 || mz < p->pos.z) mz = p->pos.z; } - if(mz <= ray_org[2]) + /* Don't use org[2] as, being float, it would lead to a float VS double + * comparison that causes accuracy problems. */ + org_z = vertices[comp_descriptors[fctx->origin_component]->max_z_vrtx_id].pos.z; + if(mz <= org_z) return 1; /* Hit triangle is below ray_org: reject */ if(hit_comp[SENC3D_FRONT] == hit_comp[SENC3D_BACK]) { @@ -345,7 +348,7 @@ self_hit_filter } /* We cannot know which side to consider if s==0. - * As hit distance > 0 and the 2 sides belong to 2 different components, + * As hit distance > 0 and the 2 sides belong to 2 different components, * another candidate must selected afterwards (can be at greater distance, * disallowing to restrict the search distance here) */ if(s == 0) { @@ -461,7 +464,7 @@ extract_connex_components for(;;) { /* Process all components for this medium * Here we start from a side of the currently processed medium that is - * not member of any component yet; by exploring neighbourhood the + * not member of any component yet; by exploring neighbourhood the * process can harvest sides with different media */ side_id_t crt_side_id = get_side_not_in_connex_component (last_side, trgsides, processed, &first_side_not_in_component, medium); @@ -560,7 +563,7 @@ extract_connex_components * id and recancel all the work in progress */ component_canceled = 1; darray_side_id_clear(&stack); - /* Don't cancel used flags as all these sides will get us back to + /* Don't cancel used flags as all these sides will get us back to * (at least) the neighbour side we have just discovered, that will * cancel them again and again */ sz = darray_side_id_size_get(&current_component); @@ -818,7 +821,7 @@ compare_components static res_T reorder_components - (struct senc3d_scene* scn, + (struct senc3d_scene* scn, struct darray_ptr_component_descriptor* connex_components, struct darray_triangle_comp* triangles_comp_array) { @@ -1075,7 +1078,7 @@ collect_and_link_neighbours vertices = darray_position_cdata_get(&scn->vertices); ASSERT(scn->ntris == darray_triangle_tmp_size_get(triangles_tmp_array)); - + /* Make some room for edges. */ nbedges_guess = 4 + (thread_count == 1 ? (edge_id_t)(scn->nverts + scn->ntris) @@ -1347,7 +1350,7 @@ reorder_enclosures ASSERT(new_id < scn->analyze.enclosures_count); cc_descriptors[c]->enclosure_id = new_id; } -error: +error: if(new_ids) MEM_RM(scn->dev->allocator, new_ids); return res; } @@ -1460,7 +1463,7 @@ build_result if(*res != RES_OK) continue; ASSERT(e <= ENCLOSURE_MAX__); enc->header.enclosure_id = (unsigned)ee; /* Back to API type */ - ASSERT(cc_descriptors[enc->first_component]->enclosure_id + ASSERT(cc_descriptors[enc->first_component]->enclosure_id == enc->header.enclosure_id); enc->header.is_infinite = (e == 0); @@ -1610,7 +1613,7 @@ scene_analyze ATOMIC next_enclosure_id = 1; res_T res = RES_OK; res_T res2 = RES_OK; - + if(!scn) return RES_BAD_ARG; if(!scn->ntris) goto exit; @@ -1724,7 +1727,7 @@ scene_analyze #pragma omp barrier /* Constraints on step 2 data are now met */ - + if(res != RES_OK) { #pragma omp single nowait { diff --git a/src/test_senc3d_bad_grouping.c b/src/test_senc3d_bad_grouping.c @@ -0,0 +1,623 @@ +/* Copyright (C) 2018-2020, 2023 |Méso|Star> (contact@meso-star.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* This test has been created using the sg3_geometry_dump_as_C_code feature + * of star-geometry. It uses a star-cad scene that crashed. */ + +#include "senc3d.h" +#include "test_senc3d_utils.h" + +#include <rsys/double3.h> + +#include <stdio.h> + +/* + * +---+ +------------+ +---+ + * | | | | | | + * | | | | | | + * |m0 | | m0 | |m0 | + * | | | | | | + * +---+ +------------+ +---+ + * + * + * m0 + * + * +---+ +------------+ +---+ + * | | | | | | + * | | | | | | + * |m0 | | m0 | |m0 | + * | | | | | | + * +---+ +------------+ +---+ + */ + +/* Dump of star-geometry-3d 'bat_1_S_glazing'. */ +static const unsigned bat_1_S_glazing_vertices_count = 112; +static const double bat_1_S_glazing_vertices[336] = +{ + 2.21823, 1.60156, 3.1, + 2, 1.60156, 4.79794, + 1.78177, 1.60156, 3.1, + 2, 1.60156, 1.40206, + 2.21823, 1.60156, 1.40206, + 1.78177, 1.60156, 1.40206, + 1.78177, 1.60156, 4.79794, + 2.21823, 1.60156, 4.79794, + 2.21823, 1.57756, 1.40206, + 2, 1.57756, 1.40206, + 1.78177, 1.57756, 1.40206, + 1.78177, 1.57756, 3.1, + 1.78177, 1.57756, 4.79794, + 2, 1.57756, 4.79794, + 2.21823, 1.57756, 4.79794, + 2.21823, 1.57756, 3.1, + 1.78177, 8.39844, 3.1, + 2, 8.39844, 4.79794, + 2.21823, 8.39844, 3.1, + 2, 8.39844, 1.40206, + 1.78177, 8.39844, 1.40206, + 2.21823, 8.39844, 1.40206, + 2.21823, 8.39844, 4.79794, + 1.78177, 8.39844, 4.79794, + 1.78177, 8.42244, 1.40206, + 2, 8.42244, 1.40206, + 2.21823, 8.42244, 1.40206, + 2.21823, 8.42244, 3.1, + 2.21823, 8.42244, 4.79794, + 2, 8.42244, 4.79794, + 1.78177, 8.42244, 4.79794, + 1.78177, 8.42244, 3.1, + 1.60156, 6.8614, 3.1, + 1.60156, 5.42628, 3.39599, + 1.60156, 6.8614, 4.79794, + 1.60156, 5, 4.79794, + 1.60156, 3.1386, 1.40206, + 1.60156, 4.39758, 2.64814, + 1.60156, 5, 1.40206, + 1.60156, 3.1386, 3.1, + 1.60156, 5.93822, 2.25103, + 1.60156, 6.8614, 1.40206, + 1.60156, 4.21127, 3.75906, + 1.60156, 3.1386, 4.79794, + 1.57756, 3.1386, 1.40206, + 1.57756, 5, 1.40206, + 1.57756, 6.8614, 1.40206, + 1.57756, 6.8614, 3.1, + 1.57756, 6.8614, 4.79794, + 1.57756, 5, 4.79794, + 1.57756, 3.1386, 4.79794, + 1.57756, 3.1386, 3.1, + 1.57756, 5.42628, 3.39599, + 1.57756, 4.39758, 2.64814, + 1.57756, 5.93822, 2.25103, + 1.57756, 4.21127, 3.75906, + 1.60156, 6.8614, 7.80206, + 1.60156, 5.42628, 9.20401, + 1.60156, 6.8614, 9.5, + 1.60156, 5, 7.80206, + 1.60156, 5, 11.1979, + 1.60156, 4.39758, 9.95186, + 1.60156, 3.1386, 11.1979, + 1.60156, 3.1386, 9.5, + 1.60156, 6.8614, 11.1979, + 1.60156, 5.93822, 10.349, + 1.60156, 3.1386, 7.80206, + 1.60156, 4.21127, 8.84094, + 1.57756, 6.8614, 7.80206, + 1.57756, 5, 7.80206, + 1.57756, 3.1386, 7.80206, + 1.57756, 6.8614, 9.5, + 1.57756, 6.8614, 11.1979, + 1.57756, 5, 11.1979, + 1.57756, 3.1386, 11.1979, + 1.57756, 3.1386, 9.5, + 1.57756, 5.42628, 9.20401, + 1.57756, 4.39758, 9.95186, + 1.57756, 5.93822, 10.349, + 1.57756, 4.21127, 8.84094, + 1.78177, 1.60156, 9.5, + 2, 1.60156, 7.80206, + 2.21823, 1.60156, 9.5, + 2, 1.60156, 11.1979, + 1.78177, 1.60156, 7.80206, + 2.21823, 1.60156, 7.80206, + 1.78177, 1.60156, 11.1979, + 2.21823, 1.60156, 11.1979, + 1.78177, 1.57756, 7.80206, + 2, 1.57756, 7.80206, + 2.21823, 1.57756, 7.80206, + 1.78177, 1.57756, 9.5, + 1.78177, 1.57756, 11.1979, + 2, 1.57756, 11.1979, + 2.21823, 1.57756, 11.1979, + 2.21823, 1.57756, 9.5, + 2.21823, 8.39844, 9.5, + 2, 8.39844, 7.80206, + 1.78177, 8.39844, 9.5, + 2, 8.39844, 11.1979, + 2.21823, 8.39844, 7.80206, + 1.78177, 8.39844, 7.80206, + 2.21823, 8.39844, 11.1979, + 1.78177, 8.39844, 11.1979, + 2.21823, 8.42244, 7.80206, + 2, 8.42244, 7.80206, + 1.78177, 8.42244, 7.80206, + 2.21823, 8.42244, 9.5, + 2.21823, 8.42244, 11.1979, + 2, 8.42244, 11.1979, + 1.78177, 8.42244, 11.1979, + 1.78177, 8.42244, 9.5 +}; +unsigned bat_1_S_glazing_triangles_count = 200; +unsigned bat_1_S_glazing_triangles[600] = +{ + 0, 1, 2, + 2, 3, 0, + 3, 4, 0, + 2, 5, 3, + 2, 1, 6, + 0, 7, 1, + 3, 4, 8, + 9, 10, 5, + 3, 9, 5, + 3, 8, 9, + 2, 5, 10, + 11, 12, 6, + 2, 11, 6, + 2, 10, 11, + 1, 6, 12, + 13, 14, 7, + 1, 13, 7, + 1, 12, 13, + 0, 8, 4, + 15, 7, 14, + 7, 15, 0, + 0, 15, 8, + 15, 13, 11, + 11, 9, 15, + 9, 8, 15, + 11, 10, 9, + 11, 13, 12, + 15, 14, 13, + 16, 17, 18, + 18, 19, 16, + 19, 20, 16, + 18, 21, 19, + 18, 17, 22, + 16, 23, 17, + 19, 20, 24, + 25, 26, 21, + 19, 25, 21, + 19, 24, 25, + 18, 21, 26, + 27, 28, 22, + 18, 27, 22, + 18, 26, 27, + 17, 22, 28, + 29, 30, 23, + 17, 29, 23, + 17, 28, 29, + 16, 24, 20, + 31, 23, 30, + 23, 31, 16, + 16, 31, 24, + 31, 29, 27, + 27, 25, 31, + 25, 24, 31, + 27, 26, 25, + 27, 29, 28, + 31, 30, 29, + 32, 33, 34, + 34, 33, 35, + 36, 37, 38, + 39, 37, 36, + 38, 40, 41, + 35, 42, 43, + 41, 40, 32, + 43, 42, 39, + 37, 40, 38, + 33, 40, 37, + 35, 33, 42, + 32, 40, 33, + 33, 37, 42, + 42, 37, 39, + 38, 36, 44, + 45, 46, 41, + 38, 45, 41, + 38, 44, 45, + 32, 41, 46, + 47, 48, 34, + 32, 47, 34, + 32, 46, 47, + 35, 34, 48, + 49, 50, 43, + 35, 49, 43, + 35, 48, 49, + 39, 44, 36, + 51, 43, 50, + 43, 51, 39, + 39, 51, 44, + 47, 52, 48, + 48, 52, 49, + 44, 53, 45, + 51, 53, 44, + 45, 54, 46, + 49, 55, 50, + 46, 54, 47, + 50, 55, 51, + 53, 54, 45, + 52, 54, 53, + 49, 52, 55, + 47, 54, 52, + 52, 53, 55, + 55, 53, 51, + 56, 57, 58, + 59, 57, 56, + 60, 61, 62, + 62, 61, 63, + 64, 65, 60, + 66, 67, 59, + 58, 65, 64, + 63, 67, 66, + 60, 65, 61, + 61, 65, 57, + 67, 57, 59, + 57, 65, 58, + 67, 61, 57, + 63, 61, 67, + 59, 68, 56, + 69, 66, 70, + 59, 66, 69, + 59, 69, 68, + 58, 56, 68, + 71, 72, 64, + 58, 71, 64, + 58, 68, 71, + 64, 72, 73, + 64, 73, 60, + 60, 74, 62, + 73, 74, 60, + 63, 70, 66, + 75, 62, 74, + 63, 62, 75, + 63, 75, 70, + 68, 76, 71, + 69, 76, 68, + 73, 77, 74, + 74, 77, 75, + 72, 78, 73, + 70, 79, 69, + 71, 78, 72, + 75, 79, 70, + 73, 78, 77, + 77, 78, 76, + 79, 76, 69, + 76, 78, 71, + 79, 77, 76, + 75, 77, 79, + 80, 81, 82, + 82, 83, 80, + 80, 84, 81, + 81, 85, 82, + 80, 83, 86, + 82, 87, 83, + 81, 88, 84, + 89, 85, 90, + 81, 85, 89, + 81, 89, 88, + 80, 84, 88, + 91, 92, 86, + 80, 91, 86, + 80, 88, 91, + 86, 92, 93, + 86, 93, 83, + 83, 94, 87, + 93, 94, 83, + 82, 90, 85, + 95, 87, 94, + 82, 87, 95, + 82, 95, 90, + 91, 89, 95, + 95, 93, 91, + 91, 88, 89, + 89, 90, 95, + 91, 93, 92, + 95, 94, 93, + 96, 97, 98, + 98, 99, 96, + 96, 100, 97, + 97, 101, 98, + 96, 99, 102, + 98, 103, 99, + 97, 104, 100, + 105, 101, 106, + 97, 101, 105, + 97, 105, 104, + 96, 100, 104, + 107, 108, 102, + 96, 107, 102, + 96, 104, 107, + 102, 108, 109, + 102, 109, 99, + 99, 110, 103, + 109, 110, 99, + 98, 106, 101, + 111, 103, 110, + 98, 103, 111, + 98, 111, 106, + 107, 105, 111, + 111, 109, 107, + 107, 104, 105, + 105, 106, 111, + 107, 109, 108, + 111, 110, 109 +}; +unsigned bat_1_S_glazing_properties[600] = +{ + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, + SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM, SENC3D_UNSPECIFIED_MEDIUM +}; + +int +main(int argc, char** argv) +{ + struct mem_allocator allocator; + struct senc3d_device* dev = NULL; + struct senc3d_scene* scn = NULL; + struct context ctx = CONTEXT_NULL__; + unsigned count, e; + (void)argc, (void)argv; + + OK(mem_init_proxy_allocator(&allocator, &mem_default_allocator)); + OK(senc3d_device_create(NULL, &allocator, SENC3D_NTHREADS_DEFAULT, 1, &dev)); + + /* Create a scene with the cubes. + * The enclosures in the small cubes contain medium 0, the external enclosure + * contains medium 2, the enclosure between the small and big cubes + * contains medium 1. */ + ctx.positions = bat_1_S_glazing_vertices; + ctx.indices = bat_1_S_glazing_triangles; + ctx.properties = bat_1_S_glazing_properties; + OK(senc3d_scene_create(dev, + SENC3D_CONVENTION_NORMAL_BACK | SENC3D_CONVENTION_NORMAL_OUTSIDE, + bat_1_S_glazing_triangles_count, get_indices, get_media_from_properties, + bat_1_S_glazing_vertices_count, get_position, &ctx, &scn)); + + OK(senc3d_scene_get_vertices_count(scn, &count)); + CHK(count == bat_1_S_glazing_vertices_count); + + OK(senc3d_scene_get_triangles_count(scn, &count)); + CHK(count == bat_1_S_glazing_triangles_count); + + OK(senc3d_scene_get_enclosure_count(scn, &count)); + CHK(count == 7); + FOR_EACH(e, 0, count) { + struct senc3d_enclosure* enclosure; + struct senc3d_enclosure_header header; + unsigned m; + char name[128]; (void)name; + OK(senc3d_scene_get_enclosure(scn, e, &enclosure)); + OK(senc3d_enclosure_get_header(enclosure, &header)); + CHK(header.enclosed_media_count == 1); + OK(senc3d_enclosure_get_medium(enclosure, 0, &m)); + CHK(m == SENC3D_UNSPECIFIED_MEDIUM); + OK(senc3d_enclosure_ref_put(enclosure)); + } + + OK(senc3d_scene_ref_put(scn)); + OK(senc3d_device_ref_put(dev)); + + check_memory_allocator(&allocator); + mem_shutdown_proxy_allocator(&allocator); + CHK(mem_allocated_size() == 0); + return 0; +} diff --git a/src/test_senc3d_cube_behind_cube.c b/src/test_senc3d_cube_behind_cube.c @@ -257,7 +257,7 @@ main(int argc, char** argv) SENC3D_CONVENTION_NORMAL_FRONT | SENC3D_CONVENTION_NORMAL_INSIDE, cube_behind_cube_2_triangles_count, get_indices, get_media_from_properties, cube_behind_cube_2_vertices_count, get_position, &ctx, &scn)); - + OK(senc3d_scene_get_enclosure_count(scn, &ecount)); CHK(ecount == 3); diff --git a/src/test_senc3d_enclosure.c b/src/test_senc3d_enclosure.c @@ -65,7 +65,7 @@ test(const int convention) OK(senc3d_scene_get_enclosure_count(scn, &count)); CHK(count == 2); - + OK(senc3d_scene_get_enclosure(scn, 0, &enclosure)); BA(senc3d_enclosure_ref_get(NULL)); OK(senc3d_enclosure_ref_get(enclosure)); diff --git a/src/test_senc3d_scene.c b/src/test_senc3d_scene.c @@ -90,7 +90,7 @@ main(int argc, char** argv) BA(senc3d_scene_get_triangles_count(NULL, NULL)); OK(senc3d_scene_get_triangles_count(scn, &count)); CHK(count == ntriangles); - + BA(senc3d_scene_get_vertices_count(NULL, &count)); BA(senc3d_scene_get_vertices_count(scn, NULL)); BA(senc3d_scene_get_vertices_count(NULL, NULL)); diff --git a/src/test_senc3d_unspecified_medium.c b/src/test_senc3d_unspecified_medium.c @@ -178,7 +178,7 @@ test(const int convention) OK(mem_init_proxy_allocator(&allocator, &mem_default_allocator)); OK(senc3d_device_create(NULL, &allocator, SENC3D_NTHREADS_DEFAULT, 1, &dev)); - + /* Geometry with no media information on both sides */ ctx.positions = front_unspecified_vertices; ctx.indices = front_unspecified_triangles; @@ -207,7 +207,7 @@ test(const int convention) expected_external_medium = conv_front ? SENC3D_UNSPECIFIED_MEDIUM : 1; expected_internal_medium = conv_front ? 1 : SENC3D_UNSPECIFIED_MEDIUM; - CHK(medium == (header.is_infinite + CHK(medium == (header.is_infinite ? expected_external_medium : expected_internal_medium)); CHK(header.primitives_count == ntriangles); CHK(header.unique_primitives_count == ntriangles);