Geogram  Version 1.7.1
A programming library of geometric algorithms
GEO Namespace Reference

Global Vorpaline namespace. More...

Namespaces

 CmdLine
 Utilities to process command line arguments.
 
 FileSystem
 Abstraction layer for file-system management.
 
 Geom
 Geometric functions and utilities.
 
 MatrixUtil
 Utilities for manipulating matrices.
 
 Memory
 Utilities for memory management.
 
 MeshCellDescriptors
 Gathers declarations of global cell descriptors.
 
 Numeric
 Defines numeric types used in Vorpaline.
 
 PCK
 PCK (Predicate Construction Kit) implements a set of geometric predicates. PCK uses arithmetic filters (Meyer and Pion), expansion arithmetics (Shewchuk) and simulation of simplicity (Edelsbrunner).
 
 Permutation
 Utilities for manipulating permutations.
 
 Process
 Abstraction layer for process management and multi-threading.
 
 Progress
 Framework for tracking the progression of a task.
 

Classes

class  AdaptiveKdTree
 Implements NearestNeighborSearch using an Adaptive Kd-tree. More...
 
class  AmbientOcclusionImpl
 Implementation of AmbientOcclusion full screen effect. More...
 
class  Application
 Base class for all applications. More...
 
class  ArcBall
 Enables to interactively define a rotation. More...
 
class  Attribute
 Manages an attribute attached to a set of object. More...
 
class  Attribute< bool >
 Specialization of Attribute for booleans. More...
 
class  AttributeBase
 Base class for Attributes, that manipulates an attribute stored in an AttributesManager. More...
 
class  AttributesManager
 Managers a set of attributes attached to an object. More...
 
class  AttributeStore
 Notifies a set of AttributeStoreObservers each time the stored array changes size and/or base address and/or dimension. More...
 
class  AttributeStoreCreator
 Internal class for creating an AttributeStore from the type name of its elements. More...
 
class  AttributeStoreObserver
 Base class for attributes. They are notified whenever the AttributeStore is modified. More...
 
struct  AxisPermutation
 
class  BalancedKdTree
 Implements NearestNeighborSearch using a balanced Kd-tree. More...
 
struct  basic_bindex
 A couple of two indices. More...
 
struct  basic_quadindex
 A tuple of four indices. More...
 
struct  basic_trindex
 A triple of three indices. More...
 
struct  Basis3d
 
struct  BBox
 
struct  BBox1
 
class  BinaryInputStream
 Binary input file. More...
 
class  BinaryOutputStream
 Binary output file. More...
 
class  BinaryStream
 Binary stream base class. More...
 
class  Box
 Axis-aligned bounding box. More...
 
class  BuildRVDMesh
 Constructs a polyhedral mesh from a restricted Voronoi diagram. More...
 
class  Cavity
 Represents the set of tetrahedra on the boundary of the cavity in a 3D Delaunay triangulation. More...
 
struct  CellDescriptor
 Lookup tables that describe the combinatorics of each cell type. More...
 
class  CentroidalVoronoiTesselation
 CentroidalVoronoiTesselation is the main component of the remeshing algorithm. More...
 
struct  Chart
 A piece of a mesh. More...
 
struct  Coeff
 
class  Colormap
 A Colormap. More...
 
class  Command
 Manages the GUI of a command with ImGUI. More...
 
class  CommandInvoker
 Abstract class for calling functions or calling member functions. More...
 
class  Console
 A console, that displays logger messages, and where the user can enter commands. More...
 
class  ConsoleLogger
 Logger client that redirects messages to standard output. More...
 
struct  CoTan3D
 
class  Counted
 Base class for reference-counted objects. More...
 
class  Delaunay
 Abstract interface for Delaunay triangulation in Nd. More...
 
class  Delaunay2d
 Implementation of Delaunay in 2d. More...
 
class  Delaunay3d
 Implementation of Delaunay in 3d. More...
 
class  Delaunay_NearestNeighbors
 Delaunay interface for NearestNeighbors search. More...
 
struct  DynamicHBoxes
 
class  Environment
 Application environment. More...
 
class  expansion
 Represents numbers in arbitrary precision with a low-level API. More...
 
class  expansion_nt
 Expansion_nt (expansion Number Type) is used to compute the sign of polynoms exactly. More...
 
struct  FacetIntersect
 
struct  FacetsExtraConnectivity
 
struct  FacetsExtraConnectivityWithInvalidFacets
 
class  Factory
 Factory of typed objects. More...
 
class  Factory0
 Factory for types without constructor arguments. More...
 
class  Factory1
 Factory for types with one constructor argument. More...
 
struct  FactoryCreator0
 Factory creator without constructor arguments. More...
 
struct  FactoryCreator1
 Factory creator with one argument. More...
 
struct  FF_param
 
class  FFopt
 
class  FileLogger
 Logger client that redirects messages to a file. More...
 
struct  Frame
 
class  FrameBufferObject
 An OpenGL frame buffer object. More...
 
class  FrameField
 Represents a 3D frame field, i.e. a function that associates a 3d orthonormal basis to each point in 3D space. More...
 
class  FullScreenEffectImpl
 Implementation of full screen effects. More...
 
class  FunctionCommandInvoker
 An implementation of CommandInvoker that calls a function. More...
 
class  GenColor
 A generic color type. More...
 
class  geo_declare_image_serializer
 Declares an image serializer for a given extension. More...
 
class  geo_register_attribute_type
 Helper class to register new attribute types. More...
 
class  GeoFile
 Base class for reading or writing Geogram structured binary files. More...
 
class  GeoFileException
 GeoFile exception. More...
 
struct  HBoxes
 
struct  HexdomParam
 
struct  IdPair
 
class  Image
 An image. More...
 
class  ImageLibrary
 Manages the ImageSerializer repository and the named images. More...
 
class  ImageRasterizer
 Draws triangles in an image. More...
 
class  ImageSerializer
 Loads and saves images. More...
 
class  ImageSerializer_pgm
 
class  ImageSerializer_xpm
 
class  ImageSerializerSTB
 Loads and saves images. More...
 
class  ImageSerializerSTBRead
 An image serializer that can read images. More...
 
class  ImageSerializerSTBReadWrite
 An image serializer that can read and write images. More...
 
class  InputGeoFile
 Used to read a structured binary file. More...
 
class  InstanceRepo
 Repository of unique instances. More...
 
class  IntegrationSimplex
 Computes an objective function and its gradient over a restricted Voronoi diagram. More...
 
class  KdTree
 Base class for all Kd-tree implementations. More...
 
class  LinearLeastSquares
 Computes the linear least squares regression of a function evaluated in 3d. More...
 
class  LineInput
 Reads an ASCII file line per line. More...
 
class  LocalFeatureSize
 Computes an approximation of lfs (local feature size). More...
 
class  Logger
 Generic logging framework. More...
 
class  LoggerClient
 Logger client base class. More...
 
class  LoggerStream
 Stream used by the Logger. More...
 
class  LoggerStreamBuf
 Stream buffer used by the LoggerStreams. More...
 
class  lua_to
 Converts LUA variables to C++ variables. More...
 
class  lua_to< bool >
 lua_to specialization for bool. More...
 
class  lua_to< const char * >
 lua_to specialization for raw string (const char*). More...
 
class  lua_to< const std::string & >
 lua_to specialization for reference to std::string. More...
 
class  lua_to< double >
 lua_to specialization for double. More...
 
class  lua_to< float >
 lua_to specialization for float. More...
 
class  lua_to< index_t >
 lua_to specialization for index_t. More...
 
class  lua_to< int >
 lua_to specialization for int. More...
 
class  lua_to< Numeric::int64 >
 lua_to specialization for Numeric::int64. More...
 
class  lua_to< Numeric::uint64 >
 lua_to specialization for Numeric::uint64. More...
 
class  lua_to< std::string >
 lua_to specialization for std::string. More...
 
class  lua_wrapper
 Manages wrappers around C++ functions to be called from LUA. More...
 
class  Matrix
 A matrix type. More...
 
struct  MatrixM
 
struct  MatrixMixedConstrainedSolver
 
class  MemberFunctionCommandInvoker
 An implementation of CommandInvoker that calls a member function of an object. More...
 
class  Mesh
 Represents a mesh. More...
 
class  MeshCellCornersStore
 Stores the cell corners of a mesh (low-level store) More...
 
class  MeshCellFacetsStore
 Stores the cell facets of a mesh (low-level store) More...
 
class  MeshCells
 The cells of a mesh. More...
 
class  MeshCellsAABB
 Axis Aligned Bounding Box tree of mesh tetrahedra. More...
 
class  MeshCellsStore
 Stores the cells of a mesh (low-level store) More...
 
class  MeshEdges
 The edges of a mesh. More...
 
class  MeshElements
 Base class for mesh elements. More...
 
class  MeshFacetCornersStore
 Stores the facet corners of a mesh (low-level store) More...
 
class  MeshFacets
 The facets of a mesh. More...
 
class  MeshFacetsAABB
 Axis Aligned Bounding Box tree of mesh facets. More...
 
class  MeshFacetsStore
 Stores the facets of a mesh (low-level store) More...
 
class  MeshGfx
 Draws a mesh using OpenGL. More...
 
class  MeshHalfedges
 Exposes a half-edge like API for traversing a Mesh. More...
 
class  MeshIOFlags
 Mesh load/save flags. More...
 
class  MeshIOHandler
 Mesh loader and saver. More...
 
class  MeshSplitCallbacks
 A set of callbacks that specify how vertices attributes should be interpolated by subdivision functions. More...
 
class  MeshSubElementsStore
 Base class for mesh sub-element storage. More...
 
class  MeshVertices
 The vertices of a mesh. More...
 
class  MonoThreadingThreadManager
 Single thread ThreadManager. More...
 
class  MorphoMath
 Implements morphological operators for images. More...
 
struct  NaiveSparseMatrix
 
class  NearestNeighborSearch
 Abstract interface for nearest neighbor search algorithms. More...
 
class  OptimalTransportMap
 Computes semi-discrete optimal transport maps. More...
 
class  OptimalTransportMap2d
 Computes semi-discrete optimal transport maps. More...
 
class  OptimalTransportMap3d
 Computes semi-discrete optimal transport maps. More...
 
class  OptimalTransportMapOnSurface
 Computes semi-discrete optimal transport maps. More...
 
class  Optimizer
 Optimizer minimizes a multivariate function. More...
 
class  OutputGeoFile
 Used to write a structured binary file. More...
 
class  PackedArrays
 Efficient storage for array of arrays. More...
 
class  Packer
 Packs a set of surfaces in parameter (texture) space. More...
 
class  ParallelDelaunay3d
 Multithreaded implementation of Delaunay in 3d. More...
 
class  ParamValidator
 Tests whether texture coordinates attached to a surface mesh define a valid parameterization. More...
 
class  Periodic
 Utilities for managing 3D periodic space. More...
 
class  PeriodicDelaunay3d
 Multithreaded implementation of Delaunay in 3d with optional periodic boundary conditions. More...
 
class  PGPopt
 
struct  Plane
 A 3D Plane. More...
 
struct  Poly2d
 
struct  Poly3d
 
class  PrincipalAxes3d
 
class  ProcessorStopwatch
 A more precise stopwatch. More...
 
class  ProgressClient
 Task progress listener. More...
 
class  ProgressTask
 Tracks the progress of a task. More...
 
class  Quaternion
 Quaternions are useful for representing rotations. More...
 
class  rational_nt
 Rational_nt (rational Number Type) is used to compute the sign of rational fractions exactly. More...
 
class  ReadOnlyScalarAttributeAdapter
 Access to an attribute as a double regardless its type. More...
 
class  RegularWeightedDelaunay2d
 Regular Delaunay triangulation of weighted points. More...
 
class  RegularWeightedDelaunay3d
 Regular Delaunay triangulation of weighted points. More...
 
struct  RemoveColMatrix
 
class  RestrictedVoronoiDiagram
 Computes a Restricted Voronoi Diagram (RVD). More...
 
class  RVDCallback
 Baseclass for user functions called for each element (polygon or polyhedron) of a restricted Voronoi diagram traversal. More...
 
class  RVDMeshBuilder
 Builds a Mesh using the symbolic information in the vertices computed by a RestrictedVoronoiDiagram. More...
 
class  RVDPolygonCallback
 Baseclass for user functions called for each polygon of a surfacic restricted Voronoi diagram. More...
 
class  RVDPolyhedronCallback
 Baseclass for user functions called for each polyhedron of a volumetric restricted Voronoi diagram. More...
 
class  RVDVertexMap
 RVDVertexMap maps symbolic vertices to unique ids. More...
 
class  SimpleApplication
 
class  SimpleMeshApplication
 An Application that manipulates a single Mesh. More...
 
class  SmartPointer
 A smart pointer with reference-counted copy semantics. More...
 
struct  SphericalHarmonicL4
 
class  StatusBar
 StatusBar displays the progress bar. More...
 
class  Stopwatch
 Scope restricted stopwatch. More...
 
class  StructuringElement
 A structuring element, that is the definition of neighborhood used by a morphological operation. More...
 
class  SystemEnvironment
 System environment. More...
 
class  SystemStopwatch
 Measures the time taken by an algorithm. More...
 
struct  TaskCanceled
 Exception thrown when a task is canceled. More...
 
class  TextEditor
 A minimalistic text editor. More...
 
class  Thread
 Platform-independent base class for running threads. More...
 
class  ThreadManager
 Platform-independent base class for running concurrent threads. More...
 
struct  TrFan
 
class  TrglGradient
 
class  TypedAttributeStore
 Stores an array of elements of a given type, and notifies a set of AttributeStoreObservers each time the storead array changes size and/or base address. More...
 
class  TypedAttributeStoreCreator
 Implementation of AttributeStoreCreator for a specific type. More...
 
class  TypedThreadGroup
 Typed collection of Threads. More...
 
struct  UncenteredPCA3D
 
class  UnsharpMaskingImpl
 Implementation of UnsharpMasking full screen effect. More...
 
class  VariableObserver
 Observes Environment variables. More...
 
class  VariableObserverList
 List of VariableObservers. More...
 
class  vecng
 Generic maths vector. More...
 
class  vecng< 2, T >
 Specialization of class vecng for DIM == 2. More...
 
class  vecng< 3, T >
 Specialization of class vecng for DIM == 3. More...
 
class  vecng< 4, T >
 Specialization of class vecn3 for DIM == 4. More...
 
class  vector
 Vector with aligned memory allocation. More...
 
class  vector< bool >
 Specialization of vector for elements of type bool. More...
 
class  VSDM
 Voronoi Square Distance Minimization. More...
 

Typedefs

typedef vecng< 3, Numeric::int32vec3i
 Represents points and vectors in 3d with integer coordinates. More...
 
typedef SmartPointer< AttributeStoreCreatorAttributeStoreCreator_var
 An automatic reference-counted pointer to an AttributeStoreCreator.
 
typedef vecng< 2, Numeric::float64vec2
 Represents points and vectors in 2d. More...
 
typedef vecng< 3, Numeric::float64vec3
 Represents points and vectors in 3d. More...
 
typedef vecng< 4, Numeric::float64vec4
 Represents points and vectors in 4d. More...
 
typedef vecng< 2, Numeric::float32vec2f
 Represents points and vectors in 2d with single-precision coordinates. More...
 
typedef vecng< 3, Numeric::float32vec3f
 Represents points and vectors in 3d with single-precision coordinates. More...
 
typedef vecng< 4, Numeric::float32vec4f
 Represents points and vectors in 4d with single-precision coordinates. More...
 
typedef vecng< 2, Numeric::int32vec2i
 Represents points and vectors in 2d with integer coordinates. More...
 
typedef vecng< 4, Numeric::int32vec4i
 Represents points and vectors in 4d with integer coordinates. More...
 
typedef Matrix< 2, Numeric::float64mat2
 Represents a 2x2 matrix. More...
 
typedef Matrix< 3, Numeric::float64mat3
 Represents a 3x3 matrix. More...
 
typedef Matrix< 4, Numeric::float64mat4
 Represents a 4x4 matrix. More...
 
typedef SmartPointer< LoggerClientLoggerClient_var
 
typedef geo_index_t index_t
 The type for storing and manipulating indices.
 
typedef geo_signed_index_t signed_index_t
 The type for storing and manipulating indices differences. More...
 
typedef geo_coord_index_t coord_index_t
 The type for storing coordinate indices, and iterating on the coordinates of a point.
 
typedef SmartPointer< ThreadThread_var
 
typedef std::vector< Thread_varThreadGroup
 Collection of Threads. More...
 
typedef SmartPointer< ThreadManagerThreadManager_var
 
typedef SmartPointer< ProgressClientProgressClient_var
 
typedef Numeric::uint8 thread_index_t
 
typedef GenColor< Numeric::float64Color
 Default representation of colors. More...
 
typedef SmartPointer< ColormapColormap_var
 An automatic reference-counted pointer to a Colormap.
 
typedef SmartPointer< ImageImage_var
 
typedef SmartPointer< ImageSerializerImageSerializer_var
 An automatic reference-counted pointer to an ImageSerializer.
 
typedef int(* lua_test_func) (lua_State *L, int idx)
 A pointer to a LUA function to test an argument in the LUA stack.
 
typedef void(* ManifoldHarmonicsCallback) (index_t eigen_index, double eigen_val, const double *eigen_vector, void *client_data)
 A function pointer to be used with mesh_compute_manifold_harmonics_by_bands()
 
typedef std::pair< TriangleRegion, TriangleRegionTriangleIsect
 Encodes the symbolic representation of a triangle intersection, as a pair of TriangleRegion.
 
typedef GEOGen::SymbolicVertex SymbolicVertex
 Symbolic representation of a RestrictedVoronoiDiagram vertex.
 
typedef SmartPointer< IntegrationSimplexIntegrationSimplex_var
 
typedef SmartPointer< RestrictedVoronoiDiagramRestrictedVoronoiDiagram_var
 Smart pointer to a RestrictedVoronoiDiagram object.
 
typedef SmartPointer< AmbientOcclusionImplAmbientOcclusionImpl_var
 An automatic reference-counted pointer to an AmbientOcclusionImpl.
 
typedef SmartPointer< FullScreenEffectImplFullScreenEffectImpl_var
 An automatic reference-counted pointer to a FullScreenEffectImpl.
 
typedef SmartPointer< UnsharpMaskingImplUnsharpMaskingImpl_var
 An automatic reference-counted pointer to an UnsharpMaskingImpl.
 
typedef SmartPointer< CommandInvokerCommandInvoker_var
 Automatic reference-counted pointer to a CommandInvoker. More...
 
typedef SmartPointer< ConsoleConsole_var
 
typedef SmartPointer< StatusBarStatusBar_var
 

Enumerations

enum  OTLinearSolver { OT_PRECG, OT_SUPERLU, OT_CHOLMOD }
 Specifies the linear solver to be used with OptimalTransport.
 
enum  AssertMode { ASSERT_THROW, ASSERT_ABORT, ASSERT_BREAKPOINT }
 Assert termination mode. More...
 
enum  { GEOGRAM_NO_HANDLER = 0, GEOGRAM_INSTALL_HANDLERS = 1 }
 Symbolic constants for GEO::initialize()
 
enum  Sign { NEGATIVE = -1, ZERO = 0, POSITIVE = 1 }
 Integer constants that represent the sign of a value. More...
 
enum  MeshCellType {
  MESH_TET = 0, MESH_HEX = 1, MESH_PRISM = 2, MESH_PYRAMID = 3,
  MESH_CONNECTOR = 4, MESH_NB_CELL_TYPES = 5
}
 
enum  MeshElementsFlags
 Indicates the mesh elements (vertices, facets or cells) present in a mesh. More...
 
enum  MeshCompareFlags {
  MESH_COMPARE_OK = 0, MESH_COMPARE_DIMENSIONS = 1, MESH_COMPARE_NB_VERTICES = 2, MESH_COMPARE_NB_FACETS = 4,
  MESH_COMPARE_NB_FACET_BORDERS = 8, MESH_COMPARE_AREAS = 16, MESH_COMPARE_TOPOLOGY = 32, MESH_COMPARE_NB_TETS = 64,
  MESH_COMPARE_NB_TET_BORDERS = 128, MESH_COMPARE_SURFACE_PROPS, MESH_COMPARE_VOLUME_PROPS, MESH_COMPARE_ALL = MESH_COMPARE_VOLUME_PROPS
}
 Flags used to compare two meshes. More...
 
enum  MeshDecimateMode {
  MESH_DECIMATE_FAST = 0, MESH_DECIMATE_DUP_F = 1, MESH_DECIMATE_DEG_3 = 2, MESH_DECIMATE_KEEP_B = 4,
  MESH_DECIMATE_DEFAULT
}
 Determines the operating mode of mesh_decimate_vertex_clustering(). The flags can be combined with the 'bitwise or' (|) operator. MESH_REPAIR_DEFAULT fits most uses. More...
 
enum  MeshAttributesFlags {
  MESH_NO_ATTRIBUTES = 0, MESH_VERTEX_REGION = 1, MESH_VERTEX_TEX_COORD = 2, MESH_VERTEX_COLOR = 4,
  MESH_FACET_REGION = 8, MESH_CELL_REGION = 16, MESH_ALL_ATTRIBUTES = 255
}
 Indicates the attributes stored in a mesh and attached to the mesh elements (vertices, facets or volumes). More...
 
enum  LaplaceBeltramiDiscretization { COMBINATORIAL, UNIFORM, FEM_P1, FEM_P1_LUMPED }
 
enum  MeshPartitionMode { MESH_PARTITION_HILBERT = 1, MESH_PARTITION_CONNECTED_COMPONENTS = 2 }
 Strategy for mesh partitioning. More...
 
