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

Integration with elalish/manifold #164

Closed
agviegas opened this issue May 15, 2022 · 16 comments
Closed

Integration with elalish/manifold #164

agviegas opened this issue May 15, 2022 · 16 comments
Assignees

Comments

@agviegas
Copy link
Collaborator

agviegas commented May 15, 2022

πŸ“‹ GENERAL:


βš” CHALLENGE:

One of the greatest challenges of BIM software are CSG operations, also known as boolean operations. Until now, we have relied on our own implementation, but it's a complex topic and it demands a lot in terms of maintainance.

Short time ago, we were super excited to see the library elalish/manifold show up, because it solves all the issues that we currently have with boolean operations. The task consists of taking this library and integrating it with this repository, thus compiling it with Emscripten.

It seems that it's possible and [some people already did it, explaining the steps to follow, so this task shouldn't be that complicated:

Here are some of the issues that this bounty should solve as a side effect:


πŸ‘©β€βš–οΈ REQUIREMENTS:

  • Use elalish/manifold to perform the boolean operations.

πŸ”₯ STARTING MATERIAL:

You should follow the steps described in the elalish/manifold issue, where they explain how to do this.

Here you have some IFC files to test:

@makc
Copy link
Contributor

makc commented May 21, 2022

hello there, I am just curious what kind of apis does ifcjs need from emscripten port, and where can I check the current code that needs to be replaced in order to tap into that port? I did dabble in emscripten ports in the past, I think I was the 1st to compile assimp to js 6 years ago, for example, but Im not sure if I could take on this one πŸ˜…

@agviegas
Copy link
Collaborator Author

Hey @makc we have a video explaining how the library works, it'll probably clarify some of your questions. If you give us a mail, we'll give you access. Cheers!

@agviegas
Copy link
Collaborator Author

agviegas commented May 24, 2022

@makc talking with one of the original authors: "he needs to port the boolean API and everything that is needed to use it, so transforming meshes to the internal format of Manifold. Inside web-ifc he needs to call that lib from the web-ifc-bool file, and potentially modify also web-ifc-geometry. If he gets the boolean subtract working using Manifold, in the browser of course, he's done"

@makc
Copy link
Contributor

makc commented May 27, 2022

@agviegas oh you actually replied, I missed the notification. I think you said somewhere you have a discord for bounties found the link, let me try to ping you there... ah. but what's your name there... ansoni?

@QuimMoya
Copy link
Contributor

QuimMoya commented Nov 9, 2022

Hello @makc
Great work with elalish manifold! this is really a hard issue. I'm trying to understand how it works but i'm having some trouble. Is it possible to contact you?

@makc
Copy link
Contributor

makc commented Nov 10, 2022

@QuimMoya iirc it did not quite work because there was a problem in the booleans code input data (so not related to manifold per se) that @agviegas never asked me to investigate, so it was left unresolved.

@QuimMoya
Copy link
Contributor

@makc I can review that code, but i will need some help from your part. Is it fine for you if we review this problem together?
I started investigating and saw that manifold library is compiled. I also found that many times geometry does not pass the "manifold" test, probably wrong triangles, not closed, etc.
It will be great if you can guide me to find a solution.

@makc
Copy link
Contributor

makc commented Nov 11, 2022

I started investigating and saw that manifold library is compiled

yes, via emscripten, so these .a files only work for wasm build

many times geometry does not pass the "manifold" test

iirc it does not pass the test due to self-intersections, which are caused by double geometry in the input (which is the data problem I referred to).

screenshot

Also see #53 (comment)

@QuimMoya
Copy link
Contributor

I think it will be necessary to add a function that removes these repeated triangles from geometries. I could do that, thank you. Let's see if it solves the problem.
Hum... is there a way to debug without build the project? I mean... now i can debug C++ but only without using manifold.

@makc
Copy link
Contributor

makc commented Nov 11, 2022

@QuimMoya what I did was using this line to output .obj file of the input to browser console.

@makc
Copy link
Contributor

makc commented Nov 11, 2022

@QuimMoya there is also this to output the data before vertices are merged for manifold lib

@makc
Copy link
Contributor

makc commented Nov 11, 2022

@QuimMoya

i can debug C++ but only without using manifold

so then you can, for example, use DEBUG_BOOLEAN_INPUT and tweak #ifdef EMSCRIPTEN to let it reach geom2mesh() but comment out all the code referencing manifold there.

@makc
Copy link
Contributor

makc commented Nov 11, 2022

@QuimMoya one last thing,

a function that removes these repeated triangles from geometries

they should never be added in the 1st place. also it will be quite hard to remove them, I mean the boxes are intersecting, not identical

@QuimMoya
Copy link
Contributor

@makc

@makc

they should never be added in the 1st place.

Maybe this is related to some types of geometry, i will try to check it. Anyway, thanks, i will update you on any news.

@QuimMoya
Copy link
Contributor

@makc

I think there is no other choice than collect all files that fail, then go file by file detecting which elements are causing it to fail.
Well... it will be a tedious work, but its feasible

@makc
Copy link
Contributor

makc commented Nov 15, 2022

@QuimMoya what, do you think it is different from file to file? I would think any file from the issues will do the job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants