Manifold 1.0
Robust computational geometry
 
Loading...
Searching...
No Matches
manifold Namespace Reference

Classes

struct  Barycentric
 
class  Boolean3
 
struct  Box
 
class  Collider
 
class  ConcurrentSharedPtr
 
class  CrossSection
 
class  CsgLeafNode
 
class  CsgNode
 
class  CsgOpNode
 
struct  ExecutionParams
 
struct  ExportOptions
 
struct  geometryErr
 
struct  Halfedge
 
struct  Halfedge2Tmp
 
class  HashTable
 
class  HashTableD
 
class  Manifold
 
struct  Material
 
struct  Mesh
 
struct  MeshGL
 
struct  PathImpl
 
struct  PolyVert
 
struct  Properties
 
class  Quality
 
struct  Rect
 
struct  ReindexEdge
 
struct  Smoothness
 
class  SparseIndices
 
class  strided_range
 
struct  SVDSet
 
struct  Timer
 
struct  TmpEdge
 
struct  TmpInvalid
 
struct  topologyErr
 
struct  TriRef
 
struct  UnionFind
 
struct  userErr
 
class  Vec
 
class  VecView
 

Typedefs

using GeneralTriangulation = std::function< std::vector< glm::ivec3 >(int)>
 
using AddTriangle = std::function< void(int, glm::ivec3, glm::vec3, TriRef)>
 
using SimplePolygonIdx = std::vector< PolyVert >
 
using PolygonsIdx = std::vector< SimplePolygonIdx >
 
using SimplePolygon = std::vector< glm::vec2 >
 
using Polygons = std::vector< SimplePolygon >
 
using logicErr = std::logic_error
 

Enumerations

enum class  CsgNodeType { Union , Intersection , Difference , Leaf }
 
enum class  ExecutionPolicy { Par , Seq }
 
enum class  OpType { Add , Subtract , Intersect }
 

Functions

Mesh ImportMesh (const std::string &filename, bool forceCleanup=false)
 
void ExportMesh (const std::string &filename, const Mesh &mesh, const ExportOptions &options)
 
void ExportMesh (const std::string &filename, const MeshGL &mesh, const ExportOptions &options)
 
Manifold TorusKnot (int p, int q, float majorRadius, float minorRadius, float threadRadius, int circularSegments=0, int linearSegments=0)
 
Manifold StretchyBracelet (float radius=30.0f, float height=8.0f, float width=15.0f, float thickness=0.4f, int nDecor=20, int nCut=27, int nDivision=30)
 
Manifold MengerSponge (int n=3)
 
Manifold RoundedFrame (float edgeLength, float radius, int circularSegments=0)
 
Manifold TetPuzzle (float edgeLength, float gap, int nDivisions)
 
Manifold Scallop ()
 
Manifold GyroidModule (float size=20, int n=20)
 
Manifold CondensedMatter (int fn=16)
 
template SparseIndices Collider::Collisions< false, false, glm::vec3 > (const VecView< const glm::vec3 > &) const
 
template SparseIndices Collider::Collisions< false, true, glm::vec3 > (const VecView< const glm::vec3 > &) const
 
ExecutionParamsManifoldParams ()
 
glm::vec3 SafeNormalize (glm::vec3 v)
 
float MaxPrecision (float minPrecision, const Box &bBox)
 
int NextHalfedge (int current)
 
glm::mat3 NormalTransform (const glm::mat4x3 &transform)
 
glm::mat3x2 GetAxisAlignedProjection (glm::vec3 normal)
 
glm::vec3 GetBarycentric (const glm::vec3 &v, const glm::mat3 &triPos, float precision)
 
Vec< TmpEdgeCreateTmpEdges (const Vec< Halfedge > &halfedge)
 
std::ostream & operator<< (std::ostream &stream, const Halfedge &edge)
 
std::ostream & operator<< (std::ostream &stream, const Barycentric &bary)
 
std::ostream & operator<< (std::ostream &stream, const TriRef &ref)
 
std::vector< glm::ivec3 > TriangulateIdx (const PolygonsIdx &polys, float precision)
 Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap, but will always return a manifold result that matches the input edge directions.
 
Mesh LevelSet (std::function< float(glm::vec3)> sdf, Box bounds, float edgeLength, float level=0, bool canParallel=true)
 
constexpr ExecutionPolicy autoPolicy (size_t size)
 
template<typename... Args>
void exclusive_scan (ExecutionPolicy policy, Args... args)
 
