40 #ifndef H_OGF_MESH_COMMANDS_MESH_GROB_SURFACE_COMMANDS_H
41 #define H_OGF_MESH_COMMANDS_MESH_GROB_SURFACE_COMMANDS_H
45 #include <geogram/parameterization/mesh_atlas_maker.h>
46 #include <geogram/parameterization/mesh_segmentation.h>
92 double epsilon = 1e-6,
93 double min_comp_area = 0.03,
94 double max_hole_area = 1e-3,
95 double max_hole_edges = 2000,
96 double max_degree3_dist = 0.0,
97 bool remove_intersections =
false
180 unsigned int nb_points = 30000,
181 double tri_shape_adapt = 1.0,
182 double tri_size_adapt = 0.0,
184 double adjust_max_edge_distance = 0.5,
185 unsigned int normal_iter = 3,
186 unsigned int Lloyd_iter = 5,
187 unsigned int Newton_iter = 30,
188 unsigned int Newton_m = 7,
189 unsigned int LFS_samples = 10000
215 unsigned int nb_points = 30000,
217 double max_dist = 0.5,
218 double normal_anisotropy = 5.0,
219 unsigned int nb_Lloyd_iter = 5,
220 unsigned int nb_Newton_iter = 30,
221 unsigned int nb_LpCVT_iter = 10,
222 unsigned int Newton_m = 7,
223 bool RVC_centroids =
false
240 double rel_edge_len = 1.0,
241 bool sharp_features =
true,
242 bool optimize_parity =
false,
243 double max_scaling_corr = 1.0
262 bool pre_process=
false,
263 bool post_process=
false
281 bool pre_process=
false,
282 bool post_process=
false
299 bool pre_process=
false,
300 bool post_process=
false
316 gom_arg_attribute(operation, values, "A+B;A*B;A-B;B-A")
317 MeshGrob* compute_boolean_operation(
320 const std::
string& operation = "A+B",
321 bool pre_process=false,
322 bool post_process=false
336 bool remove_internal_shells = true,
337 bool simplify_coplanar_facets = true,
338 double coplanar_angle_tolerance = 0.001,
339 bool interpolate_attributes = false
356 bool remove_deg3_vrtx = true,
357 bool keep_borders = true,
421 LSCM, SpectralLSCM, ABFplusplus
474 bool detect_sharp_edges =
false,
475 double sharp_edges_threshold = 45.0,
501 const std::string& attribute=
"tex_coord",
523 const std::string& tex_coord=
"tex_coord"
542 const std::string& color=
"color",
546 const std::string& attribute=
"tex_coord"
569 const std::string& src_tex_coord=
"tex_coord",
573 const std::string& tex_coord=
"tex_coord"
Base class for Commands related with a MeshGrob object.
Commands that manipulate surface meshes.
~MeshGrobSurfaceCommands() override
MeshGrobSurfaceCommands destructor.
void fill_holes(index_t max_nb_vertices=0)
Fills the holes of the surface.
void triangulate_center_vertex()
Triangulates all the facets by inserting a vertex in the center of each facet.
MeshGrob * compute_union(const MeshGrobName &other, const NewMeshGrobName &result="result", bool pre_process=false, bool post_process=false)
Computes the union between two meshes.
MeshGrob * compute_difference(const MeshGrobName &other, const NewMeshGrobName &result="result", bool pre_process=false, bool post_process=false)
Computes the difference between two meshes.
MeshGrobSurfaceCommands()
MeshGrobSurfaceCommands constructor.
void get_charts()
Gets the charts attribute from a parameterized mesh.
void remove_invisible_facets(double min_visibility=0.005)
Removes all facets that have visibility smaller than a given threshold.
void remesh_smooth(const NewMeshGrobName &remesh_name="remesh", unsigned int nb_points=30000, double tri_shape_adapt=1.0, double tri_size_adapt=0.0, bool adjust=true, double adjust_max_edge_distance=0.5, unsigned int normal_iter=3, unsigned int Lloyd_iter=5, unsigned int Newton_iter=30, unsigned int Newton_m=7, unsigned int LFS_samples=10000)
Remeshes a (smooth) surface.
void remesh_feature_sensitive(const NewMeshGrobName &surface_name="remesh", unsigned int nb_points=30000, bool refine=false, double max_dist=0.5, double normal_anisotropy=5.0, unsigned int nb_Lloyd_iter=5, unsigned int nb_Newton_iter=30, unsigned int nb_LpCVT_iter=10, unsigned int Newton_m=7, bool RVC_centroids=false)
Remeshes a surface that has sharp features.
void merge_vertices(double epsilon=0.0)
Merges vertices that are at the same location or within tolerance.
void bake_colors(const MeshGrobName &surface, const std::string &color="color", index_t size=1024, const NewImageFileName &image="colors.png", index_t nb_dilate=2, const std::string &attribute="tex_coord")
Bakes colors from a surface to the texture atlas.
void bake_texture(const MeshGrobName &src_surface, const ImageFileName &src_texture, const std::string &src_tex_coord="tex_coord", index_t size=1024, const NewImageFileName &image="texture.png", index_t nb_dilate=2, const std::string &tex_coord="tex_coord")
Bakes texture from a textured surface to an atlas.
void remove_charts()
Removes the charts attribute.
gom_arg_attribute(operation, handler, "combo_box") gom_arg_attribute(operation
Computes a boolean operation between two meshes.
MeshGrob * compute_intersection(const MeshGrobName &other, const NewMeshGrobName &result="result", bool pre_process=false, bool post_process=false)
Computes the intersection between two meshes.
void unglue_sharp_edges(double angle_threshold=90)
Unglues facet edges based on specified angle.
void parameterize_chart(const std::string &attribute="tex_coord", ChartParameterizer param=PARAM_LSCM, bool verbose=false)
Computes texture coordinates of a single unfoldable surface.
void unglue_charts()
Unglues facet edges adjacent to two different charts.
void remesh_quad_dominant(const NewMeshGrobName &surface_name="remesh", double rel_edge_len=1.0, bool sharp_features=true, bool optimize_parity=false, double max_scaling_corr=1.0)
Generates a quad-dominant mesh.
void segment(MeshSegmenter segmenter=SEGMENT_GEOMETRIC_VSA_L2, index_t nb_segments=10)
Segments a mesh.
void bake_normals(const MeshGrobName &surface, index_t size=1024, const NewImageFileName &image="normals.png", index_t nb_dilate=2, const std::string &tex_coord="tex_coord")
Bakes normals from a surface to the texture atlas.
void make_texture_atlas(bool detect_sharp_edges=false, double sharp_edges_threshold=45.0, ChartParameterizer param=PARAM_ABF, ChartPacker pack=PACK_XATLAS, bool verbose=false)
Computes texture coordinates of a surface.
void pack_texture_space(ChartPacker pack=PACK_XATLAS)
Packs charts in texture space.
void smooth()
Smooths the mesh by optimizing the vertices that are not selected. Selected vertices are locked.
void expand_border(double margin=0.05)
Preprocessing for remesh_feature_sensitive.
void fix_facets_orientation()
Fixes facets orientation based on computed visibility.
A Grob wrapper around Geogram's Mesh class.
A template class for strings that need to have a specific type in the GOM system.
Base class for Commands related with a MeshGrob object.
ChartParameterizer
Parameterizer used to flatten individual charts.
geo_index_t index_t
The type for storing and manipulating indices.
void tessellate_facets(Mesh &M, index_t max_nb_vertices)
Subdivides the facets with more than nb_vertices.
ChartPacker
Packer used to organize the charts in texture space.
Global Graphite namespace.
Definitions common to all include files in the mesh library.