zalo / CascadeStudio

A Full Live-Scripted CAD Kernel in the Browser
https://zalo.github.io/CascadeStudio/
MIT License
998 stars 122 forks source link

overload Difference so that you can separately choose to keep the mainObject and/or the objectsToSubtract #110

Closed lukebarlow closed 2 years ago

lukebarlow commented 2 years ago

This small changes allows you to cut out the space from one object to fit another, whilst keeping two objects in the scene, rather than one or three. I found it useful for rebate joins in wood.

e.g.

Difference( Box(10, 2, 10), [Translate([4, 1, 0], Box(2, 10, 10))], [false, true] )

image

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/zalo/cascade-studio/AA6Uvir9eptov3RarMVDqy6nNMNb
✅ Preview: https://cascade-studio-git-fork-lukebarlow-master-zalo.vercel.app

zalo commented 2 years ago

Apologies for the late look (Github isn't notifying me for some reason; I notice I have to @ the maintainers in other projects in my PRs too).

Code looks good (I appreciate the array check for backwards compatibility).

My original intuition was that the array would be [mainBody, toolBody1, toolBody2, etc.], but the tooltip documentation is clear so there isn't an issue. Merging...

lukebarlow commented 2 years ago

Thanks! I'll @ you in future, if anything comes up