enum  MeshOrder { MESH_ORDER_HILBERT, MESH_ORDER_MORTON }
 Strategy for spatial sorting. More...
 
enum  MeshRepairMode {
  MESH_REPAIR_TOPOLOGY = 0, MESH_REPAIR_COLOCATE = 1, MESH_REPAIR_DUP_F = 2, MESH_REPAIR_TRIANGULATE = 4,
  MESH_REPAIR_RECONSTRUCT = 8, MESH_REPAIR_QUIET = 16, MESH_REPAIR_DEFAULT
}
 Determines the operating mode of mesh_repair(). The flags can be combined with the 'bitwise or' (|) operator. MESH_REPAIR_DEFAULT fits most uses. More...
 
enum  TriangleRegion {
  T_RGN_P0 = 0, T_RGN_P1 = 1, T_RGN_P2 = 2, T_RGN_E0 = 3,
  T_RGN_E1 = 4, T_RGN_E2 = 5, T_RGN_T = 6
}
 Encodes the location of a point within a triangle. More...
 
enum  ChartParameterizer { PARAM_LSCM, PARAM_SPECTRAL_LSCM, PARAM_ABF }
 
enum  ChartPacker { PACK_TETRIS, PACK_XATLAS }
 
enum  EventAction { EVENT_ACTION_UP =0, EVENT_ACTION_DOWN =1, EVENT_ACTION_DRAG =2, EVENT_ACTION_UNKNOWN =255 }
 
enum  EventSource { EVENT_SOURCE_KEYBOARD =0, EVENT_SOURCE_MOUSE =1, EVENT_SOURCE_FINGER =2, EVENT_SOURCE_STYLUS =3 }
 
enum  { geo_imgui_string_length = 4096 }
 Maximum string length for ImGUI. TODO replace with ImGui functions to handle dynamic buffer with InputText().
 

Functions

template<class T >
void min_equal (T &A, T B)
 
template<class T >
void max_equal (T &A, T B)
 
double nint (double x)
 
index_t next_mod (index_t i, index_t imax)
 
index_t prev_mod (index_t i, index_t imax)
 
template<class T >
clamp (T in, T vmin, T vmax)
 
void show (mat3 r)
 
vec3 col (const mat3 &M, index_t j)
 
vec3 operator* (const mat3 &M, const vec3 &v)
 
mat3 mat3_from_coeffs (double a00, double a01, double a02, double a10, double a11, double a12, double a20, double a21, double a22)
 
mat3 mat3_from_coeffs (double *c)
 
double trace (const mat3 &m)
 
double Frobenius_norm (const mat3 &m)
 
vec3i snap_to_integer (const vec3 &f)
 
bool is_integer (double d)
 
template<class T >
T & aupp (int id, vector< T > &data)
 
template<class T >
T & aupp (index_t id, vector< T > &data)
 
void merge_hex_boundary_and_quadtri (Mesh *hex, Mesh *quad)
 
void halfedge_manip_example (Mesh *m)
 
void create_facet_adjacence (Mesh *m, bool has_border=false)
 
void compute_tet_edge_graph (Mesh *m, vector< index_t > &v2e, bool store_both_directions)
 
void restore_v2e (Mesh *m, vector< index_t > &v2e)
 
void cell_edges_in_RCS (Mesh *m, vector< index_t > &offset_from_org, vector< index_t > &dest)
 
bool v2f_is_valid (Mesh *m, vector< vector< index_t > > &v2f, vector< index_t > &to_kill)
 
void EXPLORAGRAM_API view_FF_with_gyphs (Mesh *m, Mesh *render, bool SH, double scale_in)
 
void EXPLORAGRAM_API view_U_locks (Mesh *m, Mesh *render, double scale_in, bool extractall)
 
bool is_identity_auvp (const mat3 &m, double eps=1e-15)
 
mat3 EXPLORAGRAM_API normalize_columns (const mat3 &B)
 
mat3 EXPLORAGRAM_API invert_columns_norm (const mat3 &B)
 
mat3 EXPLORAGRAM_API rotx (double angle)
 
mat3 EXPLORAGRAM_API roty (double angle)
 
mat3 EXPLORAGRAM_API rotz (double angle)
 
mat3 euler_to_mat3 (vec3 xyz)
 
vec3 mat3_to_euler (const mat3 &r)
 
vec3i operator* (const AxisPermutation &p, const vec3i &v)
 
AxisPermutation EXPLORAGRAM_API Rij (Mesh *m, Attribute< mat3 > &B, index_t i, index_t j)
 
bool EXPLORAGRAM_API triangle_is_frame_singular (Mesh *m, Attribute< mat3 > &B, index_t c, index_t cf)
 
bool triangle_is_frame_singular___give_stable_direction (Mesh *m, int &stable_dir_index, Attribute< mat3 > &B, index_t c, index_t cf, index_t cfv=0)
 
bool triangle_is_frame_singular___give_stable_direction (Mesh *m, vec3 &stable_dir_geom, Attribute< mat3 > &B, index_t c, index_t cf, index_t cfv=0)
 
int EXPLORAGRAM_API NoDivTriTriIsect (double V0[3], double V1[3], double V2[3], double U0[3], double U1[3], double U2[3])
 
int EXPLORAGRAM_API triBoxOverlap (float boxcenter[3], float boxhalfsize[3], float triverts[3][3])
 
void hex_set_2_hex_mesh (Mesh *hex, Mesh *quadtri=nullptr)
 
void kill_intersecting_hexes (Mesh *hex)
 
void export_hexes (Mesh *m, Mesh *hex)
 
void export_points (Mesh *m, Mesh *pts)
 
void EXPLORAGRAM_API bourrin_subdivide_hexes (Mesh *m)
 
void EXPLORAGRAM_API bourrin_quadrangulate_facets (Mesh *m)
 
bool EXPLORAGRAM_API next_crunch (Mesh *m, Mesh *newhex, bool newmodel=false, int nb_max_punch=1000000)
 
void EXPLORAGRAM_API prepare_crunch (Mesh *m, bool subdivide, bool revert)
 
void EXPLORAGRAM_API punch_and_cut (Mesh *m, Mesh *newhex, int nb_iter, int nb_punch_per_iter, bool check_validity)
 
void EXPLORAGRAM_API hex_crunch (Mesh *m, Mesh *hex)
 
void EXPLORAGRAM_API quadrangulate_easy_boundary (Mesh *m)
 
void fill_cavity_with_tetgen (Mesh *input, Mesh *tri, bool with_pyramid)
 
void add_hexes_to_tetmesh (Mesh *hex, Mesh *tet_mesh)
 
void Baudoin_mesher (Mesh *m)
 
void hex_dominant (Mesh *cavity, Mesh *hexahedrons, Mesh *result)
 
double tetra_volume_sign (vec3 A, vec3 B, vec3 C, vec3 D)
 
bool same_sign (double a, double b)
 
vector< BBoxfacets_bbox (Mesh *m)
 
bool polyintersect (vector< vec3 > &P, vector< vec3 > &Q)
 
vector< index_tget_intersecting_faces (Mesh *m)
 
void check_no_intersecting_faces (Mesh *m, bool allow_duplicated=false)
 
void EXPLORAGRAM_API get_facet_stats (Mesh *m, const char *msg="get_facet_stats", bool export_attribs=false)
 
bool EXPLORAGRAM_API surface_is_tetgenifiable (Mesh *m)
 
bool EXPLORAGRAM_API volume_is_tetgenifiable (Mesh *m)
 
bool EXPLORAGRAM_API surface_is_manifold (Mesh *m, std::string &msg)
 
bool EXPLORAGRAM_API volume_boundary_is_manifold (Mesh *m, std::string &msg)
 
double EXPLORAGRAM_API tet_vol (vec3 A, vec3 B, vec3 C, vec3 D)
 
void EXPLORAGRAM_API get_hex_proportion (Mesh *m, double &nb_hex_prop, double &vol_hex_prop)
 
bool EXPLORAGRAM_API have_negative_tet_volume (Mesh *m)
 
vec3 facet_normal (Mesh *m, index_t f)
 
index_t cell_facet_corner_id (Mesh *m, index_t c, index_t cf, index_t cfc)
 
void EXPLORAGRAM_API compute_3D_edge_cot_w (Mesh *m, Attribute< index_t > &v2e, double anisoZ_cotW)
 
void EXPLORAGRAM_API kill_isolated_vertices (Mesh *m)
 
void EXPLORAGRAM_API merge_vertices (Mesh *m, double eps)
 
void EXPLORAGRAM_API facets_smooth_geom (Mesh *m, std::vector< bool > &lock_v, double fit_coeff=.95)
 
void EXPLORAGRAM_API cells_smooth_geom (Mesh *m, std::vector< bool > &lock_v, double fit_coeff=.95)
 
void EXPLORAGRAM_API facets_smooth_geom (Mesh *m, double fit_coeff=.95)
 
void EXPLORAGRAM_API cells_smooth_geom (Mesh *m, double fit_coeff=.95)
 
void EXPLORAGRAM_API create_non_manifold_facet_adjacence (Mesh *m)
 
vec3X (Mesh *m)
 
vec3 cell_bary (Mesh *m, index_t c)
 
vec3 cell_facet_bary (Mesh *m, index_t c, index_t lf)
 
vec3 facet_bary (Mesh *m, index_t f)
 
EXPLORAGRAM_API double get_cell_average_edge_size (Mesh *mesh)
 
EXPLORAGRAM_API double get_facet_average_edge_size (Mesh *mesh)
 
EXPLORAGRAM_API vec3 tet_facet_cross (Mesh *m, index_t c, index_t lf)
 
EXPLORAGRAM_API index_t next_cell_around_oriented_edge (Mesh *m, index_t cell_id, index_t v_org, index_t v_dest)
 
const index_tMTcase (double iso, double v0, double v1, double v2, double v3)
 
index_t add_facet_to_mesh (Mesh *m, vector< vec3 > &pts, Attribute< vec2 > *uv=nullptr, vector< vec2 > *lU=nullptr)
 
template<class T >
void get_range (Attribute< T > &attr, double &v_min, double &v_max)
 
vector< vector< index_t > > generate_v2f (Mesh *m)
 
bool find_self_intersections (Mesh *facets_with_quads_and_tri_only, vector< index_t > &intersections)
 
bool lock_self_intersecting_regions (Mesh *facets_with_quads_and_tri_only, vector< BBox > &regions_to_lock)
 
bool lock_self_intersecting_regions (Mesh *facets_with_quads_and_tri_only, Attribute< bool > &verts_to_remove, Attribute< index_t > &undo)
 
bool try_simplify (Mesh *m, Attribute< index_t > &chart, Attribute< bool > &verts_to_remove, Attribute< index_t > &undo)
 
std::ostream & operator<< (std::ostream &os, const GEO::vector< Coeff > &obj)
 
bool coeffCmp (const Coeff &A, const Coeff &B)
 
void order_AND_make_unique (vector< Coeff > &c)
 
void add_to_sorted_sparse_vector (vector< Coeff > &L, index_t index, double val)
 Adds a coefficient in a sparse vector. More...
 
void mult (const vector< Coeff > &c, NaiveSparseMatrix &B, vector< Coeff > &result)
 
void EXPLORAGRAM_API produce_hexdom_input (Mesh *m, std::string &error_msg, bool hilbert_sort=true, bool relaxed=false)
 
void find_degenerate_facets (Mesh *m, vector< index_t > &degenerate)
 
void export_boundary_with_uv (Mesh *m, Mesh *hex, const char *uv_name, const char *singtri_name)
 Creates a surfacic parameterized mesh from the boundary of an input volumetric parameterized mesh. More...
 
void imprint (Mesh *m, const char *uv_name, const char *singular_name)
 
void split_edges_by_iso_uvs (Mesh *hex, const char *uv_name, const char *singular_name)
 
void facets_split (Mesh *m, const char *uv_name, const char *singular_name)
 
void mark_charts (Mesh *m, const char *uv_name, const char *charts_name, const char *singular_name)
 
void simplify_quad_charts (Mesh *m)
 
bool export_quadtri_from_charts (Mesh *hex)
 
void add_edge (Mesh *m, vec3 P0, vec3 P1, double value=0)
 
void add_triangle (Mesh *m, vec3 P0, vec3 P1, vec3 P2, double value=0)
 
void current_test (Mesh *m, Mesh *debug_mesh)
 
bool EXPLORAGRAM_API try_quadrangulate (vector< vec2 > &pts, vector< index_t > &quads)
 
std::istream & operator>> (std::istream &input, SphericalHarmonicL4 &gna)
 
std::ostream & operator<< (std::ostream &output, const SphericalHarmonicL4 &gna)
 
void EXPLORAGRAM_API compute_Laguerre_centroids_2d (Mesh *omega, index_t nb_points, const double *points, double *centroids, Mesh *RVD=nullptr, bool verbose=false, index_t nb_air_particles=0, const double *air_particles=nullptr, index_t air_particles_stride=0, double air_fraction=0.0, const double *weights_in=nullptr, double *weights_out=nullptr, index_t nb_iter=1000)
 Computes the centroids of the Laguerre cells that correspond to optimal transport in 2D. More...
 
void EXPLORAGRAM_API compute_Laguerre_centroids_3d (Mesh *omega, index_t nb_points, const double *points, double *centroids, RVDPolyhedronCallback *cb=nullptr, bool verbose=false, index_t nb_iter=2000)
 Computes the centroids of the Laguerre cells that correspond to optimal transport. More...
 
void EXPLORAGRAM_API compute_morph (CentroidalVoronoiTesselation &CVT, OptimalTransportMap3d &OTM, Mesh &morph, bool filter_tets=true)
 Computes a shape that interpolates the two input tet meshes. More...
 
void EXPLORAGRAM_API compute_singular_surface (CentroidalVoronoiTesselation &CVT, OptimalTransportMap3d &OTM, Mesh &singular_set)
 Computes the surface that corresponds to discontinuities in the optimal transport map. More...
 
void EXPLORAGRAM_API compute_Laguerre_centroids_on_surface (Mesh *omega, index_t nb_points, const double *points, double *centroids, Mesh *RVD=nullptr, bool verbose=false)
 Computes the centroids of the Laguerre cells that correspond to optimal transport over a surface embedded in 3D. More...
 
void EXPLORAGRAM_API recenter_mesh (const Mesh &M1, Mesh &M2)
 Translates a mesh in such a way that its center matches the center of another mesh. More...
 
double EXPLORAGRAM_API mesh_tets_volume (const Mesh &M)
 Computes the volume of a tetrahedral mesh. More...
 
void EXPLORAGRAM_API rescale_mesh (const Mesh &M1, Mesh &M2)
 Rescales a mesh in such a way that its total volume matches the volume of a reference mesh. More...
 
void EXPLORAGRAM_API set_density (Mesh &M, double mass1, double mass2, const std::string &func_str, Mesh *distance_reference=nullptr)
 Creates a "weight" attribute with varying values. More...
 
void EXPLORAGRAM_API sample (CentroidalVoronoiTesselation &CVT, index_t nb_points, bool project_on_border, bool BRIO=true, bool multilevel=true, double ratio=0.125, vector< index_t > *levels=nullptr)
 Computes a point sampling of a surfacic or volumetric mesh. More...
 
bool uses_parallel_algorithm ()
 Checks whether parallel algorithms are used. More...
 
template<typename ITERATOR >
void sort (const ITERATOR &begin, const ITERATOR &end)
 Sorts elements in parallel. More...
 
template<typename ITERATOR , typename CMP >
void sort (const ITERATOR &begin, const ITERATOR &end, const CMP &cmp)
 Sorts elements in parallel. More...
 
template<typename VECTOR >
void sort_unique (VECTOR &v)
 Sorts a vector and suppresses all duplicated elements. More...
 
template<typename ITERATOR >
void sort_3 (ITERATOR items)
 Specialized sort routine for 3 elements. More...
 
template<typename ITERATOR >
void sort_4 (ITERATOR items)
 Specialized sort routine for 4 elements. More...
 
template<class T >
void geo_argused (const T &)
 Suppresses compiler warnings about unused parameters. More...
 
void set_assert_mode (AssertMode mode)
 Sets assertion mode. More...
 
AssertMode assert_mode ()
 Returns the current assert termination mode.
 
GEO_NORETURN_DECL void geo_abort () GEO_NORETURN
 Aborts the program. More...
 
GEO_NORETURN_DECL void geo_breakpoint () GEO_NORETURN
 Generates a debugger breakpoint programmatically. More...
 
GEO_NORETURN_DECL void geo_assertion_failed (const std::string &condition_string, const std::string &file, int line) GEO_NORETURN
 Prints an assertion failure. More...
 
GEO_NORETURN_DECL void geo_range_assertion_failed (double value, double min_value, double max_value, const std::string &file, int line) GEO_NORETURN
 Prints a range assertion failure. More...
 
GEO_NORETURN_DECL void geo_should_not_have_reached (const std::string &file, int line) GEO_NORETURN
 Prints an unreachable location failure. More...
 
void initialize (int flags=GEOGRAM_INSTALL_HANDLERS)
 Initialize Geogram. More...
 
void terminate ()
 Cleans up Geogram. More...
 
template<class T >
bool read_ascii_attribute (FILE *file, Memory::pointer base_addr, index_t nb_elements)
 Reads an ASCII attribute from a file. More...
 
template<class T >
bool write_ascii_attribute (FILE *file, Memory::pointer base_addr, index_t nb_elements)
 Writes an ASCII attribute to a file. More...
 
template<>
bool read_ascii_attribute< char > (FILE *file, Memory::pointer base_addr, index_t nb_elements)
 Reads an ASCII attribute from a file. More...
 
template<>
bool write_ascii_attribute< char > (FILE *file, Memory::pointer base_addr, index_t nb_elements)
 Writes an ASCII attribute to a file. More...
 
template<>
bool read_ascii_attribute< bool > (FILE *file, Memory::pointer base_addr, index_t nb_elements)
 Reads an ASCII attribute from a file. More...
 
template<>
bool write_ascii_attribute< bool > (FILE *file, Memory::pointer base_addr, index_t nb_elements)
 Writes an ASCII attribute to a file. More...
 
bool bboxes_overlap (const Box &B1, const Box &B2)
 Tests whether two Boxes have a non-empty intersection. More...
 
void bbox_union (Box &target, const Box &B1, const Box &B2)
 Computes the smallest Box that encloses two Boxes. More...
 
template<class FT >
vecng< 3, FT > transform_vector (const vecng< 3, FT > &v, const Matrix< 4, FT > &m)
 Applies a 3d transform to a 3d vector. More...
 
template<class FT >
vecng< 3, FT > transform_point (const vecng< 3, FT > &v, const Matrix< 4, FT > &m)
 Applies a 3d transform to a 3d point. More...
 
template<class FT >
vecng< 4, FT > transform_vector (const vecng< 4, FT > &v, const Matrix< 4, FT > &m)
 Applies a 4d transform to a 4d point. More...
 
mat4 create_translation_matrix (const vec3 &T)
 Creates a translation matrix from a vector. More...
 
mat4 create_scaling_matrix (double s)
 Creates a scaling matrix. More...
 
double det2x2 (double a11, double a12, double a21, double a22)
 Computes a two-by-two determinant.
 
double det3x3 (double a11, double a12, double a13, double a21, double a22, double a23, double a31, double a32, double a33)
 Computes a three-by-three determinant.
 
double det4x4 (double a11, double a12, double a13, double a14, double a21, double a22, double a23, double a24, double a31, double a32, double a33, double a34, double a41, double a42, double a43, double a44)
 Computes a four-by-four determinant.
 
template<index_t DIM, class FT >
vecng< DIM, FT > operator* (const Matrix< DIM, FT > &M, const vecng< DIM, FT > &x)
 Computes a matrix vector product. More...
 
template<index_t DIM, class FT >
vecng< DIM, FT > mult (const Matrix< DIM, FT > &M, const vecng< DIM, FT > &x)
 Computes a matrix vector product. More...
 
template<class T >
Sign geo_sgn (const T &x)
 Gets the sign of a value. More...
 
template<class T >
geo_sqr (T x)
 Gets the square value of a value. More...
 
template<class T >
void geo_clamp (T &x, T min, T max)
 Clamps a value to a range. More...
 
index_t max_index_t ()
 Gets the maximum positive value of type index_t.
 
signed_index_t max_signed_index_t ()
 Gets the maximum positive value of type signed_index_t.
 
signed_index_t min_signed_index_t ()
 Gets the minimum negative value of type signed_index_t.
 
double round (double x)
 
void parallel_for (index_t from, index_t to, std::function< void(index_t)> func, index_t threads_per_core=1, bool interleaved=false)
 Executes a loop with concurrent threads. More...
 
void parallel_for_slice (index_t from, index_t to, std::function< void(index_t, index_t)> func, index_t threads_per_core=1)
 Executes a loop with concurrent threads. More...
 
void parallel (std::function< void()> f1, std::function< void()> f2)
 Calls functions in parallel. More...
 
void parallel (std::function< void()> f1, std::function< void()> f2, std::function< void()> f3, std::function< void()> f4)
 Calls functions in parallel. More...
 
void parallel (std::function< void()> f1, std::function< void()> f2, std::function< void()> f3, std::function< void()> f4, std::function< void()> f5, std::function< void()> f6, std::function< void()> f7, std::function< void()> f8)
 Calls functions in parallel. More...
 
std::ostream & operator<< (std::ostream &out, const Quaternion &q)
 Writes a Quaternion to a stream. More...
 
std::istream & operator>> (std::istream &in, Quaternion &q)
 Reads a Quaternion from a stream. More...
 
Quaternion operator+ (const Quaternion &a, const Quaternion &b)
 Computes the sum of two Quaternion. More...
 
Quaternion operator- (const Quaternion &a, const Quaternion &b)
 Computes the difference between two Quaternion. More...
 
