Graphite  Version 3
An experimental 3D geometry processing program
GEO Namespace Reference

Global Vorpaline namespace. More...

Namespaces

 CmdLine
 Utilities to process command line arguments.
 
 exact
 Exact geometric types.
 
 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  AttributeStoreObserver
 Base class for attributes. They are notified whenever the AttributeStore is modified. More...
 
class  AttributeStoreCreator
 Internal class for creating an AttributeStore from the type name of its elements. More...
 
class  AttributeStore
 Notifies a set of AttributeStoreObservers each time the stored array changes size and/or base address and/or dimension. More...
 
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  geo_register_attribute_type
 Helper class to register new attribute types. More...
 
class  AttributesManager
 Managers a set of attributes attached to an object. More...
 
class  AttributeBase
 Base class for Attributes, that manipulates an attribute stored in an AttributesManager. More...
 
class  Attribute
 Manages an attribute attached to a set of object. More...
 
class  Attribute< bool >
 Specialization of Attribute for booleans. More...
 
class  ScalarAttributeAdapterBase
 Access to an attribute as a double regardless its type. More...
 
class  ReadOnlyScalarAttributeAdapter
 Readonly access to an attribute as a double regardless its type. More...
 
class  ReadWriteScalarAttributeAdapter
 Readwrite access to an attribute as a double regardless its type. More...
 
class  BinaryStream
 Binary stream base class. More...
 
class  BinaryInputStream
 Binary input file. More...
 
class  BinaryOutputStream
 Binary output file. More...
 
class  BooleanExpression
 A simple parser for boolean expressions. More...
 
class  Counted
 Base class for reference-counted objects. More...
 
class  DebugStream
 Easy to use functions to save geometry to a Alias Wavefront .obj file for debugging. More...
 
class  VariableObserver
 Observes Environment variables. More...
 
class  VariableObserverList
 List of VariableObservers. More...
 
class  Environment
 Application environment. More...
 
class  SystemEnvironment
 System environment. More...
 
class  InstanceRepo
 Repository of unique instances. More...
 
class  Factory
 Factory of typed objects. More...
 
struct  FactoryCreator0
 Factory creator without constructor arguments. More...
 
class  Factory0
 Factory for types without constructor arguments. More...
 
struct  FactoryCreator1
 Factory creator with one argument. More...
 
class  Factory1
 Factory for types with one constructor argument. More...
 
class  GeoFileException
 GeoFile exception. More...
 
class  GeoFile
 Base class for reading or writing Geogram structured binary files. More...
 
class  InputGeoFile
 Used to read a structured binary file. More...
 
class  OutputGeoFile
 Used to write a structured binary file. More...
 
struct  Plane
 A 3D Plane. More...
 
class  Box
 Axis-aligned bounding box. More...
 
class  Box2d
 Axis-aligned bounding box. More...
 
struct  Ray
 A Ray, in parametric form. More...
 
class  LineInput
 Reads an ASCII file line per line. More...
 
class  Matrix
 A matrix type. More...
 
class  vector
 Vector with aligned memory allocation. More...
 
class  vector< bool >
 Specialization of vector for elements of type bool. More...
 
class  PackedArrays
 Efficient storage for array of arrays. More...
 
class  Thread
 Platform-independent base class for running threads. More...
 
class  TypedThreadGroup
 Typed collection of Threads. More...
 
class  ThreadManager
 Platform-independent base class for running concurrent threads. More...
 
class  MonoThreadingThreadManager
 Single thread ThreadManager. More...
 
class  ProgressClient
 Task progress listener. More...
 
struct  TaskCanceled
 Exception thrown when a task is canceled. More...
 
class  ProgressTask
 Tracks the progress of a task. More...
 
class  Quaternion
 Quaternions are useful for representing rotations. More...
 
class  index_as_iterator
 Wraps an integer to be used with the range-based for construct. More...
 
class  index_range
 A generic index_range bounded by two "non-iterators". More...
 
class  const_index_ptr_in_array
 Encapsulates a const pointer to an element in an index_t array. More...
 
class  index_ptr_in_array
 Encapsulates a pointer to an element in an index_t array. More...
 
class  index_ptr_range
 
class  const_index_ptr_range
 
class  rationalg
 rationalg (generic rational) is used to compute the sign of rational fractions exactly. More...
 
class  SmartPointer
 A smart pointer with reference-counted copy semantics. More...
 
class  Stopwatch
 Scope restricted stopwatch. 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  vec2Hg
 2d vector with homogeneous coordinates More...
 
class  vec2HgLexicoCompare
 Comparator class for vec2Hg \detail Used to create maps indexed by vec2Hg or SOS symbolic perturbation. More...
 
class  vec3Hg
 3d vector with homogeneous coordinates More...
 
class  vec3HgLexicoCompare
 Comparator class for vec3Hg \detail Used to create maps indexed by vec3Hg or SOS symbolic perturbation. More...
 
class  Cavity
 Represents the set of tetrahedra on the boundary of the cavity in a 3D Delaunay triangulation. More...
 
class  CDTBase2d
 Base class for constrained Delaunay triangulation. More...
 
class  CDT2d
 Constrained Delaunay triangulation. More...
 
class  ExactCDT2d
 Constrained Delaunay Triangulation with vertices that are exact points. Can be used to implement 2D CSG. More...
 
class  Delaunay
 Abstract interface for Delaunay triangulation in Nd. More...
 
class  Delaunay2d
 Implementation of Delaunay in 2d. More...
 
class  RegularWeightedDelaunay2d
 Regular Delaunay triangulation of weighted points. More...
 
class  Delaunay3d
 Implementation of Delaunay in 3d. More...
 
class  RegularWeightedDelaunay3d
 Regular Delaunay triangulation of weighted points. More...
 
class  Delaunay_NearestNeighbors
 Delaunay interface for NearestNeighbors search. More...
 
class  CellStatusArray
 An array of cell status codes associates to each tetrahedron in a Delaunay tetrahedralization. More...
 
class  LocalFeatureSize
 Computes an approximation of lfs (local feature size). 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  GenColor
 A generic color type. More...
 
class  Colormap
 A Colormap. More...
 
class  Image
 An image. More...
 
class  ImageLibrary
 Manages the ImageSerializer repository and the named images. More...
 
class  geo_declare_image_serializer
 Declares an image serializer for a given extension. More...
 
class  ImageRasterizer
 Draws triangles in an image. More...
 
class  ImageSerializer
 Loads and saves images. More...
 
class  ImageSerializer_pgm
 
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  ImageSerializer_xpm
 
class  StructuringElement
 A structuring element, that is the definition of neighborhood used by a morphological operation. More...
 
class  MorphoMath
 Implements morphological operators for images. More...
 
class  lua_to
 Converts LUA variables to C++ variables. More...
 
class  lua_to< int >
 lua_to specialization for int. More...
 
class  lua_to< Numeric::uint32 >
 lua_to specialization for Numeric::uint32. More...
 
class  lua_to< Numeric::uint64 >
 lua_to specialization for Numeric::uint64. More...
 
class  lua_to< Numeric::int64 >
 lua_to specialization for Numeric::int64. More...
 
class  lua_to< float >
 lua_to specialization for float. More...
 
class  lua_to< double >
 lua_to specialization for double. 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< std::string >
 lua_to specialization for std::string. More...
 
class  lua_wrapper
 Manages wrappers around C++ functions to be called from LUA. More...
 
struct  basic_bindex
 A couple of two indices. More...
 
struct  basic_trindex
 A triple of three indices. More...
 
struct  basic_quadindex
 A tuple of four indices. More...
 
