voxelization_toolkit icon indicating copy to clipboard operation
voxelization_toolkit copied to clipboard

exterior elements is empty

Open hryang1 opened this issue 11 months ago • 3 comments

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.

hryang1 avatar Dec 20 '24 07:12 hryang1

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.

aothms avatar Dec 20 '24 08:12 aothms

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: https://github.com/IfcOpenShell/voxelization_toolkit/issues/13 https://github.com/IfcOpenShell/IfcOpenShell/issues/1523 Is the tool and code I am using not matching? I am looking forward to and appreciating your reply.

hryang1 avatar Dec 23 '24 01:12 hryang1

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:

https://github.com/IfcOpenShell/voxelization_toolkit/blob/ae3735da20df3d8e1d560c4b60ba72b451f818ad/voxec.h#L1273

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.

aothms avatar Dec 29 '24 12:12 aothms