Add Cross zag and locked-zag for shoes

Ported from BambuStudio
This commit is contained in:
SoftFever 2025-06-10 23:07:12 +08:00
parent 1321cf040a
commit 18b9733f31
21 changed files with 1167 additions and 587 deletions

View file

@ -0,0 +1,44 @@
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_50_344)">
<path d="M2.30558 2.99865L3.36346 4.03181L4.42135 2.99837" stroke="#707273" stroke-width="0.5"/>
<path d="M2.75277 2.39845L3.37108 3.00231L3.98939 2.39829" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M3.94212 1.39367L5 2.42683L6.05789 1.39339" stroke="#707273" stroke-width="0.5"/>
<path d="M4.38931 0.793474L5.00762 1.39733L5.62593 0.793312" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M5.56148 2.88305L6.61936 3.91621L7.67725 2.88277" stroke="#707273" stroke-width="0.5"/>
<path d="M6.00867 2.28285L6.62698 2.88671L7.24529 2.28269" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M3.94973 4.62451L5.00761 5.65767L6.0655 4.62423" stroke="#707273" stroke-width="0.5"/>
<path d="M4.39692 4.02431L5.01523 4.62817L5.63354 4.02415" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M5.62593 6.1643L6.68381 7.19746L7.7417 6.16402" stroke="#707273" stroke-width="0.5"/>
<path d="M6.07312 5.5641L6.69143 6.16796L7.30974 5.56394" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M7.19075 4.62451L8.24864 5.65767L9.30652 4.62423" stroke="#707273" stroke-width="0.5"/>
<path d="M7.63794 4.02431L8.25625 4.62817L8.87457 4.02415" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M3.93647 7.79784L4.99436 8.831L6.05224 7.79757" stroke="#707273" stroke-width="0.5"/>
<path d="M4.38366 7.19765L5.00197 7.80151L5.62029 7.19749" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M7.16011 7.79784L8.218 8.831L9.27588 7.79757" stroke="#707273" stroke-width="0.5"/>
<path d="M7.6073 7.19765L8.22561 7.80151L8.84393 7.19749" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M2.28115 6.2777L3.33903 7.31086L4.39692 6.27743" stroke="#707273" stroke-width="0.5"/>
<path d="M2.72834 5.67751L3.34665 6.28137L3.96496 5.67735" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M0.746016 7.9252L1.67045 8.83104L2.72834 7.79761" stroke="#707273" stroke-width="0.5"/>
<path d="M1.05976 7.19765L1.67807 7.80151L2.29638 7.19749" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M0.674093 4.62451L1.73198 5.65767L2.78986 4.62423" stroke="#707273" stroke-width="0.5"/>
<path d="M1.12128 4.02431L1.73959 4.62817L2.3579 4.02415" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M0.678528 1.37752L1.67045 2.32702L2.72834 1.29358" stroke="#707273" stroke-width="0.5"/>
<path d="M1.05976 0.69362L1.67807 1.29748L2.29638 0.693458" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M7.21014 1.24951L8.26802 2.28267L9.32591 1.24923" stroke="#707273" stroke-width="0.5"/>
<path d="M7.76739 0.77738L8.27564 1.25297L8.76419 0.777344" stroke="#ABABAB" stroke-width="0.5"/>
<path d="M8.99436 0.75769H0.99436C0.856289 0.75769 0.74436 0.869619 0.74436 1.00769V9.00769C0.74436 9.14576 0.856289 9.25769 0.99436 9.25769H8.99436C9.13243 9.25769 9.24436 9.14576 9.24436 9.00769V1.00769C9.24436 0.869619 9.13243 0.75769 8.99436 0.75769Z" stroke="#262E30" stroke-width="0.5"/>
<path d="M9.32591 5.65771L5.6773 9.30652" stroke="#262E30" stroke-width="0.5"/>
<path d="M4.43306 0.724121L0.674093 4.48328" stroke="#262E30" stroke-width="0.5"/>
<path d="M9.27161 2.4071L2.42689 9.2522" stroke="#262E30" stroke-width="0.5"/>
<path d="M7.67725 0.693481L0.68421 7.68688" stroke="#262E30" stroke-width="0.5"/>
<path d="M4.34229 9.32598L0.693487 5.67737" stroke="#262E30" stroke-width="0.5"/>
<path d="M9.27588 4.43303L5.51673 0.674072" stroke="#262E30" stroke-width="0.5"/>
<path d="M7.5929 9.27161L0.747808 2.42688" stroke="#262E30" stroke-width="0.5"/>
<path d="M9.30652 7.67724L2.31313 0.684204" stroke="#262E30" stroke-width="0.5"/>
</g>
<defs>
<clipPath id="clip0_50_344">
<rect width="10" height="10" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