class  MeshSubElementsStore
 Base class for mesh sub-element storage. More...
 
class  MeshElements
 Base class for mesh elements. More...
 
class  MeshVertices
 The vertices of a mesh. More...
 
class  MeshEdges
 The edges of a mesh. More...
 
class  MeshFacetsStore
 Stores the facets of a mesh (low-level store) More...
 
class  MeshFacetCornersStore
 Stores the facet corners of a mesh (low-level store) More...
 
class  MeshFacets
 The facets of a mesh. More...
 
struct  CellDescriptor
 Lookup tables that describe the combinatorics of each cell type. More...
 
class  MeshCellsStore
 Stores the cells of a mesh (low-level store) 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  Mesh
 Represents a mesh. More...
 
class  AABB
 Base class for Axis Aligned Bounding Box trees. More...
 
class  MeshAABB2d
 Base class for Axis Aligned Bounding Box trees of mesh elements with 2d boxes. More...
 
class  MeshAABB3d
 Base class for Axis Aligned Bounding Box trees of mesh elements with 3d boxes. More...
 
class  MeshFacetsAABB
 Axis Aligned Bounding Box tree of mesh facets in 3D. More...
 
class  MeshCellsAABB
 Axis Aligned Bounding Box tree of mesh cells. More...
 
class  MeshFacetsAABB2d
 Axis Aligned Bounding Box tree of mesh facets in 2D. More...
 
class  CSGMesh
 A Mesh with reference counting and bounding box. More...
 
class  CSGBuilder
 Implements CSG objects and instructions. More...
 
class  CSGCompiler
 Creates meshes from OpenSCAD .csg files. 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  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  MeshSurfaceIntersection
 Computes surface intersections. More...
 
class  MeshInTriangle
 Meshes a single triangle with the constraints that come from the intersections with the other triangles. More...
 
struct  IsectInfo
 Stores information about a triangle-triangle intersection. More...
 
class  CoplanarFacets
 Detects and retriangulates a set of coplanar facets for MeshSurfaceIntersection. More...
 
struct  MeshTetrahedralizeParameters
 Parameters for mesh_tetrahedralize() More...
 
class  expansion_nt
 Expansion_nt (expansion Number Type) is used to compute the sign of polynoms exactly. More...
 
class  intervalBase
 Base class for interval arithmetics. More...
 
class  intervalRU
 Interval arithmetics in round to upper (RU) mode. More...
 
class  intervalRN
 Number type for interval arithmetics. More...
 
class  expansion
 Represents numbers in arbitrary precision with a low-level API. More...
 
class  Optimizer
 Optimizer minimizes a multivariate function. More...
 
class  ParamValidator
 Tests whether texture coordinates attached to a surface mesh define a valid parameterization. More...
 
class  KdTree
 Base class for all Kd-tree implementations. More...
 
class  BalancedKdTree
 Implements NearestNeighborSearch using a balanced Kd-tree. More...
 
class  AdaptiveKdTree
 Implements NearestNeighborSearch using an Adaptive Kd-tree. More...
 
class  NearestNeighborSearch
 Abstract interface for nearest neighbor search algorithms. More...
 
class  PrincipalAxes3d
 
class  CentroidalVoronoiTesselation
 CentroidalVoronoiTesselation is the main component of the remeshing algorithm. More...
 
class  IntegrationSimplex
 Computes an objective function and its gradient over a restricted Voronoi diagram. More...
 
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  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  BuildRVDMesh
 Constructs a polyhedral mesh from a restricted Voronoi diagram. More...
 
class  RVDVertexMap
 RVDVertexMap maps symbolic vertices to unique ids. More...
 
class  RVDMeshBuilder
 Builds a Mesh using the symbolic information in the vertices computed by a RestrictedVoronoiDiagram. More...
 
class  FrameBufferObject
 An OpenGL frame buffer object. More...
 
class  AmbientOcclusionImpl
 Implementation of AmbientOcclusion full screen effect. More...
 
class  FullScreenEffectImpl
 Implementation of full screen effects. More...
 
class  UnsharpMaskingImpl
 Implementation of UnsharpMasking full screen effect. More...
 
class  Application
 Base class for all applications. More...
 
class  ArcBall
 Enables to interactively define a rotation. More...
 
class  CommandInvoker
 Abstract class for calling functions or calling member functions. More...
 
class  Command
 Manages the GUI of a command with ImGUI. More...
 
class  FunctionCommandInvoker
 An implementation of CommandInvoker that calls a function. More...
 
class  MemberFunctionCommandInvoker
 An implementation of CommandInvoker that calls a member function of an object. More...
 
class  Console
 A console, that displays logger messages, and where the user can enter commands. More...
 
class  SimpleApplication
 
class  SimpleMeshApplication
 An Application that manipulates a single Mesh. More...
 
class  StatusBar
 StatusBar displays the progress bar. More...
 
class  TextEditor
 A minimalistic text editor. More...
 
class  MeshGfx
 Draws a mesh using OpenGL. More...
 

Typedefs

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< 3, Numeric::int32vec3i
 Represents points and vectors in 3d 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 Box Box3d
 
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 AABB< Box2dAABB2d
 
typedef AABB< Box3dAABB3d
 
typedef SmartPointer< CSGMeshCSGMesh_var
 A smart pointer to a CSGMesh.
 
typedef std::vector< CSGMesh_varCSGScope
 A list of CSGMesh. More...
 
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 vecng< 2, expansion_ntvec2E
 vec2 with coordinates as expansions More...
 
typedef vecng< 3, expansion_ntvec3E
 vec3 with coordinates as expansions More...
 
typedef vecng< 2, interval_ntvec2I
 vec2 with coordinates as interval_nt More...
 
typedef vecng< 3, interval_ntvec3I
 vec3 with coordinates as interval_nt More...
 
typedef vec2Hg< expansion_ntvec2HE
 2D vector in homogeneous coordinates with coordinates as expansions More...
 
typedef vec3Hg< expansion_ntvec3HE
 3D vector in homogeneous coordinates with coordinates as expansions More...
 
typedef vec2Hg< interval_ntvec2HI
 2D vector in homogeneous coordinates with coordinates as intervals. More...
 
typedef vec3Hg< interval_ntvec3HI
 3D vector in homogeneous coordinates with coordinates as intervals. More...
 
typedef rationalg< expansion_ntrational_nt
 
typedef intervalRN interval_nt
 
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  AssertMode { ASSERT_THROW , ASSERT_ABORT , ASSERT_BREAKPOINT }
 Assert termination mode. More...
 
enum  {
  GEOGRAM_INSTALL_NONE = 0 , GEOGRAM_INSTALL_HANDLERS = 1 , GEOGRAM_INSTALL_LOCALE = 2 , GEOGRAM_INSTALL_ERRNO = 4 ,
  GEOGRAM_INSTALL_FPE = 8 , GEOGRAM_INSTALL_BIBLIO = 16 , GEOGRAM_INSTALL_ALL
}
 Symbolic constants for GEO::initialize() More...
 
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_EDGE_REGION = 32 , 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 {
  T1_RGN_P0 = 0 , T1_RGN_P1 = 1 , T1_RGN_P2 = 2 , T2_RGN_P0 = 3 ,
  T2_RGN_P1 = 4 , T2_RGN_P2 = 5 , T1_RGN_E0 = 6 , T1_RGN_E1 = 7 ,
  T1_RGN_E2 = 8 , T2_RGN_E0 = 9 , T2_RGN_E1 = 10 , T2_RGN_E2 = 11 ,
  T1_RGN_T = 12 , T2_RGN_T = 13 , T_RGN_NB = 14
}
 Encodes the location of a point within a triangle. More...
 
