本文整理汇总了C++中Face::ClipEar方法的典型用法代码示例。如果您正苦于以下问题:C++ Face::ClipEar方法的具体用法?C++ Face::ClipEar怎么用?C++ Face::ClipEar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Face
的用法示例。
在下文中一共展示了Face::ClipEar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
/*
1.28 Evaporate splits this face in triangles and collapses these to a point
inside. When the parameter ~close~ is false, then the triangles are expanded,
making this the function "Condensate".
*/
vector<MSegs> Face::Evaporate(bool close) {
vector<MSegs> ret;
Face reg = *this; // Crate a copy first
// At first, integrate all holes into the cycle
reg.IntegrateHoles();
while (reg.v.size() > 3) {
// Then, repeatedly clip an ear until only a triangle is left
Face r = reg.ClipEar();
// and collapse (or expand) the triangles towards its centroid.
MSegs s = r.collapse(close, r.GetCentroid());
s.isevaporating = 1;
ret.push_back(s);
}
// Finally, handle the last triangle left.
MSegs s = reg.collapse(close, reg.GetCentroid());
s.isevaporating = 1;
ret.push_back(s);
return ret;
}