Closed scifuentes closed 7 years ago
That's a really interesting optimization! It may take me a few days to take a look at this as deeply as it deserves, but congratulations for speeding things up so much!
Sorry I left this for so long. This is great!
Don't know if you're getting notified there, @conorpp, but I opened Issue #79 to handle this. Haven't been able to duplicate this problem yet, but would appreciate input over at #79 if you can help with bug duplication. Cheers!
Hey @etjones, sorry, looks like I missed a step. This should duplicate the bug (tested this time).
r = cube(10)
r -= cube(1) # missed step
p = cube(10)
p = r * p
r -= p
scad_render(r)
Consecutive sums/subtractions/multiplications are merged into the same transformation instead of nested as independent ones eg: cube(1)+cube(2)+cube(3)
current, nested:
proposed, merged:
While it do not seems to have any notable impact on the render time at OpenScad for the difference and intersection transforms it have a considerable impact for the unions: On the simple case below it cut the render time to a third, on other cases the nested code just hanged there for many minutes -till patience run out actually- while it took ~1min for the merged code to render
Simple test case, render time: union :
OpenScad console output ...