Skip to content

Commit

Permalink
perf: Do fewer polygon ops
Browse files Browse the repository at this point in the history
This saves 3.5% of runtime on the sum of all the examples.
  • Loading branch information
eyal0 committed Feb 5, 2021
1 parent 9066dbc commit 71ac38f
Show file tree
Hide file tree
Showing 54 changed files with 11,887 additions and 12,266 deletions.
2 changes: 1 addition & 1 deletion surface_vectorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ vector<multi_polygon_type_fp> Surface_vectorial::offset_polygon(
buffered_milling_poly = buffered_milling_poly + path_minimum;
}
}
if (mask) {
if (mask && !bg::covered_by(buffered_milling_poly, mask->vectorial_surface->first)) {
// Don't mill outside the mask because that's a waste.
// But don't mill into the trace itself.
// And don't mill into other traces.
Expand Down
8 changes: 4 additions & 4 deletions testing/gerbv_example/backtrack/expected/processed_front.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 19 additions & 2 deletions testing/gerbv_example/backtrack/expected/test-F.Cu-front-0.3mm.nc
Original file line number Diff line number Diff line change
Expand Up @@ -168,26 +168,34 @@ G01 X5.33697 Y5.53408
G01 X5.33697 Y4.62587
G01 X5.38856 Y4.63613
G01 X5.40578 Y4.58038
G01 X5.40217 Y4.57944
G01 X5.40578 Y4.58038
G01 X5.55061 Y4.18780
G01 X5.73024 Y3.81726
G01 X5.72661 Y3.81483
G01 X5.73024 Y3.81726
G01 X5.80390 Y3.72610
G01 X5.80078 Y3.72387
G01 X5.80390 Y3.72610
G01 X6.13067 Y3.38582
G01 X6.35815 Y3.19154
G01 X6.35569 Y3.18790
G01 X6.35815 Y3.19154
G01 X6.51314 Y3.10802
G01 X6.89737 Y2.94297
G01 X6.94766 Y2.92311
G01 X7.17705 Y2.85318
G01 X7.17626 Y2.84960
G01 X7.17705 Y2.85318
G01 X7.41093 Y2.83144
G01 X7.35620 Y2.83266
G01 X7.82917 Y2.82994
G01 X8.06290 Y2.85316
G01 X8.06369 Y2.84945
G01 X8.06290 Y2.85316
G01 X8.29239 Y2.92290
G01 X8.72678 Y3.10805
G01 X8.88182 Y3.19154
G01 X8.88423 Y3.18790
G01 X8.88182 Y3.19154
G01 X8.88388 Y3.18854
G01 X8.88182 Y3.19154
G01 X9.14814 Y3.42270
Expand All @@ -214,31 +222,40 @@ G01 X9.14814 Y6.73727
G01 X8.88182 Y6.96841
G01 X8.88423 Y6.97207
G01 X8.88182 Y6.96841
G01 X8.88390 Y6.97144
G01 X8.88182 Y6.96841
G01 X8.72678 Y7.05193
G01 X8.34260 Y7.21698
G01 X8.29231 Y7.23684
G01 X8.06290 Y7.30679
G01 X8.06376 Y7.31109
G01 X8.06290 Y7.30679
G01 X7.88375 Y7.32696
G01 X7.82907 Y7.32851
G01 X7.41093 Y7.32851
G01 X7.35622 Y7.32696
G01 X7.17705 Y7.30679
G01 X7.17619 Y7.31109
G01 X7.17705 Y7.30679
G01 X6.94766 Y7.23684
G01 X6.89737 Y7.21700
G01 X6.51314 Y7.05193
G01 X6.35813 Y6.96841
G01 X6.35569 Y6.97207
G01 X6.35813 Y6.96841
G01 X6.13042 Y6.77441
G01 X6.09183 Y6.73727
G01 X5.80390 Y6.43387
G01 X5.73024 Y6.34268
G01 X5.72658 Y6.34512
G01 X5.73024 Y6.34268
G01 X5.57139 Y6.02132
G01 X5.55061 Y5.97218
G01 X5.40581 Y5.57959
G01 X5.38853 Y5.52384
G01 X5.38416 Y5.52470
G01 X5.38853 Y5.52384
G01 X5.36623 Y5.10662
G01 X5.36666 Y5.05336
G01 X5.39623 Y5.05645
G01 X5.43994 Y4.64063
Expand Down
8 changes: 4 additions & 4 deletions testing/gerbv_example/backtrack/expected/traced_front.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 71ac38f

Please sign in to comment.