template<typename DerivedPolicy , typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename Predicate >
OutputIterator copy_if (ExecutionPolicy policy, InputIterator1 first, InputIterator1 last, InputIterator2 stencil, OutputIterator result, Predicate pred)
 
template<typename DerivedPolicy , typename InputIterator1 , typename OutputIterator , typename Predicate >
OutputIterator copy_if (ExecutionPolicy policy, InputIterator1 first, InputIterator1 last, OutputIterator result, Predicate pred)
 
float sind (float x)
 
float cosd (float x)
 
glm::mat4x3 RotateUp (glm::vec3 up)
 
int CCW (glm::vec2 p0, glm::vec2 p1, glm::vec2 p2, float tol)
 
template<typename T >
std::ostream & operator<< (std::ostream &stream, const glm::tvec2< T > &v)
 
template<typename T >
std::ostream & operator<< (std::ostream &stream, const glm::tvec3< T > &v)
 
template<typename T >
std::ostream & operator<< (std::ostream &stream, const glm::tvec4< T > &v)
 
std::ostream & operator<< (std::ostream &stream, const glm::mat3 &mat)
 
std::ostream & operator<< (std::ostream &stream, const glm::mat4x3 &mat)
 
std::ostream & operator<< (std::ostream &stream, const Box &box)
 
std::ostream & operator<< (std::ostream &stream, const Rect &box)
 
template<typename T >
void Dump (const std::vector< T > &vec)
 
template<typename T >
void Diff (const std::vector< T > &a, const std::vector< T > &b)
 
SVDSet SVD (glm::mat3 A)
 
float SpectralNorm (glm::mat3 A)
 
void EdgeEdgeDist (glm::vec3 &x, glm::vec3 &y, const glm::vec3 &p, const glm::vec3 &a, const glm::vec3 &q, const glm::vec3 &b)
 
float DistanceTriangleTriangleSquared (const std::array< glm::vec3, 3 > &p, const std::array< glm::vec3, 3 > &q)
 
template<typename... Iters>
thrust::zip_iterator< thrust::tuple< Iters... > > zip (Iters... iters)
 
template<typename A , typename B >
thrust::permutation_iterator< A, Bperm (A a, B b)
 
template<typename T >
thrust::counting_iterator< TcountAt (T i)
 
int Next3 (int i)
 
int Prev3 (int i)
 
template<typename T >
T AtomicAdd (T &target, T add)
 
template<>
int AtomicAdd (int &target, int add)
 

Variables

constexpr float kTolerance = 1e-5
 
std::vector< glm::ivec3 > Triangulate (const Polygons &polygons, float precision)
 Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap, but will always return a manifold result that matches the input edge directions.
 
ExecutionParamsPolygonParams ()
 

Detailed Description

The notation in these files is abbreviated due to the complexity of the functions involved. The key is that the input manifolds are P and Q, while the output is R, and these letters in both upper and lower case refer to these objects. Operations are based on dimensionality: vert: 0, edge: 1, face: 2, solid: 3. X denotes a winding-number type quantity from the source paper of this algorithm, while S is closely related but includes only the subset of X values which "shadow" (are on the correct side of).

Nearly everything here are sparse arrays, where for instance each pair in p2q1 refers to a face index of P interacting with a halfedge index of Q. Adjacent arrays like x21 refer to the values of X corresponding to each sparse index pair.

Note many functions are designed to work symmetrically, for instance for both p2q1 and p1q2. Inside of these functions P and Q are marked as though the function is forwards, but it may include a Boolean "reverse" that indicates P and Q have been swapped.

Function Documentation

◆ EdgeEdgeDist()

void EdgeEdgeDist ( glm::vec3 &  x,
glm::vec3 &  y,
const glm::vec3 &  p,
const glm::vec3 &  a,
const glm::vec3 &  q,
const glm::vec3 &  b 
)
inline

Returns the distance between two line segments.

Parameters
[out]xClosest point on line segment pa.
[out]yClosest point on line segment qb.
[in]pOne endpoint of the first line segment.
[in]aOther endpoint of the first line segment.
[in]pOne endpoint of the second line segment.
[in]bOther endpoint of the second line segment.

◆ DistanceTriangleTriangleSquared()

float DistanceTriangleTriangleSquared ( const std::array< glm::vec3, 3 > &  p,
const std::array< glm::vec3, 3 > &  q 
)
inline

Returns the minimum squared distance between two triangles.

Parameters
pFirst triangle.
qSecond triangle.