Quaternion operator- (const Quaternion &a)
 Computes the opposite of a Quaternion. More...
 
Quaternion operator* (const Quaternion &a, const Quaternion &b)
 Computes the product of two Quaternion. More...
 
Quaternion operator* (const Quaternion &a, double t)
 Computes the product of a Quaternion and a scalar. More...
 
Quaternion operator* (double t, const Quaternion &a)
 Computes the product of a scalar and a Quaternion. More...
 
int my_lua_isboolean (lua_State *L, int idx)
 Tests whether a LUA variable is a boolean. More...
 
int my_lua_ispositiveinteger (lua_State *L, int idx)
 Tests whether a LUA variable is a positive integer. More...
 
void lua_set_error (lua_State *L, const char *error)
 Memorizes an error message in LUA registry. More...
 
void lua_set_error (lua_State *L, const std::string &error)
 Memorizes an error message in LUA registry. More...
 
void lua_clear_error (lua_State *L)
 Clears the last error message in LUA registry. More...
 
bool lua_has_error (lua_State *L)
 Tests whether an error message was memorized in the registry. More...
 
bool lua_check_type (lua_State *L, int idx, lua_test_func test)
 Tests whether a LUA variable has the correct type. More...
 
bool lua_check_nb_args (lua_State *L, int expected_nb_args)
 Tests whether the expected number of arguments was pushed onto the stack. More...
 
int lua_notify_last_error (lua_State *L)
 Takes the last error message memorized in the registry and sends it back to LUA. More...
 
template<class T >
void lua_push (lua_State *L, T x)
 Converts and pushes a C++ variable onto the LUA stack. More...
 
template<>
void lua_push (lua_State *L, int x)
 Specialization of lua_push() for int.
 
template<>
void lua_push (lua_State *L, index_t x)
 Specialization of lua_push() for index_t.
 
template<>
void lua_push (lua_State *L, Numeric::uint64 x)
 Specialization of lua_push() for Numeric::uint64.
 
template<>
void lua_push (lua_State *L, Numeric::int64 x)
 Specialization of lua_push() for Numeric::int64.
 
template<>
void lua_push (lua_State *L, float x)
 Specialization of lua_push() for float.
 
template<>
void lua_push (lua_State *L, double x)
 Specialization of lua_push() for double.
 
template<>
void lua_push (lua_State *L, bool x)
 Specialization of lua_push() for bool.
 
template<>
void lua_push (lua_State *L, const char *x)
 Specialization of lua_push() for raw string (const char*).
 
template<>
void lua_push (lua_State *L, const std::string &x)
 Specialization of lua_push() for reference to std::string.
 
template<>
void lua_push (lua_State *L, std::string x)
 Specialization of lua_push() for std::string.
 
template<class T >
void lua_push (lua_State *L, const std::vector< T > &x)
 Specialization of lua_push() for vectors. More...
 
template<class R >
int lua_wrap (lua_State *L, R(*fptr)(void))
 Calls a C++ function from LUA. More...
 
template<class R , class T1 >
int lua_wrap (lua_State *L, R(*fptr)(T1))
 Calls a C++ function from LUA. More...
 
template<class R , class T1 , class T2 >
int lua_wrap (lua_State *L, R(*fptr)(T1, T2))
 Calls a C++ function from LUA. More...
 
template<class R , class T1 , class T2 , class T3 >
int lua_wrap (lua_State *L, R(*fptr)(T1, T2, T3))
 Calls a C++ function from LUA. More...
 
template<class R , class T1 , class T2 , class T3 , class T4 >
int lua_wrap (lua_State *L, R(*fptr)(T1, T2, T3, T4))
 Calls a C++ function from LUA. More...
 
template<>
int lua_wrap (lua_State *L, void(*fptr)(void))
 Calls a C++ function from LUA. More...
 
template<class T1 >
int lua_wrap (lua_State *L, void(*fptr)(T1))
 Calls a C++ function from LUA. More...
 
template<class T1 , class T2 >
int lua_wrap (lua_State *L, void(*fptr)(T1, T2))
 Calls a C++ function from LUA. More...
 
template<class T1 , class T2 , class T3 >
int lua_wrap (lua_State *L, void(*fptr)(T1, T2, T3))
 Calls a C++ function from LUA. More...
 
template<class T1 , class T2 , class T3 , class T4 >
int lua_wrap (lua_State *L, void(*fptr)(T1, T2, T3, T4))
 Calls a C++ function from LUA. More...
 
template<>
int lua_wrap (lua_State *L, lua_CFunction fptr)
 Specialization of the wrapper for functions that are "already wrapped". More...
 
template<class FPTR >
void lua_pushwrapper (lua_State *L, FPTR f)
 Pushes a wrapper for a given C++ function onto the LUA stack. More...
 
template<>
void lua_pushwrapper (lua_State *L, lua_CFunction f)
 Specialization for lua_CFunction. More...
 
template<class FPTR >
void lua_bindwrapperwithname (lua_State *L, FPTR f, const std::string &name)
 Binds a wrapper to a name in the table at the top of the LUA stack. More...
 
template<class FPTR >
void lua_bindwrapperwithnameglobal (lua_State *L, FPTR f, const std::string &name)
 Binds a wrapper to a name in the global scole. More...
 
std::string lua_wrappername (lua_State *L, const char *functionname)
 Converts a C++ function name into a LUA function name. More...
 
void bake_mesh_facet_normals (Mesh *mesh, Image *target)
 Bakes the facet normals of a parameterized mesh into an image. More...
 
void bake_mesh_vertex_normals (Mesh *mesh, Image *target)
 Bakes the facet normals of a parameterized mesh into an image. More...
 
void bake_mesh_attribute (Mesh *mesh, Image *target, Attribute< double > &attribute, double bias=0.0, double scale=1.0)
 Bakes an attribute of a parameterized mesh. More...
 
void bake_mesh_geometry (Mesh *mesh, Image *target, bool clear=true)
 Bakes mesh geometry into an image (creates a geometry image). More...
 
void bake_mesh_facet_normals_indirect (Image *geometry, Image *target, Mesh *highres)
 Bakes facet normals from a (in general) high resolution mesh to a (in general) parameterized lower resolution mesh represented as a geometry image. More...
 
void bake_mesh_points_attribute_indirect (Image *geometry, Image *target, Mesh *highres, Attribute< double > &attribute, double bias=0.0, double scale=1.0)
 Bakes a vertex attribute from a (in general) high resolution point set to a (in general) parameterized lower resolution mesh represented as a geometry image. More...
 
MeshCompareFlags mesh_compare (const Mesh &M1, const Mesh &M2, MeshCompareFlags flags=MESH_COMPARE_SURFACE_PROPS, double tolerance=0.0, bool verbose=true)
 Compares two meshes. Compares the two meshes M1 and M2 according to the comparison flags flags (see MeshCompareFlags). The function returns a comparison status similar to the comparison flags: More...
 
void mesh_decimate_vertex_clustering (Mesh &M, index_t nb_bins, MeshDecimateMode mode=MESH_DECIMATE_DEFAULT, geo_index_t *vertices_flags=nullptr)
 Generates a simplified representation of a mesh. More...
 
index_t remove_degree3_vertices (Mesh &M, double max_dist)
 Removes degree 3 vertices. More...
 
double mesh_one_sided_Hausdorff_distance (Mesh &m1, Mesh &m2, double sampling_dist)
 Computes an approximation of the single sided Hausdorff distance dH(m1->m2) between two surfacic meshes. More...
 
double mesh_symmetric_Hausdorff_distance (Mesh &m1, Mesh &m2, double sampling_dist)
 Computes an approximation of the symmetric Hausdorff distance dH(m1<->m2) between two surfacic meshes. More...
 
void fill_holes (Mesh &M, double max_area=0.0, index_t max_edges=max_index_t(), bool repair=true)
 Fills holes in mesh by generating new triangles. More...
 
void tessellate_facets (Mesh &M, index_t max_nb_vertices)
 Subdivides the facets with more than nb_vertices. More...
 
void compute_normals (Mesh &M)
 Computes the normals to the vertices, and stores them as additional coordinates. More...
 
void simple_Laplacian_smooth (Mesh &M, index_t nb_iter, bool normals_only)
 Smoothes a mesh. More...
 
void get_bbox (const Mesh &M, double *xyzmin, double *xyzmax)
 Gets the bounding box of a mesh. More...
 
double bbox_diagonal (const Mesh &M)
 Computes the length of the bounding box diagonal of a mesh. More...
 
void set_anisotropy (Mesh &M, double s)
 Normalizes and scales the stored vertex normals by a factor. More...
 
void unset_anisotropy (Mesh &M)
 Normalizes the stored vertex normals. More...
 
void compute_sizing_field (Mesh &M, double gradation=1.0, index_t nb_lfs_samples=0)
 Computes a sizing field using an estimate of lfs (local feature size). More...
 
void normalize_embedding_area (Mesh &M)
 Computes vertices weights in such a way that triangle areas are normalized. More...
 
double mesh_cell_volume (const Mesh &M, index_t c)
 Computes the volume of a cell in a mesh. More...
 
double mesh_cells_volume (const Mesh &M)
 Computes the volume of the cells of a mesh. More...
 
vec3 mesh_cell_facet_normal (const Mesh &M, index_t c, index_t lf)
 Computes the normal of a cell facet. More...
 
double surface_average_edge_length (const Mesh &M)
 Computes the average edge length in a surface. More...
 
std::ostream & operator<< (std::ostream &out, const MeshHalfedges::Halfedge &H)
 Displays a Halfedge. More...
 
void mesh_remove_intersections (Mesh &M, index_t max_iter=3)
 Attempts to make a mesh conformal by removing intersecting facets and re-triangulating the holes.
 
bool mesh_load (const std::string &filename, Mesh &M, const MeshIOFlags &ioflags=MeshIOFlags())
 Loads a mesh from a file. More...
 
bool mesh_load (InputGeoFile &geofile, Mesh &M, const MeshIOFlags &ioflags=MeshIOFlags())
 Loads a mesh from a GeoFile ('.geogram' file format). More...
 
bool mesh_save (const Mesh &M, const std::string &filename, const MeshIOFlags &ioflags=MeshIOFlags())
 Saves a mesh to a file. More...
 
bool mesh_save (const Mesh &M, OutputGeoFile &geofile, const MeshIOFlags &ioflags=MeshIOFlags())
 Saves a mesh to a GeoFile ('.geogram' file format) More...
 
void mesh_io_initialize ()
 
void mesh_compute_manifold_harmonics (Mesh &M, index_t nb_eigens, LaplaceBeltramiDiscretization discretization, const std::string &attribute_name="eigen", double shift=0.0, bool print_spectrum=false)
 Computes the Manifold Harmonics basis functions. More...
 
void mesh_compute_manifold_harmonics_by_bands (Mesh &M, index_t nb_eigens, LaplaceBeltramiDiscretization discretization, ManifoldHarmonicsCallback callback, index_t nb_eigens_per_band=30, double initial_shift=0.0, void *client_data=nullptr)
 Computes Laplacian eigenfunctions band by band. More...
 
void mesh_partition (Mesh &M, MeshPartitionMode mode, vector< index_t > &facet_ptr, vector< index_t > &tet_ptr, index_t nb_parts=0)
 Partitions a mesh into a fixed number of parts. More...
 
void mesh_partition (Mesh &M, MeshPartitionMode mode, vector< index_t > &facet_ptr, index_t nb_parts=0)
 Partitions a mesh into a fixed number of parts. More...
 
void remove_small_facets (Mesh &M, double min_facet_area)
 Removes the facets that have an area smaller than a given threshold. More...
 
void remove_small_connected_components (Mesh &M, double min_component_area, index_t min_component_facets=0.0)
 Removes the connected components that have an area smaller than a given threshold. More...
 
void orient_normals (Mesh &M)
 Orients the normals in such a way that each connected component has a positive signed volume. More...
 
void invert_normals (Mesh &M)
 Inverts all the normals of a mesh. More...
 
void expand_border (Mesh &M, double epsilon)
 Enlarges a surface by moving the vertices on the border. More...
 
void remove_degree2_vertices (Mesh &M)
 Removes the degree 2 vertices in a surface mesh. More...
 
void remesh_smooth (Mesh &M_in, Mesh &M_out, index_t nb_points, coord_index_t dim=0, index_t nb_Lloyd_iter=5, index_t nb_Newton_iter=30, index_t Newton_m=7)
 Remeshes a 'smooth' shape (i.e. without management of sharp features). More...
 
void mesh_reorder (Mesh &M, MeshOrder order=MESH_ORDER_HILBERT)
 Reorders all the elements of a mesh. More...
 
void compute_Hilbert_order (index_t nb_vertices, const double *vertices, vector< index_t > &sorted_indices, index_t stride=3)
 Computes the Hilbert order for a set of 3D points. More...
 
void compute_Hilbert_order (index_t total_nb_vertices, const double *vertices, vector< index_t > &sorted_indices, index_t first, index_t last, index_t dimension, index_t stride=3)
 Computes the Hilbert order for a set of 3D points. More...
 
void compute_BRIO_order (index_t nb_vertices, const double *vertices, vector< index_t > &sorted_indices, index_t dimension, index_t stride=3, index_t threshold=64, double ratio=0.125, vector< index_t > *levels=nullptr)
 Computes the BRIO order for a set of 3D points. More...
 
void Hilbert_sort_periodic (index_t nb_vertices, const double *vertices, vector< index_t > &sorted_indices, index_t dimension, index_t stride, vector< index_t >::iterator first, vector< index_t >::iterator last, double period=1.0)
 Spatially sort a set of vertices in periodic space. More...
 
void mesh_repair (Mesh &M, MeshRepairMode mode=MESH_REPAIR_DEFAULT, double colocate_epsilon=0.0)
 Fixes some defaults in a mesh. More...
 
void mesh_postprocess_RDT (Mesh &M)
 Post-processes a Restricted Delaunay Triangulation. More...
 
void mesh_reorient (Mesh &M, vector< index_t > *moebius_facets=nullptr)
 Reorients the facets of a mesh coherently. More...
 
void mesh_detect_colocated_vertices (const Mesh &M, vector< index_t > &v_colocated_index, double colocate_epsilon=0.0)
 Detects colocated vertices in a mesh. More...
 
void mesh_detect_isolated_vertices (const Mesh &M, vector< index_t > &v_is_isolated)
 Detects isolated vertices in a mesh. More...
 
void mesh_detect_degenerate_facets (const Mesh &M, vector< index_t > &f_is_degenerate)
 Detects degenerate facets in a mesh. More...
 
template<index_t DIM>
double mesh_facet_mass (const Mesh &mesh, index_t f, Attribute< double > &vertex_weight)
 Computes the mass of a mesh facet. More...
 
template<index_t DIM>
bool mesh_generate_random_samples_on_surface (const Mesh &mesh, double *p, index_t nb_points, Attribute< double > &weight, signed_index_t facets_begin_in=-1, signed_index_t facets_end_in=-1)
 Generates a set of random samples over a surfacic mesh. More...
 
template<index_t DIM>
double mesh_tetra_mass (const Mesh &mesh, index_t t)
 Computes the mass of a mesh tetrahedron. More...
 
template<index_t DIM>
double mesh_tetra_mass (const Mesh &mesh, index_t t, const Attribute< double > &weight)
 Computes the mass of a mesh tetrahedron. More...
 
template<index_t DIM>
bool mesh_generate_random_samples_in_volume (const Mesh &mesh, double *p, index_t nb_points, Attribute< double > &vertex_weight, signed_index_t tets_begin_in=-1, signed_index_t tets_end_in=-1)
 Generates a set of random samples in a volumetric mesh. More...
 
void mesh_smooth (Mesh &M)
 Smooths the shape of a mesh. More...
 
void mesh_split_triangles (Mesh &M, index_t facets_begin=0, index_t facets_end=index_t(-1), MeshSplitCallbacks *cb=nullptr)
 Splits each triangle of a surface mesh into four. More...
 
void mesh_split_quads (Mesh &M, index_t facets_begin=0, index_t facets_end=index_t(-1), MeshSplitCallbacks *cb=nullptr)
 Splits each facet of a surface mesh into quads. More...
 
void mesh_split_catmull_clark (Mesh &M, MeshSplitCallbacks *cb=nullptr)
 Splits a mesh using Catmull-Clark subdivision rule. More...
 
bool mesh_tetrahedralize (Mesh &M, bool preprocess=true, bool refine=false, double quality=2.0, bool keep_regions=false)
 Fills a closed surface mesh with tetrahedra. More...
 
index_t get_connected_components (const Mesh &M, vector< index_t > &component)
 Computes the connected components of a Mesh. More...
 
index_t mesh_nb_connected_components (const Mesh &M)
 Computes the number of connected components of a Mesh.
 
signed_index_t mesh_Xi (const Mesh &M)
 Computes the Euler-Poincare characteristic of a surfacic Mesh. More...
 
signed_index_t mesh_nb_borders (const Mesh &M)
 Computes the number of borders of a Mesh. More...
 
bool meshes_have_same_topology (const Mesh &M1, const Mesh &M2, bool verbose=false)
 Compares the topological invariants of two meshes. More...
 
bool triangles_intersections (const vec3 &p0, const vec3 &p1, const vec3 &p2, const vec3 &q0, const vec3 &q1, const vec3 &q2, vector< TriangleIsect > &result)
 Triangle-triangle intersection. More...
 
std::string region_to_string (TriangleRegion rgn)
 Converts a triangle region code to a string. More...
 
std::ostream & operator<< (std::ostream &out, const TriangleIsect &I)
 Prints a triangle intersection element to a stream. More...
 
std::ostream & operator<< (std::ostream &out, vector< TriangleIsect > &II)
 Prints the result of a triangle intersection to a stream. More...
 
template<>
Sign geo_sgn (const expansion_nt &x)
 Specialization of geo_sgn() for expansion_nt. More...
 
bool expansion_nt_is_zero (const expansion_nt &x)
 Tests whether an expansion_nt is zero. More...
 
bool expansion_nt_is_one (const expansion_nt &x)
 Tests whether an expansion_nt is equal to one. More...
 
Sign expansion_nt_compare (const expansion_nt &x, const expansion_nt &y)
 Compares two expansion_nt. More...
 
expansion_nt expansion_nt_square (const expansion_nt &x)
 Computes the square of an expansion_nt. More...
 
expansion_nt expansion_nt_determinant (const expansion_nt &a00, const expansion_nt &a01, const expansion_nt &a10, const expansion_nt &a11)
 Computes a 2x2 determinant. More...
 
expansion_nt expansion_nt_determinant (const expansion_nt &a00, const expansion_nt &a01, const expansion_nt &a02, const expansion_nt &a10, const expansion_nt &a11, const expansion_nt &a12, const expansion_nt &a20, const expansion_nt &a21, const expansion_nt &a22)
 Computes a 3x3 determinant. More...
 
expansion_nt expansion_nt_determinant (const expansion_nt &a00, const expansion_nt &a01, const expansion_nt &a02, const expansion_nt &a03, const expansion_nt &a10, const expansion_nt &a11, const expansion_nt &a12, const expansion_nt &a13, const expansion_nt &a20, const expansion_nt &a21, const expansion_nt &a22, const expansion_nt &a23, const expansion_nt &a30, const expansion_nt &a31, const expansion_nt &a32, const expansion_nt &a33)
 Computes a 4x4 determinant. More...
 
Sign sign_of_expansion_determinant (const expansion &a00, const expansion &a01, const expansion &a10, const expansion &a11)
 Computes the sign of a 2x2 determinant. More...
 
Sign sign_of_expansion_determinant (const expansion &a00, const expansion &a01, const expansion &a02, const expansion &a10, const expansion &a11, const expansion &a12, const expansion &a20, const expansion &a21, const expansion &a22)
 Computes the sign of a 3x3 determinant. More...
 
Sign sign_of_expansion_determinant (const expansion &a00, const expansion &a01, const expansion &a02, const expansion &a03, const expansion &a10, const expansion &a11, const expansion &a12, const expansion &a13, const expansion &a20, const expansion &a21, const expansion &a22, const expansion &a23, const expansion &a30, const expansion &a31, const expansion &a32, const expansion &a33)
 Computes the sign of a 4x4 determinant. More...
 
void mesh_compute_ABF_plus_plus (Mesh &M, const std::string &attribute_name="tex_coord", bool verbose=false)
 Computes texture coordinates using Least Squares Conformal Maps. More...
 
void mesh_make_atlas (Mesh &mesh, double hard_angles_threshold=45.0, ChartParameterizer param=PARAM_ABF, ChartPacker pack=PACK_TETRIS, bool verbose=false)
 
void mesh_compute_LSCM (Mesh &M, const std::string &attribute_name="tex_coord", bool spectral=false, const std::string &angle_attribute_name="", bool verbose=false)
 Computes texture coordinates using Least Squares Conformal Maps. More...
 
void pack_atlas_using_xatlas (Mesh &mesh)
 Packs an atlas using the xatlas library. More...
 
void split_chart_along_principal_axis (Chart &chart, Chart &new_chart_1, Chart &new_chart_2, index_t axis=2, bool verbose=false)
 Splits a chart into two parts. More...
 
void Co3Ne_smooth (Mesh &M, index_t nb_neighbors, index_t nb_iterations)
 Smoothes a point set by projection onto the nearest neighbors best approximating plane. More...
 
bool Co3Ne_compute_normals (Mesh &M, index_t nb_neighbors, bool reorient=false)
 Computes the normals to a point set. The normal is obtained from the nearest neighbors best approximating plane. Normals are stored in the "normal" vertex attribute. More...
 
void Co3Ne_reconstruct (Mesh &M, double radius)
 Given a pointset with normals stored in the "normal" vertex attribute, reconstruct the triangles. More...
 