enum  ChartParameterizer { PARAM_PROJECTION , PARAM_LSCM , PARAM_SPECTRAL_LSCM , PARAM_ABF }
 Parameterizer used to flatten individual charts.
 
enum  ChartPacker { PACK_NONE , PACK_TETRIS , PACK_XATLAS }
 Packer used to organize the charts in texture space.
 
enum  MeshSegmenter {
  SEGMENT_GEOMETRIC_VSA_L2 , SEGMENT_GEOMETRIC_VSA_L12 , SEGMENT_SPECTRAL_8 , SEGMENT_SPECTRAL_20 ,
  SEGMENT_SPECTRAL_100 , SEGMENT_INERTIA_AXIS
}
 
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

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<typename ITERATOR >
void random_shuffle (const ITERATOR &begin, const ITERATOR &end)
 Applies a random permutation to a sequence. 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_NONE)
 Initialize Geogram. More...
 
void terminate ()
 Cleans up Geogram. More...
 
template<class T >
det2x2 (const T &a11, const T &a12, const T &a21, const T &a22)
 Computes a two-by-two determinant.
 
template<class T >
det3x3 (const T &a11, const T &a12, const T &a13, const T &a21, const T &a22, const T &a23, const T &a31, const T &a32, const T &a33)
 Computes a three-by-three determinant.
 
template<class T >
det4x4 (const T &a11, const T &a12, const T &a13, const T &a14, const T &a21, const T &a22, const T &a23, const T &a24, const T &a31, const T &a32, const T &a33, const T &a34, const T &a41, const T &a42, const T &a43, const T &a44)
 Computes a four-by-four determinant.
 
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...
 
double det (const mat2 &M)
 Computes the determinant of a 2x2 matrix. 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...
 
bool bboxes_overlap (const Box2d &B1, const Box2d &B2)
 Tests whether two Box2d have a non-empty intersection. More...
 
void bbox_union (Box2d &target, const Box2d &B1, const Box2d &B2)
 Computes the smallest Box2d that encloses two Box2d. 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< 3, FT > transform_point (const Matrix< 4, FT > &m, const vecng< 3, FT > &v)
 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...
 
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 >
Sign geo_cmp (const T &a, const T &b)
 Compares two values. 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...
 
template<class T >
Sign geo_sgn (const rationalg< T > &x)
 Specialization of geo_sgn() for rationalg. More...
 
template<class T >
Sign geo_cmp (const rationalg< T > &a, const rationalg< T > &b)
 Specialization of geo_cmp() for rationalg. More...
 
template<class T >
vec2Hg< T > operator- (const vec2Hg< T > &p1, const vec2Hg< T > &p2)
 
template<class T >
vec3Hg< T > operator- (const vec3Hg< T > &p1, const vec3Hg< T > &p2)
 
template<class T >
vec2Hg< T > mix (const rationalg< T > &t, const vecng< 2, double > &p1, const vecng< 2, double > &p2)
 
template<class T >
vec3Hg< T > mix (const rationalg< T > &t, const vecng< 3, double > &p1, const vecng< 3, double > &p2)
 
template<class T >
vec2Hg< T > mix (const rationalg< T > &t, const vec2Hg< T > &p1, const vec2Hg< T > &p2)
 
template<class T >
vec3Hg< T > mix (const rationalg< T > &t, const vec3Hg< T > &p1, const vec3Hg< T > &p2)
 
int my_lua_isboolean (lua_State *L, int idx)
 Tests whether a LUA variable is a boolean. More...
 
int my_lua_islightuserdata (lua_State *L, int idx)
 Tests whether a LUA variable is a light user data. 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, Numeric::uint32 x)
 Specialization of lua_push() for Numeric::uint32.
 
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<class T1 , class T2 , class T3 , class T4 , class T5 >
int lua_wrap (lua_State *L, void(*fptr)(T1, T2, T3, T4, T5))
 Calls a C++ function from LUA. More...
 
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
int lua_wrap (lua_State *L, void(*fptr)(T1, T2, T3, T4, T5, T6))
 Calls a C++ function from LUA. More...
 
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
int lua_wrap (lua_State *L, void(*fptr)(T1, T2, T3, T4, T5, T6, T7))
 Calls a C++ function from LUA. More...
 
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 >
int lua_wrap (lua_State *L, void(*fptr)(T1, T2, T3, T4, T5, T6, T7, T8))
 Calls a C++ function from LUA. More...
 
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 >
int lua_wrap (lua_State *L, void(*fptr)(T1, T2, T3, T4, T5, T6, T7, T8, T9))
 Calls a C++ function from LUA. More...
 
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 >
int lua_wrap (lua_State *L, void(*fptr)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10))
 Calls a C++ function from LUA. More...
 
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 >
int lua_wrap (lua_State *L, void(*fptr)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11))
 Calls a C++ function from LUA. More...
 
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 >
int lua_wrap (lua_State *L, void(*fptr)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12))
 Calls a C++ function from LUA. More...
 
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 >
int lua_wrap (lua_State *L, void(*fptr)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13))
 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...
 
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 glue_edges (Mesh &M, index_t f1, index_t c1, index_t f2, index_t c2)
 Glues two edges on the border of a surface mesh. More...
 
void unglue_edges (Mesh &M, index_t f1, index_t c1)
 Unglues an edge from its opposite edge. More...
 
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, bool adjust=true, double adjust_max_edge_distance=0.5)
 Remeshes a 'smooth' shape (that is, without management of sharp features). More...
 
void mesh_adjust_surface (Mesh &surface, Mesh &reference, double max_edge_distance=0.5, bool project_borders=false)
 Adjusts a surface mesh in such a way that minimizes its distance to a reference surface mesh. 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 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, const vec3 &period)
 Spatially sort a set of vertices in periodic space. 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)
 
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, bool verbose=false)
 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...
 
void mesh_colocate_vertices_no_check (Mesh &M, double colocate_epsilon=0.0, bool verbose=false)
 Merges the vertices of a mesh that are at the same geometric location. More...
 
void mesh_remove_bad_facets_no_check (Mesh &M, bool check_duplicates=true)
 Removes the degenerate and the duplicated facets in a surface mesh. More...
 
void mesh_connect_and_reorient_facets_no_check (Mesh &M)
 Connects the facets and consistently orient manifold components. 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...
 
void mesh_triangulate_center_vertex (Mesh &M, index_t facets_begin=0, index_t facets_end=index_t(-1), MeshSplitCallbacks *cb=nullptr)
 Splits each n-sided facet of a surface into n triangles by inserting a vertex in the center. More...
 
void mesh_boolean_operation (Mesh &result, Mesh &A, Mesh &B, const std::string &operation, bool verbose=false)
 Computes a boolean operation with two surface meshes. More...
 
void mesh_union (Mesh &result, Mesh &A, Mesh &B, bool verbose=false)
 Computes the union of two surface meshes. More...
 
void mesh_intersection (Mesh &result, Mesh &A, Mesh &B, bool verbose=false)
 Computes the intersection of two surface meshes. More...
 
void mesh_difference (Mesh &result, Mesh &A, Mesh &B, bool verbose=false)
 Computes the difference of two surface meshes. More...
 
void mesh_remove_intersections (Mesh &M, index_t max_iter=3, bool verbose=false)
 Attempts to make a surface mesh conformal by removing intersecting facets and re-triangulating the holes. More...
 
bool mesh_facets_have_intersection (Mesh &M, index_t f1, index_t f2)
 Tests whether two mesh facets have a non-degenerate intersection. More...
 
