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

Exclusion of BoundingBoxes in IfcConvert #2044

Closed
bdaniere opened this issue Feb 15, 2022 · 5 comments
Closed

Exclusion of BoundingBoxes in IfcConvert #2044

bdaniere opened this issue Feb 15, 2022 · 5 comments

Comments

@bdaniere
Copy link

Hi,
I have a problem with IfcConvert 0.7.0 (OCC 7.5.3) on some models.

If an IfcObject has an IfcShapeRepresentation of type "BoundingBox" (in addition to another representation, of type "SweptSolid" for example): both representations will be taken into account in the result of the conversion. The bounding box will completely hide the geometry of the resulting object.

I'm not sure if this is a bug (because both representations are present in these IFC files) but opening them on different BIM software gives me a result without the BoundingBox representation.

Currently, the only effective solution I could put in place is to remove the problematic representations before launching a conversion

for bbox in [
        rep
        for rep in ifcwrap.ifc.by_type("IfcShapeRepresentation")
        if rep.RepresentationType == "BoundingBox"
    ]:

        ifc_file.remove(bbox)
    ifc_file.write(ifc_path)

Is there a "cleaner" way to ignore some IfcProducts (by filtering on their Representation.Representations) ?

@Moult
Copy link
Contributor

Moult commented Feb 15, 2022

You can use set_context_ids() in the iterator to specify exactly what geometry contexts you want to approve, but I'm not sure if IfcConvert exposes this.

@aothms
Copy link
Member

aothms commented Mar 3, 2022

I'm also not against a general purpose flag or something to filter out IfcBoundingBox. Could even be enabled by default if you ask me, because I can't see lot of use for reading bounding boxes unless you're doing something fairly advanced. Would you be interested in wiring up the code for that @bdaniere?

@bdaniere
Copy link
Author

bdaniere commented Mar 3, 2022

It would have been a great pleasure
However, I have no skills in c++.

@theRealSuperMario
Copy link

theRealSuperMario commented Jun 28, 2022

Having the same problem here. Any thoughts on when it might be addressed?

Edit: I can confirm that the "remove bbox hack" from @bdaniere in #2044 (comment) works just fine

image

@aothms
Copy link
Member

aothms commented Feb 18, 2024

Sorry for the delay on this. With the latest commit the default is now to exclude bounding boxes. There is an option --keep-bounding-boxes to retain the old behaviour. This is implemented by actually going into the file in memory and removing the occurences of bounding boxes as it saves the trouble of propagating the settings all the way through the code base and is authored in a way to prevent error messages.

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

Successfully merging a pull request may close this issue.

4 participants