void Co3Ne_smooth_and_reconstruct (Mesh &M, index_t nb_neighbors, index_t nb_iterations, double radius)
 Computes the normals and reconstructs the triangles of a pointset. More...
 
void glupVertex (const vec2 &v)
 Sends a vertex to OpenGL. More...
 
void glupColor (const vec3 &v)
 Sends a RGB color to OpenGL. More...
 
void glupTexCoord (const vec2 &v)
 Sends 2d texture coordinates to OpenGL. More...
 
void glupTranslate (const vec3 &v)
 Applies a translation. More...
 
void GEOGRAM_GFX_API glupMapTexCoords1d (double minval, double maxval, index_t mult=1)
 Maps texture coordinates from a specified interval to the unit interval. More...
 
void GEOGRAM_GFX_API glupMultMatrix (const mat4 &m)
 Multiplies the current GLUP matrix with another one. More...
 
void GEOGRAM_GFX_API glupLoadMatrix (const mat4 &m)
 Replaces the current GLUP matrix with a user defined one. More...
 
GLint64 GEOGRAM_GFX_API get_size_of_bound_buffer_object (GLenum target)
 Gets the size (in bytes) of the OpenGL buffer bound to a specified target. More...
 
void GEOGRAM_GFX_API update_buffer_object (GLuint &buffer_id, GLenum target, size_t new_size, const void *data)
 Updates the content of an OpenGL buffer object, and resizes it if need be. More...
 
void GEOGRAM_GFX_API stream_buffer_object (GLuint &buffer_id, GLenum target, size_t new_size, const void *data)
 Updates the content of an OpenGL buffer object in streaming mode. More...
 
void GEOGRAM_GFX_API update_or_check_buffer_object (GLuint &buffer_id, GLenum target, size_t new_size, const void *data, bool update)
 Updates the content of an OpenGL buffer object, and resizes it if need be, or tests whether it has the size it should have. More...
 
void GEOGRAM_GFX_API check_gl (const char *file, int line, bool warning_only=false)
 Tests for OpenGL errors and displays a message if OpenGL errors were encountered. More...
 
void GEOGRAM_GFX_API clear_gl_error_flags (const char *file, int line)
 Clears all error flags set by previous OpenGL calls. More...
 
void GEOGRAM_GFX_API draw_unit_textured_quad ()
 Draws a textured quad. More...
 
void GEOGRAM_GFX_API glTexImage2Dxpm (char const *const *xpm_data)
 
std::string GEOGRAM_GFX_API icon_UTF8 (const char *name)
 Gets an icon by name. More...
 

Variables

const index_t NOT_AN_ID = index_t(-1)
 
const index_t EXPLORAGRAM_API quad_rand_split [2][3]
 
const index_t EXPLORAGRAM_API quad_split [4][3]
 
const index_t EXPLORAGRAM_API diamon_split [12][3]
 
const index_t EXPLORAGRAM_API diamon_quad_split [16][3]
 
EXPLORAGRAM_API const index_t tet_edge_vertices [6][2]
 
EXPLORAGRAM_API const index_t MT [16][4]
 
const index_t SPHERE_MODEL_NB_PTS = 642
 
const index_t SPHERE_MODEL_NB_TRIANGLES = 1280
 
EXPLORAGRAM_API const vec3 SPHERE_MODEL_PTS [SPHERE_MODEL_NB_PTS]
 
EXPLORAGRAM_API const index_t SPHERE_MODEL_TRIANGLES [SPHERE_MODEL_NB_TRIANGLES][3]
 
const index_t NO_VERTEX = index_t(-1)
 
const index_t NO_EDGE = index_t(-1)
 
const index_t NO_FACET = index_t(-1)
 
const index_t NO_CELL = index_t(-1)
 
const index_t NO_CORNER = index_t(-1)
 
double expansion_splitter_
 
double expansion_epsilon_
 

Detailed Description

Global Vorpaline namespace.

This namespace contains all the Vorpaline classes and functions organized in sub-namespaces.

Typedef Documentation

◆ Color

Default representation of colors.

r,g,b,a components are double-precision number between 0.0 and 1.0.

Definition at line 165 of file color.h.

◆ CommandInvoker_var

Automatic reference-counted pointer to a CommandInvoker.

Used internally by Command.

Definition at line 97 of file command.h.

◆ LoggerClient_var

Smart pointer that contains a LoggerClient object

Definition at line 202 of file logger.h.

◆ mat2

Represents a 2x2 matrix.

Syntax is (mostly) compatible with GLSL.

Definition at line 127 of file geometry.h.

◆ mat3

Represents a 3x3 matrix.

Syntax is (mostly) compatible with GLSL.

Definition at line 133 of file geometry.h.

◆ mat4

Represents a 4x4 matrix.

Syntax is (mostly) compatible with GLSL.

Definition at line 139 of file geometry.h.

◆ ProgressClient_var

Smart pointer that contains a ProgressClient object

Definition at line 122 of file progress.h.

◆ signed_index_t

The type for storing and manipulating indices differences.

Can be negative (for instance to indicate special values like borders).

Definition at line 315 of file numeric.h.

◆ Thread_var

Smart pointer that contains a Thread object

Definition at line 153 of file process.h.

◆ ThreadGroup

typedef std::vector<Thread_var> GEO::ThreadGroup

Collection of Threads.

ThreadGroup is a std::vector of Thread_var it provides the same operations for adding, removing or accessing thread elements. ThreadGroup takes ownership of Thread elements when they are added to the group, so there's is no need to delete Threads when the group is deleted.

Definition at line 163 of file process.h.

◆ ThreadManager_var

Smart pointer that contains a ThreadManager object

Definition at line 316 of file process.h.

◆ vec2

Represents points and vectors in 2d.

Syntax is (mostly) compatible with GLSL.

Definition at line 65 of file geometry.h.

◆ vec2f

Represents points and vectors in 2d with single-precision coordinates.

Syntax is (mostly) compatible with GLSL.

Definition at line 84 of file geometry.h.

◆ vec2i

Represents points and vectors in 2d with integer coordinates.

Syntax is (mostly) compatible with GLSL.

Definition at line 106 of file geometry.h.

◆ vec3

Represents points and vectors in 3d.

Syntax is (mostly) compatible with GLSL.

Definition at line 71 of file geometry.h.

◆ vec3f

Represents points and vectors in 3d with single-precision coordinates.

Syntax is (mostly) compatible with GLSL.

Definition at line 91 of file geometry.h.

◆ vec3i

Represents points and vectors in 3d with integer coordinates.

Syntax is (mostly) compatible with GLSL.

Definition at line 91 of file basic.h.

◆ vec4

Represents points and vectors in 4d.

Syntax is (mostly) compatible with GLSL.

Definition at line 77 of file geometry.h.

◆ vec4f

Represents points and vectors in 4d with single-precision coordinates.

Syntax is (mostly) compatible with GLSL.

Definition at line 98 of file geometry.h.

◆ vec4i

Represents points and vectors in 4d with integer coordinates.

Syntax is (mostly) compatible with GLSL.

Definition at line 120 of file geometry.h.

Enumeration Type Documentation

◆ AssertMode

Assert termination mode.

Defines how assertion failures should terminate the program. By default, Assertion failures throw an exception.

Enumerator
ASSERT_THROW 

Assertion failures throw an exception

ASSERT_ABORT 

Assertion failures call abort()

ASSERT_BREAKPOINT 

Assertion failures generate a breakpoint in the debugger

Definition at line 64 of file assert.h.

◆ MeshAttributesFlags

Indicates the attributes stored in a mesh and attached to the mesh elements (vertices, facets or volumes).

The set of attributes attached to a mesh is represented by a bitwise or combination of the constants.

Definition at line 72 of file mesh_io.h.

◆ MeshCompareFlags

Flags used to compare two meshes.

These flags can be bit-or'ed together to tell mesh_compare() which properties of the meshes to compare. MeshCompareFlags provides 2 reasonable default flags:

Enumerator
MESH_COMPARE_OK 

The mesh comparison is OK

MESH_COMPARE_DIMENSIONS 

Compares mesh dimensions

MESH_COMPARE_NB_VERTICES 

Compares mesh number of vertices

MESH_COMPARE_NB_FACETS 

Compares mesh number of facets

MESH_COMPARE_NB_FACET_BORDERS 

Compares mesh number of facets borders

MESH_COMPARE_AREAS 

Compares mesh areas (see Geom::mesh_area())

MESH_COMPARE_TOPOLOGY 

Compares mesh topology (see meshes_have_same_topology())

MESH_COMPARE_NB_TETS 

Compares mesh number of tets

MESH_COMPARE_NB_TET_BORDERS 

Compares mesh number of tets borders

MESH_COMPARE_SURFACE_PROPS 

Reasonable flags used to compare surfaces

MESH_COMPARE_VOLUME_PROPS 

Reasonable flags used to compare volumes

MESH_COMPARE_ALL 

Compare all properties

Definition at line 69 of file mesh_compare.h.

◆ MeshDecimateMode

Determines the operating mode of mesh_decimate_vertex_clustering(). The flags can be combined with the 'bitwise or' (|) operator. MESH_REPAIR_DEFAULT fits most uses.

Enumerator
MESH_DECIMATE_FAST 

Gives a raw result quickly

MESH_DECIMATE_DUP_F 

Remove duplicated vertices

MESH_DECIMATE_DEG_3 

Remove degree3 vertices

MESH_DECIMATE_KEEP_B 

Preserve borders

MESH_DECIMATE_DEFAULT 

Fits most uses

Definition at line 67 of file mesh_decimate.h.

◆ MeshElementsFlags

enum MeshElementsFlags
related

Indicates the mesh elements (vertices, facets or cells) present in a mesh.

The set of elements present in a mesh is represented by a bitwise-or combination of the constants.

Definition at line 2573 of file mesh.h.

◆ MeshOrder

Strategy for spatial sorting.

Enumerator
MESH_ORDER_HILBERT 

Hilbert ordering improves data locality and has a continuous mapping between indices and space.

MESH_ORDER_MORTON 

Morton ordering improves data locality and is a bit simpler than Hilbert ordering.

Definition at line 67 of file mesh_reorder.h.

◆ MeshPartitionMode

Strategy for mesh partitioning.

Enumerator
MESH_PARTITION_HILBERT 

Mesh parts are index slices of equal sizes in Hilbert order

MESH_PARTITION_CONNECTED_COMPONENTS 

Mesh parts are the connected components of the mesh

Definition at line 65 of file mesh_partition.h.

◆ MeshRepairMode

Determines the operating mode of mesh_repair(). The flags can be combined with the 'bitwise or' (|) operator. MESH_REPAIR_DEFAULT fits most uses.

Enumerator
MESH_REPAIR_TOPOLOGY 

Dissociates non-manifold vertices (always done)

MESH_REPAIR_COLOCATE 

Merges identical vertices

MESH_REPAIR_DUP_F 

Removes duplicated facets

MESH_REPAIR_TRIANGULATE 

Triangulates mesh

MESH_REPAIR_RECONSTRUCT 

Post-process result of Co3Ne algo.

MESH_REPAIR_QUIET 

Do not display any message.

MESH_REPAIR_DEFAULT 

Fits most uses

Definition at line 65 of file mesh_repair.h.

◆ Sign

enum GEO::Sign

Integer constants that represent the sign of a value.

Enumerator
NEGATIVE 

Value is negative

ZERO 

Value is zero

POSITIVE 

Value is positive

Definition at line 238 of file numeric.h.

◆ TriangleRegion

Encodes the location of a point within a triangle.

A point can be located in 6 different regions, that correspond to the three vertices, three edges and interior of a triangle.

Enumerator
T_RGN_P0 

The point is on p0

T_RGN_P1 

The point is on p1

T_RGN_P2 

The point is on p2

T_RGN_E0 

The point is on edge E0

T_RGN_E1 

The point is on edge E1

T_RGN_E2 

The point is on edge E2

T_RGN_T 

The point is in the interior of the triangle

Definition at line 67 of file triangle_intersection.h.

Function Documentation

◆ add_facet_to_mesh()

index_t GEO::add_facet_to_mesh ( Mesh m,
vector< vec3 > &  pts,
Attribute< vec2 > *  uv = nullptr,
vector< vec2 > *  lU = nullptr 
)
inline

uv is a pointer because it is an optional parameter (can be nullptr)

Definition at line 133 of file mesh_utils.h.

◆ add_to_sorted_sparse_vector()

void GEO::add_to_sorted_sparse_vector ( vector< Coeff > &  L,
index_t  index,
double  val 
)
inline

Adds a coefficient in a sparse vector.

If the coefficient already exists, then val is added to the existing coefficient, else a new coefficient is created and inserted in such a way that the vector remains sorted.

Parameters
[in,out]La reference to the sparse vector, represented by a vector<Coeff>.
[in]indexthe index of the coefficient to add.
[in]valthe value of the coefficient to add.

Definition at line 147 of file mixed_constrained_solver.h.

◆ bake_mesh_attribute()

void GEO::bake_mesh_attribute ( Mesh mesh,
Image target,
Attribute< double > &  attribute,
double  bias = 0.0,
double  scale = 1.0 
)

Bakes an attribute of a parameterized mesh.

The attribute is baked over the previous content of the image (the image is not cleared).

Parameters
[in]mesha pointer to the input mesh, with a texture coordinates stored in the "tex_coord" facet corner attribute.
[out]targetthe target image.
[in]attributethe attribute, can be a vertex, facet corner or facet attribute. Vertex and facet corner attributes are linearly interpolated. If it is a vector attribute, its available components are copied to the r,g,b,a components of the interpolated color.
[in]biasoptional value to be added to the attribute values before storing them into the color components.
[in]scaleoptional value that scales the attribute values after bias is added and before storing them into the color components.

◆ bake_mesh_facet_normals()

void GEO::bake_mesh_facet_normals ( Mesh mesh,
Image target 
)

Bakes the facet normals of a parameterized mesh into an image.

The facet normals are baked over the previous content of the image (the image is not cleared).

Parameters
[in]mesha pointer to the input esh, with a texture coordinates stored in the "tex_coord" facet corner attribute.
[out]targetthe target image.

◆ bake_mesh_facet_normals_indirect()

void GEO::bake_mesh_facet_normals_indirect ( Image geometry,
Image target,
Mesh highres 
)

Bakes facet normals from a (in general) high resolution mesh to a (in general) parameterized lower resolution mesh represented as a geometry image.

The facet normals are baked over the previous content of the image (the image is not cleared). The implementation uses a MeshFacetsAABB that changes the order of the elements of highres. Whenever a pixel of geometry has both its r,g,b components set to Numeric::max_float64(), the corresponding pixel in target is left unchanged.

Parameters
[in]geometrythe geometry image
[out]targetthe target image
[in]highresthe high-resolution mesh
Precondition
geometry and target have the same size, and geometry uses FLOAT64 component encoding.

◆ bake_mesh_geometry()

void GEO::bake_mesh_geometry ( Mesh mesh,
Image target,
bool  clear = true 
)

Bakes mesh geometry into an image (creates a geometry image).

Parameters
[in]mesha pointer to the input mesh, with a texture coordinates stored in the "tex_coord" facet corner attribute.
[out]targeta pointer to the geometry image. It should use Image::FLOAT64 storage for the color components.
[in]clearif set, then all the pixel components of the target geometry image are set to Numeric:max_float64() before rasterizing the facets.

◆ bake_mesh_points_attribute_indirect()

void GEO::bake_mesh_points_attribute_indirect ( Image geometry,
Image target,
Mesh highres,
Attribute< double > &  attribute,
double  bias = 0.0,
double  scale = 1.0 
)

Bakes a vertex attribute from a (in general) high resolution point set to a (in general) parameterized lower resolution mesh represented as a geometry image.

The attribute is baked over the previous content of the image (the image is not cleared). Whenever a pixel of geometry has both its r,g,b components set to Numeric::max_float64(), the corresponding pixel in target is left unchanged.

Parameters
[in]geometrythe geometry image
[out]targetthe target image
[in]highresthe high-resolution pointset.
[in]attributethe vertex attribute of highres to be baked.
Precondition
geometry and target have the same size, and geometry uses FLOAT64 component encoding.
Parameters
[in]biasoptional value to be added to the attribute values before storing them into the color components.
[in]scaleoptional value that scales the attribute values after bias is added and before storing them into the color components.

◆ bake_mesh_vertex_normals()

void GEO::bake_mesh_vertex_normals ( Mesh mesh,
Image target 
)

Bakes the facet normals of a parameterized mesh into an image.

The facet normals are baked over the previous content of the image (the image is not cleared). Normals are linearly interpolated in mesh facets.

Parameters
[in]mesha pointer to the input esh, with a texture coordinates stored in the "tex_coord" facet corner attribute.
[out]targetthe target image.

◆ bbox_diagonal()

double GEO::bbox_diagonal ( const Mesh M)

Computes the length of the bounding box diagonal of a mesh.

Parameters
[in]Mthe mesh
Returns
The length of M's bounding box diagonal

◆ bbox_union()

void GEO::bbox_union ( Box target,
const Box B1,
const Box B2 
)
inline

Computes the smallest Box that encloses two Boxes.

Parameters
[out]targetthe smallest axis-aligned box that encloses B1 and B2
[in]B1first box
[in]B2second box

Definition at line 683 of file geometry.h.

◆ bboxes_overlap()

bool GEO::bboxes_overlap ( const Box B1,
const Box B2 
)
inline

Tests whether two Boxes have a non-empty intersection.

Parameters
[in]B1first box
[in]B2second box
Returns
true if B1 and B2 have a non-empty intersection, false otherwise.

Definition at line 664 of file geometry.h.

◆ cell_edges_in_RCS()

void GEO::cell_edges_in_RCS ( Mesh m,
vector< index_t > &  offset_from_org,
vector< index_t > &  dest 
)

store oriented edges in a Row Column Storage structure neigborgs of vertex v are dest[i] with i in offset_from_org[v]...offset_from_org[v+1]

◆ check_gl()

void GEOGRAM_GFX_API GEO::check_gl ( const char *  file,
int  line,
bool  warning_only = false 
)

Tests for OpenGL errors and displays a message if OpenGL errors were encountered.

Parameters
[in]filecurrent sourcefile, as given by FILE
[in]linecurrent line, as given by LINE
[in]warning_onlyif true, then errors are reported as warnings.

◆ clear_gl_error_flags()

void GEOGRAM_GFX_API GEO::clear_gl_error_flags ( const char *  file,
int  line 
)

Clears all error flags set by previous OpenGL calls.

This function shoud be called to ensure that subsequent calls to check_gl() will not report any error. This is necessary to workaround some buggy or incomplete implementations of OpenGL. In debug mode, error are always reported.

Parameters
[in]filecurrent sourcefile, as given by FILE
[in]linecurrent line, as given by LINE

◆ Co3Ne_compute_normals()

bool GEO::Co3Ne_compute_normals ( Mesh M,
index_t  nb_neighbors,
bool  reorient = false 
)

Computes the normals to a point set. The normal is obtained from the nearest neighbors best approximating plane. Normals are stored in the "normal" vertex attribute.

Parameters
[in]Mthe pointset (facets and tets are ignored if present)
[in]nb_neighborsnumber of neighbors used to compute the best approximating tangent planes
[in]reorientif true, try to orient the normals by propagation over the KNN graph.
Return values
trueif normals where successfully computed.
falseotherwise (when the user pushes the cancel button).

◆ Co3Ne_reconstruct()

void GEO::Co3Ne_reconstruct ( Mesh M,
double  radius 
)

Given a pointset with normals stored in the "normal" vertex attribute, reconstruct the triangles.

Parameters
[in,out]Minput pointset and output mesh
[in]radiusmaximum distance used to connect neighbors with triangles

◆ Co3Ne_smooth()

void GEO::Co3Ne_smooth ( Mesh M,
index_t  nb_neighbors,
index_t  nb_iterations 
)

Smoothes a point set by projection onto the nearest neighbors best approximating plane.

Parameters
[in,out]Mthe pointset (facets and tets are ignored if present)
[in]nb_neighborsnumber of neighbors used to compute the best approximating tangent planes
[in]nb_iterationsnumber of iterations

◆ Co3Ne_smooth_and_reconstruct()

void GEO::Co3Ne_smooth_and_reconstruct ( Mesh M,
index_t  nb_neighbors,
index_t  nb_iterations,
double  radius 
)

Computes the normals and reconstructs the triangles of a pointset.

The normal is obtained from the nearest neighbors best approximating plane. The normals are used "on the fly" and not stored, therefore calling this function is more efficient than calling Co3Ne_compute_normals() then Co3Ne_reconstruct().

Parameters
[in,out]Mthe input pointset and the output mesh
[in]nb_neighborsnumber of neighbors used to compute the best approximating tangent planes
[in]nb_iterationsnumber of smoothing iterations
[in]radiusmaximum distance used to connect neighbors with triangles

◆ compute_BRIO_order()

void GEO::compute_BRIO_order ( index_t  nb_vertices,
const double *  vertices,
vector< index_t > &  sorted_indices,
index_t  dimension,
index_t  stride = 3,
index_t  threshold = 64,
double  ratio = 0.125,
vector< index_t > *  levels = nullptr 
)

Computes the BRIO order for a set of 3D points.

It is used to accelerate incremental insertion in Delaunay triangulation. See the following reference: -Incremental constructions con brio. Nina Amenta, Sunghee Choi, Gunter Rote, Symposium on Computational Geometry conf. proc., 2003

Parameters
[in]nb_verticesnumber of vertices to sort
[in]verticespointer to the coordinates of the vertices
[out]sorted_indicesa vector of element indices to be sorted spatially
[in]dimensionnumber of vertices coordinates
[in]stridenumber of doubles between two consecutive vertices
[in]thresholdminimum size of interval to be sorted
[in]ratiosplitting ratio between current interval and the rest to be sorted
[out]levelsif non-nullptr, indices that correspond to level l are in the range levels[l] (included) ... levels[l+1] (excluded)