@ -0,0 +1,29 @@
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_252_3415)">
<path d="M9.00005 0.799805H1.00005C0.900049 0.799805 0.800049 0.899805 0.800049 0.999805V8.9998C0.800049 9.0998 0.900049 9.1998 1.00005 9.1998H9.00005C9.10005 9.1998 9.20005 9.0998 9.20005 8.9998V0.999805C9.20005 0.899805 9.10005 0.799805 9.00005 0.799805Z" stroke="#262E30" stroke-width="0.5"/>
<path d="M4.40245 0.799805L0.78833 4.51161" stroke="#262E30" stroke-width="0.5"/>
<path d="M4.98863 6.66064L2.44897 9.2003" stroke="#262E30" stroke-width="0.5"/>
<path d="M9.30005 2.3999L8.30005 3.3999" stroke="#262E30" stroke-width="0.5"/>
<path d="M7.62586 0.799805L0.78833 7.63733" stroke="#262E30" stroke-width="0.5"/>
<path d="M4.30477 9.20004L0.78833 5.68359" stroke="#262E30" stroke-width="0.5"/>
<path d="M8.21206 3.43714L5.47705 0.799805" stroke="#262E30" stroke-width="0.5"/>
<path d="M4.98853 6.66064L0.78833 2.46045" stroke="#262E30" stroke-width="0.5"/>
<path d="M4.98865 3.43714L2.35132 0.799805" stroke="#262E30" stroke-width="0.5"/>
<path d="M6.56562 3.38428L4.98853 4.96138" stroke="#262E30" stroke-width="0.5"/>
<path d="M8.14272 3.38428L4.98853 6.53847" stroke="#262E30" stroke-width="0.5"/>
<path d="M9.22692 4.07471L5.08704 8.21459" stroke="#262E30" stroke-width="0.5"/>
<path d="M9.12844 5.94727L5.97424 9.10146" stroke="#262E30" stroke-width="0.5"/>
<path d="M9.22718 7.5249L7.55151 9.20057" stroke="#262E30" stroke-width="0.5"/>
<path d="M9.22688 4.96138L7.64978 3.38428" stroke="#262E30" stroke-width="0.5"/>
<path d="M9.22695 6.53847L6.07275 3.38428" stroke="#262E30" stroke-width="0.5"/>
<path d="M9.22692 8.21459L5.08704 4.07471" stroke="#262E30" stroke-width="0.5"/>
<path d="M8.24123 9.20009L5.08704 6.0459" stroke="#262E30" stroke-width="0.5"/>
<path d="M6.66419 9.10145L4.98853 7.42578" stroke="#262E30" stroke-width="0.5"/>
<path d="M5.09767 3.3999H9.20002V8.8697C9.20002 8.96738 9.10235 9.16273 8.907 9.16273H5V3.3999H5.09767Z" stroke="#262E30" stroke-width="0.5"/>
</g>
<defs>
<clipPath id="clip0_252_3415">
<rect width="10" height="10" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -1,7 +1,7 @@
{
"name": "Bambulab",
"url": "http://www.bambulab.com/Parameters/vendor/BBL.json",
"version": "01.10.00.36",
"version": "02.00.00.53",
"force_update": "0",
"description": "the initial version of BBL configurations",
"machine_model_list": [

View file

@ -71,5 +71,8 @@
"compatible_printers": [],
"smooth_coefficient": "80",
"overhang_totally_speed": "19",
"scarf_angle_threshold": "155"
"scarf_angle_threshold": "155",
"infill_shift_step": "0.4",
"infill_rotate_step": "0",
"symmetric_infill_y_axis": "false"
}

File diff suppressed because it is too large Load diff

View file

@ -56,7 +56,7 @@ public:
bool on_boundary(const Point &point, double eps) const;
// Projection of a point onto the polygon.
Point point_projection(const Point &point) const;
void symmetric_y(const coord_t &y_axis);
// Does this expolygon overlap another expolygon?
// Either the ExPolygons intersect, or one is fully inside the other,
// and it is not inside a hole of the other expolygon.

View file

@ -67,6 +67,11 @@ struct SurfaceFillParams
// Params for lattice infill angles
float lattice_angle_1 = 0.f;
float lattice_angle_2 = 0.f;
float infill_shift_step = 0;// param for cross zag
float infill_rotate_step = 0; // param for zig zag to get cross texture
float infill_lock_depth = 0;
float skin_infill_depth = 0;
bool symmetric_infill_y_axis = false;
bool operator<(const SurfaceFillParams &rhs) const {
#define RETURN_COMPARE_NON_EQUAL(KEY) if (this->KEY < rhs.KEY) return true; if (this->KEY > rhs.KEY) return false;
@ -96,7 +101,11 @@ struct SurfaceFillParams
RETURN_COMPARE_NON_EQUAL(solid_infill_speed);
RETURN_COMPARE_NON_EQUAL(lattice_angle_1);
RETURN_COMPARE_NON_EQUAL(lattice_angle_2);
RETURN_COMPARE_NON_EQUAL(infill_shift_step);
RETURN_COMPARE_NON_EQUAL(infill_rotate_step);
RETURN_COMPARE_NON_EQUAL(symmetric_infill_y_axis);
RETURN_COMPARE_NON_EQUAL(infill_lock_depth);
RETURN_COMPARE_NON_EQUAL(skin_infill_depth);
return false;
}
@ -119,7 +128,12 @@ struct SurfaceFillParams
this->top_surface_speed == rhs.top_surface_speed &&
this->solid_infill_speed == rhs.solid_infill_speed &&
this->lattice_angle_1 == rhs.lattice_angle_1 &&
this->lattice_angle_2 == rhs.lattice_angle_2;
this->lattice_angle_2 == rhs.lattice_angle_2 &&
this->infill_shift_step == rhs.infill_shift_step &&
this->infill_rotate_step == rhs.infill_rotate_step &&
this->symmetric_infill_y_axis == rhs.symmetric_infill_y_axis &&
this->infill_lock_depth == rhs.infill_lock_depth &&
this->skin_infill_depth == rhs.skin_infill_depth;
}
};
@ -596,16 +610,34 @@ void split_solid_surface(size_t layer_id, const SurfaceFill &fill, ExPolygons &n
#endif
}
std::vector<SurfaceFill> group_fills(const Layer &layer)
std::vector<SurfaceFill> group_fills(const Layer &layer, LockRegionParam &lock_param)
{
std::vector<SurfaceFill> surface_fills;
// Fill in a map of a region & surface to SurfaceFillParams.
std::set<SurfaceFillParams> set_surface_params;
std::vector<std::vector<const SurfaceFillParams*>> region_to_surface_params(layer.regions().size(), std::vector<const SurfaceFillParams*>());
SurfaceFillParams params;
bool has_internal_voids = false;
const PrintObjectConfig& object_config = layer.object()->config();
auto append_flow_param = [](std::map<Flow, ExPolygons> &flow_params, Flow flow, const ExPolygon &exp) {
auto it = flow_params.find(flow);
if (it == flow_params.end())
flow_params.insert({flow, {exp}});
else
it->second.push_back(exp);
it++;
};
auto append_density_param = [](std::map<float, ExPolygons> &density_params, float density, const ExPolygon &exp) {
auto it = density_params.find(density);
if (it == density_params.end())
density_params.insert({density, {exp}});
else
it->second.push_back(exp);
it++;
};
for (size_t region_id = 0; region_id < layer.regions().size(); ++ region_id) {
const LayerRegion &layerm = *layer.regions()[region_id];
region_to_surface_params[region_id].assign(layerm.fill_surfaces.size(), nullptr);
@ -621,8 +653,19 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
params.density = float(region_config.sparse_infill_density);
params.lattice_angle_1 = region_config.lattice_angle_1;
params.lattice_angle_2 = region_config.lattice_angle_2;
if (params.pattern == ipLockedZag) {
params.infill_lock_depth = scale_(region_config.infill_lock_depth);
params.skin_infill_depth = scale_(region_config.skin_infill_depth);
}
if (params.pattern == ipCrossZag || params.pattern == ipLockedZag) {
params.infill_shift_step = scale_(region_config.infill_shift_step);
params.symmetric_infill_y_axis = region_config.symmetric_infill_y_axis;
} else if (params.pattern == ipZigZag) {
params.infill_rotate_step = region_config.infill_rotate_step * M_PI / 360;
params.symmetric_infill_y_axis = region_config.symmetric_infill_y_axis;
}
if (surface.is_solid()) {
if (surface.is_solid()) {
params.density = 100.f;
//FIXME for non-thick bridges, shall we allow a bottom surface pattern?
if (surface.is_solid_infill())
@ -660,7 +703,7 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
params.bridge_angle = float(surface.bridge_angle);
if (params.extrusion_role == erInternalInfill) {
params.angle = float(Geometry::deg2rad(region_config.infill_direction.value));
params.rotate_angle = (params.pattern == ipRectilinear || params.pattern == ipLine);
params.rotate_angle = (params.pattern == ipRectilinear || params.pattern == ipLine || params.pattern == ipZigZag || params.pattern == ipCrossZag || params.pattern == ipLockedZag);
} else {
params.angle = float(Geometry::deg2rad(region_config.solid_infill_direction.value));
params.rotate_angle = region_config.rotate_solid_infill_direction;
@ -702,7 +745,28 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
params.anchor_length = std::min(params.anchor_length, params.anchor_length_max);
}
auto it_params = set_surface_params.find(params);
//get locked region param
if (params.pattern == ipLockedZag){
const PrintObject *object = layerm.layer()->object();
auto nozzle_diameter = float(object->print()->config().nozzle_diameter.get_at(layerm.region().extruder(extrusion_role) - 1));
Flow skin_flow = params.bridge ? params.flow : Flow::new_from_config_width(extrusion_role, region_config.skin_infill_line_width, nozzle_diameter, float((surface.thickness == -1) ? layer.height : surface.thickness));
//add skin flow
append_flow_param(lock_param.skin_flow_params, skin_flow, surface.expolygon);
Flow skeleton_flow = params.bridge ? params.flow : Flow::new_from_config_width(extrusion_role, region_config.skeleton_infill_line_width, nozzle_diameter, float((surface.thickness == -1) ? layer.height : surface.thickness)) ;
// add skeleton flow
append_flow_param(lock_param.skeleton_flow_params, skeleton_flow, surface.expolygon);
// add skin density
append_density_param(lock_param.skin_density_params, float(0.01 * region_config.skin_infill_density), surface.expolygon);
// add skin density
append_density_param(lock_param.skeleton_density_params, float(0.01 * region_config.skeleton_infill_density), surface.expolygon);
}
auto it_params = set_surface_params.find(params);
if (it_params == set_surface_params.end())
it_params = set_surface_params.insert(it_params, params);
region_to_surface_params[region_id][&surface - &layerm.fill_surfaces.surfaces.front()] = &(*it_params);
@ -907,8 +971,8 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
// this->export_region_fill_surfaces_to_svg_debug("10_fill-initial");
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
std::vector<SurfaceFill> surface_fills = group_fills(*this);
LockRegionParam lock_param;
std::vector<SurfaceFill> surface_fills = group_fills(*this, lock_param);
const Slic3r::BoundingBox bbox = this->object()->bounding_box();
const auto resolution = this->object()->print()->config().resolution.value;
@ -930,10 +994,19 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
f->adapt_fill_octree = (surface_fill.params.pattern == ipSupportCubic) ? support_fill_octree : adaptive_fill_octree;
f->print_config = &this->object()->print()->config();
f->print_object_config = &this->object()->config();
if (surface_fill.params.pattern == ipLightning)
f->adapt_fill_octree = (surface_fill.params.pattern == ipSupportCubic) ? support_fill_octree : adaptive_fill_octree;
if (surface_fill.params.pattern == ipConcentricInternal) {
FillConcentricInternal *fill_concentric = dynamic_cast<FillConcentricInternal *>(f.get());
assert(fill_concentric != nullptr);
fill_concentric->print_config = &this->object()->print()->config();
fill_concentric->print_object_config = &this->object()->config();
} else if (surface_fill.params.pattern == ipConcentric) {
FillConcentric *fill_concentric = dynamic_cast<FillConcentric *>(f.get());
assert(fill_concentric != nullptr);
fill_concentric->print_config = &this->object()->print()->config();
fill_concentric->print_object_config = &this->object()->config();
} else if (surface_fill.params.pattern == ipLightning)
dynamic_cast<FillLightning::Filler*>(f.get())->generator = lightning_generator;
// calculate flow spacing for infill pattern generation
bool using_internal_flow = ! surface_fill.surface.is_solid() && ! surface_fill.params.bridge;
double link_max_length = 0.;
@ -972,10 +1045,33 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
params.using_internal_flow = using_internal_flow;
params.no_extrusion_overlap = surface_fill.params.overlap;
params.config = &layerm->region().config();
params.pattern = surface_fill.params.pattern;
if( surface_fill.params.pattern == ipLockedZag ) {
params.locked_zag = true;
params.infill_lock_depth = surface_fill.params.infill_lock_depth;
params.skin_infill_depth = surface_fill.params.skin_infill_depth;
f->set_lock_region_param(lock_param);
}
if (surface_fill.params.pattern == ipCrossZag || surface_fill.params.pattern == ipLockedZag) {
if (f->layer_id % 2 == 0) {
params.horiz_move -= surface_fill.params.infill_shift_step * (f->layer_id / 2);
} else {
params.horiz_move += surface_fill.params.infill_shift_step * (f->layer_id / 2);
}
params.symmetric_infill_y_axis = surface_fill.params.symmetric_infill_y_axis;
}
if (surface_fill.params.pattern == ipGrid)
params.can_reverse = false;
for (ExPolygon& expoly : surface_fill.expolygons) {
f->no_overlap_expolygons = intersection_ex(surface_fill.no_overlap_expolygons, ExPolygons() = {expoly}, ApplySafetyOffset::Yes);
f->no_overlap_expolygons = intersection_ex(surface_fill.no_overlap_expolygons, ExPolygons() = {expoly}, ApplySafetyOffset::Yes);
if (params.symmetric_infill_y_axis) {
params.symmetric_y_axis = f->extended_object_bounding_box().center().x();
expoly.symmetric_y(params.symmetric_y_axis);
}
// Spacing is modified by the filler to indicate adjustments. Reset it for each expolygon.
f->spacing = surface_fill.params.spacing;
surface_fill.surface.expolygon = std::move(expoly);
@ -1015,9 +1111,10 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
Polylines Layer::generate_sparse_infill_polylines_for_anchoring(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive::Octree* support_fill_octree, FillLightning::Generator* lightning_generator) const
{
std::vector<SurfaceFill> surface_fills = group_fills(*this);
const Slic3r::BoundingBox bbox = this->object()->bounding_box();
const auto resolution = this->object()->print()->config().resolution.value;
LockRegionParam skin_inner_param;
std::vector<SurfaceFill> surface_fills = group_fills(*this, skin_inner_param);
const Slic3r::BoundingBox bbox = this->object()->bounding_box();
const auto resolution = this->object()->print()->config().resolution.value;
Polylines sparse_infill_polylines{};
@ -1050,7 +1147,9 @@ Polylines Layer::generate_sparse_infill_polylines_for_anchoring(FillAdaptive::Oc
case ipHilbertCurve:
case ipArchimedeanChords:
case ipOctagramSpiral:
case ipZigZag: break;
case ipZigZag:
case ipCrossZag:
case ipLockedZag: break;
}
// Create the filler object.

View file

@ -65,6 +65,8 @@ Fill* Fill::new_from_type(const InfillPattern type)
// Orca: Replace BBS implementation with Prusa implementation
case ipMonotonicLine: return new FillMonotonicLines();
case ipZigZag: return new FillZigZag();
case ipCrossZag: return new FillCrossZag();
case ipLockedZag: return new FillLockedZag();
default: throw Slic3r::InvalidArgument("unknown type");
}
}
@ -1554,6 +1556,18 @@ BoundaryInfillGraph create_boundary_infill_graph(const Polylines &infill_ordered
return out;
}
// The extended bounding box of the whole object that covers any rotation of every layer.
BoundingBox Fill::extended_object_bounding_box() const
{
BoundingBox out = bounding_box;
out.merge(Point(out.min.y(), out.min.x()));
out.merge(Point(out.max.y(), out.max.x()));
// The bounding box is scaled by sqrt(2.) to ensure that the bounding box
// covers any possible rotations.
return out.scaled(sqrt(2.));
}
void Fill::connect_infill(Polylines &&infill_ordered, const std::vector<const Polygon*> &boundary_src, const BoundingBox &bbox, Polylines &polylines_out, const double spacing, const FillParams &params)
{
assert(! infill_ordered.empty());

View file

@ -36,6 +36,15 @@ public:
InfillFailedException() : Slic3r::RuntimeError("Infill failed") {}
};
struct LockRegionParam
{
LockRegionParam() {}
std::map<float, ExPolygons> skin_density_params;
std::map<float, ExPolygons> skeleton_density_params;
std::map<Flow, ExPolygons> skin_flow_params;
std::map<Flow, ExPolygons> skeleton_flow_params;
};
struct FillParams
{
bool full_infill() const { return density > 0.9999f; }
@ -72,6 +81,7 @@ struct FillParams
// For 2D lattice
coordf_t lattice_angle_1 { 0.f };
coordf_t lattice_angle_2 { 0.f };
InfillPattern pattern{ ipRectilinear };
// BBS
Flow flow;
@ -82,6 +92,13 @@ struct FillParams
const PrintRegionConfig* config{ nullptr };
bool dont_sort{ false }; // do not sort the lines, just simply connect them
bool can_reverse{true};
float horiz_move{0.0}; //move infill to get cross zag pattern
bool symmetric_infill_y_axis{false};
coord_t symmetric_y_axis{0};
bool locked_zag{false};
float infill_lock_depth{0.0};
float skin_infill_depth{0.0};
};
static_assert(IsTriviallyCopyable<FillParams>::value, "FillParams class is not POD (and it should be - see constructor).");
@ -132,7 +149,7 @@ public:
static bool use_bridge_flow(const InfillPattern type);
void set_bounding_box(const Slic3r::BoundingBox &bbox) { bounding_box = bbox; }
BoundingBox extended_object_bounding_box() const;
// Use bridge flow for the fill?
virtual bool use_bridge_flow() const { return false; }
@ -147,10 +164,10 @@ public:
// Perform the fill.
virtual Polylines fill_surface(const Surface *surface, const FillParams &params);
virtual ThickPolylines fill_surface_arachne(const Surface* surface, const FillParams& params);
virtual void set_lock_region_param(const LockRegionParam &lock_param){};
// BBS: this method is used to fill the ExtrusionEntityCollection.
// It call fill_surface by default
virtual void fill_surface_extrusion(const Surface* surface, const FillParams& params, ExtrusionEntitiesPtr& out);
virtual void fill_surface_extrusion(const Surface *surface, const FillParams &params, ExtrusionEntitiesPtr &out);
protected:
Fill() :

View file

@ -987,7 +987,6 @@ static std::vector<SegmentedIntersectionLine> slice_region_by_vertical_lines(con
throw;
}
#endif //INFILL_DEBUG_OUTPUT
return segs;
}
@ -2761,6 +2760,8 @@ bool FillRectilinear::fill_surface_by_lines(const Surface *surface, const FillPa
// Rotate polygons so that we can work with vertical lines here
std::pair<float, Point> rotate_vector = this->_infill_direction(surface);
if (params.locked_zag)
rotate_vector.first += float(M_PI/2.);
rotate_vector.first += angleBase;
assert(params.density > 0.0001f && params.density <= 1.f);
@ -2807,6 +2808,13 @@ bool FillRectilinear::fill_surface_by_lines(const Surface *surface, const FillPa
if (params.full_infill())
x0 += (line_spacing + coord_t(SCALED_EPSILON)) / 2;
int gap_line = params.horiz_move / line_spacing;
if (gap_line % 2 == 0) {
x0 += params.horiz_move - gap_line * line_spacing;
} else {
x0 += params.horiz_move - (gap_line - 1) * line_spacing;
n_vlines += 1;
}
#ifdef SLIC3R_DEBUG
static int iRun = 0;
BoundingBox bbox_svg = poly_with_offset.bounding_box_outer();
@ -2818,7 +2826,6 @@ bool FillRectilinear::fill_surface_by_lines(const Surface *surface, const FillPa
}
iRun ++;
#endif /* SLIC3R_DEBUG */
std::vector<SegmentedIntersectionLine> segs = slice_region_by_vertical_lines(poly_with_offset, n_vlines, x0, line_spacing);
// Connect by horizontal / vertical links, classify the links based on link_max_length as too long.
connect_segment_intersections_by_contours(poly_with_offset, segs, params, link_max_length);
@ -2892,6 +2899,11 @@ bool FillRectilinear::fill_surface_by_lines(const Surface *surface, const FillPa
//FIXME rather simplify the paths to avoid very short edges?
//assert(! it->has_duplicate_points());
it->remove_duplicate_points();
//get origin direction infill
if (params.symmetric_infill_y_axis) {
it->symmetric_y(params.symmetric_y_axis);
}
}
#ifdef SLIC3R_DEBUG
@ -2900,6 +2912,8 @@ bool FillRectilinear::fill_surface_by_lines(const Surface *surface, const FillPa
assert(! polyline.has_duplicate_points());
#endif /* SLIC3R_DEBUG */
return true;
}
@ -2979,7 +2993,8 @@ bool FillRectilinear::fill_surface_by_multilines(const Surface *surface, FillPar
Polylines FillRectilinear::fill_surface(const Surface *surface, const FillParams &params)
{
Polylines polylines_out;
if (params.full_infill()) {
// Orca Todo: fow now don't use fill_surface_by_multilines for zipzag infill
if (params.full_infill() || params.pattern == ipCrossZag || params.pattern == ipZigZag || params.pattern == ipLockedZag) {
if (!fill_surface_by_lines(surface, params, 0.f, 0.f, polylines_out))
BOOST_LOG_TRIVIAL(error) << "FillRectilinear::fill_surface() fill_surface_by_lines() failed to fill a region.";
} else {
@ -3365,5 +3380,119 @@ void FillMonotonicLineWGapFill::fill_surface_by_lines(const Surface* surface, co
}
}*/
void FillLockedZag::fill_surface_locked_zag (const Surface * surface,
const FillParams & params,
std::vector<std::pair<Polylines, Flow>> &multi_width_polyline)
{
// merge different part exps
// diff skin flow
Polylines skin_lines;
Polylines skeloton_lines;
double offset_threshold = params.skin_infill_depth;
double overlap_threshold = params.infill_lock_depth;
Surface cross_surface = *surface;
Surface zig_surface = *surface;
// inner exps
// inner union exps
ExPolygons zig_expas = offset_ex({surface->expolygon}, -offset_threshold);
ExPolygons cross_expas = diff_ex(surface->expolygon, zig_expas);
bool zig_get = false;
FillParams zig_params = params;
zig_params.horiz_move = 0;
// generate skeleton for diff density
auto generate_for_different_flow = [&multi_width_polyline](const std::map<Flow, ExPolygons> &flow_params, const Polylines &polylines) {
auto it = flow_params.begin();
while (it != flow_params.end()) {
ExPolygons region_exp = union_safety_offset_ex(it->second);
Polylines polys = intersection_pl(polylines, region_exp);
multi_width_polyline.emplace_back(polys, it->first);
it++;
}
};
auto it = this->lock_param.skeleton_density_params.begin();
while (it != this->lock_param.skeleton_density_params.end()) {
ExPolygons region_exp = union_safety_offset_ex(it->second);
ExPolygons exps = intersection_ex(region_exp, zig_expas);
zig_params.density = it->first;
exps = intersection_ex(offset_ex(exps, overlap_threshold), surface->expolygon);
for (ExPolygon &exp : exps) {
zig_surface.expolygon = exp;
Polylines zig_polylines_out = this->fill_surface(&zig_surface, zig_params);
skeloton_lines.insert(skeloton_lines.end(), zig_polylines_out.begin(), zig_polylines_out.end());
}
it++;
}
// set skeleton flow
generate_for_different_flow(this->lock_param.skeleton_flow_params, skeloton_lines);
// skin exps
bool cross_get = false;
FillParams cross_params = params;
cross_params.locked_zag = false;
auto skin_density = this->lock_param.skin_density_params.begin();
while (skin_density != this->lock_param.skin_density_params.end()) {
ExPolygons region_exp = union_safety_offset_ex(skin_density->second);
ExPolygons exps = intersection_ex(region_exp, cross_expas);
cross_params.density = skin_density->first;
for (ExPolygon &exp : exps) {
cross_surface.expolygon = exp;
Polylines cross_polylines_out = this->fill_surface(&cross_surface, cross_params);
skin_lines.insert(skin_lines.end(), cross_polylines_out.begin(), cross_polylines_out.end());
}
skin_density++;
}
generate_for_different_flow(this->lock_param.skin_flow_params, skin_lines);
}
void FillLockedZag::fill_surface_extrusion(const Surface *surface, const FillParams &params, ExtrusionEntitiesPtr &out)
{
Polylines polylines;
ThickPolylines thick_polylines;
std::vector<std::pair<Polylines, Flow>> multi_width_polyline;
try {
this->fill_surface_locked_zag(surface, params, multi_width_polyline);
}
catch (InfillFailedException&) {}
if (!thick_polylines.empty() || !multi_width_polyline.empty()) {
// Save into layer.
ExtrusionEntityCollection* eec = nullptr;
out.push_back(eec = new ExtrusionEntityCollection());
// Only concentric fills are not sorted.
eec->no_sort = this->no_sort();
size_t idx = eec->entities.size();
{
for (std::pair<Polylines, Flow> &poly_with_flow: multi_width_polyline) {
// calculate actual flow from spacing (which might have been adjusted by the infill
// pattern generator)
double flow_mm3_per_mm = poly_with_flow.second.mm3_per_mm();
double flow_width = poly_with_flow.second.width();
if (params.using_internal_flow) {
// if we used the internal flow we're not doing a solid infill
// so we can safely ignore the slight variation that might have
// been applied to f->spacing
} else {
Flow new_flow = poly_with_flow.second.with_spacing(this->spacing);
flow_mm3_per_mm = new_flow.mm3_per_mm();
flow_width = new_flow.width();
}
extrusion_entities_append_paths(
eec->entities, std::move(poly_with_flow.first),
params.extrusion_role,
flow_mm3_per_mm, float(flow_width), poly_with_flow.second.height());
}
}
if (!params.can_reverse) {
for (size_t i = idx; i < eec->entities.size(); i++)
eec->entities[i]->set_reverse();
}
}
}
} // namespace Slic3r

View file

@ -189,6 +189,31 @@ public:
bool has_consistent_pattern() const override { return true; }
};
class FillCrossZag : public FillRectilinear
{
public:
Fill *clone() const override { return new FillCrossZag(*this); }
~FillCrossZag() override = default;
bool has_consistent_pattern() const override { return true; }
};
class FillLockedZag : public FillRectilinear
{
public:
Fill *clone() const override { return new FillLockedZag(*this); }
~FillLockedZag() override = default;
LockRegionParam lock_param;
void fill_surface_extrusion(const Surface *surface, const FillParams &params, ExtrusionEntitiesPtr &out) override;
bool has_consistent_pattern() const override { return true; }
void set_lock_region_param(const LockRegionParam &lock_param) override { this->lock_param = lock_param;};
void fill_surface_locked_zag(const Surface * surface,
const FillParams & params,
std::vector<std::pair<Polylines, Flow>> &multi_width_polyline);
};
Points sample_grid_pattern(const ExPolygon &expolygon, coord_t spacing, const BoundingBox &global_bounding_box);
Points sample_grid_pattern(const ExPolygons &expolygons, coord_t spacing, const BoundingBox &global_bounding_box);
Points sample_grid_pattern(const Polygons &polygons, coord_t spacing, const BoundingBox &global_bounding_box);

View file

@ -82,6 +82,13 @@ public:
bool operator==(const Flow &rhs) const { return m_width == rhs.m_width && m_height == rhs.m_height && m_nozzle_diameter == rhs.m_nozzle_diameter && m_bridge == rhs.m_bridge; }
bool operator!=(const Flow &rhs) const{
return m_width != rhs.m_width || m_height != rhs.m_height || m_nozzle_diameter != rhs.m_nozzle_diameter || m_bridge != rhs.m_bridge;
}
bool operator <(const Flow &rhs) const {
return this->mm3_per_mm() < rhs.mm3_per_mm();
}
Flow with_width (float width) const {
assert(! m_bridge);
return Flow(width, m_height, rounded_rectangle_extrusion_spacing(width, m_height), m_nozzle_diameter, m_bridge);

View file

@ -507,4 +507,11 @@ BoundingBox get_extents_rotated(const MultiPoint &mp, double angle)
return get_extents_rotated(mp.points, angle);
}
void MultiPoint::symmetric_y(const coord_t &x_axis)
{
for (Point &pt : points) {
pt(0) = 2 * x_axis - pt(0);
}
}
}

View file

@ -94,7 +94,7 @@ public:
bool intersection(const Line& line, Point* intersection) const;
bool first_intersection(const Line& line, Point* intersection) const;
bool intersections(const Line &line, Points *intersections) const;
void symmetric_y(const coord_t &y_axis);
static Points _douglas_peucker(const Points &points, const double tolerance);
static Points visivalingam(const Points& pts, const double tolerance);
static Points concave_hull_2d(const Points& pts, const double tolerence);

View file

@ -786,7 +786,7 @@ static std::vector<std::string> s_Preset_print_options {
"top_shell_layers", "top_shell_thickness", "bottom_shell_layers", "bottom_shell_thickness",
"extra_perimeters_on_overhangs", "ensure_vertical_shell_thickness", "reduce_crossing_wall", "detect_thin_wall", "detect_overhang_wall", "overhang_reverse", "overhang_reverse_threshold","overhang_reverse_internal_only", "wall_direction",
"seam_position", "staggered_inner_seams", "wall_sequence", "is_infill_first", "sparse_infill_density", "sparse_infill_pattern", "lattice_angle_1", "lattice_angle_2", "top_surface_pattern", "bottom_surface_pattern",
"infill_direction", "solid_infill_direction", "rotate_solid_infill_direction", "counterbore_hole_bridging",
"infill_direction", "solid_infill_direction", "rotate_solid_infill_direction", "counterbore_hole_bridging","infill_shift_step", "infill_rotate_step", "symmetric_infill_y_axis","skeleton_infill_density", "infill_lock_depth", "skin_infill_depth", "skin_infill_density",
"minimum_sparse_infill_area", "reduce_infill_retraction","internal_solid_infill_pattern","gap_fill_target",
"ironing_type", "ironing_pattern", "ironing_flow", "ironing_speed", "ironing_spacing", "ironing_angle", "ironing_inset",
"max_travel_detour_distance",
@ -805,8 +805,9 @@ static std::vector<std::string> s_Preset_print_options {
"support_top_z_distance", "support_on_build_plate_only","support_critical_regions_only", "bridge_no_support", "thick_bridges", "thick_internal_bridges","dont_filter_internal_bridges","enable_extra_bridge_layer", "max_bridge_length", "print_sequence", "print_order", "support_remove_small_overhang",
"filename_format", "wall_filament", "support_bottom_z_distance",
"sparse_infill_filament", "solid_infill_filament", "support_filament", "support_interface_filament","support_interface_not_for_body",
"ooze_prevention", "standby_temperature_delta", "preheat_time","preheat_steps", "interface_shells", "line_width", "initial_layer_line_width",
"inner_wall_line_width", "outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width",
"ooze_prevention", "standby_temperature_delta", "preheat_time","preheat_steps", "interface_shells", "line_width", "initial_layer_line_width", "inner_wall_line_width",
"outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width",
"skin_infill_line_width","skeleton_infill_line_width",
"top_surface_line_width", "support_line_width", "infill_wall_overlap","top_bottom_infill_wall_overlap", "bridge_flow", "internal_bridge_flow",
"elefant_foot_compensation", "elefant_foot_compensation_layers", "xy_contour_compensation", "xy_hole_compensation", "resolution", "enable_prime_tower",
"prime_tower_width", "prime_tower_brim_width", "prime_volume",

View file

@ -1384,7 +1384,7 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
if (!validate_extrusion_width(object->config(), "support_line_width", layer_height, err_msg))
return {err_msg, object, "support_line_width"};
}
for (const char *opt_key : { "inner_wall_line_width", "outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width", "top_surface_line_width" })
for (const char *opt_key : { "inner_wall_line_width", "outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width", "top_surface_line_width","skin_infill_line_width" ,"skeleton_infill_line_width"})
for (const PrintRegion &region : object->all_regions())
if (!validate_extrusion_width(region.config(), opt_key, layer_height, err_msg))
return {err_msg, object, opt_key};

View file

@ -159,7 +159,9 @@ static t_config_enum_values s_keys_map_InfillPattern {
{ "lightning", ipLightning },
{ "crosshatch", ipCrossHatch},
{ "quartercubic", ipQuarterCubic},
{ "zigzag", ipZigZag }
{ "zigzag", ipZigZag },
{ "crosszag", ipCrossZag },
{ "lockedzag", ipLockedZag }
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(InfillPattern)
@ -2385,6 +2387,8 @@ void PrintConfigDef::init_fff_params()
def->enum_values.push_back("crosshatch");
def->enum_values.push_back("quartercubic");
def->enum_values.push_back("zigzag");
def->enum_values.push_back("crosszag");
def->enum_values.push_back("lockedzag");
def->enum_labels.push_back(L("Concentric"));
def->enum_labels.push_back(L("Rectilinear"));
def->enum_labels.push_back(L("Grid"));
@ -2406,6 +2410,8 @@ void PrintConfigDef::init_fff_params()
def->enum_labels.push_back(L("Cross Hatch"));
def->enum_labels.push_back(L("Quarter Cubic"));
def->enum_labels.push_back(L("Zig Zag"));
def->enum_labels.push_back(L("Cross Zag"));
def->enum_labels.push_back(L("Locked Zag"));
def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipCrossHatch));
def = this->add("lattice_angle_1", coFloat);
@ -3082,6 +3088,99 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("infill_shift_step", coFloat);
def->label = L("Infill shift step");
def->category = L("Strength");
def->tooltip = L("This parameter adds a slight displacement to each layer of infill to create a cross texture.");
def->sidetext = L("mm");
def->min = 0;
def->max = 10;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.4));
//Orca TODO: make it support all sparse infill patterns and multiple rotate step
def = this->add("infill_rotate_step", coFloat);
def->label = L("Infill rotate step");
def->category = L("Strength");
def->tooltip = L("This parameter adds a slight rotation to each layer of infill to create a cross cross texture.");
def->sidetext = L("°");
def->min = 0;
def->max = 360;
def->mode = comDevelop;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("skeleton_infill_density", coPercent);
def->label = L("Skeleton infill density");
def->category = L("Strength");
def->tooltip = L("The remaining part of the model contour after removing a certain depth from the surface is called the skeleton. This parameter is used to adjust the density of this section."
"When two regions have the same sparse infill settings but different skeleton densities, their skeleton areas will develop overlapping sections."
"default is as same as infill density.");
def->sidetext = "%";
def->min = 0;
def->max = 100;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionPercent(25));
def = this->add("skin_infill_density", coPercent);
def->label = L("Skin infill density");
def->category = L("Strength");
def->tooltip = L("The portion of the model's outer surface within a certain depth range is called the skin. This parameter is used to adjust the density of this section."
"When two regions have the same sparse infill settings but different skin densities, This area will not be split into two separate regions."
"default is as same as infill density.");
def->sidetext = "%";
def->min = 0;
def->max = 100;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionPercent(25));
def = this->add("skin_infill_depth", coFloat);
def->label = L("Skin infill depth");
def->category = L("Strength");
def->tooltip = L("The parameter sets the depth of skin.");
def->sidetext = L("mm");
def->min = 0;
def->max = 100;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(2.0));
def = this->add("infill_lock_depth", coFloat);
def->label = L("Infill lock depth");
def->category = L("Strength");
def->tooltip = L("The parameter sets the overlapping depth between the interior and skin.");
def->sidetext = L("mm");
def->min = 0;
def->max = 100;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(1.0));
def = this->add("skin_infill_line_width", coFloatOrPercent);
def->label = L("Skin line width");
def->category = L("Strength");
def->tooltip = L("Adjust the line width of the selected skin paths.");
def->sidetext = L("mm");
def->ratio_over = "nozzle_diameter";
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(0.4, false));
def = this->add("skeleton_infill_line_width", coFloatOrPercent);
def->label = L("Skeleton line width");
def->category = L("Strength");
def->tooltip = L("Adjust the line width of the selected skeleton paths.");
def->sidetext = L("mm");
def->ratio_over = "nozzle_diameter";
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(0.4, false));
def = this->add("symmetric_infill_y_axis", coBool);
def->label = L("Symmetric infill y axis");
def->category = L("Strength");
def->tooltip = L("If the model has two parts that are symmetric about the y-axis,"
" and you want these parts to have symmetric textures, please click this option on one of the parts.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
// Orca: max layer height for combined infill
def = this->add("infill_combination_max_layer_height", coFloatOrPercent);
def->label = L("Infill combination - Max layer height");
@ -7182,7 +7281,9 @@ std::map<std::string, std::string> validate(const FullPrintConfig &cfg, bool und
"internal_solid_infill_line_width",
"top_surface_line_width",
"support_line_width",
"initial_layer_line_width" };
"initial_layer_line_width",
"skin_infill_line_width",
"skeleton_infill_line_width"};
for (size_t i = 0; i < sizeof(widths) / sizeof(widths[i]); ++ i) {
std::string key(widths[i]);
if (cfg.get_abs_value(key, max_nozzle_diameter) > 2.5 * max_nozzle_diameter) {

View file

@ -60,7 +60,7 @@ enum AuthorizationType {
enum InfillPattern : int {
ipConcentric, ipRectilinear, ipGrid, ip2DLattice, ipLine, ipCubic, ipTriangles, ipStars, ipGyroid, ipHoneycomb, ipAdaptiveCubic, ipMonotonic, ipMonotonicLine, ipAlignedRectilinear, ip3DHoneycomb,
ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, ipSupportCubic, ipSupportBase, ipConcentricInternal,
ipLightning, ipCrossHatch, ipQuarterCubic, ipZigZag,
ipLightning, ipCrossHatch, ipQuarterCubic, ipZigZag, ipCrossZag, ipLockedZag,
ipCount,
};
@ -935,6 +935,9 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, infill_direction))
((ConfigOptionFloat, solid_infill_direction))
((ConfigOptionBool, rotate_solid_infill_direction))
((ConfigOptionBool, symmetric_infill_y_axis))
((ConfigOptionFloat, infill_shift_step))
((ConfigOptionFloat, infill_rotate_step))
((ConfigOptionPercent, sparse_infill_density))
((ConfigOptionEnum<InfillPattern>, sparse_infill_pattern))
((ConfigOptionFloat, lattice_angle_1))
@ -953,7 +956,12 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionPercent, infill_wall_overlap))
((ConfigOptionPercent, top_bottom_infill_wall_overlap))
((ConfigOptionFloat, sparse_infill_speed))
//BBS
((ConfigOptionPercent, skeleton_infill_density))
((ConfigOptionPercent, skin_infill_density))
((ConfigOptionFloat, infill_lock_depth))
((ConfigOptionFloat, skin_infill_depth))
((ConfigOptionFloatOrPercent, skin_infill_line_width))
((ConfigOptionFloatOrPercent, skeleton_infill_line_width))
((ConfigOptionBool, infill_combination))
// Orca:
((ConfigOptionFloatOrPercent, infill_combination_max_layer_height))

