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

exterior elements is empty #18

Open
hryang1 opened this issue Dec 20, 2024 · 3 comments
Open

exterior elements is empty #18

hryang1 opened this issue Dec 20, 2024 · 3 comments

Comments

@hryang1
Copy link

hryang1 commented Dec 20, 2024

Hello, I am having a problem running the code you provided.
The code is as:
file = parse("duplex.ifc")
surfaces = create_geometry(file)
voxels = voxelize(surfaces)
external = exterior(voxels)
shell = offset(external)
export_ifc(file, shell, surfaces, "exterior.ifc")

My operating system is Windows.
Due to the lack of corresponding DLLs in the exe provided by conda, I downloaded the exe from here (https://github.com/IfcOpenShell/voxelization_toolkit/releases/tag/v0.3.0).
I test sample data (duplex.ifc).
The result is that "exterior.ifc" is empty.
image

Can you provide other versions of exe that can be used for Windows? Thank you very much. Looking forward to your reply.

@aothms
Copy link
Member

aothms commented Dec 20, 2024

Most likely, it's not empty, but it doesn't contain the spatial hierarchy to connect the elements to the project so some viewers will not show anything.

A more versatile approach is to use export_json instead and use ifcopenshell's IfcPatch ExtractElements recipe on the resulting elements from the JSON. ExtractElements will copy over the full hierarchy.

CI/CD builds are being worked on. Soon you can just install this from using python pip.

@hryang1
Copy link
Author

hryang1 commented Dec 23, 2024

Hi, aothms.
Thank you for your reply. I have followed your suggestion and obtained a JSON file, but this JSON file does not fully contain some obviously external elements, such as the IfcWallStandardCase with UUID "2O2Fr$t4X7Zf8NOew3FLQD":
企业微信截图_17349166994394
Here is the exported JSON file:
[
{"id":274,"guid":"1hOSvn6df7F8_7GcBWlRBU"},
{"id":217,"guid":"0jf0rYHfX3RAB3bSIRjmmy"},
{"id":271,"guid":"1l0GAJtRTFv8$zmKJOH4hv"},
{"id":340,"guid":"0kF45Qs8L9PAM9kmb1lT2N"},
{"id":297,"guid":"1hOSvn6df7F8_7GcBWlS4Q"},
{"id":290,"guid":"1Eo2$BaHX42AEkDvQQDocD"},
{"id":337,"guid":"0kF45Qs8L9PAM9kmb1lT5t"},
{"id":231,"guid":"1hOSvn6df7F8_7GcBWlRLx"},
{"id":275,"guid":"1l0GAJtRTFv8$zmKJOH4qs"},
{"id":256,"guid":"1CZILmCaHETO8tf3SgGEWh"},
{"id":227,"guid":"1l0GAJtRTFv8$zmKJOH4$e"},
{"id":294,"guid":"1l0GAJtRTFv8$zmKJOH4oq"},
{"id":273,"guid":"1hOSvn6df7F8_7GcBWlS_W"},
{"id":292,"guid":"1Eo2$BaHX42AEkDvQQDoy2"},
{"id":296,"guid":"1l0GAJtRTFv8$zmKJOH4u1"},
{"id":251,"guid":"1s1jVhK8z0pgKYcr9jt7AB"},
{"id":230,"guid":"1hOSvn6df7F8_7GcBWlRRL"},
{"id":269,"guid":"1l0GAJtRTFv8$zmKJOH4ZZ"},
{"id":272,"guid":"1hOSvn6df7F8_7GcBWlSXO"},
{"id":268,"guid":"1hOSvn6df7F8_7GcBWlR72"},
{"id":336,"guid":"0kF45Qs8L9PAM9kmb1lT5d"},
{"id":252,"guid":"1hOSvn6df7F8_7GcBWlRGQ"},
{"id":298,"guid":"1hOSvn6df7F8_7GcBWlSnC"},
{"id":228,"guid":"1hOSvn6df7F8_7GcBWlS2V"},
{"id":270,"guid":"1l0GAJtRTFv8$zmKJOH4aS"},
{"id":293,"guid":"1hOSvn6df7F8_7GcBWlSp1"},
{"id":226,"guid":"1l0GAJtRTFv8$zmKJOH4pU"},
{"id":338,"guid":"0kF45Qs8L9PAM9kmb1lT2B"},
{"id":253,"guid":"1hOSvn6df7F8_7GcBWlRH8"},
{"id":291,"guid":"1l0GAJtRTFv8$zmKJOH4kJ"},
{"id":229,"guid":"1hOSvn6df7F8_7GcBWlSga"},
{"id":334,"guid":"0kF45Qs8L9PAM9kmb1lT5l"},
{"id":255,"guid":"1CZILmCaHETO8tf3SgGEXu"},
{"id":299,"guid":"1hOSvn6df7F8_7GcBWlS1M"},
{"id":254,"guid":"1s1jVhK8z0pgKYcr9jt781"},
{"id":295,"guid":"1l0GAJtRTFv8$zmKJOH4gQ"}
]
Also, I have another question, why did others successfully extract external elements and appear to be directly exporting them using "export_ifc"?
For example:
#13
IfcOpenShell/IfcOpenShell#1523
Is the tool and code I am using not matching?
I am looking forward to and appreciating your reply.

@aothms
Copy link
Member

aothms commented Dec 29, 2024

but this JSON file does not fully contain some obviously external elements, such as the IfcWallStandardCase with UUID "2O2Fr$t4X7Zf8NOew3FLQD":

Probably the inclusion criteria need to be tweaked. The full list of available arguments to the function is here:

static std::vector<argument_spec> nm_ = { { true, "input", "ifcfile" }, { true, "input_voxels", "voxels" }, { true, "input_surfaces", "surfaceset" }, { true, "output_path", "string" }, {false, "individual_faces", "integer"}, {false, "factor", "integer"}, {false, "face_count", "integer"} };

These factors and face counts are an attempt at preventing situations like this where the gray element would be counted as external due to the voxel resolution.

afbeelding

factor concerns the overlap of voxels for the element vs voxels in the input grid to this function. factor=2 means at least 1/2 of the voxels for an individual element need to be present in the input set

individual_faces=0|1 means whether this factor is applied to the full element surface or to individual faces

num_faces in case of the latter =1 this governs how many faces (absolute) value needs to have at least factor overlap.

why did others successfully extract external elements and appear to be directly exporting them using "export_ifc"?

Not all viewers have the requirement to have a fully connected spatial decomposition tree. The model from export_ifc is not really invalid, it's just that the elements are not really part of the project and viewers choose to handle that differently.

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

2 participants