◆ compute_Hilbert_order() [1/2]

void GEO::compute_Hilbert_order ( index_t  nb_vertices,
const double *  vertices,
vector< index_t > &  sorted_indices,
index_t  stride = 3 
)

Computes the Hilbert order for a set of 3D points.

The implementation is inspired by:

  • Christophe Delage and Olivier Devillers. Spatial Sorting. In CGAL User and Reference Manual. CGAL Editorial Board, 3.9 edition, 2011
    Parameters
    [in]nb_verticesnumber of vertices to sort.
    [in]verticespointer to the coordinates of the vertices
    [out]sorted_indicesa vector of vertex indices, sorted spatially on exit
    [in]stridenumber of doubles between two consecutive vertices

◆ compute_Hilbert_order() [2/2]

void GEO::compute_Hilbert_order ( index_t  total_nb_vertices,
const double *  vertices,
vector< index_t > &  sorted_indices,
index_t  first,
index_t  last,
index_t  dimension,
index_t  stride = 3 
)

Computes the Hilbert order for a set of 3D points.

This variant sorts a subsequence of the indices vector. The implementation is inspired by:

  • Christophe Delage and Olivier Devillers. Spatial Sorting. In CGAL User and Reference Manual. CGAL Editorial Board, 3.9 edition, 2011
    Parameters
    [in]total_nb_verticestotal number of vertices in the vertices array, used to test indices in debug mode
    [in]verticespointer to the coordinates of the vertices
    [in,out]sorted_indicesa vector of vertex indices, sorted spatially on exit
    [in]firstindex of the first element in sorted_indices to be sorted
    [in]lastone position past the index of the last element in sorted_indices to be sorted
    [in]dimensionnumber of vertices coordinates
    [in]stridenumber of doubles between two consecutive vertices

◆ compute_Laguerre_centroids_2d()

void EXPLORAGRAM_API GEO::compute_Laguerre_centroids_2d ( Mesh omega,
index_t  nb_points,
const double *  points,
double *  centroids,
Mesh RVD = nullptr,
bool  verbose = false,
index_t  nb_air_particles = 0,
const double *  air_particles = nullptr,
index_t  air_particles_stride = 0,
double  air_fraction = 0.0,
const double *  weights_in = nullptr,
double *  weights_out = nullptr,
index_t  nb_iter = 1000 
)

Computes the centroids of the Laguerre cells that correspond to optimal transport in 2D.

Parameters
[in]omegaa reference to the mesh that represents the domain
[in]nb_pointsnumber of points
[in]pointsa pointer to the coordinates of the points
[out]centroidsa pointer to the computed centroids of the Laguerre cells that correspond to the optimal transport of the uniform measure to the points
[out]RVDif non-nullptr, a mesh with the restricted Voronoi diagram.
[in]nb_air_particlesnumber of air particles.
[in]air_particlesa pointer to the array of doubles with the coordinates of the air particles.
[in]stridenumber of doubles between two consecutive air particles in the array, or 0 if tightly packed.
[in]air_fractionthe fraction of the total mass occupied by air.
[in]weights_inan optional array of nb_points doubles corresponding to the initial value of the weight vector.
[out]weights_outthe computed value of the weights.
[in]nb_itermaximum number of Newton iterations.

◆ compute_Laguerre_centroids_3d()

void EXPLORAGRAM_API GEO::compute_Laguerre_centroids_3d ( Mesh omega,
index_t  nb_points,
const double *  points,
double *  centroids,
RVDPolyhedronCallback cb = nullptr,
bool  verbose = false,
index_t  nb_iter = 2000 
)

Computes the centroids of the Laguerre cells that correspond to optimal transport.

Parameters
[in]omegaa reference to the mesh that represents the domain
[in]nb_pointsnumber of points
[in]pointsa pointer to the coordinates of the points
[out]centroidsa pointer to the computed centroids of the Laguerre cells that correspond to the optimal transport of the uniform measure to the points
[in]cban optional RVD polyhedron callback to be called on the restricted power diagram once it is computed.

◆ compute_Laguerre_centroids_on_surface()

void EXPLORAGRAM_API GEO::compute_Laguerre_centroids_on_surface ( Mesh omega,
index_t  nb_points,
const double *  points,
double *  centroids,
Mesh RVD = nullptr,
bool  verbose = false 
)

Computes the centroids of the Laguerre cells that correspond to optimal transport over a surface embedded in 3D.

Parameters
[in]omegaa reference to the mesh that represents the domain
[in]nb_pointsnumber of points
[in]pointsa pointer to the coordinates of the points
[out]centroidsa pointer to the computed centroids of the Laguerre cells that correspond to the optimal transport of the uniform measure to the points

◆ compute_morph()

void EXPLORAGRAM_API GEO::compute_morph ( CentroidalVoronoiTesselation CVT,
OptimalTransportMap3d OTM,
Mesh morph,
bool  filter_tets = true 
)

Computes a shape that interpolates the two input tet meshes.

The shape is composed of tetrahedra

Parameters
[in]CVTthe Centroidal Voronoi Tesselation used to sample the second shape
[in]OTMthe Optimal Transport Map
[out]morphmesh where to store the morphing shape. It uses 6d coordinates (original location + final location).
[in]filter_tetsif true, remove the tetrahedra that are outside the source mesh.

◆ compute_normals()

void GEO::compute_normals ( Mesh M)

Computes the normals to the vertices, and stores them as additional coordinates.

Parameters
[in,out]Mthe mesh

◆ compute_singular_surface()

void EXPLORAGRAM_API GEO::compute_singular_surface ( CentroidalVoronoiTesselation CVT,
OptimalTransportMap3d OTM,
Mesh singular_set 
)

Computes the surface that corresponds to discontinuities in the optimal transport map.

The surface is determined as the facets of Voronoi cells that are adjacent in Pow(X)|M1 but not in Vor(X)|M2

Parameters
[in]CVTthe Centroidal Voronoi Tesselation used to sample the second shape M2
[in]OTMthe Optimal Transport Map with the power diagram that samples the first shape M1
[out]singular_setwhere to store the singular surface

◆ compute_sizing_field()

void GEO::compute_sizing_field ( Mesh M,
double  gradation = 1.0,
index_t  nb_lfs_samples = 0 
)

Computes a sizing field using an estimate of lfs (local feature size).

The sizing field is stored in M's vertices weights.

Parameters
[in,out]Mthe mesh
[in]gradationthe exponent to be applied to the sizing field
[in]nb_lfs_samplesif set to 0, the vertices of M are used, else M is resampled (needed if M's facets density is highly irregular).

◆ compute_tet_edge_graph()

void GEO::compute_tet_edge_graph ( Mesh m,
vector< index_t > &  v2e,
bool  store_both_directions 
)

for each edge of a tet mesh, generate an edge in m->edges edges are sorted by id of their first vertex and the first edge a vertex v is stored in Attribute<index_t>(m->vertices.attributes(), "v2e");

◆ create_facet_adjacence()

void GEO::create_facet_adjacence ( Mesh m,
bool  has_border = false 
)

export adjacency defined by shared vertices (for compatibility with other geomgram algo)

◆ create_scaling_matrix()

mat4 GEO::create_scaling_matrix ( double  s)
inline

Creates a scaling matrix.

The scaling matrix is in homogeneous coordinates, with the same convention as OpenGL (transforms row vectors mutliplied on the left).

Parameters
[in]sthe scaling coefficient
Returns
the scaling matrix

Definition at line 818 of file geometry.h.

◆ create_translation_matrix()

mat4 GEO::create_translation_matrix ( const vec3 T)
inline

Creates a translation matrix from a vector.

The translation matrix is in homogeneous coordinates, with the same convention as OpenGL (transforms row vectors mutliplied on the left).

Parameters
[in]Ta const reference to the translation vector
Returns
the translation matrix

Definition at line 801 of file geometry.h.

◆ draw_unit_textured_quad()

void GEOGRAM_GFX_API GEO::draw_unit_textured_quad ( )

Draws a textured quad.

The textured quad spans the [-1,1]x[-1,1] square with texture coordinates in [0,1]x[0,1]. If no program is currently bound, then a default one is used, and it uses the texture bound to unit 0 of GL_TEXTURE_2D. If a program is bound, then it is used. Vertices coordinates are sent to vertex attribute 0 and texture coordinates to vertex attribute 1.

◆ expand_border()

void GEO::expand_border ( Mesh M,
double  epsilon 
)

Enlarges a surface by moving the vertices on the border.

Shifts the vertices on the border by epsilon along a direction tangent to the surface and normal to the border. This enlarges the surface in such a way that small holes are geometrically closed (but not combinatorially). Subsequent remeshing with CentroidalVoronoiTesselation results in a watertight surface.

Parameters
[in,out]Mthe mesh to be processed
[in]epsilonthe distance along which border vertices are shifted

◆ expansion_nt_compare()

Sign GEO::expansion_nt_compare ( const expansion_nt x,
const expansion_nt y 
)
inline

Compares two expansion_nt.

Optimized using the low-level API

Parameters
[in]x,ythe two expansion_nt to compare
Return values
POSITIVEif x is greater than y
ZEROif x equals y
NEGATIVEif x is smaller than y

Definition at line 602 of file expansion_nt.h.

◆ expansion_nt_determinant() [1/3]

expansion_nt GEO::expansion_nt_determinant ( const expansion_nt a00,
const expansion_nt a01,
const expansion_nt a10,
const expansion_nt a11 
)

Computes a 2x2 determinant.

Specialization using the low-evel API for expansions. This gains some performance as compared to using CGAL's determinant template with expansion_nt.

◆ expansion_nt_determinant() [2/3]

expansion_nt GEO::expansion_nt_determinant ( const expansion_nt a00,
const expansion_nt a01,
const expansion_nt a02,
const expansion_nt a10,
const expansion_nt a11,
const expansion_nt a12,
const expansion_nt a20,
const expansion_nt a21,
const expansion_nt a22 
)

Computes a 3x3 determinant.

Specialization using the low-evel API for expansions. This gains some performance as compared to using CGAL's determinant template with expansion_nt.

◆ expansion_nt_determinant() [3/3]

expansion_nt GEO::expansion_nt_determinant ( const expansion_nt a00,
const expansion_nt a01,
const expansion_nt a02,
const expansion_nt a03,
const expansion_nt a10,
const expansion_nt a11,
const expansion_nt a12,
const expansion_nt a13,
const expansion_nt a20,
const expansion_nt a21,
const expansion_nt a22,
const expansion_nt a23,
const expansion_nt a30,
const expansion_nt a31,
const expansion_nt a32,
const expansion_nt a33 
)

Computes a 4x4 determinant.

Specialization using the low-evel API for expansions. This gains some performance as compared to using CGAL's determinant template with expansion_nt.

◆ expansion_nt_is_one()

bool GEO::expansion_nt_is_one ( const expansion_nt x)
inline

Tests whether an expansion_nt is equal to one.

Optimized using the low-level API

Parameters
[in]xa const reference to the expansion_nt to be tested
Return values
trueif x is equal to one
falseotherwise

Definition at line 588 of file expansion_nt.h.

◆ expansion_nt_is_zero()

bool GEO::expansion_nt_is_zero ( const expansion_nt x)
inline

Tests whether an expansion_nt is zero.

Optimized using the low-level API

Parameters
[in]xa const reference to the expansion_nt to be tested
Return values
trueif x is equal to zero
falseotherwise

Definition at line 577 of file expansion_nt.h.

◆ expansion_nt_square()

expansion_nt GEO::expansion_nt_square ( const expansion_nt x)
inline

Computes the square of an expansion_nt.

Optimized using the low-level API

Parameters
[in]xthe expansion_nt to be squared
Returns
x * x

Definition at line 615 of file expansion_nt.h.

◆ export_boundary_with_uv()

void GEO::export_boundary_with_uv ( Mesh m,
Mesh hex,
const char *  uv_name,
const char *  singtri_name 
)

Creates a surfacic parameterized mesh from the boundary of an input volumetric parameterized mesh.

The parameterization is stored in m in a cell corners attribute of type vec3 called "U". The input parameterization is supposed to be snapped, i.e. abs(coord - round(coord)) < 0.05 for each coordinate. The input mesh m also has a boolean cell attribute called "has_param" that indicates whether each cell has a valid parameterization.

Parameters
[in]mthe volumetric parameterized mesh
[out]hexthe generated surfacic parametrized mesh
[in]uv_namethe name of a created facet corner attribute with the 2d parameterization as a vec2 attached to the facet corners.
[in]singtri_namethe name of a created facet attribute with an index_t that indicates whether the facet is singular.

◆ facet_normal()

vec3 GEO::facet_normal ( Mesh m,
index_t  f 
)
inline

unit vector: weighted sum of normal of a triangle fan around the barycenter

Definition at line 67 of file mesh_inspector.h.

◆ fill_holes()

void GEO::fill_holes ( Mesh M,
double  max_area = 0.0,
index_t  max_edges = max_index_t(),
bool  repair = true 
)

Fills holes in mesh by generating new triangles.

This fills specific holes in mesh M with new triangles. This only fills the holes for which the total area of the generated triangles is smaller than max_area and for which the number of edges is smaller than max_edges. This does not generate new vertices.

Parameters
[in,out]Mthe mesh to modify
[in]max_areamaximum area of a hole to be filled, larger holes are ignored.
[in]max_edgesmaximum number of edges around a hole to be filled, larger holes are ignored.
[in]repairif true (default), then the newly generated triangles are connected to their neighbors and the zero-length edges are discarted.

◆ geo_abort()

GEO_NORETURN_DECL void GEO::geo_abort ( )

Aborts the program.

On Linux, this calls the system function abort(). On Windows, abort() is more difficult to see under debugger, so this creates a segmentation fault by deferencing a null pointer.

◆ geo_argused()

template<class T >
void GEO::geo_argused ( const T &  )
inline

Suppresses compiler warnings about unused parameters.

This function is meant to get rid of warnings concerning non used parameters (for instance, parameters to callbacks). The corresponding code is supposed to be wiped out by the optimizer.

Definition at line 66 of file argused.h.

◆ geo_assertion_failed()

GEO_NORETURN_DECL void GEO::geo_assertion_failed ( const std::string &  condition_string,
const std::string &  file,
int  line 
)

Prints an assertion failure.

This function is called when a boolean condition is not met. It prints an error message and terminates the program according to the current assert termination mode.

Parameters
[in]condition_stringstring representation of the condition
[in]filefile where the assertion failed
[in]lineline where the assertion failed

◆ geo_breakpoint()

GEO_NORETURN_DECL void GEO::geo_breakpoint ( )

Generates a debugger breakpoint programmatically.

On Windows, generates a breakpoint using __debugbreak(), on other systems, calls geo_abort().

◆ geo_clamp()

template<class T >
void GEO::geo_clamp ( T &  x,
min,
max 
)
inline

Clamps a value to a range.

Clamps the value x to a range defined by min and max. This modifies the value of x directly.

Parameters
[in,out]xa value of type T
[in]minthe lower bound of the clamping range
[in]maxthe upper bound of the clamping range

Definition at line 286 of file numeric.h.

◆ geo_range_assertion_failed()

GEO_NORETURN_DECL void GEO::geo_range_assertion_failed ( double  value,
double  min_value,
double  max_value,
const std::string &  file,
int  line 
)

Prints a range assertion failure.

This function is called when a value is out of a legal range. It prints an error message and terminates the program according to the current assert termination mode.

Parameters
[in]valuethe illegal value
[in]min_valueminimum allowed value
[in]max_valuemaximum allowed value
[in]filefile where the assertion failed
[in]lineline where the assertion failed

◆ geo_sgn() [1/2]

template<class T >
Sign GEO::geo_sgn ( const T &  x)
inline

Gets the sign of a value.

Returns -1, 0, or 1 whether value x is resp. negative, zero or positive. The function uses operator<() and operator>() to compare the value to 0 (zero). The integer constant zero must make senses for the type of the value, or T must be constructible from integer constant zero.

Parameters
[in]xthe value to test
Template Parameters
Tthe type of the value
Returns
the sign of the value
See also
Sign

Definition at line 260 of file numeric.h.

◆ geo_sgn() [2/2]

template<>
Sign GEO::geo_sgn ( const expansion_nt x)
inline

Specialization of geo_sgn() for expansion_nt.

Parameters
xa const reference to an expansion_nt
Returns
the (exact) sign of x (one of POSITIVE, ZERO, NEGATIVE)

Definition at line 564 of file expansion_nt.h.

◆ geo_should_not_have_reached()

GEO_NORETURN_DECL void GEO::geo_should_not_have_reached ( const std::string &  file,
int  line 
)

Prints an unreachable location failure.

This function is called when execution reaches a point that it should not reach. It prints an error message and terminates the program according to the current assert termination mode.

Parameters
[in]filefile containing the unreachable location
[in]lineline of the unreachable location

◆ geo_sqr()

template<class T >
T GEO::geo_sqr ( x)
inline

Gets the square value of a value.

Parameters
[in]xa value of type T
Template Parameters
Tthe type of the value
Returns
the square value of x

Definition at line 273 of file numeric.h.

◆ get_bbox()

void GEO::get_bbox ( const Mesh M,
double *  xyzmin,
double *  xyzmax 
)

Gets the bounding box of a mesh.

Parameters
[in]MThe mesh
[out]xyzminthe lower corner of the bounding box
[out]xyzmaxthe upper corner of the bounding box

◆ get_connected_components()

index_t GEO::get_connected_components ( const Mesh M,
vector< index_t > &  component 
)

Computes the connected components of a Mesh.

Parameters
[in]Mthe input mesh
[out]componentcomponent[f] contains the index of the connected component that facet f belongs to.
Returns
the number of connceted components
Postcondition
component.size() == M.nb_facets()

◆ get_size_of_bound_buffer_object()

GLint64 GEOGRAM_GFX_API GEO::get_size_of_bound_buffer_object ( GLenum  target)

Gets the size (in bytes) of the OpenGL buffer bound to a specified target.

Parameters
[in]targetbuffer object target (GL_ARRAY_BUFFER, GL_INDEX_BUFFER ...)
Returns
the size in bytes of the buffer object bound to target.

◆ glupColor()

void GEO::glupColor ( const vec3 v)
inline

Sends a RGB color to OpenGL.

Sends a RGBA color to OpenGL.

Parameters
[in]va const reference to the color to be sent.

Definition at line 139 of file GL.h.

◆ glupLoadMatrix()

void GEOGRAM_GFX_API GEO::glupLoadMatrix ( const mat4 m)

Replaces the current GLUP matrix with a user defined one.

Parameters
[in]ma const reference to the matrix.
Note
m is transposed before being sent to OpenGL because Geogram uses the convention with column vectors and GLUP the convention with row vectors to represent the transformed points.

◆ glupMapTexCoords1d()

void GEOGRAM_GFX_API GEO::glupMapTexCoords1d ( double  minval,
double  maxval,
index_t  mult = 1 
)

Maps texture coordinates from a specified interval to the unit interval.

This changes the GLUP texture matrix. GLUP matrix mode is reset to GLUP_MODELVIEW_MATRIX on exit.

Parameters
[in]minvalminimum value, to be mapped to 0
[in]maxvalmaximum value, to be mapped to 1
[in]multmultiplicator, applied after the mapping

◆ glupMultMatrix()

void GEOGRAM_GFX_API GEO::glupMultMatrix ( const mat4 m)

Multiplies the current GLUP matrix with another one.

Parameters
[in]ma const reference to the matrix.
Note
m is transposed before being sent to GLUP because Geogram uses the convention with column vectors and GLUP the convention with row vectors to represent the transformed points.

◆ glupTexCoord()

void GEO::glupTexCoord ( const vec2 v)
inline

Sends 2d texture coordinates to OpenGL.

Sends 4d texture coordinates to OpenGL.

Sends 3d texture coordinates to OpenGL.

Parameters
[in]va const reference to the texture coordinates to be sent.

Definition at line 156 of file GL.h.

◆ glupTranslate()

void GEO::glupTranslate ( const vec3 v)
inline

Applies a translation.

Parameters
[in]vthe translation vector.

Definition at line 180 of file GL.h.

◆ glupVertex()

void GEO::glupVertex ( const vec2 v)
inline

Sends a vertex to OpenGL.

Parameters
[in]va const reference to the vertex to be sent.
[in]va const reference to the vertex to be sent, in homogeneous coordinates (4d).

Definition at line 114 of file GL.h.

◆ Hilbert_sort_periodic()

void GEO::Hilbert_sort_periodic ( index_t  nb_vertices,
const double *  vertices,
vector< index_t > &  sorted_indices,
index_t  dimension,
index_t  stride,
vector< index_t >::iterator  first,
vector< index_t >::iterator  last,
double  period = 1.0 
)

Spatially sort a set of vertices in periodic space.

Parameters
[in]nb_verticestotal number of vertices, including the virtual periodic copies. This is 27 times the number of stored vertices.
[in]verticespointer to the coordinates of the vertices
[in,out]sorted_indicesa vector of vertex indices, sorted
[in]dimensionnumber of vertices coordinates. Only 3 is supported.
[in]stridenumber of doubles between two consecutive vertices spatially on exit
[in]firstindex of the first element in sorted_indices to be sorted
[in]lastone position past the index of the last element in sorted_indices to be sorted
[in]periodthe translation to be applied in periodic mode

◆ icon_UTF8()

std::string GEOGRAM_GFX_API GEO::icon_UTF8 ( const char *  name)

Gets an icon by name.

Parameters
[in]namethe symbolic name of the icon.
Returns
an UTF8 encoded string with the icon or the empty string if there is no such icon.

◆ initialize()

void GEO::initialize ( int  flags = GEOGRAM_INSTALL_HANDLERS)

Initialize Geogram.

Parameters
[in]flagsan or combination of
  • GEOGRAM_INSTALL_HANDLERS to install geogram error handlers. This avoid opening dialog boxes under Windows. This is useful for the automatic test suite. Else continuous integration tests hang because of the dialog box. Normal users may want to keep the default Windows behavior, since geogram error handlers may make debugging more difficult under Windows.

This function must be called once at the very beginning of a program to initialize the Vorpaline library. It also installs a exit() handler that calls function terminate() when the program exists normally. If it is called multiple times, then the supplemental calls have no effect.

◆ invert_normals()

void GEO::invert_normals ( Mesh M)

Inverts all the normals of a mesh.

Parameters
[in,out]Mthe mesh to be processed

◆ kill_isolated_vertices()

void EXPLORAGRAM_API GEO::kill_isolated_vertices ( Mesh m)

remove vertices that are not referenced in cells/facets/edges

◆ lua_bindwrapperwithname()

template<class FPTR >
void GEO::lua_bindwrapperwithname ( lua_State *  L,
FPTR  f,
const std::string &  name 
)
inline

Binds a wrapper to a name in the table at the top of the LUA stack.

Precondition
the object on the top of the stack is a table.
Parameters
[in]La pointer to the LUA state.
[in]fa pointer to the C++ function to be wrapped. It cannot be a non-static object member function.

Definition at line 901 of file lua_wrap.h.

◆ lua_bindwrapperwithnameglobal()

template<class FPTR >
void GEO::lua_bindwrapperwithnameglobal ( lua_State *  L,
FPTR  f,
const std::string &  name 
)
inline

Binds a wrapper to a name in the global scole.

Parameters
[in]La pointer to the LUA state.
[in]fa pointer to the C++ function to be wrapped. It cannot be a non-static object member function.

Definition at line 918 of file lua_wrap.h.

◆ lua_check_nb_args()

bool GEO::lua_check_nb_args ( lua_State *  L,
int  expected_nb_args 
)
inline

Tests whether the expected number of arguments was pushed onto the stack.

If the number of elements on the stack does not match the expected number of arguments, then an error message is memorized in the registry.

Parameters
[in]La pointer to the LUA state
[in]expected_nb_argsthe expected number of arguments
Return values
trueif the expected number of arguments were pushed onto the stack
falseotherwise

Definition at line 187 of file lua_wrap.h.

◆ lua_check_type()

bool GEO::lua_check_type ( lua_State *  L,
int  idx,
lua_test_func  test 
)
inline

Tests whether a LUA variable has the correct type.

If the LUA variable does not have the correct type, then an error message is memorized in the registry.

Parameters
[in]La pointer to the LUA state
[in]idxthe index of the variable
[in]testa function to test the type, taking as argument L and idx, and returning 1 if the type of the argument is correct and 0 otherwise.
Return values
trueif the type is corret
falseotherwise

Definition at line 164 of file lua_wrap.h.

◆ lua_clear_error()

void GEO::lua_clear_error ( lua_State *  L)
inline

Clears the last error message in LUA registry.

Parameters
[in]La pointer to the LUA state.

Definition at line 135 of file lua_wrap.h.

◆ lua_has_error()

bool GEO::lua_has_error ( lua_State *  L)
inline

Tests whether an error message was memorized in the registry.

Parameters
[in]La pointer to the LUA state.

Definition at line 145 of file lua_wrap.h.

◆ lua_notify_last_error()

int GEO::lua_notify_last_error ( lua_State *  L)
inline

Takes the last error message memorized in the registry and sends it back to LUA.

This function is called by wrappers right before returning each time an error is detected.

Return values
thereturn value supposed to be returned by the wrapper, as follows:
if(error occured) {
}

Definition at line 211 of file lua_wrap.h.

◆ lua_push() [1/2]

template<class T >
void GEO::lua_push ( lua_State *  L,
x 
)
inline

Converts and pushes a C++ variable onto the LUA stack.

This version is a placeholder. The actual implementation is done in the specializations.

Note
Just using function overloading (instead of template partializations) works with gcc, but does not work with clang and MSVC.
Parameters
[in]La pointer to the LUA state.
[in]xthe variable to be pushed.

Definition at line 469 of file lua_wrap.h.

◆ lua_push() [2/2]

template<class T >
void GEO::lua_push ( lua_State *  L,
const std::vector< T > &  x 
)
inline

Specialization of lua_push() for vectors.

It pushes a table, indexed by integers, from 1 to n (rather than 0 to n-1, following LUA indexing convention).

Definition at line 550 of file lua_wrap.h.

◆ lua_pushwrapper() [1/2]

template<class FPTR >
void GEO::lua_pushwrapper ( lua_State *  L,
FPTR  f 
)
inline

Pushes a wrapper for a given C++ function onto the LUA stack.

Parameters
[in]La pointer to the LUA state.
[in]fa pointer to the C++ function to be pushed. It cannot be a non-static object member function.

Definition at line 879 of file lua_wrap.h.

◆ lua_pushwrapper() [2/2]

template<>
void GEO::lua_pushwrapper ( lua_State *  L,
lua_CFunction  f 
)
inline

Specialization for lua_CFunction.

No need for a wrapper if it is already a LUA function.

Definition at line 887 of file lua_wrap.h.

◆ lua_set_error() [1/2]

void GEO::lua_set_error ( lua_State *  L,
const char *  error 
)
inline

Memorizes an error message in LUA registry.

This is used by C++/LUA interoperability functions to memorize an error. The error message can be passed back to LUA when exiting a wrapper.

Parameters
[in]La pointer to the LUA state.
[in]errorthe error message. It will be copied.

Definition at line 114 of file lua_wrap.h.

◆ lua_set_error() [2/2]

void GEO::lua_set_error ( lua_State *  L,
const std::string &  error 
)
inline

Memorizes an error message in LUA registry.

This is used by C++/LUA interoperability functions to memorize an error. The error message can be passed back to LUA when exiting a wrapper.

Parameters
[in]La pointer to the LUA state.
[in]errorthe error message. It will be copied.

Definition at line 127 of file lua_wrap.h.

◆ lua_wrap() [1/11]

template<class R >
int GEO::lua_wrap ( lua_State *  L,
R(*)(void)  fptr 
)
inline

Calls a C++ function from LUA.

The arguments are converted from the LUA stack, and the return value pushed onto the LUA stack. Whenever an error occurs, (invalid number of arguments or type error), it is captured and an error message is returned to the caller.

Definition at line 593 of file lua_wrap.h.

◆ lua_wrap() [2/11]

template<class R , class T1 >
int GEO::lua_wrap ( lua_State *  L,
R(*)(T1)  fptr 
)
inline

Calls a C++ function from LUA.

The arguments are converted from the LUA stack, and the return value pushed onto the LUA stack. Whenever an error occurs, (invalid number of arguments or type error), it is captured and an error message is returned to the caller.

Definition at line 609 of file lua_wrap.h.

◆ lua_wrap() [3/11]

template<class R , class T1 , class T2 >
int GEO::lua_wrap ( lua_State *  L,
R(*)(T1, T2)  fptr 
)
inline

Calls a C++ function from LUA.

The arguments are converted from the LUA stack, and the return value pushed onto the LUA stack. Whenever an error occurs, (invalid number of arguments or type error), it is captured and an error message is returned to the caller.

Definition at line 632 of file lua_wrap.h.

◆ lua_wrap() [4/11]

template<class R , class T1 , class T2 , class T3 >
int GEO::lua_wrap ( lua_State *  L,
R(*)(T1, T2, T3)  fptr 
)
inline

Calls a C++ function from LUA.

The arguments are converted from the LUA stack, and the return value pushed onto the LUA stack. Whenever an error occurs, (invalid number of arguments or type error), it is captured and an error message is returned to the caller.

Definition at line 657 of file lua_wrap.h.

◆ lua_wrap() [5/11]

template<class R , class T1 , class T2 , class T3 , class T4 >
int GEO::lua_wrap ( lua_State *  L,
R(*)(T1, T2, T3, T4)  fptr 
)
inline

Calls a C++ function from LUA.

The arguments are converted from the LUA stack, and the return value pushed onto the LUA stack. Whenever an error occurs, (invalid number of arguments or type error), it is captured and an error message is returned to the caller.

Definition at line 685 of file lua_wrap.h.

◆ lua_wrap() [6/11]

template<>
int GEO::lua_wrap ( lua_State *  L,
void(*)(void)  fptr 
)
inline

Calls a C++ function from LUA.

The arguments are converted from the LUA stack. Whenever an error occurs, (invalid number of arguments or type error), it is captured and an error message is returned to the caller.

Definition at line 713 of file lua_wrap.h.

◆ lua_wrap() [7/11]

template<class T1 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1)  fptr 
)
inline

