For open polylines, only add two endpoints to line bucket grid
For open polylines, only add two endpoints to line bucket grid

The intermediary vertices are irrelevant for those, since we can't start from them anyway. This should reduce computation time to create the line bucket grid, and reduce false positives of tests for nearby candidates.
With a quick test (N=1) I found a performance improvement of 1% over the entire slice, which falls within my measurement inaccuracy. Maybe it's not relevant in my case, but in theory it should improve things.

Contributes to issue CURA-7558.

Ultimaker/CuraEngine,Ultimaker/CuraEngine