bool mesh_tetrahedralize (Mesh &M, const MeshTetrahedralizeParameters &params)
 Fills a closed surface mesh with tetrahedra. More...
 
bool mesh_tetrahedralize (Mesh &M, bool preprocess=true, bool refine=false, double quality=2.0, bool keep_regions=false, double eps=0.001)
 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 is_in_T1 (TriangleRegion R)
 Tests whether a region belongs to triangle T1. More...
 
TriangleRegion swap_T1_T2 (TriangleRegion R)
 Replaces T1 with T2 or T2 with T1 in a region code. 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 with symbolic information. More...
 
bool triangles_intersections (const vec3 &p0, const vec3 &p1, const vec3 &p2, const vec3 &q0, const vec3 &q1, const vec3 &q2)
 Triangle-triangle intersection predicate. More...
 
std::string region_to_string (TriangleRegion rgn)
 Converts a triangle region code to a string. More...
 
coord_index_t region_dim (TriangleRegion r)
 Gets the dimension of a triangle region. More...
 
void get_triangle_vertices (TriangleRegion T, TriangleRegion &p0, TriangleRegion &p1, TriangleRegion &p2)
 Gets the vertices of a triangle. More...
 
void get_triangle_edges (TriangleRegion T, TriangleRegion &e0, TriangleRegion &e1, TriangleRegion &e2)
 Gets the edges of a triangle. More...
 
void get_edge_vertices (TriangleRegion E, TriangleRegion &q0, TriangleRegion &q1)
 Gets the vertices of an edge. More...
 
TriangleRegion regions_convex_hull (TriangleRegion R1, TriangleRegion R2)
 Computes the convex hull of two regions. 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<class VEC3 = vec3>
VEC3 make_vec3 (const vec3 &p1, const vec3 &p2)
 Creates a vector with coordinates of arbitrary type from two points with double coordinates. More...
 
template<class VEC2 >
VEC2 make_vec2 (const vec2 &p1, const vec2 &p2)
 Creates a vector with coordinates of arbitrary type from two points with double coordinates. More...
 
template<class VEC3 >
VEC3 triangle_normal (const vec3 &p1, const vec3 &p2, const vec3 &p3)
 Computes the normal to a triangle from its three vertices. More...
 
template<>
vec2E make_vec2< vec2E > (const vec2 &p1, const vec2 &p2)
 Specialization of make_vec2() for vec2E.
 
template<>
vec3E make_vec3< vec3E > (const vec3 &p1, const vec3 &p2)
 Specialization of make_vec3() for vec3E.
 
template<>
Sign geo_sgn (const expansion_nt &x)
 Specialization of geo_sgn() for expansion_nt. More...
 
template<>
Sign geo_cmp (const expansion_nt &x, const expansion_nt &y)
 Specialization of geo_cmp() 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...
 
intervalRU operator+ (const intervalRU &a, const intervalRU &b)
 
intervalRU operator- (const intervalRU &a, const intervalRU &b)
 
intervalRU operator* (const intervalRU &a, const intervalRU &b)
 
intervalRN operator+ (const intervalRN &a, const intervalRN &b)
 
intervalRN operator- (const intervalRN &a, const intervalRN &b)
 
intervalRN operator* (const intervalRN &a, const intervalRN &b)
 
template<>
vec2Hg< interval_ntoperator- (const vec2Hg< interval_nt > &p1, const vec2Hg< interval_nt > &p2)
 Specialization of 2d homogeneous-coord vector difference for interval_nt coordinates. More...
 
template<>
vec3Hg< interval_ntoperator- (const vec3Hg< interval_nt > &p1, const vec3Hg< interval_nt > &p2)
 Specialization of 3d homogeneous-coord vector difference for interval_nt coordinates. 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 grow_expansion_zeroelim (const expansion &e, double b, expansion &h)
 Adds a scalar to an expansion, eliminating zero components from the output expansion. More...
 
void scale_expansion_zeroelim (const expansion &e, double b, expansion &h)
 Multiplies an expansion by a scalar, eliminating zero components from the output expansion. More...
 
void fast_expansion_sum_zeroelim (const expansion &e, const expansion &f, expansion &h)
 Sums two expansions, eliminating zero components from the output expansion (sets h = e + f). More...
 
void fast_expansion_diff_zeroelim (const expansion &e, const expansion &f, expansion &h)
 Computes the difference of two expansions, eliminating zero components from the output expansion. 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_XATLAS, bool verbose=false)
 Generates u,v coordinates for a given mesh. More...
 
index_t mesh_get_charts (Mesh &mesh)
 Gets the charts attribute from a parameterized mesh. More...
 
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_only_normalize_charts (Mesh &mesh)
 Normalizes chart texture coordinates. More...
 
void pack_atlas_using_xatlas (Mesh &mesh)
 Packs an atlas using the xatlas library. More...
 
void pack_atlas_using_tetris_packer (Mesh &mesh)
 Packs an atlas using the tetris packer algorithm. More...
 
index_t mesh_segment (Mesh &mesh, MeshSegmenter segmenter, index_t nb_segments, bool verbose=false)
 Computes a segmentation of a mesh. 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 glupMapTexCoords1d (double minval, double maxval, index_t mult=1)
 Maps texture coordinates from a specified interval to the unit interval. More...
 
void glupMultMatrix (const mat4 &m)
 Multiplies the current GLUP matrix with another one. More...
 
void glupLoadMatrix (const mat4 &m)
 Replaces the current GLUP matrix with a user defined one. More...
 
GLint64 get_size_of_bound_buffer_object (GLenum target)
 Gets the size (in bytes) of the OpenGL buffer bound to a specified target. More...
 
void 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 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 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 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 clear_gl_error_flags (const char *file, int line)
 Clears all error flags set by previous OpenGL calls. More...
 
void draw_unit_textured_quad (bool BW=false)
 Draws a textured quad. More...
 
void glTexImage2Dxpm (char const *const *xpm_data)
 

Variables

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 168 of file color.h.

◆ CommandInvoker_var

Automatic reference-counted pointer to a CommandInvoker.

Used internally by Command.

Definition at line 91 of file command.h.

◆ CSGScope

typedef std::vector< CSGMesh_var > GEO::CSGScope

A list of CSGMesh.

The meshes are stored as smart pointers.

Definition at line 127 of file mesh_CSG.h.

◆ mat2

Represents a 2x2 matrix.

Syntax is (mostly) compatible with GLSL.

Definition at line 121 of file geometry.h.

◆ mat3

Represents a 3x3 matrix.

Syntax is (mostly) compatible with GLSL.

Definition at line 127 of file geometry.h.

◆ mat4

Represents a 4x4 matrix.

Syntax is (mostly) compatible with GLSL.

Definition at line 133 of file geometry.h.

◆ ProgressClient_var

Smart pointer that contains a ProgressClient object

Definition at line 116 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 343 of file numeric.h.

◆ Thread_var

Smart pointer that contains a Thread object

Definition at line 145 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 155 of file process.h.

◆ ThreadManager_var

Smart pointer that contains a ThreadManager object

Definition at line 290 of file process.h.

◆ vec2

Represents points and vectors in 2d.

Syntax is (mostly) compatible with GLSL.

Definition at line 59 of file geometry.h.

◆ vec2E

vec2 with coordinates as expansions

Coordinates support +,-,*

Definition at line 80 of file exact_geometry.h.

◆ vec2f

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

Syntax is (mostly) compatible with GLSL.

Definition at line 78 of file geometry.h.

◆ vec2HE

