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

IfcAdvancedBrep for example file cube-advanced-brep #462

Merged
merged 84 commits into from
Mar 4, 2022

Conversation

christophKaiser
Copy link
Collaborator

@christophKaiser christophKaiser commented Jun 19, 2021

In this pull request, IfcAdvancedBrep will be implemented to run the example file cube-advanced-brep.ifc.
This includes the implementation and adjustment of a few other functions, too. A rough overview of the involved functions was given in a comment in the corresponding issue #60.

Finally, this PR will close #60.
Probably, issue #58 could be closed, as well. However, this will be investigated at the right time in future. [currently, the non-linked issue is intended]

UPDATE 21.02.2022: This PR will close #58, as well.

@christophKaiser christophKaiser self-assigned this Jun 19, 2021
@christophKaiser christophKaiser added enhancement New feature or request example-files Issue related to failing reading an example file IFC Content related to Industry Foundation Classes (IFC) functionalities labels Jun 19, 2021
@christophKaiser
Copy link
Collaborator Author

While I have analysed the function convertIfcFaceList in commit 346e611 and 032606c, I came over a 'TODO Stefan':

// Loop through all faces
for (auto it = faces.cbegin(); it != faces.cend(); ++it)
{ //TODO Stefan
EXPRESSReference<typename IfcEntityTypesT::IfcFace> face = (*it);
if (face.expired()) {
throw oip::ReferenceExpiredException(face);
}
if (!convertIfcFace(face, pos, polygon, polygonIndices))
{
throw oip::InconsistentGeometryException(face, "IFC Face conversion failed with these faces");
}
}
// IfcFaceList can be a closed or open shell, so let the calling function decide where to put it
itemData->open_or_closed_polyhedrons.push_back(polygon);

(Note: The cited code is without the new changes.)

It was added in commit 2aec12f last summer. However, I wasn't able to find more information about that.
Currently, the function does its purposed task.

@pjanck Should I leave that comment there for the moment, or can you give me more information about it?

My next task in this PR will be an analyse of the function convertIfcFace. This will lead in a (probably) small refactoring of this function and the implementation of its subtype IfcFaceSurface, which is the supertype of IfcAdvancedFace (which I will need at the end).

@pjanck
Copy link
Contributor

pjanck commented Jun 20, 2021

Good analysis of the task!

  1. About the TODO Stefan: no idea what I meant there. If the function does its task, you can safely delete it.
  2. You can change the for loop to for( const auto& face : faces ) - perhaps that was the only purpose of the TODO?
  3. convertIfcFace - it seems that the function returns bool - this can be changed to be more in parallel with other functions. I trust you here to judge by yourself what to do. Perhaps it is needed, that a bool is returned. In case of doubt, ask.

Copy link
Contributor

@pjanck pjanck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start!

The defined boolean value does not change inside the function convertIfcFace. Probably, its original purpose was to indicate an error inside the function. In the current code of convertIfcFace, all inspected error-cases are handled by the call of 'throw opi::<exception>'.
vertex3D and v were both declared as const carve::geom::vector<3>. By hovering with the mouse, both variables were identified as const crave::geom3d::Vector &.
Thus, I can't see any 'global transformation' like promised in the comment.
See following github.ghproxy.topment for more details on this.
Of cause, some information was saved in the variable (line 833), but it was never used / called in the entire function.
@christophKaiser
Copy link
Collaborator Author

[Refactoring of convertIfcFace is still in process.]

Like promised in commit 3ae4b05 “Fixed semi-bug of double triangulation of triangular ifcFaceBound”, this comment gives more details about the fixed issue – especially screenshots of an example.

Before this commit, faces with an exactly triangular bound loop (ifcFaceBound) were added twice to the variable polygon (of type PolyhedronData). First, the triangle face was added in the if-block if (loopVertices3D.size() == 3) (in convertIfcFace). The second adding occurred inside of the function triangulateFace which is called in convertIfcFace. This became implicitly visible by the variable polygon.faceCount, respectively polygon.faceIndices.
Moreover, the first adding has not gave respect to holes inside the outer triangle bound, respectively they were covered by the first added triangle face as shown in the following screenshot:
screenshot fix double triangles 1 before

After this fix, the code decides between the case of only one triangular bound loop without an inner bound (= hole), and the case of an arbitrary number of vertices and / or holes inside the face. Now, the hole in my example is visible:
screenshot fix double triangles 2 after

The relevant ifc-data of my example:

#38= IFCFACE((#202,#203));

#202= IFCFACEOUTERBOUND(#366,.T.);
#203= IFCFACEBOUND(#367,.T.);

#366= IFCPOLYLOOP((#527,#526,#606));
#367= IFCPOLYLOOP((#528,#608,#529));

#526= IFCCARTESIANPOINT((0.,0.,0.));
#527= IFCCARTESIANPOINT((1000.,0.,0.));
#606= IFCCARTESIANPOINT((0.,1000.,0.));

#528= IFCCARTESIANPOINT((250.,250.,0.));
#529= IFCCARTESIANPOINT((500.,250.,0.));
#608= IFCCARTESIANPOINT((250.,500.,0.));

Copy link
Collaborator

@jschlenger jschlenger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start. Excellent description of what needs to be supported in order to be able to display the example file.

Copy link
Contributor

@pjanck pjanck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work so far!

Copy link
Collaborator

@jschlenger jschlenger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good to me.
We should merge this pull request soon.

@pjanck
Copy link
Contributor

pjanck commented Feb 15, 2022

Please mark it as ready for review, then I'll go through the code once more.

At least I have no idea which information or benefit the note should give to the user or programmer.
The description is placed in the comment of convertIfcFace.
Added 'See also' (\see) to all functions inside the FaceConverter which have the parameter polyhedron and polyhedronIndices.
@christophKaiser
Copy link
Collaborator Author

christophKaiser commented Feb 21, 2022

Commit ac64eb1 updates the Doxygen comments, which are related to the parameters polyhedron and polyhedronIndices.

A detailed explanation about these parameters is in the description of the function convertIfcFace. As shown in the screenshot below, this section is separated with a bold header:
doxygen_description

Furthermore, all functions which have polyhedron and polyhedronIndices as parameter refer to this description by the Doxygen command \see. This generates the section 'See also', as shown in the screenshot:
doxygen_seeAlso

@christophKaiser christophKaiser marked this pull request as ready for review February 21, 2022 17:05
It's intended to test the IfcFace entities (with their IfcFaceOuterBound and IfcFaceBound); thus IfcFacetedBrep and IfcClosedShell aren't necessary for this test.
The images of the visual unit test have not changed (because the geometry hasn't changed).
Copy link
Contributor

@pjanck pjanck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

Small suggestions, but this can definitely be merged.

Copy link
Collaborator

@jschlenger jschlenger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we can merge after the last few comments of pjanck are resolved

Copy link
Contributor

@pjanck pjanck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!

@pjanck pjanck merged commit 4fa2e0a into tumcms:development Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request example-files Issue related to failing reading an example file IFC Content related to Industry Foundation Classes (IFC) functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example file "cube-advanced-brep" is not working Example file "basin-advanced-brep" is not working
3 participants