Skip to content

Commit

Permalink
LICENSE: added mention of BSD three-clauses
Browse files Browse the repository at this point in the history
mesh_geometry, mesh_remesh: limit sizing field to overcome bad
estimations of lfs
  • Loading branch information
BrunoLevy committed Nov 11, 2022
1 parent 39c6cd7 commit 7fc8ce6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 39 deletions.
59 changes: 30 additions & 29 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
BSD 3-Clause License

Copyright (c) 2000-2022 Inria
All rights reserved.
Copyright (c) 2000-2022 Inria
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the ALICE Project-Team nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Inria nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

Contact: Bruno Levy
Contact: Bruno Levy

https://www.inria.fr/fr/bruno-levy
https://www.inria.fr/fr/bruno-levy

Inria,
Domaine de Voluceau,
78150 Le Chesnay - Rocquencourt
FRANCE
Inria,
Domaine de Voluceau,
78150 Le Chesnay - Rocquencourt
FRANCE
5 changes: 5 additions & 0 deletions src/lib/geogram/mesh/mesh_geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,14 @@ namespace {
void compute_sizing_field_lfs(
Mesh& M, const LocalFeatureSize& LFS, double gradation
) {
// Avoid LFS points that are too close to the surface
double min_distance2 = 0.1*surface_average_edge_length(M);
min_distance2 = min_distance2 * min_distance2;

Attribute<double> weight(M.vertices.attributes(),"weight");
for(index_t v: M.vertices) {
double lfs2 = LFS.squared_lfs(M.vertices.point_ptr(v));
lfs2 = std::max(lfs2, min_distance2);
double w = pow(lfs2, -2.0 * gradation);
weight[v] = w;
}
Expand Down
11 changes: 1 addition & 10 deletions src/lib/geogram/mesh/mesh_remesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,12 @@ namespace GEO {
dim = coord_index_t(M_in.vertices.dimension());
}

geo_argused(dim); // See TODO later.
geo_argused(dim);

Stopwatch W("Remesh");

CentroidalVoronoiTesselation CVT(&M_in);

/*
* TODO: reactivate projection, debug
vector<vec3> R3_embedding(M_in.vertices.nb());
for(index_t i=0; i<M_in.vertices.nb(); ++i) {
R3_embedding[i] = vec3(M_in.vertices.point_ptr(i));
}
CentroidalVoronoiTesselation CVT(&M_in, R3_embedding, dim);
*/

if(nb_points == 0) {
nb_points = M_in.vertices.nb();
}
Expand Down

0 comments on commit 7fc8ce6

Please sign in to comment.