本文整理汇总了C++中Bedge::is_crease方法的典型用法代码示例。如果您正苦于以下问题:C++ Bedge::is_crease方法的具体用法?C++ Bedge::is_crease怎么用?C++ Bedge::is_crease使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bedge
的用法示例。
在下文中一共展示了Bedge::is_crease方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
CWvec&
Bface::vert_normal(CBvert* v, Wvec& n) const
{
// for gouraud shading: return appropriate
// normal to use at a vertex of this face
assert(this->contains(v));
if(!v->is_crease()) {
n = v->norm();
return n;
}
// take average of face normals in star of v,
// using faces which can be reached from this
// face without crossing a crease edge
n = weighted_vnorm(this, v); // add weighted normal from this face
int count = 1; // count of faces processed
// wind around v in clockwise direction
// but don't cross a crease edge
CBface* f = this;
Bedge* e = edge_from_vert(v);
for (; e&&!e->is_crease() && (f=e->other_face(f)); e=f->edge_from_vert(v)) {
n += weighted_vnorm(f, v);
if (++count > v->degree()) {
// this should never happen, but it does
// happen on effed up models
// (i.e. when "3rd faces" get added)
break;
}
}
// wind around v in counter-clockwise direction;
// as before, don't cross a crease edge
f = this;
e = edge_before_vert(v);
for(; e&&!e->is_crease()&&(f=e->other_face(f)); e=f->edge_before_vert(v)) {
n += weighted_vnorm(f, v);
if(++count > v->degree())
break;
}
n = n.normalized();
return n;
}
示例2: return
/*****************************************************************
* InflateCreaseFilter:
*****************************************************************/
bool
InflateCreaseFilter::accept(CBsimplex* s) const
{
// Reject non-edges:
if (!is_edge(s))
return false;
Bedge* e = (Bedge*)s;
if (e->nfaces() < 2)
return false;
// Accept it if it's labelled a crease, is owned by a
// Bcurve, or the adjacent faces make a sharp angle:
return (
e->is_crease() ||
Bcurve::find_controller(e) ||
rad2deg(norm_angle(e)) > 50
);
}