View file

@ -1069,6 +1069,8 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "sparse_infill_filament"
|| opt_key == "solid_infill_filament"
|| opt_key == "sparse_infill_line_width"
|| opt_key == "skin_infill_line_width"
|| opt_key == "skeleton_infill_line_width"
|| opt_key == "infill_direction"
|| opt_key == "solid_infill_direction"
|| opt_key == "rotate_solid_infill_direction"
@ -1092,7 +1094,14 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "lattice_angle_1"
|| opt_key == "lattice_angle_2") {
steps.emplace_back(posInfill);
} else if (opt_key == "sparse_infill_pattern") {
} else if (opt_key == "sparse_infill_pattern"
|| opt_key == "symmetric_infill_y_axis"
|| opt_key == "infill_shift_step"
|| opt_key == "infill_rotate_step"
|| opt_key == "skeleton_infill_density"
|| opt_key == "skin_infill_density"
|| opt_key == "infill_lock_depth"
|| opt_key == "skin_infill_depth") {
steps.emplace_back(posPrepareInfill);
} else if (opt_key == "sparse_infill_density") {
// One likely wants to reslice only when switching between zero infill to simulate boolean difference (subtracting volumes),

View file

@ -461,6 +461,20 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
apply(config, &new_conf);
is_msg_dlg_already_exist = false;
}
// layer_height shouldn't be equal to zero
float skin_depth = config->opt_float("skin_infill_depth");
if (config->opt_float("infill_lock_depth") > skin_depth) {
const wxString msg_text = _(L("lock depth should smaller than skin depth.\nReset to 50% of skin depth"));
MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK);
DynamicPrintConfig new_conf = *config;
is_msg_dlg_already_exist = true;
dialog.ShowModal();
new_conf.set_key_value("infill_lock_depth", new ConfigOptionFloat(skin_depth / 2));
apply(config, &new_conf);
is_msg_dlg_already_exist = false;
}
}
void ConfigManipulation::apply_null_fff_config(DynamicPrintConfig *config, std::vector<std::string> const &keys, std::map<ObjectBase *, ModelConfig *> const &configs)
@ -515,7 +529,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
bool have_infill = config->option<ConfigOptionPercent>("sparse_infill_density")->value > 0;
// sparse_infill_filament uses the same logic as in Print::extruders()
for (auto el : { "sparse_infill_pattern", "infill_combination",
"minimum_sparse_infill_area", "sparse_infill_filament", "infill_anchor_max"})
"minimum_sparse_infill_area", "sparse_infill_filament", "infill_anchor_max","infill_shift_step","infill_rotate_step","symmetric_infill_y_axis"})
toggle_line(el, have_infill);
bool have_combined_infill = config->opt_bool("infill_combination") && have_infill;
@ -528,6 +542,19 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
bool has_infill_anchors = have_infill && config->option<ConfigOptionFloatOrPercent>("infill_anchor_max")->value > 0 && infill_anchor;
toggle_field("infill_anchor", has_infill_anchors);
//cross zag
bool is_cross_zag = config->option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value == InfillPattern::ipCrossZag;
bool is_locked_zig = config->option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value == InfillPattern::ipLockedZag;
toggle_line("infill_shift_step", is_cross_zag || is_locked_zig);
for (auto el : { "skeleton_infill_density", "skin_infill_density", "infill_lock_depth", "skin_infill_depth","skin_infill_line_width", "skeleton_infill_line_width" })
toggle_line(el, is_locked_zig);
bool is_zig_zag = config->option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value == InfillPattern::ipZigZag;
toggle_line("symmetric_infill_y_axis", is_zig_zag || is_cross_zag || is_locked_zig);
bool has_spiral_vase = config->opt_bool("spiral_mode");
toggle_line("spiral_mode_smooth", has_spiral_vase);
toggle_line("spiral_mode_max_xy_smoothing", has_spiral_vase && config->opt_bool("spiral_mode_smooth"));