2D vector in homogeneous coordinates with coordinates as expansions

Coordinates support +,-,* and / by multiplying w.

Definition at line 108 of file exact_geometry.h.

◆ vec2HI

2D vector in homogeneous coordinates with coordinates as intervals.

Used to write arithmetic filters for geometric predicates.

Definition at line 124 of file exact_geometry.h.

◆ vec2i

Represents points and vectors in 2d with integer coordinates.

Syntax is (mostly) compatible with GLSL.

Definition at line 100 of file geometry.h.

◆ vec2I

vec2 with coordinates as interval_nt

Used to write arithmetic filters for geometric predicates.

Definition at line 93 of file exact_geometry.h.

◆ vec3

Represents points and vectors in 3d.

Syntax is (mostly) compatible with GLSL.

Definition at line 65 of file geometry.h.

◆ vec3E

vec3 with coordinates as expansions

Coordinates support +,-,*

Definition at line 86 of file exact_geometry.h.

◆ vec3f

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

Syntax is (mostly) compatible with GLSL.

Definition at line 85 of file geometry.h.

◆ vec3HE

3D vector in homogeneous coordinates with coordinates as expansions

Coordinates support +,-,* and / by multiplying w.

Definition at line 116 of file exact_geometry.h.

◆ vec3HI

3D vector in homogeneous coordinates with coordinates as intervals.

Used to write arithmetic filters for geometric predicates.

Definition at line 132 of file exact_geometry.h.

◆ vec3i

Represents points and vectors in 3d with integer coordinates.

Syntax is (mostly) compatible with GLSL.

Definition at line 107 of file geometry.h.

◆ vec3I

vec3 with coordinates as interval_nt

Used to write arithmetic filters for geometric predicates.

Definition at line 100 of file exact_geometry.h.

◆ vec4

Represents points and vectors in 4d.

Syntax is (mostly) compatible with GLSL.

Definition at line 71 of file geometry.h.

◆ vec4f

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

Syntax is (mostly) compatible with GLSL.

Definition at line 92 of file geometry.h.

◆ vec4i

Represents points and vectors in 4d with integer coordinates.

Syntax is (mostly) compatible with GLSL.

Definition at line 114 of file geometry.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Symbolic constants for GEO::initialize()

Enumerator
GEOGRAM_INSTALL_NONE 

Do not install error handlers.

GEOGRAM_INSTALL_HANDLERS 

Install Geogram's signal handlers.

GEOGRAM_INSTALL_LOCALE 

Sets the locale to POSIX.

GEOGRAM_INSTALL_ERRNO 

Reset errno to 0.

GEOGRAM_INSTALL_FPE 

Enable or disable FPE during initialization.

GEOGRAM_INSTALL_BIBLIO 

Enable global citation database.

GEOGRAM_INSTALL_ALL 

Install everything.

Definition at line 66 of file common.h.

◆ 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 58 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 66 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 63 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 61 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 2672 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 62 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 59 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 59 of file mesh_repair.h.

◆ MeshSegmenter

Enumerator
SEGMENT_GEOMETRIC_VSA_L2 

continuous version of variational shape approximation

SEGMENT_GEOMETRIC_VSA_L12 

anisotropic continous version of variational shape approximation

SEGMENT_SPECTRAL_8 

spectral segmentation with 8 manifold harmonics

SEGMENT_SPECTRAL_20 

spectral segmentation with 20 manifold harmonics

SEGMENT_SPECTRAL_100 

spectral segmentation with 100 manifold harmonics (uses some memory, use with caution !)

SEGMENT_INERTIA_AXIS 

create two segments along shortest inertia axis

Definition at line 54 of file mesh_segmentation.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 68 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.

  • RGN_P0, RGN_P1, RGN_P2 when point is exactly on a vertex
  • RGN_E0, RGN_E1, RGN_E2 when point is on an edge
  • RGN_T when point is on the interior of the triangle

Definition at line 64 of file triangle_intersection.h.

Function Documentation

◆ 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() [1/2]

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 720 of file geometry.h.

◆ bbox_union() [2/2]

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

Computes the smallest Box2d that encloses two Box2d.

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

Definition at line 782 of file geometry.h.

◆ bboxes_overlap() [1/2]

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 701 of file geometry.h.

◆ bboxes_overlap() [2/2]

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

Tests whether two Box2d 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 763 of file geometry.h.

◆ check_gl()

void 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 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()

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_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_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).

◆ 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 957 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 940 of file geometry.h.

◆ det()

double GEO::det ( const mat2 M)
inline

Computes the determinant of a 2x2 matrix.

Computes the determinant of a 4x4 matrix.

Computes the determinant of a 3x3 matrix.

Parameters
[in]Ma const reference to the matrix
Returns
the determinant

Definition at line 142 of file geometry.h.

◆ draw_unit_textured_quad()

void GEO::draw_unit_textured_quad ( bool  BW = false)

Draws a textured quad.

Parameters
[in]BWif set, copy the red channel to the output red, green blue channels (and set alpha to 1.0).

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 874 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 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_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 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_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 861 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 850 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 887 of file expansion_nt.h.

◆ fast_expansion_diff_zeroelim()

void GEO::fast_expansion_diff_zeroelim ( const expansion e,
const expansion f,
expansion h 
)

Computes the difference of two expansions, eliminating zero components from the output expansion.

Parameters
[in]efirst expansion
[in]fsecond expansion to be subtracted from e
[out]hthe result e - f

Sets h = (e - f). h cannot be e or f. This function is adapted from Jonathan Shewchuk's code. See the long version of his paper for details. If round-to-even is used (as with IEEE 754), maintains the strongly nonoverlapping property. (That is, if e is strongly nonoverlapping, h will be also.) Does NOT maintain the nonoverlapping or nonadjacent properties.

◆ fast_expansion_sum_zeroelim()

void GEO::fast_expansion_sum_zeroelim ( const expansion e,
const expansion f,
expansion h 
)

Sums two expansions, eliminating zero components from the output expansion (sets h = e + f).

Parameters
[in]ethe first expansion
[in]fthe second expansion
[out]hthe result e + f

h cannot be e or f. This function is adapted from Jonathan Shewchuk's code. See the long version of his paper for details. If round-to-even is used (as with IEEE 754), maintains the strongly nonoverlapping property. (That is, if e is strongly nonoverlapping, h will be also.) Does NOT maintain the nonoverlapping or nonadjacent properties.

◆ 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 60 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 314 of file numeric.h.

◆ geo_cmp() [1/3]

template<>
Sign GEO::geo_cmp ( const expansion_nt x,
const expansion_nt y 
)
inline

Specialization of geo_cmp() for expansion_nt.

Parameters
x,yconst references to two expansion_nt
Return values
POSITIVEif x > y
ZEROif x == y
NEGATIVEif x < y

Definition at line 835 of file expansion_nt.h.

◆ geo_cmp() [2/3]

template<class T >
Sign GEO::geo_cmp ( const rationalg< T > &  a,
const rationalg< T > &  b 
)
inline

Specialization of geo_cmp() for rationalg.

Parameters
a,bconst references to two rationalg
Return values
POSITIVEif a > b
ZEROif a == b
NEGATIVEif a < b

Definition at line 729 of file rationalg.h.

◆ geo_cmp() [3/3]

template<class T >
Sign GEO::geo_cmp ( const T &  a,
const T &  b 
)
inline

Compares two values.

Parameters
[in]a,bthe two values to compare
Template Parameters
Tthe type of the value
Return values
POSITIVEif a is greater than b
ZEROif a is equal to b
NEGATIVEif a is smaller than b
See also
Sign

