Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC > Class Template Reference
+ Collaboration diagram for igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >:

Public Member Functions

IGL_INLINE MeshCutterMini (const Eigen::PlainObjectBase< DerivedV > &_V, const Eigen::PlainObjectBase< DerivedF > &_F, const Eigen::PlainObjectBase< DerivedTT > &_TT, const Eigen::PlainObjectBase< DerivedTT > &_TTi, const std::vector< std::vector< VFType > > &_VF, const std::vector< std::vector< VFType > > &_VFi, const std::vector< bool > &_V_border, const Eigen::PlainObjectBase< DerivedC > &_Handle_Seams)
 
IGL_INLINE void InitMappingSeam ()
 vertex to variable mapping initialize the mapping for a given sampled mesh
 

Public Attributes

const Eigen::PlainObjectBase< DerivedV > & V
 
const Eigen::PlainObjectBase< DerivedF > & F
 
const Eigen::PlainObjectBase< DerivedTT > & TT
 
const Eigen::PlainObjectBase< DerivedTT > & TTi
 
const std::vector< std::vector< VFType > > & VF
 
const std::vector< std::vector< VFType > > & VFi
 
const std::vector< bool > & V_border
 
const Eigen::PlainObjectBase< DerivedC > & Handle_Seams
 
int num_scalar_variables
 
DerivedF HandleS_Index
 
std::vector< std::vector< int > > HandleV_Integer
 

Private Member Functions

IGL_INLINE void FirstPos (const int v, int &f, int &edge)
 
IGL_INLINE int AddNewIndex (const int v0)
 
IGL_INLINE bool IsSeam (const int f0, const int f1)
 
IGL_INLINE void FindInitialPos (const int vert, int &edge, int &face)
 find initial position of the pos to
 
IGL_INLINE void MapIndexes (const int vert, const int edge_init, const int f_init)
 initialize the mapping given an initial pos whih must be initialized with FindInitialPos
 
IGL_INLINE void InitMappingSeam (const int vert)
 initialize the mapping for a given vertex
 

Detailed Description

template<typename DerivedV, typename DerivedF, typename VFType, typename DerivedTT, typename DerivedC>
class igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >

Constructor & Destructor Documentation

◆ MeshCutterMini()

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
IGL_INLINE igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::MeshCutterMini ( const Eigen::PlainObjectBase< DerivedV > &  _V,
const Eigen::PlainObjectBase< DerivedF > &  _F,
const Eigen::PlainObjectBase< DerivedTT > &  _TT,
const Eigen::PlainObjectBase< DerivedTT > &  _TTi,
const std::vector< std::vector< VFType > > &  _VF,
const std::vector< std::vector< VFType > > &  _VFi,
const std::vector< bool > &  _V_border,
const Eigen::PlainObjectBase< DerivedC > &  _Handle_Seams 
)
94 :
95 V(_V),
96 F(_F),
97 TT(_TT),
98 TTi(_TTi),
99 VF(_VF),
100 VFi(_VFi),
101 V_border(_V_border),
102 Handle_Seams(_Handle_Seams)
103{
105 HandleS_Index.setConstant(F.rows(),3,-1);
106 HandleV_Integer.resize(V.rows());
107}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
Definition PlainObjectBase.h:151
const std::vector< std::vector< VFType > > & VF
Definition cut_mesh.cpp:31
const Eigen::PlainObjectBase< DerivedC > & Handle_Seams
Definition cut_mesh.cpp:35
const std::vector< bool > & V_border
Definition cut_mesh.cpp:33
const Eigen::PlainObjectBase< DerivedF > & F
Definition cut_mesh.cpp:27
int num_scalar_variables
Definition cut_mesh.cpp:38
DerivedF HandleS_Index
Definition cut_mesh.cpp:41
const Eigen::PlainObjectBase< DerivedV > & V
Definition cut_mesh.cpp:26
const Eigen::PlainObjectBase< DerivedTT > & TT
Definition cut_mesh.cpp:29
const std::vector< std::vector< VFType > > & VFi
Definition cut_mesh.cpp:32
const Eigen::PlainObjectBase< DerivedTT > & TTi
Definition cut_mesh.cpp:30
std::vector< std::vector< int > > HandleV_Integer
Definition cut_mesh.cpp:44

References igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::F, igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::HandleS_Index, igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::HandleV_Integer, igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::num_scalar_variables, Eigen::PlainObjectBase< Derived >::rows(), and igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::V.

+ Here is the call graph for this function:

Member Function Documentation

◆ AddNewIndex()

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
IGL_INLINE int igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::AddNewIndex ( const int  v0)
private
121{
125}

◆ FindInitialPos()

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
IGL_INLINE void igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::FindInitialPos ( const int  vert,
int &  edge,
int &  face 
)
private

find initial position of the pos to

test if I've just crossed a border

or if I've just crossed a seam if I'm on a border I MUST start from the one next t othe border

152{
153 int f_init;
154 int edge_init;
155 FirstPos(vert,f_init,edge_init); // todo manually the function
157
158 bool vertexB = V_border[vert];
159 bool possible_split=false;
160 bool complete_turn=false;
161 do
162 {
163 int curr_f = VFI.Fi();
164 int curr_edge=VFI.Ei();
165 VFI.NextFE();
166 int next_f=VFI.Fi();
168 bool on_border=(TT(curr_f,curr_edge)==-1);
169 //bool mismatch=false;
170 bool seam=false;
171
174 if (!vertexB)
175 //seam=curr_f->IsSeam(next_f);
176 seam=IsSeam(curr_f,next_f);
177 // if (vertexB)
178 // assert(!Handle_Singular(vert));
179 // ;
180 //assert(!vert->IsSingular());
181 possible_split=((on_border)||(seam));
182 complete_turn = next_f == f_init;
183 } while ((!possible_split)&&(!complete_turn));
184 face=VFI.Fi();
185 edge=VFI.Ei();
186}
Definition HalfEdgeIterator.h:48
IGL_INLINE bool IsSeam(const int f0, const int f1)
Definition cut_mesh.cpp:129
IGL_INLINE void FirstPos(const int v, int &f, int &edge)
Definition cut_mesh.cpp:112

