mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-14 08:05:57 +08:00
optimize cross hatch infill to enchance strength (#5495)
Optimize the cross-hatch infill pattern to improve strength when low infill density is used.
This commit is contained in:
parent
c14ae13788
commit
8b1bf13021
@ -1,6 +1,7 @@
|
||||
#include "../ClipperUtils.hpp"
|
||||
#include "../ShortestPath.hpp"
|
||||
#include "../Surface.hpp"
|
||||
#include <cmath>
|
||||
|
||||
#include "FillCrossHatch.hpp"
|
||||
|
||||
@ -193,7 +194,12 @@ void FillCrossHatch ::_fill_surface_single(
|
||||
bb.merge(align_to_grid(bb.min, Point(line_spacing * 4, line_spacing * 4)));
|
||||
|
||||
// generate pattern
|
||||
Polylines polylines = generate_infill_layers(scale_(this->z), 1, line_spacing, bb.size()(0), bb.size()(1));
|
||||
//Orca: optimize the cross-hatch infill pattern to improve strength when low infill density is used.
|
||||
double repeat_ratio = 1.0;
|
||||
if (params.density < 0.3)
|
||||
repeat_ratio = std::clamp(1.0 - std::exp(-5 * params.density), 0.2, 1.0);
|
||||
|
||||
Polylines polylines = generate_infill_layers(scale_(this->z), repeat_ratio, line_spacing, bb.size()(0), bb.size()(1));
|
||||
|
||||
// shift the pattern to the actual space
|
||||
for (Polyline &pl : polylines) { pl.translate(bb.min); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user