Calls a C++ function from LUA.

The arguments are converted from the LUA stack. Whenever an error occurs, (invalid number of arguments or type error), it is captured and an error message is returned to the caller.

Definition at line 727 of file lua_wrap.h.

◆ lua_wrap() [8/11]

template<class T1 , class T2 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1, T2)  fptr 
)
inline

Calls a C++ function from LUA.

The arguments are converted from the LUA stack. Whenever an error occurs, (invalid number of arguments or type error), it is captured and an error message is returned to the caller.

Definition at line 746 of file lua_wrap.h.

◆ lua_wrap() [9/11]

template<class T1 , class T2 , class T3 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1, T2, T3)  fptr 
)
inline

Calls a C++ function from LUA.

The arguments are converted from the LUA stack. Whenever an error occurs, (invalid number of arguments or type error), it is captured and an error message is returned to the caller.

Definition at line 770 of file lua_wrap.h.

◆ lua_wrap() [10/11]

template<class T1 , class T2 , class T3 , class T4 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1, T2, T3, T4)  fptr 
)
inline

Calls a C++ function from LUA.

The arguments are converted from the LUA stack. Whenever an error occurs, (invalid number of arguments or type error), it is captured and an error message is returned to the caller.

Definition at line 794 of file lua_wrap.h.

◆ lua_wrap() [11/11]

template<>
int GEO::lua_wrap ( lua_State *  L,
lua_CFunction  fptr 
)
inline

Specialization of the wrapper for functions that are "already wrapped".

Note
Normally not used, since there is a specialization of lua_pushwrapper() for lua_CFunction.

Definition at line 820 of file lua_wrap.h.

◆ lua_wrappername()

std::string GEO::lua_wrappername ( lua_State *  L,
const char *  functionname 
)
inline

Converts a C++ function name into a LUA function name.

Removes all namespaces from the name.

Parameters
[in]La pointer to the LUA state (unused).
[in]functionnamethe C++ function name.
Returns
a std::string with the function name with all namespaces removed.

Definition at line 934 of file lua_wrap.h.

◆ merge_vertices()

void EXPLORAGRAM_API GEO::merge_vertices ( Mesh m,
double  eps 
)

merges vertices that are close (see GEO::colocate for details about distance guaranty) update references to vertices in cells/facets/edges

◆ mesh_cell_facet_normal()

vec3 GEO::mesh_cell_facet_normal ( const Mesh M,
index_t  c,
index_t  lf 
)

Computes the normal of a cell facet.

Parameters
[in]Ma const reference to the mesh
[in]cthe index of the cell
[in]lfthe local index of the facet within cell c
Returns
the vector normal to facet lf in cell c
Precondition
c < M.cells.nb() && lf < M.cells
Note
the computed vector is not normalized

◆ mesh_cell_volume()

double GEO::mesh_cell_volume ( const Mesh M,
index_t  c 
)

Computes the volume of a cell in a mesh.

Parameters
[in]Ma const reference to the mesh
[in]cthe index of the cell
Returns
the volume of the cell
Precondition
c < M.cells.nb()

◆ mesh_cells_volume()

double GEO::mesh_cells_volume ( const Mesh M)

Computes the volume of the cells of a mesh.

Parameters
[in]Ma const reference to the mesh
Returns
the volume of the cells of the mesh

◆ mesh_compare()

MeshCompareFlags GEO::mesh_compare ( const Mesh M1,
const Mesh M2,
MeshCompareFlags  flags = MESH_COMPARE_SURFACE_PROPS,
double  tolerance = 0.0,
bool  verbose = true 
)

Compares two meshes. Compares the two meshes M1 and M2 according to the comparison flags flags (see MeshCompareFlags). The function returns a comparison status similar to the comparison flags:

  • if a comparison failed for a test f in in flags, the same flag f is set in the status
  • otherwise the flag f is cleared in the status. A status of zero indicates that all comparisons succeeded.
    Parameters
    [in]M1the first input mesh
    [in]M2the second input mesh
    [in]flagsspecifies which properties of the meshes should be compared. By default it is set to MESH_COMPARE_SURFACE_PROPS information for the two meshes
    [in]tolerancerelative tolerance used to compare floating point values (such as the mash areas)
    [in]verboseenables/disables the display of mesh information for the two meshes, as well mesh comparison error messages.
    Return values
    MESH_COMPARE_OKif meshes M1 and M2 are identical according to the comparison criteria
    thecomparison status otherwise.
    See also
    MeshCompareFlags
    Geom::mesh_area()
    meshes_have_same_topology()

◆ mesh_compute_ABF_plus_plus()

void GEO::mesh_compute_ABF_plus_plus ( Mesh M,
const std::string &  attribute_name = "tex_coord",
bool  verbose = false 
)

Computes texture coordinates using Least Squares Conformal Maps.

The method is described in the following reference: ABF++: fast and robust angle-based flattening, A. Sheffer, B. Levy, M. Mogilnitsky, A. Bogomyakov, ACM Transactions on Graphics, 2005

Parameters
[in,out]Ma reference to a surface mesh. Facets need to be triangulated.
[in]attribute_namethe name of the vertex attribute where texture coordinates are stored.
[in]verboseif true, messages with statistics are displayed in the logger during computation.

◆ mesh_compute_LSCM()

void GEO::mesh_compute_LSCM ( Mesh M,
const std::string &  attribute_name = "tex_coord",
bool  spectral = false,
const std::string &  angle_attribute_name = "",
bool  verbose = false 
)

Computes texture coordinates using Least Squares Conformal Maps.

The method is described in the following references:

  • least squares mode: Least Squares Conformal Maps, Levy, Petitjean, Ray, Maillot, ACM SIGGRAPH, 2002
  • spectral mode: Spectral Conformal Parameterization, Mullen, Tong, Alliez, Desbrun, Computer Graphics Forum (SGP conf. proc.), 2008
    Parameters
    [in,out]Ma reference to a surface mesh
    [in]attribute_namethe name of the vertex attribute where texture coordinates are stored.
    [in]spectralif true, use spectral conformal parameterization, otherwise use least squares conformal maps. Spectral mode requires support of the ARPACK OpenNL extension.
    [in]angle_attribute_nameif specified, the desired angles in the 2D map. If unspecified, the desired angles are read on the 3D mesh.
    [in]verboseif true, display statistics during computation.

◆ mesh_compute_manifold_harmonics()

void GEO::mesh_compute_manifold_harmonics ( Mesh M,
index_t  nb_eigens,
LaplaceBeltramiDiscretization  discretization,
const std::string &  attribute_name = "eigen",
double  shift = 0.0,
bool  print_spectrum = false 
)

Computes the Manifold Harmonics basis functions.

The computed eigenvectors are stored in a vertex attribute.

Parameters
[in]Ma reference to a surface mesh
[in]nb_eigensnumber of eigenfunctions to compute
[in]discretizationthe discretization of the Laplace-Beltrami operator, one of:
  • COMBINATORIAL: 1.0 everywhere
  • UNIFORM: combinatorial divided by node degree
  • FEM_P1: linear finite elements
  • FEM_P1_LUMPED: linear finite elements with lumped mass matrix
[in]shifteigen shift applied to explore a certain part of the spectrum.
[in]print_spectrumif true, prints eigenvalues to the terminal.

◆ mesh_compute_manifold_harmonics_by_bands()

void GEO::mesh_compute_manifold_harmonics_by_bands ( Mesh M,
index_t  nb_eigens,
LaplaceBeltramiDiscretization  discretization,
ManifoldHarmonicsCallback  callback,
index_t  nb_eigens_per_band = 30,
double  initial_shift = 0.0,
void *  client_data = nullptr 
)

Computes Laplacian eigenfunctions band by band.

This function should be used when a large number of eigenfunctions should be computed.

Parameters
[in]Ma const reference to a surface mesh
[in]nb_eigenstotal number of eigenpairs to compute
[in]callbackthe client function to be called for each computed eigenpair
[in]nb_eigens_per_bandthe number of eigenpairs to be computed in each band
[in]initial_shiftthe initial location in the spectrum
[in]client_dataa pointer passed to the client callback

◆ mesh_decimate_vertex_clustering()

void GEO::mesh_decimate_vertex_clustering ( Mesh M,
index_t  nb_bins,
MeshDecimateMode  mode = MESH_DECIMATE_DEFAULT,
geo_index_t vertices_flags = nullptr 
)

Generates a simplified representation of a mesh.

Parameters
[in,out]Mthe mesh to decimate
[in]nb_binsthe higher, the more detailed mesh.
[in]modea combination of MeshDecimateMode flags. Combine them with the 'bitwise or' (|) operator.
[in]vertices_flagsan array of flags associated with each vertex of mesh_id, or nullptr if unspecified. Memory is managed by client code. If vertices_flags[v] is non-zero, then vertex v is preserved, else it can be discarded.

◆ mesh_detect_colocated_vertices()

void GEO::mesh_detect_colocated_vertices ( const Mesh M,
vector< index_t > &  v_colocated_index,
double  colocate_epsilon = 0.0 
)

Detects colocated vertices in a mesh.

Example of function to remove duplicated vertices in a pointset:

mesh_detect_colocated_vertices(M, colocated, epsilon);
for(index_t v=0; v<M.vertices.nb(); ++v) {
if(colocated[v] == v) {
// keep vertex if colocated with itself
colocated[v] = 0;
} else {
// delete vertex if colocated with other
colocated[v] = 1;
}
}
// note: this code supposes that M is a pointset.
// If the mesh has facets and cells, then
// references to facet corners and cell corners
// need to be updated here...
M.vertices.delete_elements(colocated);
Parameters
[in]Ma const reference to the mesh
[out]v_colocated_indexon exit, a vector of size M.vertices.nb(), such that for each vertex index v, v_colocated_index[v] contains either v (if v should be kept) or the index of the vertex that v is colocated with.
[in]colocate_epsilonif the distance between two mesh vertices is smaller than colocate_epsilon, then they are colocated.

◆ mesh_detect_degenerate_facets()

void GEO::mesh_detect_degenerate_facets ( const Mesh M,
vector< index_t > &  f_is_degenerate 
)

Detects degenerate facets in a mesh.

A facet is degenerate if it is incident to the same vertex several times.

Parameters
[in]Ma const reference to the mesh
[out]f_is_degenerateon exit, a vector of size M.facets.nb(), such that f_is_degenerate[f] is equal to 1 if f is degenerate or 0 if f is not degenerate.

◆ mesh_detect_isolated_vertices()

void GEO::mesh_detect_isolated_vertices ( const Mesh M,
vector< index_t > &  v_is_isolated 
)

Detects isolated vertices in a mesh.

A vertex is isolated if no mesh element (edge, facet or cell) is incident to it.

Parameters
[in]Ma const reference to the mesh
[out]v_is_isolatedon exit, a vector of size M.vertices.nb(), such that v_is_isolated[v] is equal to 1 if v is isolated or 0 if v is not isolated.

◆ mesh_facet_mass()

template<index_t DIM>
double GEO::mesh_facet_mass ( const Mesh mesh,
index_t  f,
Attribute< double > &  vertex_weight 
)
inline

Computes the mass of a mesh facet.

The function can optionally take into account the vertex weights.

Parameters
[in]meshthe surface mesh
[in]fa facet index in mesh
[in]vertex_weighta reference to a vertex attribute. If it is bound, it is used to weight the vertices.
Returns
the mass of facet f in mesh

Definition at line 75 of file mesh_sampling.h.

◆ mesh_generate_random_samples_in_volume()

template<index_t DIM>
bool GEO::mesh_generate_random_samples_in_volume ( const Mesh mesh,
double *  p,
index_t  nb_points,
Attribute< double > &  vertex_weight,
signed_index_t  tets_begin_in = -1,
signed_index_t  tets_end_in = -1 
)
inline

Generates a set of random samples in a volumetric mesh.

Parameters
[in]meshthe mesh
[out]ppointer to an array of generated samples, of size nb_points times DIM. To be allocated by the caller.
[in]nb_pointsnumber of points to generate
[in]vertex_weightif bound, vertex weights are taken into account
[in]tets_begin_inif specified, first index of the tetrahedron sequence in which points should be generated. If left unspecified (-1), points are generated over all the tetrahedra of the mesh.
[in]tets_end_inif specified, one position past the last index of the tetrahedron sequence in which points should be generated. If left unspecified (-1), points are generated over all the tetrahedra of the mesh.
Template Parameters
DIMdimension of the points, specified as a template argument for efficiency reasons
Returns
true if everything went OK, false otherwise. Whenever all the points land in the same tetrahedron, the function returns false to notify potential numerical problem.

Definition at line 294 of file mesh_sampling.h.

◆ mesh_generate_random_samples_on_surface()

template<index_t DIM>
bool GEO::mesh_generate_random_samples_on_surface ( const Mesh mesh,
double *  p,
index_t  nb_points,
Attribute< double > &  weight,
signed_index_t  facets_begin_in = -1,
signed_index_t  facets_end_in = -1 
)
inline

Generates a set of random samples over a surfacic mesh.