References igl::HalfEdgeIterator< DerivedF, DerivedFF, DerivedFFi >::Ei(), igl::HalfEdgeIterator< DerivedF, DerivedFF, DerivedFFi >::Fi(), and igl::HalfEdgeIterator< DerivedF, DerivedFF, DerivedFFi >::NextFE().

+ Here is the call graph for this function:

◆ FirstPos()

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
IGL_INLINE void igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::FirstPos ( const int  v,
int &  f,
int &  edge 
)
private
113{
114 f = VF[v][0]; // f=v->cVFp();
115 edge = VFi[v][0]; // edge=v->cVFi();
116}

◆ InitMappingSeam() [1/2]

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
IGL_INLINE void igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::InitMappingSeam

vertex to variable mapping initialize the mapping for a given sampled mesh

253{
255 for (unsigned int i=0;i<V.rows();i++)
257
258 for (unsigned int j=0;j<V.rows();j++)
259 assert(HandleV_Integer[j].size()>0);
260}
IGL_INLINE void InitMappingSeam()
vertex to variable mapping initialize the mapping for a given sampled mesh
Definition cut_mesh.cpp:252
constexpr auto size(const C &c) -> decltype(c.size())
Definition span.hpp:183

Referenced by igl::cut_mesh().

+ Here is the caller graph for this function:

◆ InitMappingSeam() [2/2]

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
IGL_INLINE void igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::InitMappingSeam ( const int  vert)
private

initialize the mapping for a given vertex

first rotate until find the first pos after a mismatch or a border or return to the first position...

234{
237 int f_init = VF[vert][0];
238 int indexE = VFi[vert][0];
239
241
242 int edge_init;
243 int face_init;
244 FindInitialPos(vert,edge_init,face_init);
245 MapIndexes(vert,edge_init,face_init);
246}
IGL_INLINE void MapIndexes(const int vert, const int edge_init, const int f_init)
initialize the mapping given an initial pos whih must be initialized with FindInitialPos
Definition cut_mesh.cpp:194
IGL_INLINE void FindInitialPos(const int vert, int &edge, int &face)
find initial position of the pos to
Definition cut_mesh.cpp:149

◆ IsSeam()

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
IGL_INLINE bool igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::IsSeam ( const int  f0,
const int  f1 
)
private

border

130{
131 for (int i=0;i<3;i++)
132 {
133 int f_clos = TT(f0,i);
134
135 if (f_clos == -1)
136 continue;
137
138 if (f_clos == f1)
139 return(Handle_Seams(f0,i));
140 }
141 assert(0);
142 return false;
143}

◆ MapIndexes()

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
IGL_INLINE void igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::MapIndexes ( const int  vert,
const int  edge_init,
const int  f_init 
)
private

initialize the mapping given an initial pos whih must be initialized with FindInitialPos

check that is not on border.. in such case maybe it's non manyfold insert an initial index

and initialize the jumping pos

assing the current index

test if I've finiseh with the face exploration

or if I've just crossed a mismatch

then add a new index

197{
201 int curr_index=AddNewIndex(vert);
204 bool complete_turn=false;
205 do
206 {
207 int curr_f = VFI.Fi();
208 int curr_edge = VFI.Ei();
210 HandleS_Index(curr_f,curr_edge) = curr_index;
211 VFI.NextFE();
212 int next_f = VFI.Fi();
214 complete_turn = (next_f==f_init);
216 if (!complete_turn)
217 {
218 bool seam=false;
219 //seam=curr_f->IsSeam(next_f);
220 seam=IsSeam(curr_f,next_f);
221 if (seam)
222 {
224 curr_index=AddNewIndex(vert);
225 }
226 }
227 } while (!complete_turn);
228}
IGL_INLINE int AddNewIndex(const int v0)
Definition cut_mesh.cpp:120

References igl::HalfEdgeIterator< DerivedF, DerivedFF, DerivedFFi >::Ei(), igl::HalfEdgeIterator< DerivedF, DerivedFF, DerivedFFi >::Fi(), and igl::HalfEdgeIterator< DerivedF, DerivedFF, DerivedFFi >::NextFE().

+ Here is the call graph for this function:

Member Data Documentation

◆ F

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
const Eigen::PlainObjectBase<DerivedF>& igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::F

◆ Handle_Seams

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
const Eigen::PlainObjectBase<DerivedC>& igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::Handle_Seams

◆ HandleS_Index

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
DerivedF igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::HandleS_Index

◆ HandleV_Integer

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
std::vector<std::vector<int> > igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::HandleV_Integer

◆ num_scalar_variables

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
int igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::num_scalar_variables

◆ TT

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
const Eigen::PlainObjectBase<DerivedTT>& igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::TT

◆ TTi

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
const Eigen::PlainObjectBase<DerivedTT>& igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::TTi

◆ V

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
const Eigen::PlainObjectBase<DerivedV>& igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::V

◆ V_border

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
const std::vector<bool>& igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::V_border

◆ VF

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
const std::vector<std::vector<VFType> >& igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::VF

◆ VFi

template<typename DerivedV , typename DerivedF , typename VFType , typename DerivedTT , typename DerivedC >
const std::vector<std::vector<VFType> >& igl::MeshCutterMini< DerivedV, DerivedF, VFType, DerivedTT, DerivedC >::VFi

The documentation for this class was generated from the following file: