ThatOpen / engine_web-ifc

Reading and writing IFC files with Javascript, at native speeds.
https://thatopen.github.io/engine_web-ifc/demo
Mozilla Public License 2.0
617 stars 190 forks source link

Wall openings is not displayed #196

Closed krosoftware closed 1 year ago

krosoftware commented 2 years ago

Hello IFC files does not display some wall openings, please check image. On some other viewer, it is displayed. IFC file: https://easyupload.io/iy1jfm bad image: https://postimg.cc/LJFDTjmv OK image: https://postimg.cc/SjwfScYq Thank you for your help.

QuimMoya commented 2 years ago

I think the hole is made, but for some unknown reason there is a thin layer blocking the hole image

aka-blackboots commented 2 years ago

::take

agviegas commented 2 years ago

🟢🟢🟢

::take

Hi, @aka-blackboots! Thanks for taking this bounty! The due date is November 1, 2022 UTC.

If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bounty’s status will automatically changed to done.

If you do not need to make a PR, tell the manager @agviegas to run ::done command after your tasks is confirmed to be done.

Good luck!

aka-blackboots commented 2 years ago

::drop

agviegas commented 2 years ago

🟢🟢🟢

::drop

Hi, @aka-blackboots! Thanks for giving it a try! It’s now once again available for anyone to take.

BSchafer01 commented 2 years ago

The link for the model appears to have expired. Would you be able to attach the model again?

aka-blackboots commented 1 year ago

@BSchafer01, connect with me on discord, and I will share a basic IFC file with you.

Exathera commented 1 year ago

Hello, I have the same problem with this file: Projekt_COLORADO_PS.zip Some Openings are displayed correctly, but others dont. Hope this file can help.

And I guess, the same issue here: https://github.com/IFCjs/web-ifc/issues/126

Thank you

sanvie commented 1 year ago

Hi, I think I have the same problem with a "public" IFC file: AC20-FZK-Haus.ifc (so easily retrieved by anyone and pretty small one). Some (most openings) are "closed" by a thin layer. When exporting "only" the IFCOPENINGELEMENT it see a strange thing: this thin layers is there.. so it is not a result of the boolean op... (it is in a way) but that in the first place the geometry to "remove" from the wall to create the hole contains that non manifold thin layer.

The model should look like this: image

but the openings only are: image

there is a thin layer inside each ones... sometimes it gets removed and sometimes it stays there... don"t know it it helps...

sanvie commented 1 year ago

I'll keep ranting here because this problem is bothering me ... Looking a bit closer into this issue... it looks like in the IFC file, the geometry used to create the hole is defined (most of the time) as

32472= IFCSHAPEREPRESENTATION(#118,'Body','SweptSolid',(#32455,#32471));

I guess this means 2 reps are used to define the shape. Both are extruded

32455= IFCEXTRUDEDAREASOLID(#32445,#32452,#32453,0.3);

(why a software would end up generating this... I don't know, specifically considering both "blocks" are same size and basically stand back to back). I assume webIFC generates the 2 geometries and pool them together in a single geometry. In turns, when boolean substract is called, it is called between a geometry and this 'pooled result' of two back to back geometry. The isInsideMesh function is then unable to provide the correct answer for those duplicated back to back triangles (moreover, answer is probably inconsistent depending on the ray direction)

Edit: some more digging... in fact it does generate triangles that are back to back but not identical.

image

contains a "manifold" inside "wall" : image

made of triangles that are not "identical" image

This probably comes from the fact the opening is made of 2 extrude that are merged into single representation. So when util.h::flattenRecursive is called => the method just "merge" both list of triangles... where a proper union should be made. Unfortunately the joinBoolean method within web-ifc is not able to remove these triangles either.

sanvie commented 1 year ago

Finally able to confirm: replacing the included boolean by csgjscpp and unioning in flattenrecursive => image

Now the 2 cents questions => is flatten recursive always supposed to perform union ? I would guess no (?) in this case... passing a flag all along to know what this union is exactly could be required... fully replacing the provided boolean bycsgjscpp is pretty easy and probably would be a good idea here... ... or not... as csgcpp enters infinite loop in some cases...

pbbr commented 1 year ago

We have the same issue on several models. @sanvie Do you have an idea how to proceed on this topic?

QuimMoya commented 1 year ago

We are working on this issue, this is related to the solids library we are using.

Sorry for the inconvenience.

pbbr commented 1 year ago

Thanks for your feedback. Good to know that you are working on.

I've build a model which includes elements that show the issues on this topic and show issues that are maybe related to this topic: image image image

Maybe it helps for further investigation and resolve.

Test Model.zip

krosoftware commented 1 year ago

I see new version but this problem is still not solved.

pbbr commented 1 year ago

https://github.com/IFCjs/web-ifc/releases/tag/0.0.37 Great update, congrats and many thanks to the team! There's much better support for complex solids with this release.

What we saw is, that there is still an issue with openings. It seems that the parsing has changed for openings, but not in a way to solve the problem (see https://github.com/IFCjs/web-ifc/issues/196#issuecomment-1354482639).

image

Do you have any plans to improve the parsing for openings?

QuimMoya commented 1 year ago

@pbbr and @krosoftware The new solids engine solves many previous issues, but not all. As you may know, solids are one of the most complex areas in programming. This problem cannot be solved in one step, there are literally hundreds of edge cases. With the new engine we can improve it over time because it does not rely on external libraries. It means that, in the coming months we will be solving specific solids issues one by one. Your file is one of these cases, I’m going to add it to the list.

Thanks

MagicalBloom commented 1 year ago

I have one example with broken walls as well and I'll probably come across more in the future. Should I add those in here or create a new issue for each one? @QuimMoya

pbbr commented 1 year ago

@QuimMoya Thanks for your feedback. I understand the complexity and that not every problem can be solved right now. We have a lot of models were the openings are the main issue. Other complex solids have a lower priority in my opinion.

Attached the problematic ifc file. If you like to have more examples please get back to me. Thanks a lot!

Test Model Openings.zip

QuimMoya commented 1 year ago

@MagicalBloom Add the files here, i will use them for testing.

Thanks

MagicalBloom commented 1 year ago

https://www.dropbox.com/s/mci7l5mdjxwpvjb/walls.ifc

QuimMoya commented 1 year ago

image Should be something like this?

MagicalBloom commented 1 year ago

There seems to be something weird going on in the left corner, but other than that it looks good. I should probably add reference images for any future models.

Here is one for this one: image

pbbr commented 1 year ago

@QuimMoya With the latest changes our issues regarding openings (https://github.com/IFCjs/web-ifc/issues/196#issuecomment-1435586011) are now solved, thanks a lot!

QuimMoya commented 1 year ago

image solved also

makc commented 1 year ago

@agviegas another bounty that is still open. I guess most of the bounties are outdated now?

agviegas commented 1 year ago

@makc On it!