Definition at line 106 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/3]

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 824 of file expansion_nt.h.

◆ geo_sgn() [2/3]

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

Specialization of geo_sgn() for rationalg.

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

Definition at line 718 of file rationalg.h.

◆ geo_sgn() [3/3]

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 90 of file numeric.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 301 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_edge_vertices()

void GEO::get_edge_vertices ( TriangleRegion  E,
TriangleRegion q0,
TriangleRegion q1 
)

Gets the vertices of an edge.

Parameters
[in]Ethe region code of an edge
[out]q0,q1the region codes of the two vertices of the edge

◆ get_size_of_bound_buffer_object()

GLint64 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.

◆ get_triangle_edges()

void GEO::get_triangle_edges ( TriangleRegion  T,
TriangleRegion e0,
TriangleRegion e1,
TriangleRegion e2 
)

Gets the edges of a triangle.

Parameters
[in]Tone of T1_RGN_T, T2_RGN_T
[out]e0,e1,e2the region codes of the three edges of the triangle

◆ get_triangle_vertices()

void GEO::get_triangle_vertices ( TriangleRegion  T,
TriangleRegion p0,
TriangleRegion p1,
TriangleRegion p2 
)

Gets the vertices of a triangle.

Parameters
[in]Tone of T1_RGN_T, T2_RGN_T
[out]p0,p1,p2the region codes of the three vertices of the triangle

◆ glue_edges()

void GEO::glue_edges ( Mesh M,
index_t  f1,
index_t  c1,
index_t  f2,
index_t  c2 
)

Glues two edges on the border of a surface mesh.

Parameters
[in]Ma reference to the mesh
[in]f1,c1the first edge, as a corner seen from a facet
[in]f2,c2the second edge, as a corner seen from a facet
Precondition
Both edges are on the border

◆ 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 169 of file GL.h.

◆ glupLoadMatrix()

void 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 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 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 186 of file GL.h.

◆ glupTranslate()

void GEO::glupTranslate ( const vec3 v)
inline

Applies a translation.

Parameters
[in]vthe translation vector.

Definition at line 210 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 144 of file GL.h.

◆ grow_expansion_zeroelim()

void GEO::grow_expansion_zeroelim ( const expansion e,
double  b,
expansion h 
)

Adds a scalar to an expansion, eliminating zero components from the output expansion.

Parameters
[in]efirst expansion
[in]bdouble to be added to e
[out]hthe result e + b

Sets h = (e + b). e and h can be the same. This function is adapted from Jonathan Shewchuk's code. See the long version of his paper for details. Maintains the nonoverlapping property. If round-to-even is used (as with IEEE 754), maintains the strongly nonoverlapping and nonadjacent properties as well. (That is, if e has one of these properties, so will 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,
const vec3 period 
)

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

◆ initialize()

void GEO::initialize ( int  flags = GEOGRAM_INSTALL_NONE)

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.
  • GEOGRAM_INSTALL_LOCALE to set the locale to POSIX.
  • GEOGRAM_INSTALL_ERRNO to clear the last system error.
  • GEOGRAM_INSTALL_FPE to enable/disable floating point exceptions.
  • GEOGRAM_INSTALL_BIBLIO to enable global citation database.

    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

◆ is_in_T1()

bool GEO::is_in_T1 ( TriangleRegion  R)
inline

Tests whether a region belongs to triangle T1.

Return values
trueif region belongs to T1
falseif region belongs to T2

Definition at line 93 of file triangle_intersection.h.

◆ 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 1291 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 1308 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 201 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 178 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 149 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 159 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) {
}
int lua_notify_last_error(lua_State *L)
Takes the last error message memorized in the registry and sends it back to LUA.
Definition: lua_wrap.h:225

Definition at line 225 of file lua_wrap.h.

◆ lua_push() [1/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 566 of file lua_wrap.h.

◆ lua_push() [2/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 484 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 1269 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 1277 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 128 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 141 of file lua_wrap.h.

◆ lua_wrap() [1/20]

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 1210 of file lua_wrap.h.

◆ lua_wrap() [2/20]

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 625 of file lua_wrap.h.

◆ lua_wrap() [3/20]

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 648 of file lua_wrap.h.

◆ lua_wrap() [4/20]

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 673 of file lua_wrap.h.

◆ lua_wrap() [5/20]

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 701 of file lua_wrap.h.

◆ lua_wrap() [6/20]

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 609 of file lua_wrap.h.

◆ lua_wrap() [7/20]

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 743 of file lua_wrap.h.

◆ lua_wrap() [8/20]

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 762 of file lua_wrap.h.

◆ lua_wrap() [9/20]

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 786 of file lua_wrap.h.

◆ lua_wrap() [10/20]

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 810 of file lua_wrap.h.

◆ lua_wrap() [11/20]

template<class T1 , class T2 , class T3 , class T4 , class T5 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1, T2, T3, T4, T5)  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 838 of file lua_wrap.h.

◆ lua_wrap() [12/20]

template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1, T2, T3, T4, T5, T6)  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 870 of file lua_wrap.h.

◆ lua_wrap() [13/20]

template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1, T2, T3, T4, T5, T6, T7)  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 905 of file lua_wrap.h.

◆ lua_wrap() [14/20]

template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1, T2, T3, T4, T5, T6, T7, T8)  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 943 of file lua_wrap.h.

◆ lua_wrap() [15/20]

template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1, T2, T3, T4, T5, T6, T7, T8, T9)  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 983 of file lua_wrap.h.

◆ lua_wrap() [16/20]

template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)  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 1025 of file lua_wrap.h.

◆ lua_wrap() [17/20]

template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)  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 1070 of file lua_wrap.h.

◆ lua_wrap() [18/20]

template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)  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 1116 of file lua_wrap.h.

◆ lua_wrap() [19/20]

template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 >
int GEO::lua_wrap ( lua_State *  L,
void(*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)  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 1165 of file lua_wrap.h.

◆ lua_wrap() [20/20]

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 729 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 1324 of file lua_wrap.h.

◆ make_vec2()

template<class VEC2 >
VEC2 GEO::make_vec2 ( const vec2 p1,
const vec2 p2 
)
inline

Creates a vector with coordinates of arbitrary type from two points with double coordinates.

Parameters
[in]p1,p2the two vectors
Returns
The vector p2 - p1
Template Parameters
VEC2the type of the returned vector

Definition at line 161 of file exact_geometry.h.

◆ make_vec3()

template<class VEC3 = vec3>
VEC3 GEO::make_vec3 ( const vec3 p1,
const vec3 p2 
)
inline

Creates a vector with coordinates of arbitrary type from two points with double coordinates.

Parameters
[in]p1,p2the two vectors
Returns
The vector p2 - p1
Template Parameters
VEC3the type of the returned vector

Definition at line 144 of file exact_geometry.h.

◆ mesh_adjust_surface()

void GEO::mesh_adjust_surface ( Mesh surface,
Mesh reference,
double  max_edge_distance = 0.5,
bool  project_borders = false 
)

Adjusts a surface mesh in such a way that minimizes its distance to a reference surface mesh.

Parameters
[in,out]surfacethe surface mesh to be adjusted
[in]referencethe reference surface mesh
[in]max_edge_distancedistance along which searching for nearest vertex, relative to average edge length in the neighborhood of the considered vertex
[in]project_bordersif set, in a final post-processing, project the vertices on the border of the surface onto the borders of the reference surface. Whereas it improves a bit the borders, it results in a worse approximation on the facets adjacent to the border, hence it is off by default

Internally it uses an AABB, hence the order of the facets of reference can be changed.

◆ mesh_boolean_operation()

void GEO::mesh_boolean_operation ( Mesh result,
Mesh A,
Mesh B,
const std::string &  operation,
bool  verbose = false 
)

Computes a boolean operation with two surface meshes.

A and B need to be two closed surface mesh without intersections.

Parameters
[in]A,Bthe two operands.
[out]resultthe computed mesh.
[in]operationone of "A+B", "A*B", "A-B", "B-A"
[in]verboseif set, display additional information during computation

◆ 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_colocate_vertices_no_check()

void GEO::mesh_colocate_vertices_no_check ( Mesh M,
double  colocate_epsilon = 0.0,
bool  verbose = false 
)

Merges the vertices of a mesh that are at the same geometric location.

Does not check for manifoldness, and does not recompute facet connects (one needs to call mesh.facets.connect()).

Parameters
[in]Mthe mesh
[in]colocate_epsilontolerance for merging vertices

◆ 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_connect_and_reorient_facets_no_check()

void GEO::mesh_connect_and_reorient_facets_no_check ( Mesh M)

Connects the facets and consistently orient manifold components.

This may leave some non-manifold edges, with more than two facets indicent to them.

◆ 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);
geo_index_t index_t
The type for storing and manipulating indices.
Definition: numeric.h:329
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.
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_difference()

