本文整理汇总了C++中SliceMeshStorage::getSettingInAngleRadians方法的典型用法代码示例。如果您正苦于以下问题:C++ SliceMeshStorage::getSettingInAngleRadians方法的具体用法?C++ SliceMeshStorage::getSettingInAngleRadians怎么用?C++ SliceMeshStorage::getSettingInAngleRadians使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SliceMeshStorage
的用法示例。
在下文中一共展示了SliceMeshStorage::getSettingInAngleRadians方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateInfillSupport
void SkinInfillAreaComputation::generateInfillSupport(SliceMeshStorage& mesh)
{
const coord_t layer_height = mesh.getSettingInMicrons("layer_height");
const double support_angle = mesh.getSettingInAngleRadians("infill_support_angle");
const double tan_angle = tan(support_angle) - 0.01; //The X/Y component of the support angle. 0.01 to make 90 degrees work too.
const coord_t max_dist_from_lower_layer = tan_angle * layer_height; //Maximum horizontal distance that can be bridged.
for (int layer_idx = mesh.layers.size() - 2; layer_idx >= 0; layer_idx--)
{
SliceLayer& layer = mesh.layers[layer_idx];
SliceLayer& layer_above = mesh.layers[layer_idx + 1];
Polygons inside_above;
Polygons infill_above;
for (SliceLayerPart& part_above : layer_above.parts)
{
inside_above.add(part_above.infill_area);
infill_above.add(part_above.getOwnInfillArea());
}
for (SliceLayerPart& part : layer.parts)
{
const Polygons& infill_area = part.infill_area;
if (infill_area.empty())
{
continue;
}
const Polygons unsupported = infill_area.offset(-max_dist_from_lower_layer);
const Polygons basic_overhang = unsupported.difference(inside_above);
const Polygons overhang_extented = basic_overhang.offset(max_dist_from_lower_layer + 50); // +50 for easier joining with support from layer above
const Polygons full_overhang = overhang_extented.difference(inside_above);
const Polygons infill_support = infill_above.unionPolygons(full_overhang);
part.infill_area_own = infill_support.intersection(part.getOwnInfillArea());
}
}
}