star-enclosures-2d

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

commit 5b5efd746f4c6feb01ba5e837f4a0679108e5c30
parent 14b0879d4763e3d3627bb4c3d5dd2fac2b3dfdd9
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 18 Oct 2021 15:51:59 +0200

Merge branch 'release_0.5.4'

Diffstat:
MREADME.md | 89+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mcmake/CMakeLists.txt | 44++++++++++++++++++++++----------------------
Msrc/senc2d_descriptor.c | 10+++++-----
Msrc/test_senc2d_sample_enclosure.c | 2+-
4 files changed, 72 insertions(+), 73 deletions(-)

diff --git a/README.md b/README.md @@ -42,18 +42,23 @@ in star-enclosures-3d but is still present in star-enclosures-2d. Release notes ------------- +### Version 0.5.4 + +Sets the required version of Star-SampPling to 0.12. This version fixes +compilation errors with gcc 11 but introduces API breaks. + ### Version 0.5.3 -- Fix API break on filter function introduced by Star-2D 0.5. +Fix API break on filter function introduced by Star-2D 0.5. ### Version 0.5.2 -- BugFix: enclosures including multiple media could end with invalid - primitive count. +BugFix: enclosures including multiple media could end with invalid primitive +count. ### Version 0.5.1 -- Fix a warning +Fix a warning ### Version 0.5 @@ -62,72 +67,66 @@ to an add-like call anymore. Instead the whole geometry must be provided at once, with no duplicates (either vertices or segments) nor zero-area segments. -- Compute volume (in m^2) and surface (in m) of enclosures. - -- Report overlapping segments. - Only segments with a common vertex are currently detected. - Do not extract enclosures when overlapping segments are detected. - -- Make enclosure IDs consistent across runs. - -- Fix enclosure extraction when all segments Ny component is zero. - -- More robust on invalid scenes. +- Compute volume (in m^2) and surface (in m) of enclosures. +- Report overlapping segments. Only segments with a common vertex are + currently detected. Do not extract enclosures when overlapping segments are + detected. +- Make enclosure IDs consistent across runs. +- Fix enclosure extraction when all segments Ny component is zero. +- More robust on invalid scenes. ### Version 0.4.2 -- Fix global id of segments; releases 0.4.0 and 0.4.1 are broken - -- Reintroduce an API call to get the global id in user space of - a global unique segment after deduplication +- Fix global id of segments; releases 0.4.0 and 0.4.1 are broken +- Reintroduce an API call to get the global id in user space of a global unique + segment after deduplication ### Version 0.4.1 -- Fix an infinite loop related to a rare numerical accuracy problem. +- Fix an infinite loop related to a rare numerical accuracy problem. ### Version 0.4 -- Change signature of the senc2d_scene_add_geometry API. Thus this release - is **not compatible** with previous ones. - The global_id callback that was ill-defined is removed and 2 callbacks - are added to manage client-app data when deduplicating geometry. - These 2 callback allow a proper client-app management of global ids. -- Remove execution time for analysis steps from the log. +- Change signature of the `senc2d_scene_add_geometry` API. Thus this release is + **not compatible** with previous ones. The `global_id` callback that was + ill-defined is removed and 2 callbacks are added to manage client-app data + when deduplicating geometry. These 2 callback allow a proper client-app + management of global ids. +- Remove execution time for analysis steps from the log. ### Version 0.3.1 -- Performance Fix: when a connex component was canceled by a thread the - complexity was O(n^2). New algorithm is O(n). -- Output execution time for analysis steps in the log. +- Performance Fix: when a connex component was canceled by a thread the + complexity was O(n^2). New algorithm is O(n). +- Output execution time for analysis steps in the log. ### Version 0.3 -- Add API calls to access to geometry frontiers. -- Improve documentation in the header file. -- BugFix: wrong data cleaning on computation canceling. +- Add API calls to access to geometry frontiers. +- Improve documentation in the header file. +- BugFix: wrong data cleaning on computation canceling. ### Version 0.2.2 -- BugFix when grouping components into enclosures. -- Add a warning message in log when edges that could surround a - hole are found (edges with at least one unshared vertex and - different media on its sides). +- BugFix when grouping components into enclosures. +- Add a warning message in log when edges that could surround a hole are found + (edges with at least one unshared vertex and different media on its sides). ### Version 0.2.1 -- BugFix: needed data cleaning on computation canceling. +BugFix: needed data cleaning on computation canceling. ### Version 0.2 -- Add the support of enclosures with multiple media. -- Allow to set the FRONT/BACK convention for input segments. -- Allow to set the normal convention for output segments. +- Add the support of enclosures with multiple media. +- Allow to set the FRONT/BACK convention for input segments. +- Allow to set the normal convention for output segments. License ------- -Star-enclosures-2d is Copyright (C) |Méso|Star> 2018-2020 -(<a href="mailto:contact@meso-star.com" class="email">contact@meso-star.com</a>). -It is free software released under the GPLv3+ license. You are welcome -to redistribute it under certain conditions; refer to the COPYING files -for details. +Copyright (C) 2018-2021 [|Meso|Star>](https://www.meso-star.com) +(<contact@meso-star.com>). +Star-enclosures-2d is free software released under the GPLv3+ license: GNU GPL +version 3 or later. You are welcome to redistribute it under certain +conditions; refer to the COPYING file for details. diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -35,28 +35,21 @@ find_package(RSys 0.8.1 REQUIRED) find_package(OpenMP 2.0 REQUIRED) if(NOT NO_TEST) - find_package(StarSP 0.7 REQUIRED) + find_package(StarSP 0.12 QUIET) endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RCMAKE_SOURCE_DIR}) include(rcmake) include(rcmake_runtime) -if(NO_TEST) - include_directories( - ${RSys_INCLUDE_DIR} - ${Star2D_INCLUDE_DIR}) - - rcmake_append_runtime_dirs(_runtime_dirs RSys Star2D) -else() - include_directories( - ${RSys_INCLUDE_DIR} - ${Star2D_INCLUDE_DIR} - ${StarSP_INCLUDE_DIR}) - -if(NOT NO_TEST) - rcmake_append_runtime_dirs(_runtime_dirs RSys StarSP Star2D) - endif() +include_directories( + ${RSys_INCLUDE_DIR} + ${Star2D_INCLUDE_DIR}) +rcmake_append_runtime_dirs(_runtime_dirs RSys Star2D) + +if(StarSP_FOUND) + include_directories(${StarSP_INCLUDE_DIR}) + rcmake_append_runtime_dirs(_runtime_dirs RSys StarSP Star2D) endif() ################################################################################ @@ -64,7 +57,7 @@ endif() ################################################################################ set(VERSION_MAJOR 0) set(VERSION_MINOR 5) -set(VERSION_PATCH 3) +set(VERSION_PATCH 4) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) set(SENC2D_FILES_SRC @@ -147,7 +140,7 @@ if(NOT NO_TEST) build_test(${_name} ${ARGN}) register_test(${_name} ${_name}) endfunction() - + new_test(test_senc2d_square_behind_square) new_test(test_senc2d_square_in_square) new_test(test_senc2d_square_on_square) @@ -156,18 +149,25 @@ if(NOT NO_TEST) new_test(test_senc2d_inconsistant_square) new_test(test_senc2d_invalid_scenes) new_test(test_senc2d_multi_media) - new_test(test_senc2d_sample_enclosure) new_test(test_senc2d_scene) new_test(test_senc2d_some_enclosures) new_test(test_senc2d_some_segments) new_test(test_senc2d_unspecified_medium) - + + if(NOT StarSP_FOUND) + message(STATUS + "StarSP is not found. Do not compile the" + "'test_senc2d_sample_enclosure' test.") + else() + new_test(test_senc2d_sample_enclosure) + target_link_libraries(test_senc2d_sample_enclosure StarSP Star2D) + endif() + build_test(test_senc2d_many_enclosures) build_test(test_senc2d_many_segments) target_link_libraries(test_senc2d_enclosure Star2D) - target_link_libraries(test_senc2d_sample_enclosure StarSP Star2D) - + rcmake_copy_runtime_libraries(test_senc2d_many_enclosures test_senc2d_utils2.h) rcmake_copy_runtime_libraries(test_senc2d_many_segments test_senc2d_utils2.h) rcmake_copy_runtime_libraries(test_senc2d_sample_enclosure) diff --git a/src/senc2d_descriptor.c b/src/senc2d_descriptor.c @@ -137,7 +137,7 @@ senc2d_scene_get_segment_enclosures res_T senc2d_scene_get_frontier_vertice_count (const struct senc2d_scene* scn, - vrtx_id_t* count) + unsigned* count) { size_t tmp; if(!scn || !count) @@ -146,15 +146,15 @@ senc2d_scene_get_frontier_vertice_count return RES_BAD_OP; tmp = darray_frontier_vertex_size_get(&scn->analyze.frontiers); ASSERT(tmp <= VRTX_MAX__); - *count = (vrtx_id_t)tmp; /* Back to API type */ + *count = (unsigned)tmp; /* Back to API type */ return RES_OK; } res_T senc2d_scene_get_frontier_vertex (const struct senc2d_scene* scn, - const vrtx_id_t iver, - vrtx_id_t* vrtx_id, + const unsigned iver, + unsigned vrtx_id[SENC2D_GEOMETRY_DIMENSION-1], unsigned* seg_id) { const struct frontier_vertex* vrtx; @@ -172,7 +172,7 @@ senc2d_scene_get_frontier_vertex res_T senc2d_scene_get_overlapping_segments_count (const struct senc2d_scene* scn, - vrtx_id_t* count) + unsigned* count) { size_t tmp; if(!scn || !count) diff --git a/src/test_senc2d_sample_enclosure.c b/src/test_senc2d_sample_enclosure.c @@ -75,7 +75,7 @@ main(int argc, char** argv) S2D(scene_view_create(s2d_scn, S2D_SAMPLE, &s2d_view)); /* ... and sample it. */ - OK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng)); + OK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng)); FOR_EACH(i, 0, 10000) { struct s2d_attrib attrib; int n, c;