本文整理汇总了C++中CLPoint::liftZ方法的典型用法代码示例。如果您正苦于以下问题:C++ CLPoint::liftZ方法的具体用法?C++ CLPoint::liftZ怎么用?C++ CLPoint::liftZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLPoint
的用法示例。
在下文中一共展示了CLPoint::liftZ方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vertexDrop
// general purpose vertex-drop which delegates to this->height(r) of subclass
bool MillingCutter::vertexDrop(CLPoint &cl, const Triangle &t) const {
bool result = false;
BOOST_FOREACH( const Point& p, t.p) { // test each vertex of triangle
double q = cl.xyDistance(p); // distance in XY-plane from cl to p
if ( q <= radius ) { // p is inside the cutter
CCPoint cc_tmp(p, VERTEX);
if ( cl.liftZ( p.z - this->height(q), cc_tmp ) )
result = true;
}
}
return result;
}
示例2: addCutter
//.........这里部分代码省略.........
return false;
double d = cl.xyDistance(*cl.cc);
double lolimit;
double hilimit;
if (n==0)
lolimit = - 1E-6;
else
lolimit = radiusvec[n-1] - 1E-6;
hilimit = radiusvec[n]+1e-6; // FIXME: really ugly solution this one...
if (d<lolimit)
return false;
else if (d>hilimit)
return false;
else
return true;
}
bool CompositeCutter::ccValidHeight(unsigned int n, CCPoint& cc, const Fiber& f) const {
//if ( ((cc.z-f.p1.z) >= 0.0) && (n == height_to_index(cc.z-f.p1.z)) )
if ( n == height_to_index(cc.z-f.p1.z) )
return true;
else
return false;
}
// return true if height h belongs to cutter n
bool CompositeCutter::validHeight(unsigned int n, double h) const {
double lolimit, hilimit;
if (n==0)
lolimit = -1E-6;
else
lolimit = heightvec[n-1] - 1E-6;
hilimit = heightvec[n]+1e-6; // FIXME: really ugly solution this one...
if ( (lolimit<=h) )
if (h<=hilimit)
return true;
return false;
}
bool CompositeCutter::validRadius(unsigned int n, double r) const {
assert( r >= 0.0 );
double lolimit, hilimit;
if (n==0)
lolimit = -1E-6;
else
lolimit = radiusvec[n-1] - 1E-6;
hilimit = radiusvec[n]+1e-6; // FIXME: really ugly solution this one...
if ( (lolimit<=r) )
if (r<=hilimit)
return true;
return false;
}
//******** facetDrop ********************** */
// call facetDrop on each cutter and pick a valid cc-point
bool CompositeCutter::facetDrop(CLPoint &cl, const Triangle &t) const {
bool result = false;
for (unsigned int n=0; n<cutter.size(); ++n) { // loop through cutters
CLPoint cl_tmp = cl + CLPoint(0,0,zoffset[n]);
CCPoint* cc_tmp;
if ( cutter[n]->facetDrop(cl_tmp, t) ) {
assert( cl_tmp.cc != 0);
if ( ccValidRadius(n,cl_tmp) ) { // cc-point is valid
cc_tmp = new CCPoint(*cl_tmp.cc);
if (cl.liftZ( cl_tmp.z - zoffset[n] )) { // we need to lift the cutter
cc_tmp->type = FACET;
cl.cc = cc_tmp;
result = true;
} else {
delete cc_tmp;
}
}
}
}
return result;
}
//******** edge **************************************************** */
bool CompositeCutter::edgeDrop(CLPoint &cl, const Triangle &t) const {
bool result = false;
for (unsigned int n=0; n<cutter.size(); ++n) { // loop through cutters
CLPoint cl_tmp = cl + Point(0,0,zoffset[n]);
CCPoint* cc_tmp;
if ( cutter[n]->edgeDrop(cl_tmp,t) ) { // drop sub-cutter against edge
if ( ccValidRadius(n,cl_tmp) ) { // check if cc-point is valid
cc_tmp = new CCPoint(*cl_tmp.cc);
if (cl.liftZ( cl_tmp.z - zoffset[n] ) ) { // we need to lift the cutter
cc_tmp->type = EDGE;
cl.cc = cc_tmp;
result = true;
} else {
delete cc_tmp;
}
}
}
}
return result;
}
示例3: facetDrop
// call facetDrop on each cutter and pick a valid cc-point
bool CompositeCutter::facetDrop(CLPoint &cl, const Triangle &t) const {
bool result = false;
for (unsigned int n=0; n<cutter.size(); ++n) { // loop through cutters
CLPoint cl_tmp = cl + CLPoint(0,0,zoffset[n]);
CCPoint* cc_tmp;
if ( cutter[n]->facetDrop(cl_tmp, t) ) {
assert( cl_tmp.cc != 0);
if ( ccValidRadius(n,cl_tmp) ) { // cc-point is valid
cc_tmp = new CCPoint(*cl_tmp.cc);
if (cl.liftZ( cl_tmp.z - zoffset[n] )) { // we need to lift the cutter
cc_tmp->type = FACET;
cl.cc = cc_tmp;
result = true;
} else {
delete cc_tmp;
}
}
}
}
return result;
}