void GEO::mesh_difference ( Mesh result,
Mesh A,
Mesh B,
bool  verbose = false 
)

Computes the difference of two surface meshes.

A and B need to be two closed surface mesh without intersections.

Parameters
[in]A,Bthe two operands.
[out]resultthe computed mesh.
[in]verboseif set, display additional information during computation

◆ 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 69 of file mesh_sampling.h.

◆ mesh_facets_have_intersection()

bool GEO::mesh_facets_have_intersection ( Mesh M,
index_t  f1,
index_t  f2 
)

Tests whether two mesh facets have a non-degenerate intersection.

If the facets are polygonal, they are triangulated from the first vertex, and intersections between each pair of triangles is tested.

Return values
trueif the two facets have an intersection. If they share a vertex, it does not count as an intersection.
falseotherwise.

◆ 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 287 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 120 of file mesh_sampling.h.

◆ mesh_get_charts()

index_t GEO::mesh_get_charts ( Mesh mesh)

Gets the charts attribute from a parameterized mesh.

The charts are stored in a facet attribute named "chart" of type index_t

Parameters
[in,out]mesha parameterized mesh
Returns
the number of charts

◆ mesh_intersection()

void GEO::mesh_intersection ( Mesh result,
Mesh A,
Mesh B,
bool  verbose = false 
)

Computes the intersection of two surface meshes.

A and B need to be two closed surface mesh without intersections.

Parameters
[in]A,Bthe two operands.
[out]resultthe computed mesh.
[in]verboseif set, display additional information during computation

◆ 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 to be loaded with optional path
[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_make_atlas()

void GEO::mesh_make_atlas ( Mesh mesh,
double  hard_angles_threshold = 45.0,
ChartParameterizer  param = PARAM_ABF,
ChartPacker  pack = PACK_XATLAS,
bool  verbose = false 
)

Generates u,v coordinates for a given mesh.

The generated u,v coordinates are stored in an attribute attached to the facet corners. The mesh is first decomposed into a set of charts, then each chart is flatenned using param. After parameterization, if distortion is too high, the chart is further decomposed into smaller charts. Finally, all the charts are packed in texture space using pack. If the mesh has a facet attribute named "chart", then it is used to initialize the segmentation.

Parameters
[in,out]meshthe mesh to be parameterized. For now, only triangulated meshes are supported.
[in]hard_angle_thresholdedges for which the dihedral angle is larger than this threshold are considered as chart boundaries (in degrees)
[in]paramone of:
  • PARAM_PROJECTION: projection on least-squares fitted plane
  • PARAM_LSCM: Least Squares Conformal Maps with two fixed points
  • PARAM_SPECTRAL_LSCM: spectral Least Squares Conformal Maps (less distorted than PARAM_LSCM)
  • PARAM_ABF: Angle-Based Flattening++ (best quality)
[in]packone of:
  • PACK_NONE: no texture packing
  • PACK_TETRIS: using built-in "Tetris" packing, as in the original LSCM article
  • PACK_XATLAS: use the XAtlas library to do the packing

◆ 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,
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_partition() [2/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_postprocess_RDT()

void GEO::mesh_postprocess_RDT ( Mesh M,
bool  verbose = false 
)

Post-processes a Restricted Delaunay Triangulation.

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

◆ mesh_remove_bad_facets_no_check()

void GEO::mesh_remove_bad_facets_no_check ( Mesh M,
bool  check_duplicates = true 
)

Removes the degenerate and the duplicated facets in a surface mesh.

Does not recompute facet connections ( one needs to call mesh.facets.connect()).

Parameters
[in]Mthe mesh
[in]check_duplicatesif set, removes the duplicated facets (facets that have the same vertices, regardless the orientation).

◆ mesh_remove_intersections()

void GEO::mesh_remove_intersections ( Mesh M,
index_t  max_iter = 3,
bool  verbose = false 
)

Attempts to make a surface mesh conformal by removing intersecting facets and re-triangulating the holes.

Parameters
[in]verboseif set, display additional information during computation

◆ 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_segment()

index_t GEO::mesh_segment ( Mesh mesh,
MeshSegmenter  segmenter,
index_t  nb_segments,
bool  verbose = false 
)

Computes a segmentation of a mesh.

The segmentation is stored in the "chart" facet attribute.

Parameters
[in,out]meshthe mesh to be segmented. For now, only triangulated meshes are supported.
[in]segmenterone of SEGMENT_GEOMETRIC_VSA_L2, SEGMENT_GEOMETRIC_VSA_L12, SEGMENT_SPECTRAL_8, SEGMENT_SPECTRAL_20, SEGMENT_SPECTRAL_100
[in]nb_segmentsdesired number of segment
Returns
number of charts

◆ 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 212 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 245 of file mesh_sampling.h.

◆ mesh_tetrahedralize() [1/2]

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

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.
[in]epsthreshold for merging verties if preprocess is set, in percentage of bounding box diagonal. Use 0 to merge strictly colocated vertices
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).

Definition at line 142 of file mesh_tetrahedralize.h.

◆ mesh_tetrahedralize() [2/2]

bool GEO::mesh_tetrahedralize ( Mesh M,
const MeshTetrahedralizeParameters params 
)

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 the input surface mesh. On exit, the (optionally pre-processed) same surface mesh filled with tetrahedra
[in]paramsa reference to a MeshTetrahedralizeParameters
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_triangulate_center_vertex()

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

Splits each n-sided facet of a surface into n triangles by inserting a vertex in the center.

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_union()

void GEO::mesh_union ( Mesh result,
Mesh A,
Mesh B,
bool  verbose = false 
)

Computes the union of two surface meshes.

A and B need to be two closed surface mesh without intersections.

Parameters
[in]A,Bthe two operands.
[out]resultthe computed mesh.
[in]verboseif set, display additional information during computation

◆ 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 558 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 84 of file lua_wrap.h.

◆ my_lua_islightuserdata()

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

Tests whether a LUA variable is a light user data.

lua_isuserdata() 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 light user data.
0otherwise.

Definition at line 99 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 112 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]

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 536 of file matrix.h.

