Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
vhacdICHull.h
Go to the documentation of this file.
1/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com)
2 All rights reserved.
3
4
5 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
6 following conditions are met:
7
8 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
9 disclaimer.
10
11 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
12 disclaimer in the documentation and/or other materials provided with the distribution.
13
14 3. The names of the contributors may not be used to endorse or promote products derived from this software without
15 specific prior written permission.
16
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25#pragma once
26
29
30namespace tesseract_collision
31{
32namespace VHACD
33{
36{
42};
43class ICHull
44{
45public:
46 static const double sc_eps;
48 bool IsFlat() { return m_isFlat; }
50 TMMesh& GetMesh() { return m_mesh; }
52 bool AddPoint(const Vec3<double>& point) { return AddPoints(&point, 1); }
54 bool AddPoint(const Vec3<double>& point, int32_t id);
56 bool AddPoints(const Vec3<double>* points, size_t nPoints);
60 ICHullError Process(const uint32_t nPointsCH, const double minVolume = 0.0);
62 bool IsInside(const Vec3<double>& pt0, const double eps = 0.0);
64 const ICHull& operator=(ICHull& rhs);
65
67 ICHull();
69 ~ICHull(void){};
70
71private:
85 bool ProcessPoint();
87 bool ComputePointVolume(double& totalVolume, bool markVisibleFaces);
89 bool FindMaxVolumePoint(const double minVolume = 0.0);
91 bool CleanEdges();
93 bool CleanVertices(uint32_t& addedPoints);
95 bool CleanTriangles();
97 bool CleanUp(uint32_t& addedPoints);
100 void Clear();
101
102private:
103 static const int32_t sc_dummyIndex;
110 ICHull(const ICHull& rhs);
111};
112} // namespace VHACD
113} // namespace tesseract_collision
CircularListElement class.
Definition: vhacdCircularList.h:36
Definition: vhacdICHull.h:44
CircularListElement< TMMTriangle > * MakeFace(CircularListElement< TMMVertex > *v0, CircularListElement< TMMVertex > *v1, CircularListElement< TMMVertex > *v2, CircularListElement< TMMTriangle > *fold)
MakeFace creates a new face structure from three vertices (in ccw order). It returns a pointer to the...
Definition: vhacdICHull.cpp:467
TMMesh & GetMesh()
Returns the computed mesh.
Definition: vhacdICHull.h:50
bool CleanVertices(uint32_t &addedPoints)
Definition: vhacdICHull.cpp:726
TMMesh m_mesh
Definition: vhacdICHull.h:104
ICHull()
Constructor.
Definition: vhacdICHull.cpp:38
bool AddPoint(const Vec3< double > &point)
Add one point to the convex-hull.
Definition: vhacdICHull.h:52
bool ComputePointVolume(double &totalVolume, bool markVisibleFaces)
Definition: vhacdICHull.cpp:541
~ICHull(void)
Destructor.
Definition: vhacdICHull.h:69
static const double sc_eps
Definition: vhacdICHull.h:46
bool m_isFlat
Definition: vhacdICHull.h:109
bool CleanUp(uint32_t &addedPoints)
Definition: vhacdICHull.cpp:676
bool MakeCCW(CircularListElement< TMMTriangle > *f, CircularListElement< TMMEdge > *e, CircularListElement< TMMVertex > *v)
Definition: vhacdICHull.cpp:637
bool CleanTriangles()
Definition: vhacdICHull.cpp:715
bool IsFlat()
Definition: vhacdICHull.h:48
ICHullError Process()
Definition: vhacdICHull.cpp:66
Vec3< double > m_normal
Definition: vhacdICHull.h:108
bool AddPoints(const Vec3< double > *points, size_t nPoints)
Add points to the convex-hull.
Definition: vhacdICHull.cpp:39
void Clear()
Definition: vhacdICHull.cpp:761
bool ProcessPoint()
Definition: vhacdICHull.cpp:597
bool IsInside(const Vec3< double > &pt0, const double eps=0.0)
Definition: vhacdICHull.cpp:781
SArray< CircularListElement< TMMEdge > * > m_edgesToDelete
Definition: vhacdICHull.h:105
static const int32_t sc_dummyIndex
Definition: vhacdICHull.h:103
SArray< CircularListElement< TMMEdge > * > m_edgesToUpdate
Definition: vhacdICHull.h:106
const ICHull & operator=(ICHull &rhs)
Definition: vhacdICHull.cpp:769
CircularListElement< TMMTriangle > * MakeConeFace(CircularListElement< TMMEdge > *e, CircularListElement< TMMVertex > *v)
Definition: vhacdICHull.cpp:507
SArray< CircularListElement< TMMTriangle > * > m_trianglesToDelete
Definition: vhacdICHull.h:107
bool FindMaxVolumePoint(const double minVolume=0.0)
Definition: vhacdICHull.cpp:362
bool CleanEdges()
Definition: vhacdICHull.cpp:683
ICHullError DoubleTriangle()
Definition: vhacdICHull.cpp:399
SArray.
Definition: vhacdSArray.h:42
triangular manifold mesh data structure.
Definition: vhacdManifoldMesh.h:117
Vector dim 3.
Definition: vhacdVector.h:37
ICHullError
Incremental Convex Hull algorithm (cf. http://cs.smith.edu/~orourke/books/ftp.html ).
Definition: vhacdICHull.h:36
@ ICHullErrorCoplanarPoints
Definition: vhacdICHull.h:38
@ ICHullErrorOK
Definition: vhacdICHull.h:37
@ ICHullErrorNoVolume
Definition: vhacdICHull.h:39
@ ICHullErrorNotEnoughPoints
Definition: vhacdICHull.h:41
@ ICHullErrorInconsistent
Definition: vhacdICHull.h:40
Definition: bullet_cast_bvh_manager.h:49
std::vector< std::string > v2
Definition: tesseract_common_unit.cpp:418
v1["1"]
Definition: tesseract_common_unit.cpp:434
v
Definition: tesseract_common_unit.cpp:369