Cura icon indicating copy to clipboard operation
Cura copied to clipboard

Layer.py: Simplify if else statement

Open digitalfrost opened this issue 3 years ago • 2 comments

digitalfrost avatar Jul 22 '22 15:07 digitalfrost

Have you considered the performance change? This change introduces a comparison for each polygon.

On a general note, please do provide a description for a PR; let us know how your change improves the code.

fieldOfView avatar Jul 23 '22 09:07 fieldOfView

Yes, I did. I thought the improved readability was worth the trade off and would facilitate further refactoring…

I also later noticed lines 91 and 93 where the polygons are looped over again you find the same if make_mesh else clause

I think the change I propose makes the code more consistent.

digitalfrost avatar Jul 23 '22 18:07 digitalfrost

We discussed and while this does shorten the code, given that this results in worse performance I'm going to have to reject the PR, unfortunately.

Joeydelarago avatar Oct 21 '22 15:10 Joeydelarago