-
-
Notifications
You must be signed in to change notification settings - Fork 886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wall ordering #1562
Fix wall ordering #1562
Conversation
Fixes: |
24a94e2
to
a526a46
Compare
Results of tests on Applicatas dataset (assembled from models from the internet). Tested on S5 with Generic PLA at 0.1mm layer height. Travel times: ACAM: airhose splitter Alahamra David: Decking fixture: Jet engine Combustion_and_HPT_Casing In all cases this PR reduced the Arachne travel time; in some cases this PR reduced travel time even more than before Arachne. |
Sort of the same story for this one, except in this case the build-server is down for some reason. Can you run the test manually & report back? Otherwise we can do that, but it might slow down the process a bit. |
With the above model These are the travel times: |
e3177f7
to
1409d46
Compare
Is this PR in a state where it's suitable for testing? I'm the reporter of #1495 and would like to test if so. |
Yes it is. If you are able to test from source then we would be very interested in your findings. Before it will be merged some developers will review my code and some more tests will be performed, but there's always a chance for bugs to fall through, so I would be very happy if you could help our testing efforts. |
OK, I can confirm at least for my test case in that report that the problem is fixed. |
Unfortunately it segfaulted trying to slice a Benchy. |
The crash occurs with |
Could you please save your project as a 3mf file, put it in a zip and upload it here? |
I don't use or have the Cura gui, just CuraEngine. I can probably make you a minimal reproducing testcase with that. |
OK, all that's required to reproduce the issue is |
Thanks. This is a problem on master. Fixed in fa196db |
OK, good to know. It was not present in master but appeared when checking out your PR branch which is a ways behind master and apparently doesn't merge cleanly. I'll try the merge or wait for you to get it merged upstream. |
The bug was in master since somehwere last week, so perhaps you hadn't pulled he bug in yet. I'll merge master into this branch soon. |
…all lines when the outline and hole regions interact then the ordering is more strict than need be. This is because adjacency information is either expensive to compute, or requires a lot of score-keeping in arachne
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed part I would submit (the incomplete) review earlier. Expect part 2/2 of the review soon.
src/WallToolPaths.cpp
Outdated
if (wall_idx >= wall_lines.size()) | ||
{ | ||
wall_lines.resize(wall_idx + 1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As wall_lines
was just cleared before it's size is always 0, making the statement wall_idx >= wall_lines.size()
always true
if (wall_idx >= wall_lines.size()) | |
{ | |
wall_lines.resize(wall_idx + 1); | |
} | |
wall_lines.resize(wall_idx + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally I also don't really get why you would want to resize the vector to wall_idx
. Seems like the vector needs a size of closed_polygons.size()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find that code and github can't find the commit. Looks like you're looking at outdated commits. Idk.
src/utils/polygon.cpp
Outdated
auto it = node_to_index.find(child); | ||
assert(it != node_to_index.end() && "Each PolyNode should be mapped to the corresponding Polygon index!"); | ||
ret[index].emplace_back(it->second); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this part is deserving of a comment. Why shoudn't it
equal node_to_index.end()
, and why push it->second
to ret[index]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. This exact line doesn't appear anymore in the latest branch. Please check if the new code is still unclear to you.
Old code was less intelligible.
Fixes #1552. |
Simply use a SparseGrid to see which lines are adjacent to each other, rather than using nesting informtoin and info from region_idx. This makes the code simpler to read, the algorithm more reobust to when stitching hasn't been accomplished where it should have, while have negligle impact in slicing time.
We didn't check the distance between two lines properly, so wall lines which weren;t adjacent could end up with an order constraint. This effectively meant that in some cases Optimize Wall Printing Order acted as if it wasn't enabled.
The test assumed that the pat hwas closed. Only for closed polygons is a size of 2 or 1 not allowed.
…erse direction Polygonal walls with even index should always be closed into polygons, but if they somehow weren't closed, we should at least retain their printing direction.
Is better for finding neighboring walls in uncommon cases where the vertices of consectuive walls are not next to each other.
Mostly just code conventions and documentation. Please pay special attention when reviewing the last two commits, since they are behavioral changes/fixes. |
An extrusion junction lies on an edge of the MAT, but since each edge has two half edges which may belong to a different region, the extrusion junction should have recorded two region_ids. The region_id recorded in the junction was therefore not reliable, and code depending on it was very bug-prone.
It's not used anymore.
@@ -38,13 +39,14 @@ void TopSurface::setAreasFromMeshAndLayerNumber(SliceMeshStorage& mesh, size_t l | |||
} | |||
} | |||
|
|||
bool TopSurface::ironing(const SliceMeshStorage& mesh, const GCodePathConfig& line_config, LayerPlan& layer) const | |||
bool TopSurface::ironing(const SliceDataStorage& storage, const SliceMeshStorage& mesh, const GCodePathConfig& line_config, LayerPlan& layer, const FffGcodeWriter& gcode_writer) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't touch the order of ironing lines, only of the walls of ironing.
This PR builds on #1554
That PR should be merged first - or it will be automatically merged with this one.
This PR comes with an accompanying frontend PR: Ultimaker/Cura#11334
Please merge both simultaneously.
This PR solves a number of bugs all relating to the order in which walls are printed:
Code changes:
Behavior changes:
Benefits:
Possibly affected behavior:
Before:
After:
UM3_santa.3mf.renamed.zip
Before:
After:
UM3_perimeter_hole_connections.3mf.renamed.zip
The following items are not addressed by this PR, but came up during review of the surrounding code and during testing: