mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 05:36:03 +08:00
simplifed choice of seam spot in the next layer removed checks for similarity.
increased raycasting precision a little smoothen the B-splines increasing the number of points per segment (from 8 to 14)
This commit is contained in:
parent
e42448d31b
commit
faaaf4148e
@ -1112,9 +1112,8 @@ std::optional<std::pair<size_t, size_t>> SeamPlacer::find_next_seam_in_layer(
|
||||
return {std::pair<size_t, size_t> {layer_idx, nearest_point.perimeter.seam_index}};
|
||||
}
|
||||
|
||||
// Next compare nearest and nearby point. If they are similar pick nearest, Otherwise expect curvy lines on smooth surfaces like chimney of benchy model
|
||||
if (comparator.are_similar(nearest_point, best_nearby_point)
|
||||
&& comparator.is_first_not_much_worse(nearest_point, next_layer_seam)) {
|
||||
// First try to align the nearest, then try the best nearby
|
||||
if (comparator.is_first_not_much_worse(nearest_point, next_layer_seam)) {
|
||||
return {std::pair<size_t, size_t> {layer_idx, nearest_point_index}};
|
||||
}
|
||||
// If nearest point is not good enough, try it with the best nearby point.
|
||||
@ -1237,13 +1236,12 @@ void SeamPlacer::align_seam_points(const PrintObject *po, const SeamPlacerImpl::
|
||||
}
|
||||
}
|
||||
|
||||
Vec2f back_attractor = 2.0f * unscaled(po->bounding_box().max).cast<float>();
|
||||
//sort them before alignment. Alignment is sensitive to initializaion, this gives it better chance to choose something nice
|
||||
std::sort(seams.begin(), seams.end(),
|
||||
[&comparator, &layers, &back_attractor](const std::pair<size_t, size_t> &left,
|
||||
[&comparator, &layers](const std::pair<size_t, size_t> &left,
|
||||
const std::pair<size_t, size_t> &right) {
|
||||
return comparator.is_first_better(layers[left.first].points[left.second],
|
||||
layers[right.first].points[right.second], back_attractor);
|
||||
layers[right.first].points[right.second]);
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -113,7 +113,7 @@ class SeamPlacer {
|
||||
public:
|
||||
static constexpr size_t raycasting_decimation_target_triangle_count = 10000;
|
||||
// for subdivision, both following criteria are considered, and the one with less resulting triangles is used
|
||||
static constexpr size_t raycasting_subdivision_target_triangle_count = 15000;
|
||||
static constexpr size_t raycasting_subdivision_target_triangle_count = 20000;
|
||||
static constexpr float raycasting_subdivision_target_length = 2.0f;
|
||||
//square of number of rays per triangle
|
||||
static constexpr size_t sqr_rays_per_triangle = 7;
|
||||
@ -140,7 +140,7 @@ public:
|
||||
// minimum number of seams needed in cluster to make alignment happen
|
||||
static constexpr size_t seam_align_minimum_string_seams = 6;
|
||||
// points covered by spline; determines number of splines for the given string
|
||||
static constexpr size_t seam_align_seams_per_segment = 8;
|
||||
static constexpr size_t seam_align_seams_per_segment = 14;
|
||||
|
||||
//The following data structures hold all perimeter points for all PrintObject.
|
||||
std::unordered_map<const PrintObject*, PrintObjectSeamData> m_seam_per_object;
|
||||
|
Loading…
x
Reference in New Issue
Block a user