make brige_angle as override instead of default value for the algorithm.

#142
This commit is contained in:
supermerill 2020-01-14 18:49:21 +01:00
parent c754ab3883
commit 088c62246b

View File

@ -301,16 +301,18 @@ void LayerRegion::process_external_surfaces(const Layer *lower_layer, const Poly
printf("Processing bridge at layer " PRINTF_ZU ":\n", this->layer()->id()); printf("Processing bridge at layer " PRINTF_ZU ":\n", this->layer()->id());
#endif #endif
double custom_angle = Geometry::deg2rad(this->region()->config().bridge_angle.value); double custom_angle = Geometry::deg2rad(this->region()->config().bridge_angle.value);
if (bd.detect_angle(custom_angle)) { if (custom_angle > 0) {
// Bridge was not detected (likely it is only supported at one side). Still it is a surface filled in
// using a bridging flow, therefore it makes sense to respect the custom bridging direction.
bridges[idx_last].bridge_angle = custom_angle;
}else if (bd.detect_angle(custom_angle)) {
bridges[idx_last].bridge_angle = bd.angle; bridges[idx_last].bridge_angle = bd.angle;
if (this->layer()->object()->config().support_material) { if (this->layer()->object()->config().support_material) {
polygons_append(this->bridged, intersection(bd.coverage(), to_polygons(initial))); polygons_append(this->bridged, intersection(bd.coverage(), to_polygons(initial)));
append(this->unsupported_bridge_edges, bd.unsupported_edges()); append(this->unsupported_bridge_edges, bd.unsupported_edges());
} }
} else if (custom_angle > 0) { } else {
// Bridge was not detected (likely it is only supported at one side). Still it is a surface filled in bridges[idx_last].bridge_angle = 0;
// using a bridging flow, therefore it makes sense to respect the custom bridging direction.
bridges[idx_last].bridge_angle = custom_angle;
} }
// without safety offset, artifacts are generated (GH #2494) // without safety offset, artifacts are generated (GH #2494)
surfaces_append(bottom, union_ex(grown, true), bridges[idx_last]); surfaces_append(bottom, union_ex(grown, true), bridges[idx_last]);