本文整理汇总了C++中Poly::getZ方法的典型用法代码示例。如果您正苦于以下问题:C++ Poly::getZ方法的具体用法?C++ Poly::getZ怎么用?C++ Poly::getZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Poly
的用法示例。
在下文中一共展示了Poly::getZ方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cpolys
vector<Poly> Clipping::getOffset(const Poly &poly, double distance,
JoinType jtype, double miterdist)
{
CL::Polygons cpolys(1); cpolys[0]=getClipperPolygon(poly);
CL::Polygons offset = CLOffset(cpolys, CL_FACTOR*distance, CLType(jtype), miterdist);
return getPolys(offset, poly.getZ(), poly.getExtrusionFactor());
}
示例2: addInfillPoly
void Infill::addInfillPoly(Poly p)
{
// Poly *zigzagpoly = NULL;
switch (type) {
// case ZigzagInfill: // take parallel lines and connect ends
// zigzagpoly = new Poly(p.getZ(),extrusionfactor);
case BridgeInfill:
case ParallelInfill:
{ // make lines instead of closed polygons
Vector2d l,rotl;
double sina = sin(-angle);
double cosa = cos(-angle);
// use the lines that have the angle of this Infill
for (uint i=0; i < p.size() ; i+=1 )
{
l = (p.getVertexCircular(i+1) - p.getVertexCircular(i));
// rotate with neg. infill angle and see whether it's 90° as infill lines
rotl = Vector2d(l.x*cosa-l.y*sina,
l.y*cosa+l.x*sina);
if (abs(rotl.x) < 0.1 && abs(rotl.y) > 0.1)
{
// if (zigzagpoly) {
// zigzagpoly->addVertex(p.getVertexCircular(i+i%2));
// zigzagpoly->addVertex(p.getVertexCircular(i+1+i%2));
// } else
{
Poly newpoly(p.getZ(), extrusionfactor);
newpoly.vertices.push_back(p.getVertexCircular(i));
newpoly.vertices.push_back(p.getVertexCircular(i+1));
infillpolys.push_back(newpoly);
}
}
// else
// if (zigzagpoly) {
// zigzagpoly->addVertex(p.getVertexCircular(i));
// }
}
// if (zigzagpoly) {
// cerr << zigzagpoly->size()<< endl;
// if (zigzagpoly->size()>0)
// infillpolys.push_back(*zigzagpoly);
// else delete zigzagpoly;
// cerr << infillpolys.size()<< endl;
// }
}
break;
default:
{
p.setExtrusionFactor(extrusionfactor);
infillpolys.push_back(p);
}
}
}
示例3: addPoly
void Clipping::addPoly(const Poly &poly, PolyType type)
{
clpr.AddPolygon(getClipperPolygon(poly),CLType(type));
lastZ = poly.getZ();
lastExtrF = poly.getExtrusionFactor();
}