Skip to content
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

Implement 2D boolean operations #943

Closed
hannobraun opened this issue Aug 11, 2022 · 5 comments
Closed

Implement 2D boolean operations #943

hannobraun opened this issue Aug 11, 2022 · 5 comments
Labels
topic: core Issues relating to core geometry, operations, algorithms type: feature New features and improvements to existing features
Milestone

Comments

@hannobraun
Copy link
Owner

It should be possible to combine sketches (2D shapes) using union, difference, and intersection operations. This is related to 3D boolean operations (#42, #43, #44), which I'm currently working on. While the low-level details are going to be different (and most likely much simpler for 2D), the high-level algorithm should be pretty much the same, allowing for reuse there.

I'm not sure where this issue fits into the current plans. It could make sense to finish 3D boolean operations first, then work on making the algorithm more generic, until it supports 2D operations too. It could also make sense to go the other way: implement 2D boolean operations first (which should be much easier, given the simpler geometry), then work to expand the algorithm to also support 3D.

@hannobraun hannobraun added type: feature New features and improvements to existing features topic: model labels Aug 11, 2022
@hannobraun hannobraun added this to the 2D CAD milestone Aug 11, 2022
@hannobraun hannobraun changed the title 2D boolean operations Implement 2D boolean operations Aug 11, 2022
@hannobraun hannobraun added topic: core Issues relating to core geometry, operations, algorithms topic: modeling and removed topic: host labels Aug 12, 2022
@rozgo
Copy link

rozgo commented Aug 31, 2022

A "3D boolean operations first" approach to generalize for 2D seems like a good direction. Starting with 2D could allow for too many easy shortcuts and assumptions that may not generalize correctly to 3D.

@hannobraun
Copy link
Owner Author

It's always a trade-off! On the one hand, what you say is totally correct. On the other hand, getting something working (and be useful) earlier would be worth a lot, as it could provide experience and feedback, which could be worth the extra work generalizing the 2D code to 3D.

I think if I were to start fresh, then I would do 2D first, then later generalize to 3D. I have no intent to do that though, and since I've already put a lot of work into the 3D part, I will continue along that path.

@joamatab
Copy link

joamatab commented Jan 3, 2023

We already have Boolean operations in gdsfactory, I hope you find it useful

@hannobraun
Copy link
Owner Author

I hadn't hear of gdsfactory. Looks interesting!

@hannobraun
Copy link
Owner Author

This remains a desired feature, but I've decided to close this issue for now. I've expanded the entry about boolean operations on the feature wishlist to include 2D.

Everything I wrote in #42 is true here too, albeit to a lesser degree. In addition, there are upcoming changes to the geometry representation that would make this issue both more practical to implement, and would essentially require rewriting any code that we'll write for this before then.

For these reasons, I've determined that the feature wishlist is the more appropriate place to track this, for the time being.

@hannobraun hannobraun closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: core Issues relating to core geometry, operations, algorithms type: feature New features and improvements to existing features
Projects
None yet
Development

No branches or pull requests

3 participants