40 #ifndef H_HEXDOM_ALGO_MESH_UTILS_H
41 #define H_HEXDOM_ALGO_MESH_UTILS_H
44 #include <exploragram/hexdom/basic.h>
51 return m->cells.corner(c, m->cells.descriptor(c).facet_vertex[cf][cfc]);
54 void EXPLORAGRAM_API compute_3D_edge_cot_w(Mesh* m, Attribute<index_t>& v2e,
double anisoZ_cotW);
68 void EXPLORAGRAM_API facets_smooth_geom(
Mesh* m, std::vector<bool>& lock_v,
double fit_coeff = .95);
70 void EXPLORAGRAM_API cells_smooth_geom(
Mesh* m, std::vector<bool>& lock_v,
double fit_coeff = .95);
82 FOR(lv, m->cells.nb_vertices(c)) ave += m->vertices.point(m->cells.vertex(c, lv));
83 return ave / double(m->cells.nb_vertices(c));
88 FOR(lv, m->cells.facet_nb_vertices(c, lf)) ave += m->vertices.point(m->cells.facet_vertex(c, lf, lv));
89 return ave / double(m->cells.facet_nb_vertices(c, lf));
94 FOR(lv, m->facets.nb_vertices(f)) ave += m->vertices.point(m->facets.vertex(f, lv));
95 return ave / double(m->facets.nb_vertices(f));
120 inline const index_t* MTcase(
double iso,
double v0,
double v1,
double v2,
double v3){
122 if (v0 < iso) triindex |= 1;
123 if (v1 < iso) triindex |= 2;
124 if (v2 < iso) triindex |= 4;
125 if (v3 < iso) triindex |= 8;
126 return &(MT[triindex][0]);
136 FOR(lv ,pts.
size()) {
138 m->vertices.
point(nv[lv]) = pts[lv];
141 if (uv !=
nullptr) FOR(lc,m->facets.
nb_corners(f))
142 (*uv)[m->facets.
corner(f,lc)] = (*lU)[lc];
146 template <
class T>
inline void get_range(Attribute<T> &attr,
double& v_min,
double &v_max) {
149 FOR(i, attr.nb_elements()) {
150 v_min = std::min(v_min, attr[i]);
151 v_max = std::max(v_max, attr[i]);
Generic mechanism for attributes.
Manages an attribute attached to a set of object.
index_t corner(index_t f, index_t lv) const
Gets a corner by facet and local vertex index.
index_t nb_corners(index_t f) const
Gets the number of corners in a facet.
index_t create_polygon(index_t nb_vertices)
Creates a polygonal facet.
const double * point_ptr(index_t v) const
Gets a point.
index_t create_vertices(index_t nb)
Creates a contiguous chunk of vertices.
vec3 & point(index_t v)
Gets a point.
index_t size() const
Gets the number of elements.
#define EXPLORAGRAM_API
Linkage declaration for exploragram symbols.
Included by all headers in exploragram.
The class that represents a mesh.
Global Vorpaline namespace.
vecng< 3, Numeric::float64 > vec3
Represents points and vectors in 3d.
void EXPLORAGRAM_API kill_isolated_vertices(Mesh *m)
void EXPLORAGRAM_API merge_vertices(Mesh *m, double eps)
geo_index_t index_t
The type for storing and manipulating indices.
index_t add_facet_to_mesh(Mesh *m, vector< vec3 > &pts, Attribute< vec2 > *uv=nullptr, vector< vec2 > *lU=nullptr)