-
-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor async CSG operations to dedicated module, unify sync/async operations, and adopt async-first approach #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
@copilot I see another |
Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
Good catch! I've refactored the |
Okay looking good @copilot ! I think we can default to
|
Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
I've made the requested changes! The |
This PR addresses code duplication in the CSG (Constructive Solid Geometry) operations by refactoring them into a dedicated module structure, unifying synchronous and asynchronous implementations, and adopting an async-first approach.
Changes Made
Code Organization
app/polytree.coffee
toapp/async/csg.coffee
Polytree.async.unite
,Polytree.async.subtract
,Polytree.async.intersect
Polytree.async.uniteArray
,Polytree.async.subtractArray
,Polytree.async.intersectArray
Polytree.async.operation
Duplication Removal
Removed duplicate synchronous array functions that were essentially the same as their async counterparts:
Polytree.uniteArray
(synchronous version)Polytree.subtractArray
(synchronous version)Polytree.intersectArray
(synchronous version)Unified
Polytree.operation
andhandleObjectForOp
functions with anasync
parameter:async
parameter now defaults totrue
for async-first approachAsync-First Approach
async = true
)realtime.html
to usePolytree.async.uniteArray
and proper async handlingBuild Process Updates
package.json
build script to includeapp/async/csg.js
in the bundle concatenationPolytree.async.*
methods after the refactoringBenefits
Testing
All existing tests pass, confirming that the refactoring maintains full functionality while improving the codebase structure and embracing modern async patterns.
Created from VS Code via the GitHub Pull Request extension.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.