README.md (3896B)
1 # Star 2D 2 3 Star-2D is a C library that manages *2D geometries* and implements 4 operators to access them efficiently such as uniform sampling, ray 5 tracing or a closest point query. 6 7 The main concept exposed in Star-2D is the *shape*. A shape is a set of 8 segments representing the outline of a 2D geometry. Shape data is 9 user-defined and can be updated at any time. The shapes are then 10 attached to a *scene* where they can be queried using a *view* of the 11 scene. When it is created, the view internally builds the accelerating 12 structures necessary for the access operators. These data structures are 13 constructed from the scene geometry as defined at the time of view 14 creation; a view is thus insensitive to updates of the scene following 15 its creation. This means that multiple views can be used to save 16 different states of the same scene, giving the caller great flexibility 17 in managing scene data. 18 19 ## Requirements 20 21 - C compiler (C99) 22 - POSIX make 23 - pkg-config 24 - [Embree](https://github.com/embree/embree) 25 - [RSys](https://gitlab.com/vaplv/rsys) 26 27 ## Installation 28 29 Edit config.mk as needed, then run: 30 31 make clean install 32 33 ## Release notes 34 35 ### Version 0.7 36 37 - Replace CMake by Makefile as build system. 38 - Update compiler and linker flags to increase the security and 39 robustness of generated binaries. 40 - Provide a pkg-config file to link the library as an external 41 dependency. 42 43 ### Version 0.6 44 45 - Upgrading the ray-tracing backend from Embree3 to Embree4 46 47 ### Version 0.5.1 48 49 - Corrects an invalid memory read. 50 - Fix compilation warnings detected by gcc 11. 51 52 ### Version 0.5 53 54 Update the API of the filtering function: add the range of the ray as 55 input argument. For closest point queries, this range is from 0 to query 56 radius. 57 58 ### Vesion 0.4.1 59 60 - Improve the accuracy of the closest point query. 61 - Fix the closest point query: the returned hit was wrong. 62 - Fix the barycentric coordinates of the intersection of the ray onto 63 the segment: the coordinates could lie outside the segment. 64 65 ### Version 0.4 66 67 - Add the `s2d_scene_view_closest_point` function. This function 68 retrieves the closest point into the scene to a query position in a 69 radius from ]0, INF]. This closest point is returned as a regular hit 70 which means that the function returns to the caller not only the 71 distance to the query position, but also the geometric primitive onto 72 which the point lies and its location onto this primitive. If no 73 segment lies around the query position in a distance lesser than the 74 one defined by the query radius, the returned hit is invalid which can 75 be checked with the regular `S2D_HIT_NONE` macro. Finally, this 76 function supports the filter functions so that the caller can choose 77 to discard closest hits according to its own criteria. 78 79 ### Version 0.3.1 80 81 - Fix the `s2d_segment_get_vertex_attrib` function: it could fail and 82 return an error while it shouldn't. 83 84 ### Version 0.3 85 86 - Migrate the ray-tracing backend from Embree2 to Embree3. 87 88 ### Version 0.2 89 90 - Add the `s2d_segment_get_vertex_attrib` function that returns the 91 vertex attributes of a given segment. 92 93 ### Version 0.1.1 94 95 - Fix the `s2d_primitive_get_function`. The function failed when the 96 submitted parametric coordinate was equal to 1. 97 98 ### Version 0.1 99 100 - Implement the `s2d_scene_view` API; it replaces the 101 `s2d_scene_<begin|end>_session` functions that were removed. A view 102 registers the state of the scene from which it is created. It is used 103 to retrieve the scene data through ray-tracing, sampling or indexing. 104 Several views can be created on the same scene. 105 - Add the possibility to attach a same shape to several scenes. 106 107 ## License 108 109 Copyright (C) 2016-2021, 2023 |Méso|Star> (contact@meso-star.com) 110 111 Star-2D is free software released under GPL v3+ license: GNU GPL version 112 3 or later. You are welcome to redistribute it under certain conditions; 113 refer to the COPYING file for details.