本文整理汇总了C++中Polygons::smooth_outward方法的典型用法代码示例。如果您正苦于以下问题:C++ Polygons::smooth_outward方法的具体用法?C++ Polygons::smooth_outward怎么用?C++ Polygons::smooth_outward使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polygons
的用法示例。
在下文中一共展示了Polygons::smooth_outward方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: join
Polygons AreaSupport::join(Polygons& supportLayer_up, Polygons& supportLayer_this, int64_t supportJoinDistance, int64_t smoothing_distance, int max_smoothing_angle, bool conical_support, int64_t conical_support_offset, int64_t conical_smallest_breadth)
{
Polygons joined;
if (conical_support)
{
Polygons insetted = supportLayer_up.offset(-conical_smallest_breadth/2);
Polygons small_parts = supportLayer_up.difference(insetted.offset(conical_smallest_breadth/2+20));
joined = supportLayer_this.unionPolygons(supportLayer_up.offset(conical_support_offset))
.unionPolygons(small_parts);
}
else
{
joined = supportLayer_this.unionPolygons(supportLayer_up);
}
// join different parts
if (supportJoinDistance > 0)
{
joined = joined.offset(supportJoinDistance)
.offset(-supportJoinDistance);
}
// remove jagged line pieces introduced by unioning separate overhang areas for consectuive layers
//
// support may otherwise look like:
// _____________________ .
// / \ } dist_from_lower_layer
// /__ __\ /
// /''--...........--''\ `\ .
// / \ } dist_from_lower_layer
// /__ __\ ./
// /''--...........--''\ `\ .
// / \ } dist_from_lower_layer
// /_______________________\ ,/
// rather than
// _____________________
// / \ .
// / \ .
// | |
// | |
// | |
// | |
// | |
// |_______________________|
//
// dist_from_lower_layer may be up to max_dist_from_lower_layer (see below), but that value may be extremely high
joined = joined.smooth_outward(max_smoothing_angle, smoothing_distance);
return joined;
}