Skip to content

Commit

Permalink
Fix deactivate seam visibility search if disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Jun 10, 2024
1 parent 6672c13 commit 67279c5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/libslic3r/Fill/Fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ void Layer::make_ironing()
fill.init_spacing(ironing_params.line_spacing, fill_params);
fill.can_angle_cross = region_config.fill_angle_cross.value;
fill.angle = float(ironing_params.angle);
fill.link_max_length = (coord_t)scale_(3. * fill.get_spacing());
fill.link_max_length = scale_t(3. * fill.get_spacing());
double extrusion_height = ironing_params.height * fill.get_spacing() / nozzle_dmr;
//FIXME FLOW decide if it's good
// note: don't use filament_max_overlap, as it's a top surface
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Fill/FillPlanePath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void FillPlanePath::_fill_surface_single(
{
expolygon.rotate(- direction.first);

coord_t distance_between_lines = coord_t(scale_(this->get_spacing()) / params.density);
coord_t distance_between_lines = scale_t(this->get_spacing() / params.density);

// align infill across layers using the object's bounding box
// Rotated bounding box of the whole object.
Expand Down
8 changes: 6 additions & 2 deletions src/libslic3r/GCode/SeamPlacer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,9 @@ void compute_global_occlusion(GlobalModelInfo &result, const PrintObject *po,
throw_if_canceled();
BOOST_LOG_TRIVIAL(debug)
<< "SeamPlacer: build AABB tree: end";
bool has_seam_visibility = po->config().seam_visibility.value && po->config().seam_position.value == SeamPosition::spCost;
result.mesh_samples_visibility = raycast_visibility(raycasting_tree, triangle_set, result.mesh_samples,
negative_volumes_start_index, !po->config().seam_visibility.value);
negative_volumes_start_index, !has_seam_visibility);
throw_if_canceled();
#ifdef DEBUG_FILES
result.debug_export(triangle_set);
Expand Down Expand Up @@ -840,7 +841,10 @@ struct SeamComparator {
travel_importance = (float)po.config().seam_travel_cost.get_abs_value(1.f);
angle_importance = (float)po.config().seam_angle_cost.get_abs_value(1.f);
}
visibility_importance = po.config().seam_visibility.value ? 1.f : 0.f;
visibility_importance = (po.config().seam_visibility.value &&
po.config().seam_position.value == SeamPosition::spCost) ?
1.f :
0.f;
}

// Standard comparator, must respect the requirements of comparators (e.g. give same result on same inputs) for sorting usage
Expand Down
12 changes: 6 additions & 6 deletions src/libslic3r/SupportMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3417,7 +3417,7 @@ static inline void fill_expolygon_generate_paths(
float density,
ExtrusionRole role,
const Flow &flow,
coordf_t spacing)
double spacing)
{
assert(!fill_params.use_arachne);
FillParams new_params = fill_params;
Expand All @@ -3440,7 +3440,7 @@ static inline void fill_expolygons_generate_paths(
float density,
ExtrusionRole role,
const Flow &flow,
coordf_t spacing)
double spacing)
{
for (ExPolygon& expoly : expolygons)
fill_expolygon_generate_paths(dst, std::move(expoly), filler, fill_params, density, role, flow, spacing);
Expand All @@ -3453,7 +3453,7 @@ static inline void fill_expolygons_generate_paths(
float density,
ExtrusionRole role,
const Flow &flow,
coordf_t spacing,
double spacing,
const PrintRegionConfig& region_config)
{
FillParams fill_params;
Expand Down Expand Up @@ -4401,7 +4401,7 @@ void PrintObjectSupportMaterial::generate_toolpaths(
//filler->layer_id = support_layer_id; // don't do that, or the filler will rotate thigns from that layerid
filler->z = support_layer.print_z;
float supp_density = m_support_params.interface_density;
coordf_t filler_spacing;
double filler_spacing;
//if first layer and solid first layer : draw concentric with 100% density
if (support_layer.id() == 0 && layer_ex.layer->bottom_z <= 0) {
filler = filler_first_layer_ptr.get();
Expand Down Expand Up @@ -4441,7 +4441,7 @@ void PrintObjectSupportMaterial::generate_toolpaths(
// Base interface layers under soluble interfaces
if ( ! base_interface_layer.empty() && ! base_interface_layer.polygons_to_extrude().empty()) {
Fill *filler = filler_base_interface.get();
coordf_t filler_spacing = filler->get_spacing();
double filler_spacing = filler->get_spacing();
//FIXME Bottom interfaces are extruded with the briding flow. Some bridging layers have its height slightly reduced, therefore
// the bridging flow does not quite apply. Reduce the flow to area of an ellipse? (A = pi * a * b)
assert(! base_interface_layer.layer->bridging);
Expand All @@ -4465,7 +4465,7 @@ void PrintObjectSupportMaterial::generate_toolpaths(
// Base support or flange.
if (! base_layer.empty() && ! base_layer.polygons_to_extrude().empty()) {
Fill *filler = filler_support.get();
coordf_t filler_spacing = m_support_params.support_material_flow.spacing();
double filler_spacing = m_support_params.support_material_flow.spacing();
// We don't use $base_flow->spacing because we need a constant spacing
// value that guarantees that all layers are correctly aligned.
assert(! base_layer.layer->bridging);
Expand Down

0 comments on commit 67279c5

Please sign in to comment.