◆ operator*() [2/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 274 of file quaternion.h.

◆ operator*() [3/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 287 of file quaternion.h.

◆ operator*() [4/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 298 of file quaternion.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 239 of file quaternion.h.

◆ operator-() [1/4]

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 264 of file quaternion.h.

◆ operator-() [2/4]

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 252 of file quaternion.h.

◆ operator-() [3/4]

template<>
vec2Hg<interval_nt> GEO::operator- ( const vec2Hg< interval_nt > &  p1,
const vec2Hg< interval_nt > &  p2 
)
inline

Specialization of 2d homogeneous-coord vector difference for interval_nt coordinates.

We cannot check for p1.w and p2.w equality (since they might be in the same interval without being equal), so we always reduce to the same denominator.

Definition at line 730 of file interval_nt.h.

◆ operator-() [4/4]

template<>
vec3Hg<interval_nt> GEO::operator- ( const vec3Hg< interval_nt > &  p1,
const vec3Hg< interval_nt > &  p2 
)
inline

Specialization of 3d homogeneous-coord vector difference for interval_nt coordinates.

We cannot check for p1.w and p2.w equality (since they might be in the same interval without being equal), so we always reduce to the same denominator.

Definition at line 748 of file interval_nt.h.

◆ operator<<() [1/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 305 of file mesh_halfedges.h.

◆ operator<<() [2/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 213 of file quaternion.h.

◆ operator<<() [3/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 231 of file triangle_intersection.h.

◆ operator<<() [4/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 248 of file triangle_intersection.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 225 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_only_normalize_charts()

void GEO::pack_atlas_only_normalize_charts ( Mesh mesh)

Normalizes chart texture coordinates.

Ensure that each chart has a texture area proportional to its 3D area.

◆ pack_atlas_using_tetris_packer()

void GEO::pack_atlas_using_tetris_packer ( Mesh mesh)

Packs an atlas using the tetris packer algorithm.

The mesh needs to have a parameterization stored in the tex_coord facet_corner attribute. The method is decribed in the following referene:

  • least squares mode: Least Squares Conformal Maps, Levy, Petitjean, Ray, Maillot, ACM SIGGRAPH, 2002
    Parameters
    [in,out]mesha reference to the mesh

◆ 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(from, to, func) 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).

◆ random_shuffle()

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

Applies a random permutation to a sequence.

A drop-in replacement of std::random_shuffle(), that is deprecated since c++17

Parameters
[in]begin,endfirst position and one item past last position of the sequence to be randomly permuted

Definition at line 208 of file algorithm.h.

◆ 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 102 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 204 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 158 of file geofile.h.

◆ region_dim()

coord_index_t GEO::region_dim ( TriangleRegion  r)

Gets the dimension of a triangle region.

Parameters
[in]ra triangle region
Return values
0for vertices
1for edges
2for the interior

◆ 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.

◆ regions_convex_hull()

TriangleRegion GEO::regions_convex_hull ( TriangleRegion  R1,
TriangleRegion  R2 
)

Computes the convex hull of two regions.

The function is purely combinatorial.

  • The convex hull of twice the same region is that region
  • the convex hull of an edge and a vertex this edge is incident to is that edge
  • the convex hull of two vertices is the edge incident to the vertices
  • in all other cases, the convex hull is the triangle
    Precondition
    R1 and R2 are in the same triangle (they both start with T1_ or they both start with T2_).
    Parameters
    [in]R1,R2the two regions
    Returns
    The convex hull of R1 and R2

◆ 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,
bool  adjust = true,
double  adjust_max_edge_distance = 0.5 
)

Remeshes a 'smooth' shape (that is, 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
[in]adjustif set, call mesh_adjust_surface() to improve the placement of the points in such a way that the facets of M_out better approximate M_in
[in]adjust_max_edge_distancedistance along which searching for nearest vertex, relative to average edge length in the neighborhood of the considered vertex

Example 1 - isotropic remesh:

remesh_smooth(M_in, M_out, 30000, 3) ;
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, bool adjust=true, double adjust_max_edge_distance=0.5)
Remeshes a 'smooth' shape (that is, without management of sharp features).

Example 2 - anisotropic remesh:

set_anisotropy(M_in, 0.04) ;
remesh_smooth(M_in, M_out, 30000, 6) ;
void set_anisotropy(Mesh &M, double s)
Normalizes and scales the stored vertex normals by a factor.

◆ 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) ;
    index_t remove_degree3_vertices(Mesh &M, double max_dist)
    Removes degree 3 vertices.

◆ 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

◆ round()

double GEO::round ( double  x)
inline

\TODOC

Definition at line 368 of file numeric.h.

◆ scale_expansion_zeroelim()

void GEO::scale_expansion_zeroelim ( const expansion e,
double  b,
expansion h 
)

Multiplies an expansion by a scalar, eliminating zero components from the output expansion.

Parameters
[in]ean expansion
[in]bthe double to be multiplied by e
[out]hthe result b * e

(sets h = b * e). e and h cannot be the same. This function is adapted from Jonathan Shewchuk's code. See either version of his paper for details. Maintains the nonoverlapping property. If round-to-even is used (as with IEEE 754), maintains the strongly nonoverlapping and nonadjacent properties as well. (That is, if e has one of these properties, so will h.)

◆ 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

◆ sign_of_expansion_determinant() [1/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.

◆ 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 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.

◆ 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 90 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 126 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 163 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 181 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 147 of file algorithm.h.

◆ stream_buffer_object()

void 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

◆ swap_T1_T2()

TriangleRegion GEO::swap_T1_T2 ( TriangleRegion  R)

Replaces T1 with T2 or T2 with T1 in a region code.

Parameters
[in]Ra region
Returns
the region in T2 corresponding to a region in T1, or the region in T1 corresponding to a region in T2.

◆ 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() [1/2]

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

Applies a 3d transform to a 3d point.

Convention is the same as in math, i.e. vector is a column vector, multiplied on the right 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 880 of file geometry.h.

◆ transform_point() [2/2]

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 840 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 804 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 914 of file geometry.h.

◆ triangle_normal()

template<class VEC3 >
VEC3 GEO::triangle_normal ( const vec3 p1,
const vec3 p2,
const vec3 p3 
)
inline

Computes the normal to a triangle from its three vertices.

Parameters
[in]p1,p2,p3the three vertices of the triangle
Returns
the normal to the triangle with coordinates of arbitrary type
Template Parameters
VEC3the type of the returned vector

Definition at line 180 of file exact_geometry.h.

◆ triangles_intersections() [1/2]

bool GEO::triangles_intersections ( const vec3 p0,
const vec3 p1,
const vec3 p2,
const vec3 q0,
const vec3 q1,
const vec3 q2 
)

Triangle-triangle intersection predicate.

Parameters
[in]p0,p1,p2first triangle
[in]q0,q1,q2second triangle
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.

◆ triangles_intersections() [2/2]

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 with symbolic information.

The input triangles are supposed to be non-degenerate (their three vertices are supposed to be distinct and not co-linear). For now, when intersection is surfacic (overlapping pair of co-planar triangles), the vertices of the intersection are not sorted. One can order them by computing their convex hull.

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.

◆ unglue_edges()

void GEO::unglue_edges ( Mesh M,
index_t  f1,
index_t  c1 
)

Unglues an edge from its opposite edge.

Parameters
[in]Ma reference to the mesh
[in]f1,c1the edge, as a corner seen from a facet
Precondition
The edge (f,c) is not on the border

◆ unset_anisotropy()

void GEO::unset_anisotropy ( Mesh M)

Normalizes the stored vertex normals.

Parameters
[in,out]Mthe mesh

◆ update_buffer_object()

void 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 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.

◆ 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 131 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 228 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 182 of file geofile.h.