Geogram Version 1.9.6-rc
A programming library of geometric algorithms
Loading...
Searching...
No Matches
mesh_inspector.h
1/*
2 * Copyright (c) 2000-2022 Inria
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * * Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * * Neither the name of the ALICE Project-Team nor the names of its
14 * contributors may be used to endorse or promote products derived from this
15 * software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
28 *
29 * Contact: Bruno Levy
30 *
31 * https://www.inria.fr/fr/bruno-levy
32 *
33 * Inria,
34 * Domaine de Voluceau,
35 * 78150 Le Chesnay - Rocquencourt
36 * FRANCE
37 *
38 */
39
40#ifndef H_HEXDOM_ALGO_MESH_INSPECTOR_H
41#define H_HEXDOM_ALGO_MESH_INSPECTOR_H
42
44#include <exploragram/hexdom/mesh_utils.h>
45
46namespace GEO {
47
48 void EXPLORAGRAM_API get_facet_stats(Mesh* m, const char * msg = "get_facet_stats", bool export_attribs = false);
49
50 bool EXPLORAGRAM_API surface_is_tetgenifiable(Mesh* m);
51
52 bool EXPLORAGRAM_API volume_is_tetgenifiable(Mesh* m);
53
54 bool EXPLORAGRAM_API surface_is_manifold(Mesh* m, std::string& msg);
55
56 bool EXPLORAGRAM_API volume_boundary_is_manifold(Mesh* m, std::string& msg);
57
58 double EXPLORAGRAM_API tet_vol(vec3 A, vec3 B, vec3 C, vec3 D);
59
60 void EXPLORAGRAM_API get_hex_proportion(Mesh*m, double &nb_hex_prop, double &vol_hex_prop);
61
62 bool EXPLORAGRAM_API have_negative_tet_volume(Mesh*m);
63
67 inline vec3 facet_normal(Mesh* m, index_t f) {
68 index_t nbv = m->facets.nb_vertices(f);
69 vec3 bary = facet_bary(m, f);
70 vec3 res(0, 0, 0);
71 FOR(fv, nbv) res = res + cross(X(m)[m->facets.vertex(f, fv)] - bary, X(m)[m->facets.vertex(f, next_mod(fv, nbv))] - bary);
72 return normalize(res);
73 }
74}
75#endif
index_t vertex(index_t f, index_t lv) const
Gets a vertex by facet and local vertex index.
Definition mesh.h:1143
index_t nb_vertices(index_t f) const
Gets the number of vertices of a facet.
Definition mesh.h:1132
Represents a mesh.
Definition mesh.h:3050
#define EXPLORAGRAM_API
Linkage declaration for exploragram symbols.
Definition defs.h:18
Included by all headers in exploragram.
Global Vorpaline namespace.
Definition basic.h:55
vecng< 3, Numeric::float64 > vec3
Represents points and vectors in 3d.
Definition geometry.h:65
geo_index_t index_t
The type for storing and manipulating indices.
Definition numeric.h:329
vec3 facet_normal(Mesh *m, index_t f)