Skip to content

Force fast-csg numbers to be exact to improve pathological cases.#4099

Merged
t-paul merged 2 commits intoopenscad:masterfrom
ochafik:fast-csg-exact-callbacks
Feb 7, 2022
Merged

Force fast-csg numbers to be exact to improve pathological cases.#4099
t-paul merged 2 commits intoopenscad:masterfrom
ochafik:fast-csg-exact-callbacks

Conversation

@ochafik
Copy link
Contributor

@ochafik ochafik commented Feb 7, 2022

Bring in features that force lazy numbers to be exact to improve files like

e.g. examples/Old/example024.scad (see here)

Lazy numbers retain their entire arithmetic tree, which can grow bigger and bigger and can cause "surprising" performance degradation.

  • The feature fast-csg-exact forces numbers to exact after each operation, which slows every operation down a bit but does a good job on some bad cases.
  • The feature fast-csg-exact-callbacks doesn't wait for corefinement operations to finish to make its resulting new numbers exact: it registers a callback within corefinement operations that gets called for each new face being created. This slows down more models, but may further fix other bad cases.

See more details in @sloriot's comment where he suggested this workaround

This will need more test in real life to decide what to retain.

Currently running my benchmarks with all the feature combos, will post the results shortly.

Olivier Chafik and others added 2 commits February 7, 2022 00:27
…pathological cases.

e.g. examples/Old/example024.scad

Lazy numbers retain their entire arithmetic tree, which can grow bigger and bigger and can cause "surprising" performance degradation.
- The feature fast-csg-exact forces numbers to exact after each operation, which slows every operation down a bit but does a good job on some bad cases.
- The feature fast-csg-exact-callbacks doesn't wait for corefinement operations to finish to make its resulting new numbers exact: it registers a callback within corefinement operations that gets called for each new face being created. This slows down more models, but may further fix other bad cases.

This will need more test in real life to decide what to retain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants