Conversation
|
I see quite significant (10x) speedup with this PR. We could make this roughly 2x faster, but that would require many more changes. |
Codecov Report
@@ Coverage Diff @@
## master #768 +/- ##
=======================================
Coverage 94.64% 94.65%
=======================================
Files 32 32
Lines 7250 7256 +6
Branches 789 789
=======================================
+ Hits 6862 6868 +6
Misses 255 255
Partials 133 133
Continue to review full report at Codecov.
|
|
Wow, this code: import cadquery as cq
from itertools import product
num = 49
hole_dim = 1
wall_thick = 0.2
outer_dim = num * hole_dim + (num + 1) * wall_thick
vals = [wall_thick + (hole_dim + wall_thick) * idx for idx in range(num)]
points = [(x, y) for x, y in product(vals, repeat=2)]
grid = (
cq.Workplane()
.rect(outer_dim, outer_dim, centered=False)
.pushPoints(points)
.rect(hole_dim, hole_dim, centered=False)
.extrude(2)
)went from 111 seconds down to 4.4s. That's fantastic, thanks very much @adam-urbanczyk! |
marcus7070
left a comment
There was a problem hiding this comment.
I've rendered a bunch of my models with this code now and nothing has broken, looks great to me!
jmwright
left a comment
There was a problem hiding this comment.
Looks good. Thanks a lot @adam-urbanczyk ! This yields incredible improvements.
Related to #766