mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 07:28:59 +08:00
improved triangle tracking in triangle selector - if not hit registered, nearest triangle is taken instead
This commit is contained in:
parent
d5a584a2c2
commit
9294d5e604
@ -119,7 +119,6 @@ public:
|
||||
|
||||
class StabilityAccumulator {
|
||||
private:
|
||||
Polygon base_convex_hull { };
|
||||
Points support_points { };
|
||||
Vec3f centroid_accumulator = Vec3f::Zero();
|
||||
float accumulated_volume { };
|
||||
@ -384,7 +383,7 @@ void check_extrusion_entity_stability(const ExtrusionEntity *entity,
|
||||
if (distance_from_last_support_point > params.min_distance_between_support_points &&
|
||||
bridging_acc.distance // if unsupported distance is larger than bridge distance linearly decreased by curvature, enforce supports.
|
||||
> params.bridge_distance
|
||||
/ (bridging_acc.max_curvature
|
||||
/ (1.0f + bridging_acc.max_curvature
|
||||
* params.bridge_distance_decrease_by_curvature_factor / PI)) {
|
||||
current_segment.add_support_point(current, 0.0f); // Do not count extrusion supports into the sticking force. They can be very densely placed, causing algorithm to overestimate stickiness.
|
||||
issues.supports_nedded.emplace_back(to_vec3f(current), 1.0);
|
||||
|
@ -11,7 +11,7 @@ struct Params {
|
||||
const float gravity_constant = 9806.65f; // mm/s^2; gravity acceleration on Earth's surface, algorithm assumes that printer is in upwards position.
|
||||
|
||||
float bridge_distance = 10.0f; //mm
|
||||
float bridge_distance_decrease_by_curvature_factor = 5.0f; // >0 REQUIRED; allowed bridge distance = bridge_distance / (this factor * (curvature / PI) )
|
||||
float bridge_distance_decrease_by_curvature_factor = 5.0f; // allowed bridge distance = bridge_distance / (this factor * (curvature / PI) )
|
||||
|
||||
float min_distance_between_support_points = 0.5f;
|
||||
|
||||
@ -21,7 +21,7 @@ struct Params {
|
||||
|
||||
float support_points_interface_radius = 0.5f; // mm
|
||||
|
||||
float max_acceleration = 1000.0f; // mm/s^2 ; max acceleration of object (bed) in XY
|
||||
float max_acceleration = 9*1000.0f; // mm/s^2 ; max acceleration of object (bed) in XY (NOTE: The max hit is received by the object in the jerk phase, so the usual machine limits are too low)
|
||||
float filament_density = 1.25f * 0.001f; // g/mm^3 ; Common filaments are very lightweight, so precise number is not that important
|
||||
|
||||
float tolerable_extruder_conflict_force = 50.0f * gravity_constant; // force that can occasionally push the model due to various factors (filament leaks, small curling, ... ); current value corresponds to weight of X grams
|
||||
|
@ -29,6 +29,14 @@ void TriangleSelectorWrapper::enforce_spot(const Vec3f &point, const Vec3f &orig
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
size_t hit_idx_out;
|
||||
Vec3f hit_point_out;
|
||||
AABBTreeIndirect::squared_distance_to_indexed_triangle_set(mesh.its.vertices, mesh.its.indices, triangles_tree, point, hit_idx_out, hit_point_out);
|
||||
std::unique_ptr<TriangleSelector::Cursor> cursor = std::make_unique<TriangleSelector::Sphere>(
|
||||
point, origin, radius, Transform3d::Identity(), TriangleSelector::ClippingPlane { });
|
||||
selector.select_patch(hit_idx_out, std::move(cursor), EnforcerBlockerType::ENFORCER, Transform3d::Identity(),
|
||||
true, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user