View file

@ -1470,6 +1470,9 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
}
}
if (opt_key == "single_extruder_multi_material" || opt_key == "extruders_count" )
update_wiping_button_visibility();
if (opt_key == "pellet_flow_coefficient")
{
@ -1483,6 +1486,44 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
}
if (opt_key == "single_extruder_multi_material" ){
const auto bSEMM = m_config->opt_bool("single_extruder_multi_material");
wxGetApp().sidebar().show_SEMM_buttons(bSEMM);
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
}
if(opt_key == "purge_in_prime_tower")
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
if (opt_key == "enable_prime_tower") {
auto timelapse_type = m_config->option<ConfigOptionEnum<TimelapseType>>("timelapse_type");
bool timelapse_enabled = timelapse_type->value == TimelapseType::tlSmooth;
if (!boost::any_cast<bool>(value) && timelapse_enabled) {
MessageDialog dlg(wxGetApp().plater(), _L("A prime tower is required for smooth timelapse. There may be flaws on the model without prime tower. Are you sure you want to disable prime tower?"),
_L("Warning"), wxICON_WARNING | wxYES | wxNO);
if (dlg.ShowModal() == wxID_NO) {
DynamicPrintConfig new_conf = *m_config;
new_conf.set_key_value("enable_prime_tower", new ConfigOptionBool(true));
m_config_manipulation.apply(m_config, &new_conf);
}
wxGetApp().plater()->update();
}
bool is_precise_z_height = m_config->option<ConfigOptionBool>("precise_z_height")->value;
if (boost::any_cast<bool>(value) && is_precise_z_height) {
MessageDialog dlg(wxGetApp().plater(), _L("Enabling both precise Z height and the prime tower may cause the size of prime tower to increase. Do you still want to enable?"),
_L("Warning"), wxICON_WARNING | wxYES | wxNO);
if (dlg.ShowModal() == wxID_NO) {
DynamicPrintConfig new_conf = *m_config;
new_conf.set_key_value("enable_prime_tower", new ConfigOptionBool(false));
m_config_manipulation.apply(m_config, &new_conf);
}
wxGetApp().plater()->update();
}
update_wiping_button_visibility();
}
if (opt_key == "single_extruder_multi_material" ){
const auto bSEMM = m_config->opt_bool("single_extruder_multi_material");
wxGetApp().sidebar().show_SEMM_buttons(bSEMM);
@ -2166,6 +2207,18 @@ void TabPrint::build()
optgroup = page->new_optgroup(L("Infill"), L"param_infill");
optgroup->append_single_option_line("sparse_infill_density");
optgroup->append_single_option_line("sparse_infill_pattern", "fill-patterns#infill types and their properties of sparse");
optgroup->append_single_option_line("skin_infill_density");
optgroup->append_single_option_line("skeleton_infill_density");
optgroup->append_single_option_line("infill_lock_depth");
optgroup->append_single_option_line("skin_infill_depth");
optgroup->append_single_option_line("skin_infill_line_width", "parameter/line-width");
optgroup->append_single_option_line("skeleton_infill_line_width", "parameter/line-width");
optgroup->append_single_option_line("symmetric_infill_y_axis");
optgroup->append_single_option_line("infill_shift_step");
//Orca TODO: hide it for now, make it support all sparse infill patterns and multiple rotate step
// optgroup->append_single_option_line("infill_rotate_step");
optgroup->append_single_option_line("lattice_angle_1");
optgroup->append_single_option_line("lattice_angle_2");
optgroup->append_single_option_line("infill_anchor_max");