Parameters
[in]meshthe mesh
[out]ppointer to an array of generated samples, of size nb_points times DIM. To be allocated by the caller.
[in]nb_pointsnumber of points to generate
[in]weighta reference to a vertex attribute. If bound, it is taken into account.
[in]facets_begin_inif specified, first index of the facet sequence in which points should be generated. If left unspecified (-1), points are generated over all the facets of the mesh.
[in]facets_end_inif specified, one position past the last index of the facet sequence in which points should be generated. If left unspecified (-1), points are generated over all the facets of the mesh.
Template Parameters
DIMdimension of the points, specified as a template argument for efficiency reasons
Returns
true if everything went OK, false otherwise. Whenever all the points land in the same facet, the function returns false to notify a potential numerical problem.

Definition at line 126 of file mesh_sampling.h.

◆ mesh_load() [1/2]

bool GEO::mesh_load ( const std::string &  filename,
Mesh M,
const MeshIOFlags ioflags = MeshIOFlags() 
)

Loads a mesh from a file.

Loads the contents of the mesh file filename and stores the resulting mesh to M. The file format is determined by the filename's extension, which determines the appropriate MeshIOHandler to use to read the file.

Parameters
[in]filenamename of the file
[out]Mthe loaded mesh
[in]ioflagsspecifies which attributes and elements should be loaded
Returns
true on success, false otherwise.
See also
MeshIOHandler

◆ mesh_load() [2/2]

bool GEO::mesh_load ( InputGeoFile geofile,
Mesh M,
const MeshIOFlags ioflags = MeshIOFlags() 
)

Loads a mesh from a GeoFile ('.geogram' file format).

Loads the contents of the InputGeoFile geofile and stores the resulting mesh to M. This function can be used to load several meshes that are stored in the same GeoFile.

Parameters
[in]geofilea reference to the InputGeoFile
[out]Mthe loaded mesh
[in]ioflagsspecifies which attributes and elements should be loaded
Returns
true on success, false otherwise.

◆ mesh_nb_borders()

signed_index_t GEO::mesh_nb_borders ( const Mesh M)

Computes the number of borders of a Mesh.

Parameters
[in]Mthe input mesh
Returns
the number of borders, or -1 if the border is non-manifold (i.e. has "butterfly" vertices).

◆ mesh_one_sided_Hausdorff_distance()

double GEO::mesh_one_sided_Hausdorff_distance ( Mesh m1,
Mesh m2,
double  sampling_dist 
)

Computes an approximation of the single sided Hausdorff distance dH(m1->m2) between two surfacic meshes.

The single sided Hausdorff distance dH(m1,m2) is defined as: $dH(m1->m2) = Max(min(d(p,q) | q \in m2) | p \in m1)$

The mesh m1 is sampled as discrete locations and the max of the distances between these samples and m2 is returned.

Remarks
Only the facets of meshes m1 and m2 are used (line segments and volumetric cells are ignored). Note that the order of the mesh facets are changed.
Parameters
[in]m1,m2two surfacic meshes whose distance is computed
[in]sampling_distaverage distance between two samples (the smaller, the more accurate). At least all the vertices of m1 are sampled, and additional random samples on the surface are added until sampling density is reached, i.e. nb_samples >= area(m1) / sampling_dist^2

◆ mesh_partition() [1/2]

void GEO::mesh_partition ( Mesh M,
MeshPartitionMode  mode,
vector< index_t > &  facet_ptr,
vector< index_t > &  tet_ptr,
index_t  nb_parts = 0 
)

Partitions a mesh into a fixed number of parts.

The mesh facets and tetrahedra are reordered in such a way that each mesh part contains a contiguous set of facet indices.

Parameters
[in,out]Mthe mesh to partition
[in]modeone of MESH_PARTITION_HILBERT, MESH_PARTITION_CONNECTED_COMPONENTS.
[out]facet_ptron exit, part p's facets are facet_ptr[p] ... facet_ptr[p+1]-1
[out]tet_ptron exit, part p's tetrahedra are tet_ptr[p] ... tet_ptr[p+1]-1
[in]nb_partsnumber of parts to create. Ignored if mode = MESH_PARTITION_CONNECTED_COMPONENTS

◆ mesh_partition() [2/2]

void GEO::mesh_partition ( Mesh M,
MeshPartitionMode  mode,
vector< index_t > &  facet_ptr,
index_t  nb_parts = 0 
)

Partitions a mesh into a fixed number of parts.

The mesh facets are reordered in such a way that each mesh part contains a contiguous set of facet indices.

Parameters
[in,out]Mthe mesh to partition
[in]modeone of MESH_PARTITION_HILBERT, MESH_PARTITION_CONNECTED_COMPONENTS.
[out]facet_ptron exit, part p's facets are facet_ptr[p] ... facet_ptr[p+1]-1
[in]nb_partsnumber of parts to create. Ignored if mode = MESH_PARTITION_CONNECTED_COMPONENTS

◆ mesh_postprocess_RDT()

void GEO::mesh_postprocess_RDT ( Mesh M)

Post-processes a Restricted Delaunay Triangulation.

Reconstructs the triangle-triangle connectivity and removes some degeneracies (vertices with a unique triangle incident to them).

◆ mesh_reorder()

void GEO::mesh_reorder ( Mesh M,
MeshOrder  order = MESH_ORDER_HILBERT 
)

Reorders all the elements of a mesh.

It is used for both improving data locality and for implementing mesh partitioning.

Parameters
[in]Mthe mesh to reorder
[in]orderthe reordering scheme

◆ mesh_reorient()

void GEO::mesh_reorient ( Mesh M,
vector< index_t > *  moebius_facets = nullptr 
)

Reorients the facets of a mesh coherently.

The input mesh may have facets that have incoherent orientations, i.e. edges that do not respect the Moebius law (two facets that share an edge, one oriented clockwise and the other one anticlockwise). This function detects and repairs such configurations by flipping the incoherent facets. Facet-facet links (corner_adjacent_facet) need to be initialized as follows: for two corners c1, c2, if we have:

  • v1 = corner_vertex_index(c1)
  • v2 = corner_vertex_index(c1,next_around_facet(c2f(c1),c1))
  • w1 = corner_vertex_index(c2)
  • w2 = corner_vertex_index(c2,next_around_facet(c2f(c2),c2)) then c1 and c2 are adjacent if we have:
  • v1=w2 and v2=w1 (as usual) or:
  • v1=v2 and w1=w2 ('inverted' configuration) On exit, facets are flipped in such a way that only the first configuration (v1=w2 and v2=w1) appears. Moebius strips, if encountered, are cut.
    Parameters
    [in,out]Mthe mesh to reorient
    [out]moebius_facetsa pointer to a vector. On exit, *moebius_facets[f] has a non-zero value if facet f is incident to an edge that could not be consistently oriented. If nullptr, then this information is not returned.

◆ mesh_repair()

void GEO::mesh_repair ( Mesh M,
MeshRepairMode  mode = MESH_REPAIR_DEFAULT,
double  colocate_epsilon = 0.0 
)

Fixes some defaults in a mesh.

Parameters
[in,out]Mthe mesh to repair
[in]modea combination of MeshRepairMode flags. Combine them with the 'bitwise or' (|) operator.
[in]colocate_epsilontolerance used to colocate vertices (if MESH_REPAIR_COLOCATE is set in mode).

◆ mesh_save() [1/2]

bool GEO::mesh_save ( const Mesh M,
const std::string &  filename,
const MeshIOFlags ioflags = MeshIOFlags() 
)

Saves a mesh to a file.

Saves mesh M to the file filename. The file format is determined by the filename's extension, which determines the appropriate MeshIOHandler to use to write the file.

Parameters
[in]Mthe mesh to save
[in]filenamename of the file
[in]ioflagsspecifies which attributes and elements should be saved
Returns
true on success, false otherwise.
See also
MeshIOHandler

◆ mesh_save() [2/2]

bool GEO::mesh_save ( const Mesh M,
OutputGeoFile geofile,
const MeshIOFlags ioflags = MeshIOFlags() 
)

Saves a mesh to a GeoFile ('.geogram' file format)

Saves mesh M to the GeoFile geofile. This function can be used to write several meshes into the same GeoFile.

Parameters
[in]Mthe mesh to save
[in]geofilea reference to the OutputGeoFile
[in]ioflagsspecifies which attributes and elements should be saved
Returns
true on success, false otherwise.

◆ mesh_smooth()

void GEO::mesh_smooth ( Mesh M)

Smooths the shape of a mesh.

The vertices in the current vertex selection are locked, and all the other ones are optimized.

Parameters
[in]Ma reference to a surface mesh

◆ mesh_split_catmull_clark()

void GEO::mesh_split_catmull_clark ( Mesh M,
MeshSplitCallbacks cb = nullptr 
)

Splits a mesh using Catmull-Clark subdivision rule.

If the surface mesh has a boundary, then its geometry is left unchanged.

Parameters
[in,out]Ma reference to a surface mesh.
[in]cban optional pointer to a MeshSplitCallbacks, indicating how vertices attributes should be interpolated.

◆ mesh_split_quads()

void GEO::mesh_split_quads ( Mesh M,
index_t  facets_begin = 0,
index_t  facets_end = index_t(-1),
MeshSplitCallbacks cb = nullptr 
)

Splits each facet of a surface mesh into quads.

Parameters
[in,out]Ma reference to a surface mesh
[in]facets_begin(optional) index of the first facet to be split
[in]facets_end(optional) one position past the index of the last facet to be split or index_t(-1) if unspecified.
[in]cban optional pointer to a MeshSplitCallbacks, indicating how vertices attributes should be interpolated.

◆ mesh_split_triangles()

void GEO::mesh_split_triangles ( Mesh M,
index_t  facets_begin = 0,
index_t  facets_end = index_t(-1),
MeshSplitCallbacks cb = nullptr 
)

Splits each triangle of a surface mesh into four.

Parameters
[in,out]Ma reference to a surface mesh
[in]facets_begin(optional) index of the first facet to be split
[in]facets_end(optional) one position past the index of the last facet to be split or index_t(-1) if unspecified
[in]cban optional pointer to a MeshSplitCallbacks, indicating how vertices attributes should be interpolated.
Precondition
M.facets.are_simplices() == true

◆ mesh_symmetric_Hausdorff_distance()

double GEO::mesh_symmetric_Hausdorff_distance ( Mesh m1,
Mesh m2,
double  sampling_dist 
)

Computes an approximation of the symmetric Hausdorff distance dH(m1<->m2) between two surfacic meshes.

The symmetric Hausdorff distance dH(m1<->m2) is defined as: dH(m1<->m2) = Max(dH(m1->m2),dH(m2->m1))

Remarks
Only the facets of meshes m1 and m2 are used (line segments and volumetric cells are ignored). Note that the order of the mesh facets are changed.
Parameters
[in]m1,m2two surfacic meshes whose distance is computed
[in]sampling_distaverage distance between two samples (the smaller, the more accurate). At least all the vertices of m1 (resp. m2) are sampled, and additional random samples on the surface are added until sampling density is reached, i.e. nb_samples_m1 >= area(m1) / sampling_dist^2 (resp. m2).
See also
mesh_one_sided_Hausdorff_distance()

◆ mesh_tetra_mass() [1/2]

template<index_t DIM>
double GEO::mesh_tetra_mass ( const Mesh mesh,
index_t  t 
)
inline

Computes the mass of a mesh tetrahedron.

The function can optionally take into account the vertex weights.

Parameters
[in]meshthe surface mesh
[in]ta tetrahedron index in mesh
Returns
the mass of tetrahedron t in mesh

Definition at line 218 of file mesh_sampling.h.

◆ mesh_tetra_mass() [2/2]

template<index_t DIM>
double GEO::mesh_tetra_mass ( const Mesh mesh,
index_t  t,
const Attribute< double > &  weight 
)
inline

Computes the mass of a mesh tetrahedron.

The function can optionally take into account the vertex weights.

Parameters
[in]meshthe surface mesh
[in]ta tetrahedron index in mesh
[in]weighta reference to a vertex weight attribute. If it is bound, it is taken into account in mass computation
Returns
the mass of tetrahedron t in mesh

Definition at line 251 of file mesh_sampling.h.

◆ mesh_tetrahedralize()

bool GEO::mesh_tetrahedralize ( Mesh M,
bool  preprocess = true,
bool  refine = false,
double  quality = 2.0,
bool  keep_regions = false 
)

Fills a closed surface mesh with tetrahedra.

A constrained Delaunay triangulation algorithm needs to be interfaced (e.g., compiling with tetgen support).

Parameters
[in,out]Ma reference to a mesh
[in]preprocessif true, the surface mesh is preprocessed to fix some defects (small gaps and intersections). If preprocess is set and borders are detected after preprocessing, then the function returns false. If preprocess is set to false, then the caller is supposed to provide a correct set of input constraints (that may have dangling borders / internal constraints).
[in]refineif true, inserts additional vertices to improve the quality of the mesh elements
[in]qualitytypically in [1.0, 2.0], specifies the desired quality of mesh elements (1.0 means maximum quality, and generates a higher number of elements).
[in]keep_regionsif set, then all internal regions are kept, and a region cell attribute is created, else only tetrahedra in the outermost region are kept.
Return values
trueif the mesh was successfuly tetrahedralized
falseotherwise
Note
needs a constrained Delaunay algorithm to work (geogram needs to be compiled with mg-tetra or tetgen).

◆ mesh_tets_volume()

double EXPLORAGRAM_API GEO::mesh_tets_volume ( const Mesh M)

Computes the volume of a tetrahedral mesh.

Parameters
[in]Ma const reference to the mesh
Returns
the volume of the tetrahedra of M

◆ mesh_Xi()

signed_index_t GEO::mesh_Xi ( const Mesh M)

Computes the Euler-Poincare characteristic of a surfacic Mesh.

Parameters
[in]Mthe input mesh
Returns
Xi = V - E + F, where V = number of vertices, E = number of edges and F = number of faces.

◆ meshes_have_same_topology()

bool GEO::meshes_have_same_topology ( const Mesh M1,
const Mesh M2,
bool  verbose = false 
)

Compares the topological invariants of two meshes.

The topological invariants are: the number of connected components (get_connected_components()), the Euler-Poincare characteristic (computed by mesh_Xi()) and the number of borders (computed by mesh_number_of_borders()). These are displayed if verbose is set to true.

Parameters
[in]M1the first input mesh
[in]M2the second input mesh
[in]verboseenables/disables the display of topological information for the two meshes
Return values
trueif meshes M1 and M2 have the same topology,
falseotherwise.

◆ mult()

template<index_t DIM, class FT >
vecng<DIM,FT> GEO::mult ( const Matrix< DIM, FT > &  M,
const vecng< DIM, FT > &  x 
)
inline

Computes a matrix vector product.

Parameters
[in]Mthe matrix
[in]xthe vector
Returns
M times x
Note
This function copies the resulting vector, thus it is not very efficient and should be only used when prototyping.

Definition at line 593 of file matrix.h.

◆ my_lua_isboolean()

int GEO::my_lua_isboolean ( lua_State *  L,
int  idx 
)
inline

Tests whether a LUA variable is a boolean.

lua_isboolean() is a macro, and we needed a true function here (to be passed to lua_check_type()).

Parameters
[in]La pointer to the LUA state
[in]idxan index in the LUA stack
Return values
anon-zero integer if the variable at index idx in the LUA state L is a boolean.
0otherwise.

Definition at line 85 of file lua_wrap.h.

◆ my_lua_ispositiveinteger()

int GEO::my_lua_ispositiveinteger ( lua_State *  L,
int  idx 
)
inline

Tests whether a LUA variable is a positive integer.

Parameters
[in]La pointer to the LUA state
[in]idxan index in the LUA stack
Return values
anon-zero integer if the variable at index idx in the LUA state L is a positive integer.
0otherwise.

Definition at line 98 of file lua_wrap.h.

◆ normalize_embedding_area()

void GEO::normalize_embedding_area ( Mesh M)

Computes vertices weights in such a way that triangle areas are normalized.

If this function is used, then CentroidalVoronoiTesselation generates Voronoi cells of equal areas.

Parameters
[in,out]Mthe mesh

◆ operator*() [1/4]

Quaternion GEO::operator* ( const Quaternion a,
const Quaternion b 
)
inline

Computes the product of two Quaternion.

Parameters
[in]aa const reference to the first Quaternion
[in]ba const reference to the second Quaternion
Returns
the product of a and b

Definition at line 280 of file quaternion.h.

◆ operator*() [2/4]

Quaternion GEO::operator* ( const Quaternion a,
double  t 
)
inline

Computes the product of a Quaternion and a scalar.

Parameters
[in]aa const reference to the Quaternion
[in]tthe scalar
Returns
the product of a and t

Definition at line 293 of file quaternion.h.

◆ operator*() [3/4]

Quaternion GEO::operator* ( double  t,
const Quaternion a 
)
inline

Computes the product of a scalar and a Quaternion.

Parameters
[in]tthe scalar
[in]aa const reference to the second Quaternion
Returns
the product of t and a

Definition at line 304 of file quaternion.h.

◆ operator*() [4/4]

template<index_t DIM, class FT >
vecng<DIM,FT> GEO::operator* ( const Matrix< DIM, FT > &  M,
const vecng< DIM, FT > &  x 
)
inline

Computes a matrix vector product.

Parameters
[in]Mthe matrix
[in]xthe vector
Returns
M times x
Note
This function copies the resulting vector, thus it is not very efficient and should be only used when prototyping.

Definition at line 571 of file matrix.h.

◆ operator+()

Quaternion GEO::operator+ ( const Quaternion a,
const Quaternion b 
)
inline

Computes the sum of two Quaternion.

Parameters
[in]aa const reference to the first Quaternion
[in]ba const reference to the second Quaternion
Returns
the sum of a and b

Definition at line 245 of file quaternion.h.

◆ operator-() [1/2]

Quaternion GEO::operator- ( const Quaternion a,
const Quaternion b 
)
inline

Computes the difference between two Quaternion.

Parameters
[in]aa const reference to the first Quaternion
[in]ba const reference to the second Quaternion
Returns
the difference between a and b

Definition at line 258 of file quaternion.h.

◆ operator-() [2/2]

Quaternion GEO::operator- ( const Quaternion a)
inline

Computes the opposite of a Quaternion.

Parameters
[in]aa const reference to the Quaternion
Returns
the opposite of a

Definition at line 270 of file quaternion.h.

◆ operator<<() [1/4]

std::ostream& GEO::operator<< ( std::ostream &  out,
const TriangleIsect I 
)
inline

Prints a triangle intersection element to a stream.

Used for debugging purposes.

Parameters
[in]outthe stream.
[in]Ithe intersection element to be printed.

Definition at line 115 of file triangle_intersection.h.

◆ operator<<() [2/4]

std::ostream& GEO::operator<< ( std::ostream &  out,
vector< TriangleIsect > &  II 
)
inline

Prints the result of a triangle intersection to a stream.

Used for debugging purposes.

Parameters
[in]outthe stream.
[in]IIthe intersections to be printed.

Definition at line 132 of file triangle_intersection.h.

◆ operator<<() [3/4]

std::ostream& GEO::operator<< ( std::ostream &  out,
const Quaternion q 
)
inline

Writes a Quaternion to a stream.

Parameters
[in,out]outthe stream
[in]qa const reference to the quaternion
Returns
a reference to the stream

Definition at line 219 of file quaternion.h.

◆ operator<<() [4/4]

std::ostream& GEO::operator<< ( std::ostream &  out,
const MeshHalfedges::Halfedge H 
)
inline

Displays a Halfedge.

Parameters
[out]outthe stream where to print the Halfedge
[in]Hthe Halfedge
Returns
a reference to the stream out

Definition at line 300 of file mesh_halfedges.h.

◆ operator>>()

std::istream& GEO::operator>> ( std::istream &  in,
Quaternion q 
)
inline

Reads a Quaternion from a stream.

Parameters
[in,out]inthe stream
[out]qa reference to the quaternion
Returns
a reference to the stream

Definition at line 231 of file quaternion.h.

◆ orient_normals()

void GEO::orient_normals ( Mesh M)

Orients the normals in such a way that each connected component has a positive signed volume.

Parameters
[in,out]Mthe mesh to be processed

◆ pack_atlas_using_xatlas()

void GEO::pack_atlas_using_xatlas ( Mesh mesh)

Packs an atlas using the xatlas library.

The mesh needs to have a parameterization stored in the tex_coord facet_corner attribute.

Parameters
[in,out]mesha reference to the mesh

◆ parallel() [1/3]

void GEO::parallel ( std::function< void()>  f1,
std::function< void()>  f2 
)

Calls functions in parallel.

Can be typically used with lambdas that capture this. See mesh/mesh_reorder.cpp and points/kd_tree.cpp for examples.

Parameters
[in]f1,f2functions to be called in parallel.

◆ parallel() [2/3]

void GEO::parallel ( std::function< void()>  f1,
std::function< void()>  f2,
std::function< void()>  f3,
std::function< void()>  f4 
)

Calls functions in parallel.

Can be typically used with lambdas that capture this. See mesh/mesh_reorder.cpp and points/kd_tree.cpp for examples.

Parameters
[in]f1,f2,f3,f4functions to be called in parallel.

◆ parallel() [3/3]

void GEO::parallel ( std::function< void()>  f1,
std::function< void()>  f2,
std::function< void()>  f3,
std::function< void()>  f4,
std::function< void()>  f5,
std::function< void()>  f6,
std::function< void()>  f7,
std::function< void()>  f8 
)

Calls functions in parallel.

Can be typically used with lambdas that capture this. See mesh/mesh_reorder.cpp and points/kd_tree.cpp for examples.

Parameters
[in]f1,f2,f3,f4,f5,f6,f7,f8functions to be called in parallel.

◆ parallel_for()

