Graphite  Version 3
An experimental 3D geometry processing program
mesh_grob_volume_commands.h
Go to the documentation of this file.
1 /*
2  * OGF/Graphite: Geometry and Graphics Programming Library + Utilities
3  * Copyright (C) 2000-2009 INRIA - Project ALICE
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  * If you modify this software, you should include a notice giving the
20  * name of the person performing the modification, the date of modification,
21  * and the reason for such modification.
22  *
23  * Contact: Bruno Levy - levy@loria.fr
24  *
25  * Project ALICE
26  * LORIA, INRIA Lorraine,
27  * Campus Scientifique, BP 239
28  * 54506 VANDOEUVRE LES NANCY CEDEX
29  * FRANCE
30  *
31  * Note that the GNU General Public License does not permit incorporating
32  * the Software into proprietary programs.
33  *
34  * As an exception to the GPL, Graphite can be linked with the following (non-GPL) libraries:
35  * Qt, SuperLU, WildMagic and CGAL
36  */
37 
38 
39 #ifndef H_OGF_MESH_COMMANDS_MESH_GROB_VOLUME_COMMANDS_H
40 #define H_OGF_MESH_COMMANDS_MESH_GROB_VOLUME_COMMANDS_H
41 
42 #include <OGF/mesh/common/common.h>
44 
50 namespace OGF {
51 
55  gom_class MESH_API MeshGrobVolumeCommands : public MeshGrobCommands {
56  public:
57 
62 
67 
68  gom_slots:
69 
70  /*********************************************************************/
71 
84  void tet_meshing(
85  bool preprocess=false,
86  double epsilon=0.001,
87  double max_hole_area=0.01,
88  bool refine=false,
89  double quality=1.0,
90  bool keep_regions=false,
91  bool verbose=false
92  );
93 
94  /*********************************************************************/
95 
114  const NewMeshGrobName& hexdom_name = "hexes",
115  unsigned int nb_points = 30000,
116  bool prisms = true,
117  bool pyramids = true,
118  bool border_refine = false,
119  double border_max_dist = 0.2,
120  double min_normal_cos = 0.5,
121  double max_corner_cos = 0.6
122  );
123 
124 
125  /*********************************************************************/
126 
127  enum VoronoiSimplification {
128  keep_everything,
129  simplify_tet,
130  simplify_tet_voro
131  };
132 
153  const NewMeshGrobName& voronoi = "voronoi",
154  index_t nb_cells = 1000,
155  VoronoiSimplification simplification = simplify_tet_voro,
156  double angle_threshold = 1e-3,
157  double shrink = 0.0,
158  const NewMeshGrobName& points = "",
159  bool exact = true,
160  bool tessellate_non_convex = false,
161  bool generate_ids = true,
162  bool medial_axis = false
163  );
164 
165 
166  /*********************************************************************/
167 
176  bool save_histo=false,
177  index_t nb_bins=100
178  );
179 
180  /*********************************************************************/
181 
196  const MeshGrobName& points,
197  const NewMeshGrobName& tetrahedra = "tetrahedra",
198  bool refine_surface = false,
199  double max_distance = 0.2
200  );
201 
202  /*********************************************************************/
203 
217  void tet2hex(
218  const NewMeshGrobName& hexdom_name = "hexes",
219  bool prisms = true,
220  bool pyramids = true,
221  double min_normal_cos = 0.5,
222  double max_corner_cos = 0.6
223  );
224 
225  /*********************************************************************/
226 
233  void remesh_tetrahedra(double quality = 0.5);
234 
235  /*********************************************************************/
236 
241 
242  /*********************************************************************/
243 
249  };
250 
251 }
252 #endif
253 
Base class for Commands related with a MeshGrob object.
Commands that manipulate volume meshes.
void Voronoi_meshing(const NewMeshGrobName &voronoi="voronoi", index_t nb_cells=1000, VoronoiSimplification simplification=simplify_tet_voro, double angle_threshold=1e-3, double shrink=0.0, const NewMeshGrobName &points="", bool exact=true, bool tessellate_non_convex=false, bool generate_ids=true, bool medial_axis=false)
Generates a Voronoi mesh from a volume and points.
void compute_borders()
Copies the border of the volume into the surfacic part of the mesh.
void tet_meshing_with_points(const MeshGrobName &points, const NewMeshGrobName &tetrahedra="tetrahedra", bool refine_surface=false, double max_distance=0.2)
Creates a tetrahedral mesh from a closed surface mesh and a pointset, using tetgen....
void volume_mesh_statistics(bool save_histo=false, index_t nb_bins=100)
Computes and displays various statistics for a hex-dominant mesh.
void tet2hex(const NewMeshGrobName &hexdom_name="hexes", bool prisms=true, bool pyramids=true, double min_normal_cos=0.5, double max_corner_cos=0.6)
Converts a tetrahedral mesh into a hexahedral dominant mesh by merging tetrahedra.
void display_volume()
Displays the volume of a mesh.
void remesh_tetrahedra(double quality=0.5)
Extracts the boundary of the zone with tetrahedral cells and remeshes it using Tetgen.
void hex_dominant_meshing(const NewMeshGrobName &hexdom_name="hexes", unsigned int nb_points=30000, bool prisms=true, bool pyramids=true, bool border_refine=false, double border_max_dist=0.2, double min_normal_cos=0.5, double max_corner_cos=0.6)
Fills a closed mesh with hexaedra (+other cells).
MeshGrobVolumeCommands()
MeshGrobVolumeCommands constructor.
~MeshGrobVolumeCommands() override
MeshGrobVolumeCommands destructor.
A template class for strings that need to have a specific type in the GOM system.
Definition: properties.h:218
Base class for Commands related with a MeshGrob object.
geo_index_t index_t
The type for storing and manipulating indices.
Definition: numeric.h:329
Global Graphite namespace.
Definition: common.h:76
Definitions common to all include files in the mesh library.