Skip to content

3) calc_faces_first_level(K)

Janset Esen edited this page Oct 22, 2024 · 13 revisions

first level space boundaries

  • remove triangulation attached to faces, to reduce fusing time

  • fuse is an empty TopoDS_Shape declared in the scope of calc_faces_first_level function and list<cFace> faces_1st_level is a member variable of Graph, which is also empty at the moment. list<oFace> ifc_faces is the list of original faces, from prepare_faces-prepare_faces(K,-opening_shapes)). Every oFace.face (TopoDS_Face) in ifc_faces, will be fused with the General Fuse Algorithm, BOPAlgo_Builder. Then for every oFace in ifc_faces, a list of shapes Modified from that oFace.face will be initialized. If the face was not modified: this face will be added to faces_1st_level. If face was modified into one or more new faces: all those modified faces that we have saved in the list mentioned above will be added to the faces_1st_level, but not the face that these new faces were modified from. This is done by faces_1st_level.emplace_back(TopoDS::Face(shape from the list), &orig_face, face_id) with the cFace(TopoDS_Face face, oFace* ancestor, unsigned int id) constructor. At the end, fuse = builder.[Shape()](https://dev.opencascade.org/doc/refman/html/class_b_o_p_algo___builder_shape.html#af1d5815b12bd5c1b18acd321b45610c5) will be set. The result of the General Fuse algorithm itself is a compound containing all split parts of the arguments and with this assignation, fuse is that compound.

    image

  • For every oFace in ifc_faces, oFace.face = TopoDS_Face() will be set.

  • if (Kernel::number_of_faces_of_unknown_orientation(faces_1st_level) == 0)  
        calc_faces_first_level_normals_known(fuse);  
    else  
        calc_faces_first_level_normals_unknown(fuse, K);  
    

At the end of calc_faces_first_level(K), there is list<cFace> faces_1st_level that contains the result faces from fusion of the faces of the actual IfcBuildingElements (oFaces). And according to the number of faces of unknown orientation, calc_faces_first_level_normals_known(fuse) or calc_faces_first_level_normals_unknown(fuse, K) will be called.