本文整理汇总了C++中CLPoint::xyClosestPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ CLPoint::xyClosestPoint方法的具体用法?C++ CLPoint::xyClosestPoint怎么用?C++ CLPoint::xyClosestPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLPoint
的用法示例。
在下文中一共展示了CLPoint::xyClosestPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: singleEdgeDrop
// "dual" edge-drop problems
// cylinder: zero diam edge/ellipse, r-radius cylinder, find r-offset == cl (ITO surface XY-slice is a circle)
// sphere: zero diam cylinder. ellipse around edge, find offset == cl (ITO surface slice is ellipse) (?)
// toroid: radius2 diam edge, radius1 cylinder, find radius1-offset-ellipse=cl (ITO surf slice is offset ellipse) (this is the offset-ellipse problem)
// cone: ??? (how is this an ellipse??)
bool MillingCutter::singleEdgeDrop(CLPoint& cl, const Point& p1, const Point& p2, double d) const {
Point v = p2 - p1; // vector along edge, from p1 -> p2
Point vxy( v.x, v.y, 0.0);
vxy.xyNormalize(); // normalized XY edge vector
// figure out u-coordinates of p1 and p2 (i.e. x-coord in the rotated system)
Point sc = cl.xyClosestPoint( p1, p2 );
assert( ( (cl-sc).xyNorm() - d ) < 1E-6 );
// edge endpoints in the new coordinate system, in these coordinates, CL is at origo
Point up1( (p1-sc).dot(vxy) , d, p1.z); // d, distance to line, is the y-coord in the rotated system
Point up2( (p2-sc).dot(vxy) , d, p2.z);
CC_CLZ_Pair contact = this->singleEdgeDropCanonical( up1, up2 ); // the subclass handles this
CCPoint cc_tmp( sc + contact.first * vxy, EDGE); // translate back into original coord-system
cc_tmp.z_projectOntoEdge(p1,p2);
return cl.liftZ_if_InsidePoints( contact.second , cc_tmp , p1, p2);
}