fix(build): restore ImageMap outer-wall widths, pass model_rotation_rad, Polyline3/Point3 in LayerRegion

This commit is contained in:
thysson2701
2026-07-22 14:34:23 +02:00
parent 2d7a3165d4
commit 15b094540f

View File

@@ -297,8 +297,8 @@ static void perimeter_texture_accumulate_path_image_weights_for_path(const Extru
const double pitch_scaled = std::max(1.0, double(scale_(context.high_resolution_texture_sampling ? 0.08 : 0.16)));
for (size_t idx = 1; idx < path.polyline.points.size(); ++idx) {
const Point &a = path.polyline.points[idx - 1];
const Point &b = path.polyline.points[idx];
const Point3 &a = path.polyline.points[idx - 1];
const Point3 &b = path.polyline.points[idx];
const double dx = double(b.x()) - double(a.x());
const double dy = double(b.y()) - double(a.y());
const double len = std::hypot(dx, dy);
@@ -1853,7 +1853,7 @@ static void perimeter_texture_append_recolor_path_piece(std::vector<PerimeterTex
unscale<double>(polyline.length()) + unscale<double>(std::max<double>(1.0, double(SCALED_EPSILON))) <
2.0 * double(source.width))
extruder_override = -1;
ExtrusionPath *path = new ExtrusionPath(std::move(polyline), source);
ExtrusionPath *path = new ExtrusionPath(Polyline3(std::move(polyline)), source);
path->inset_idx = source.inset_idx;
pieces.push_back(PerimeterTextureRecolorEntityPiece{ extruder_override, path });
}
@@ -1958,8 +1958,8 @@ static bool perimeter_texture_split_path_by_recolor_masks(const ExtrusionPath
bool saw_override = false;
for (size_t idx = 1; idx < path.polyline.points.size(); ++idx) {
const Point &a = path.polyline.points[idx - 1];
const Point &b = path.polyline.points[idx];
const Point a = path.polyline.points[idx - 1].to_point();
const Point b = path.polyline.points[idx].to_point();
if (a == b)
continue;
saw_segment = true;
@@ -2847,6 +2847,11 @@ void LayerRegion::make_perimeters(const SurfaceCollection &slices, const LayerRe
(this->layer()->id() >= size_t(region_config.bottom_shell_layers.value) &&
this->layer()->print_z >= region_config.bottom_shell_thickness - EPSILON);
// ImageMap: outer-wall widths used by the texture/contoning perimeter paths.
const float texture_external_width_mm =
std::max(0.05f, float(print_config.texture_mapping_outer_wall_gradient_max_line_width.value));
const float normal_external_width_mm = std::max(0.05f, float(this->flow(frExternalPerimeter).width()));
double model_rotation_rad = 0.0;
if (region_config.align_infill_direction_to_model) {
auto m = this->layer()->object()->trafo().matrix();
@@ -2990,6 +2995,7 @@ void LayerRegion::make_perimeters(const SurfaceCollection &slices, const LayerRe
&this->layer()->object()->config(),
&print_config,
spiral_mode,
model_rotation_rad,
// output:
&this->perimeters,