void GEO::parallel_for ( index_t  from,
index_t  to,
std::function< void(index_t)>  func,
index_t  threads_per_core = 1,
bool  interleaved = false 
)

Executes a loop with concurrent threads.

Executes a parallel for loop from index to index to, calling functional object func at each iteration.

Calling parallel_for(func, from, to) is equivalent to the following loop, computed in parallel:

for(index_t i = from; i < to; i++) {
func(i)
}

When applicable, iterations are executed by concurrent threads: the range of the loop is split in to several contiguous sub-ranges, each of them being executed by a separate thread.

If parameter interleaved is set to true, the loop range is decomposed in interleaved index sets. Interleaved execution may improve cache coherency.

Parameters
[in]funcfunction that takes an index_t.
[in]fromthe first iteration index
[in]toone position past the last iteration index
[in]threads_per_corenumber of threads to allocate per physical core (default is 1).
[in]interleavedif set to true, indices are allocated to threads with an interleaved pattern.

◆ parallel_for_slice()

void GEO::parallel_for_slice ( index_t  from,
index_t  to,
std::function< void(index_t, index_t)>  func,
index_t  threads_per_core = 1 
)

Executes a loop with concurrent threads.

When applicable, iterations are executed by concurrent threads: the range of the loop is split in to several contiguous sub-ranges, each of them being executed by a separate thread.

Calling parallel_for(func, from, to) is equivalent to the following loop, computed in parallel:

func(from, i1);
func(i1, i2);
...
func(in, to);

where i1,i2,...in are automatically generated. Typically one interval per physical core is generated.

Parameters
[in]funcfunctional object that accepts two arguments of type index_t.
[in]fromfirst iteration index of the loop
[in]toone position past the last iteration index
[in]threads_per_corenumber of threads to allocate per physical core (default is 1).

◆ read_ascii_attribute()

template<class T >
bool GEO::read_ascii_attribute ( FILE *  file,
Memory::pointer  base_addr,
index_t  nb_elements 
)
inline

Reads an ASCII attribute from a file.

Parameters
[in]filethe input file, obtained through fopen()
[out]base_addran array with sufficient space for storing nb_elements of type T
[in]nb_elementsthe number of elements to be read
Return values
trueon success
falseotherwise
Template Parameters
Tthe type of the elements to be read

Definition at line 108 of file geofile.h.

◆ read_ascii_attribute< bool >()

template<>
bool GEO::read_ascii_attribute< bool > ( FILE *  file,
Memory::pointer  base_addr,
index_t  nb_elements 
)
inline

Reads an ASCII attribute from a file.

Template specialization for bool.

Parameters
[in]filethe input file, obtained through fopen()
[out]base_addran array with sufficient space for storing nb_elements of type bool (1 byte per element)
[in]nb_elementsthe number of elements to be read
Return values
trueon success
falseotherwise

Definition at line 210 of file geofile.h.

◆ read_ascii_attribute< char >()

template<>
bool GEO::read_ascii_attribute< char > ( FILE *  file,
Memory::pointer  base_addr,
index_t  nb_elements 
)
inline

Reads an ASCII attribute from a file.

Template specialization for char, needed because we want chars to appear as integers in ASCII files.

Parameters
[in]filethe input file, obtained through fopen()
[out]base_addran array with sufficient space for storing nb_elements of type char
[in]nb_elementsthe number of elements to be read
Return values
trueon success
falseotherwise

Definition at line 164 of file geofile.h.

◆ recenter_mesh()

void EXPLORAGRAM_API GEO::recenter_mesh ( const Mesh M1,
Mesh M2 
)

Translates a mesh in such a way that its center matches the center of another mesh.

Parameters
[in]M1the reference volumetric mesh
[in,out]M2the volumetric mesh that will be recentered

◆ region_to_string()

std::string GEO::region_to_string ( TriangleRegion  rgn)

Converts a triangle region code to a string.

Parameters
[in]rgnthe triangle region code.
Returns
the string representation of rgn.

◆ remesh_smooth()

void GEO::remesh_smooth ( Mesh M_in,
Mesh M_out,
index_t  nb_points,
coord_index_t  dim = 0,
index_t  nb_Lloyd_iter = 5,
index_t  nb_Newton_iter = 30,
index_t  Newton_m = 7 
)

Remeshes a 'smooth' shape (i.e. without management of sharp features).

Parameters
[in]M_ininput mesh
[out]M_outresult
[in]nb_pointsdesired number of points (note: may generate more points to solve problematic configurations)
[in]dimdimension in which to do the remesh. Use dim=6 and set_anisotropy(M_in,s) for anisotropic remesh, dim=3 for isotropic remesh, dim=0 uses M_in.dimension().
[in]nb_Lloyd_iternumber of Lloyd relaxation iterations (used to initialize Newton iterations with a more homogeneous distribution)
[in]nb_Newton_iternumber of Newton iterations
[in]Newton_mnumber of evaluations used for Hessian approximation..

Example 1 - isotropic remesh:

remesh_smooth(M_in, M_out, 30000, 3) ;

Example 2 - anisotropic remesh:

set_anisotropy(M_in, 0.04) ;
remesh_smooth(M_in, M_out, 30000, 6) ;

◆ remove_degree2_vertices()

void GEO::remove_degree2_vertices ( Mesh M)

Removes the degree 2 vertices in a surface mesh.

Degree two vertices cause some combinatorial problems in some algorithms, since they make the same pair of facets adjacent twice. This function disconnects the concerned facets.

◆ remove_degree3_vertices()

index_t GEO::remove_degree3_vertices ( Mesh M,
double  max_dist 
)

Removes degree 3 vertices.

Parameters
[in,out]Mthe mesh to modify
[in]max_distonly vertices for which the distance to the neighbors supporting place is smaller than max_dist are removed.
Returns
the number of vertices that were removed.
Note
  • vertices on border and vertices that are incident to quads (or facets that are not triangles) are kept untouched.
  • since removing a degree3 vertex can create another one, the most common use is to call the function in a loop like:
    while(remove_degree3_vertices(M, max_dist) != 0) ;

◆ remove_small_connected_components()

void GEO::remove_small_connected_components ( Mesh M,
double  min_component_area,
index_t  min_component_facets = 0.0 
)

Removes the connected components that have an area smaller than a given threshold.

Parameters
[in,out]Mthe mesh to be processed
[in]min_component_areathe connected components with an area smaller than this threshold are removed
[in]min_component_facetsthe connected components with less than min_component_facets facets are removed

◆ remove_small_facets()

void GEO::remove_small_facets ( Mesh M,
double  min_facet_area 
)

Removes the facets that have an area smaller than a given threshold.

Note
This creates holes (borders) in the mesh.
Parameters
[in,out]Mthe mesh to be processed
[in]min_facet_areafacets with an area smaller than this threshold are removed

◆ rescale_mesh()

void EXPLORAGRAM_API GEO::rescale_mesh ( const Mesh M1,
Mesh M2 
)

Rescales a mesh in such a way that its total volume matches the volume of a reference mesh.

Parameters
[in]M1the reference volumetric mesh
[in,out]M2the volumetric mesh that will be rescaled

◆ round()

double GEO::round ( double  x)
inline

Definition at line 340 of file numeric.h.

◆ sample()

void EXPLORAGRAM_API GEO::sample ( CentroidalVoronoiTesselation CVT,
index_t  nb_points,
bool  project_on_border,
bool  BRIO = true,
bool  multilevel = true,
double  ratio = 0.125,
vector< index_t > *  levels = nullptr 
)

Computes a point sampling of a surfacic or volumetric mesh.

If CVT is in volumetric mode and the mesh has cells, then the sampling is in the volume, else the sampling is on the surface (facets) of the mesh.

See also
CentroidalVoronoiTesselation::set_volumetric()
Parameters
[in,out]CVTa CentroidalVoronoiTesselation plugged on the volumetric mesh to be sampled
[in]nb_pointsnumber of points to be created
[in]project_on_borderif true, points near the border are projected onto the boundary of M. Needs VORPALINE to be supported.
[in]BRIOif true, use Biased Random Insertion Order [Amenta et.al]
[in]multilevelif true, use multilevel sampling (note: BRIO implies multilevel)
[in]ratioratio between the sizes of two sucessive levels
[in]levelsif specified, the indices that indicate the beginning of each level will be copied to this vector.

◆ set_anisotropy()

void GEO::set_anisotropy ( Mesh M,
double  s 
)

Normalizes and scales the stored vertex normals by a factor.

If no normal are stored, then they are created and computed. Normals are stored in coordinates 3,4,5 of the vertices.

Parameters
[in,out]Mthe mesh
[in]sthe factor used to scale the normals

◆ set_assert_mode()

void GEO::set_assert_mode ( AssertMode  mode)

Sets assertion mode.

Parameters
[in]modeassert termination mode
See also
AssertMode

◆ set_density()

void EXPLORAGRAM_API GEO::set_density ( Mesh M,
double  mass1,
double  mass2,
const std::string &  func_str,
Mesh distance_reference = nullptr 
)

Creates a "weight" attribute with varying values.

Parameters
[in,out]Ma reference to the volumetric mesh that should be decorated with densities
[in]mass1minimum value of the density
[out]mass2maximum value of the density
[in]func_strspecification of the function to be used, in the form "(+|-)?func(^pow)?", where func is one of X,Y,Z,R,sin,dist
[in]distance_referenceif func is "dist" and if non-nullptr, distance is computed relative to distance_reference, else it is computed relative to M. the same thing is refered here as "mass", "density" and "weight", this is a total mess.

◆ sign_of_expansion_determinant() [1/3]

Sign GEO::sign_of_expansion_determinant ( const expansion a00,
const expansion a01,
const expansion a10,
const expansion a11 
)

Computes the sign of a 2x2 determinant.

Specialization using the low-evel API for expansions. This gains some performance as compared to using CGAL's determinant template with expansion_nt.

◆ sign_of_expansion_determinant() [2/3]

Sign GEO::sign_of_expansion_determinant ( const expansion a00,
const expansion a01,
const expansion a02,
const expansion a10,
const expansion a11,
const expansion a12,
const expansion a20,
const expansion a21,
const expansion a22 
)

Computes the sign of a 3x3 determinant.

Specialization using the low-evel API for expansions. This gains some performance as compared to using CGAL's determinant template with expansion_nt.

◆ sign_of_expansion_determinant() [3/3]

Sign GEO::sign_of_expansion_determinant ( const expansion a00,
const expansion a01,
const expansion a02,
const expansion a03,
const expansion a10,
const expansion a11,
const expansion a12,
const expansion a13,
const expansion a20,
const expansion a21,
const expansion a22,
const expansion a23,
const expansion a30,
const expansion a31,
const expansion a32,
const expansion a33 
)

Computes the sign of a 4x4 determinant.

Specialization using the low-evel API for expansions. This gains some performance as compared to using CGAL's determinant template with expansion_nt.

◆ simple_Laplacian_smooth()

void GEO::simple_Laplacian_smooth ( Mesh M,
index_t  nb_iter,
bool  normals_only 
)

Smoothes a mesh.

Moves each point of mesh M to the barycenter of its neighbors. This operation is repeated the specified number of times nb_iter.

Parameters
[in,out]Mthe mesh to smooth
[in]nb_iternumber of smoothing iterations
[in]normals_onlyif set, only stored normals are smoothed.

◆ sort() [1/2]

template<typename ITERATOR >
void GEO::sort ( const ITERATOR &  begin,
const ITERATOR &  end 
)
inline

Sorts elements in parallel.

Sorts elements in the iterator range [begin..end) using a parallel version of the standard std::sort() algorithm (if possible). The elements are compared using operator<(). Whether to use the parallel or the standard version of the std::sort() algorithm is controlled by the "algo:parallel" environment property.

Parameters
[in]beginfirst element to sort
[in]endone position past the last element to sort
Template Parameters
ITERATORthe type of the iterator
See also
uses_parallel_algorithm()

Definition at line 95 of file algorithm.h.

◆ sort() [2/2]

template<typename ITERATOR , typename CMP >
void GEO::sort ( const ITERATOR &  begin,
const ITERATOR &  end,
const CMP &  cmp 
)
inline

Sorts elements in parallel.

Sorts elements in the iterator range [begin..end) using a parallel version of the standard std::sort() algorithm (if possible). The elements are compared using comparator cmp. Comparator cmp must implement an operator() with the following signature:

bool operator(T a, T b) const;

Whether to use the parallel or the standard version of the std::sort() algorithm is controlled by the "algo:parallel" environment property.

Parameters
[in]beginfirst element to sort
[in]endone position past the last element to sort
[in]cmpcomparison object.
Template Parameters
ITERATORthe type of the iterator
CMPthe type of the comparator
See also
uses_parallel_algorithm()

Definition at line 131 of file algorithm.h.

◆ sort_3()

template<typename ITERATOR >
void GEO::sort_3 ( ITERATOR  items)
inline

Specialized sort routine for 3 elements.

std::sort is slower than specialized sort on small sequences of elements.

Parameters
[in]itemsa random access iterator iterator to the first element.

Definition at line 168 of file algorithm.h.

◆ sort_4()

template<typename ITERATOR >
void GEO::sort_4 ( ITERATOR  items)
inline

Specialized sort routine for 4 elements.

std::sort is slower than specialized sort on small sequences of elements.

Parameters
[in]itemsa random access iterator iterator to the first element.

Definition at line 186 of file algorithm.h.

◆ sort_unique()

template<typename VECTOR >
void GEO::sort_unique ( VECTOR &  v)
inline

Sorts a vector and suppresses all duplicated elements.

Parameters
[in,out]vthe vector

Definition at line 152 of file algorithm.h.

◆ split_chart_along_principal_axis()

void GEO::split_chart_along_principal_axis ( Chart chart,
Chart new_chart_1,
Chart new_chart_2,
index_t  axis = 2,
bool  verbose = false 
)

Splits a chart into two parts.

Parameters
[in,out]chartthe input chart. On exit, its list of facets is cleared.
[out]new_chart_1,new_chart_2the two generated charts. Their chart id is used to initialize the "chart" attribute of the input mesh.
[in]verboseif true, display messages and statistics.

◆ stream_buffer_object()

void GEOGRAM_GFX_API GEO::stream_buffer_object ( GLuint &  buffer_id,
GLenum  target,
size_t  new_size,
const void *  data 
)

Updates the content of an OpenGL buffer object in streaming mode.

Streaming mode means that there will be many updates of the contents of the same buffer object. stream_buffer_object() does the same thing as update_buffer_object(), but may be faster than update_buffer_object() in this situation.

Parameters
[in,out]buffer_idOpenGL opaque id of the buffer object. 0 means uninitialized. may be changed on exit if the buffer needed to be created or destroyed.
[in]targetbuffer object target (GL_ARRAY_BUFFER, GL_INDEX_BUFFER ...)
[in]new_sizeof the buffer data, in bytes
[in]datapointer to the data to be copied into the buffer, of length new_size

◆ surface_average_edge_length()

double GEO::surface_average_edge_length ( const Mesh M)

Computes the average edge length in a surface.

Parameters
[in]Ma const reference to a surface mesh
Returns
the average edge length

◆ terminate()

void GEO::terminate ( )

Cleans up Geogram.

This function is called automatically when the program exists normally.

Warning
This function should not be called directly.
See also
initialize()

◆ tessellate_facets()

void GEO::tessellate_facets ( Mesh M,
index_t  max_nb_vertices 
)

Subdivides the facets with more than nb_vertices.

Parameters
[in]Ma reference to a surface mesh.
[in]max_nb_verticesmaximum number of vertices in a facet.

◆ transform_point()

template<class FT >
vecng<3,FT> GEO::transform_point ( const vecng< 3, FT > &  v,
const Matrix< 4, FT > &  m 
)

Applies a 3d transform to a 3d point.

Convention is the same as in OpenGL, i.e. vector is a row vector, multiplied on the left of the transform. Internally, the point is converted into a 4d vector, with w coordinate set to one. Transformed coordinates are divided by the transformed w to form a 3d point.

Parameters
[in]vthe input 3d point to be transformed
[in]mthe transform, as a 4x4 matrix, using homogeneous coordinates
Template Parameters
FTtype of the coordinates
Returns
the transformed 3d point

Definition at line 741 of file geometry.h.

◆ transform_vector() [1/2]

template<class FT >
vecng<3,FT> GEO::transform_vector ( const vecng< 3, FT > &  v,
const Matrix< 4, FT > &  m 
)

Applies a 3d transform to a 3d vector.

Convention is the same as in OpenGL, i.e. vector is a row vector, multiplied on the left of the transform. Internally, the vector is converted into a 4d vector, with w coordinate set to zero.

Parameters
[in]vthe input 3d vector to be transformed
[in]mthe transform, as a 4x4 matrix, using homogeneous coordinates
Template Parameters
FTtype of the coordinates
Returns
the transformed 3d vector

Definition at line 705 of file geometry.h.

◆ transform_vector() [2/2]

template<class FT >
vecng<4,FT> GEO::transform_vector ( const vecng< 4, FT > &  v,
const Matrix< 4, FT > &  m 
)

Applies a 4d transform to a 4d point.

Convention is the same as in OpenGL, i.e. vector is a row vector, multiplied on the left of the transform.

Parameters
[in]vthe input 4d point to be transformed
[in]mthe transform, as a 4x4 matrix
Template Parameters
FTtype of the coordinates
Returns
the transformed 4d vector

Definition at line 775 of file geometry.h.

◆ triangles_intersections()

bool GEO::triangles_intersections ( const vec3 p0,
const vec3 p1,
const vec3 p2,
const vec3 q0,
const vec3 q1,
const vec3 q2,
vector< TriangleIsect > &  result 
)

Triangle-triangle intersection.

Parameters
[in]p0,p1,p2first triangle
[in]q0,q1,q2second triangle
[out]resultthe intersection in symbolic form, as TriangleRegion pairs. There can be between 0 and 6 intersection pairs in the result.
Return values
trueif there is a non-degenerate intersection
falseotherwise. Degenerate intersection cases are:
  • one vertex in common
  • two vertices (an edge) in common
  • or duplicated triangles.

◆ unset_anisotropy()

void GEO::unset_anisotropy ( Mesh M)

Normalizes the stored vertex normals.

Parameters
[in,out]Mthe mesh

◆ update_buffer_object()

void GEOGRAM_GFX_API GEO::update_buffer_object ( GLuint &  buffer_id,
GLenum  target,
size_t  new_size,
const void *  data 
)

Updates the content of an OpenGL buffer object, and resizes it if need be.

Parameters
[in,out]buffer_idOpenGL opaque id of the buffer object. 0 means uninitialized. may be changed on exit if the buffer needed to be created or destroyed.
[in]targetbuffer object target (GL_ARRAY_BUFFER, GL_INDEX_BUFFER ...)
[in]new_sizeof the buffer data, in bytes
[in]datapointer to the data to be copied into the buffer, of length new_size

◆ update_or_check_buffer_object()

void GEOGRAM_GFX_API GEO::update_or_check_buffer_object ( GLuint &  buffer_id,
GLenum  target,
size_t  new_size,
const void *  data,
bool  update 
)

Updates the content of an OpenGL buffer object, and resizes it if need be, or tests whether it has the size it should have.

Parameters
[in,out]buffer_idOpenGL opaque id of the buffer object. 0 means uninitialized. may be changed on exit if the buffer needed to be created or destroyed.
[in]targetbuffer object target (GL_ARRAY_BUFFER, GL_INDEX_BUFFER ...)
[in]new_sizeof the buffer data, in bytes
[in]datapointer to the data to be copied into the buffer, of length new_size
[in]update
  • if true, the buffer will be updated, and resized if need be.
  • if false, the size of the buffer will be tested, and an error message will be displayed in the logger if it does not match the specified size (and update will be forced).

◆ uses_parallel_algorithm()

bool GEO::uses_parallel_algorithm ( )

Checks whether parallel algorithms are used.

Some algorithms such as sort() can be used in parallel or sequential mode. Behavior is toggled by the "algo:parallel" environment variable.

Return values
trueif parallel algorithms are used.
falseif sequential algorithms are used.

◆ v2f_is_valid()

bool GEO::v2f_is_valid ( Mesh m,
vector< vector< index_t > > &  v2f,
vector< index_t > &  to_kill 
)

check that v2f[v] gives all facets that are adjacent to v are not to be killed

◆ write_ascii_attribute()

template<class T >
bool GEO::write_ascii_attribute ( FILE *  file,
Memory::pointer  base_addr,
index_t  nb_elements 
)
inline

Writes an ASCII attribute to a file.

Parameters
[in]filethe output file, obtained through fopen()
[in]base_addran array with nb_elements of type T
[in]nb_elementsthe number of elements to be written
Return values
trueon success
falseotherwise
Template Parameters
Tthe type of the elements to be written

Definition at line 137 of file geofile.h.

◆ write_ascii_attribute< bool >()

template<>
bool GEO::write_ascii_attribute< bool > ( FILE *  file,
Memory::pointer  base_addr,
index_t  nb_elements 
)
inline

Writes an ASCII attribute to a file.

Template specialization for bool.

Parameters
[in]filethe output file, obtained through fopen()
[in]base_addran array with nb_elements of type bool (1 byte per element)
[in]nb_elementsthe number of elements to be written
Return values
trueon success
falseotherwise

Definition at line 234 of file geofile.h.

◆ write_ascii_attribute< char >()

template<>
bool GEO::write_ascii_attribute< char > ( FILE *  file,
Memory::pointer  base_addr,
index_t  nb_elements 
)
inline

Writes an ASCII attribute to a file.

Template specialization for char, needed because we want chars to appear as integers in ASCII files.

Parameters
[in]filethe output file, obtained through fopen()
[in]base_addran array with nb_elements of type char
[in]nb_elementsthe number of elements to be written
Return values
trueon success
falseotherwise

Definition at line 188 of file geofile.h.