mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Refactor, fix wall normals and gap detection.
This commit is contained in:
parent
ddd0a9abb6
commit
b7e3ee0709
2 changed files with 43 additions and 35 deletions
|
@ -2164,7 +2164,10 @@ public:
|
|||
m_cfg.base_radius_mm + EPSILON;
|
||||
|
||||
while(!found && alpha < 2*PI) {
|
||||
for (unsigned n = 0; n < needpillars; n++) {
|
||||
for (unsigned n = 0;
|
||||
n < needpillars && (!n || canplace[n - 1]);
|
||||
n++)
|
||||
{
|
||||
double a = alpha + n * PI / 3;
|
||||
Vec3d s = sp;
|
||||
s(X) += std::cos(a) * r;
|
||||
|
@ -2173,11 +2176,12 @@ public:
|
|||
|
||||
// Check the path vertically down
|
||||
auto hr = bridge_mesh_intersect(s, {0, 0, -1}, pillar().r);
|
||||
Vec3d gndsp{s(X), s(Y), gnd};
|
||||
|
||||
// If the path is clear, check for pillar base collisions
|
||||
canplace[n] = std::isinf(hr.distance())
|
||||
&& m_mesh.squared_distance({s(X), s(Y), gnd})
|
||||
> min_dist;
|
||||
canplace[n] = std::isinf(hr.distance()) &&
|
||||
std::sqrt(m_mesh.squared_distance(gndsp)) >
|
||||
min_dist;
|
||||
}
|
||||
|
||||
found = std::all_of(canplace.begin(), canplace.end(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue