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

Swap face bound orientation of Cube Advanced Brep #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thbeu
Copy link
Contributor

@thbeu thbeu commented Jun 13, 2024

I failed to obtain a positive volume of the Cube Advanced Brep.

One solution is to swap the face bound orientation of five faces.

Can you please cross-check and verify. Thanks a lot.

@aothms
Copy link
Contributor

aothms commented Jun 19, 2024

Thanks for looking into this. This is quite a puzzle. I know there are some issues wrt to orientation in this model. The thing I'm most interested in is making sure that every edge is visited twice in opposite direction so that we have a manifold structure. I don't think your fix completely resolves this:

If we print the tree structure and underneath evaluated edge start and end points, in my interpretation we obtain the following (partially printed below). The evaluated begin->end points with an x in front are visited twice in the same direction.

  • When the Face Bound is reversed it means all edges are reversed and the order within the bound is reversed.

  • When an individual Oriented Edge is reversed it only means its respective underlying edge begin and end are reversed.

  • Face and Edge sense itself I think only affect the parametrization of the curve / normal of the surface, it doesn't affect topology (but I'm not 100% sure of this).

#104=IfcAdvancedFace((#99),#100,.T.)
 #99=IfcFaceOuterBound(#98,.F.)
  #98=IfcEdgeLoop((#94,#95,#96,#97))
    #94=IfcOrientedEdge(*,*,#49,.T.)
      #49=IfcEdgeCurve(#30,#36,#48,.T.)
       #30=IfcVertexPoint(#31)
        #31=IfcCartesianPoint((-0.5,-0.5,0.0))
       #36=IfcVertexPoint(#37)
        #37=IfcCartesianPoint((-0.5,0.5,0.0))
x (-0.5, -0.5, 0.0)->(0.5, -0.5, 0.0)
x (0.5, -0.5, 0.0)->(0.5, 0.5, 0.0)
x (0.5, 0.5, 0.0)->(-0.5, 0.5, 0.0)
x (-0.5, 0.5, 0.0)->(-0.5, -0.5, 0.0)
#115=IfcAdvancedFace((#110),#111,.T.)
#110=IfcFaceOuterBound(#109,.T.)
  (-0.683012701892219, -0.183012701892219, 1.0)->(0.183012701892219, -0.683012701892219, 1.0)
  (0.183012701892219, -0.683012701892219, 1.0)->(0.683012701892219, 0.183012701892219, 1.0)
  (0.683012701892219, 0.183012701892219, 1.0)->(-0.183012701892219, 0.683012701892219, 1.0)
  (-0.183012701892219, 0.683012701892219, 1.0)->(-0.683012701892219, -0.183012701892219, 1.0)
#131=IfcAdvancedFace((#121),#122,.F.)
 #121=IfcFaceOuterBound(#120,.F.)
  #120=IfcEdgeLoop((#116,#117,#118,#119))
   #116=IfcOrientedEdge(*,*,#93,.T.)
    #93=IfcEdgeCurve(#36,#38,#92,.T.)
     #36=IfcVertexPoint(#37)
      #37=IfcCartesianPoint((-0.5,0.5,0.0))
     #38=IfcVertexPoint(#39)
      #39=IfcCartesianPoint((-0.683012701892219,-0.183012701892219,1.0))
   #117=IfcOrientedEdge(*,*,#65,.T.)
    #65=IfcEdgeCurve(#38,#44,#64,.T.)
     #38=IfcVertexPoint(#39)
      #39=IfcCartesianPoint((-0.683012701892219,-0.183012701892219,1.0))
     #44=IfcVertexPoint(#45)
      #45=IfcCartesianPoint((0.183012701892219,-0.683012701892219,1.0))
   #118=IfcOrientedEdge(*,*,#81,.F.)
    #81=IfcEdgeCurve(#30,#44,#80,.T.)
     #30=IfcVertexPoint(#31)
      #31=IfcCartesianPoint((-0.5,-0.5,0.0))
     #44=IfcVertexPoint(#45)
      #45=IfcCartesianPoint((0.183012701892219,-0.683012701892219,1.0))
   #119=IfcOrientedEdge(*,*,#49,.T.)
    #49=IfcEdgeCurve(#30,#36,#48,.T.)
     #30=IfcVertexPoint(#31)
      #31=IfcCartesianPoint((-0.5,-0.5,0.0))
     #36=IfcVertexPoint(#37)
      #37=IfcCartesianPoint((-0.5,0.5,0.0))
x (-0.5, 0.5, 0.0)->(-0.5, -0.5, 0.0)
  (-0.5, -0.5, 0.0)->(0.183012701892219, -0.683012701892219, 1.0)
  (0.183012701892219, -0.683012701892219, 1.0)->(-0.683012701892219, -0.183012701892219, 1.0)
  (-0.683012701892219, -0.183012701892219, 1.0)->(-0.5, 0.5, 0.0)
#147=IfcAdvancedFace((#137),#138,.F.)
#137=IfcFaceOuterBound(#136,.F.)
  (0.5, -0.5, 0.0)->(0.683012701892219, 0.183012701892219, 1.0)
  (0.683012701892219, 0.183012701892219, 1.0)->(0.183012701892219, -0.683012701892219, 1.0)
  (0.183012701892219, -0.683012701892219, 1.0)->(-0.5, -0.5, 0.0)
x (-0.5, -0.5, 0.0)->(0.5, -0.5, 0.0)
#163=IfcAdvancedFace((#153),#154,.F.)
#153=IfcFaceOuterBound(#152,.F.)
  (0.5, 0.5, 0.0)->(-0.183012701892219, 0.683012701892219, 1.0)
  (-0.183012701892219, 0.683012701892219, 1.0)->(0.683012701892219, 0.183012701892219, 1.0)
  (0.683012701892219, 0.183012701892219, 1.0)->(0.5, -0.5, 0.0)
x (0.5, -0.5, 0.0)->(0.5, 0.5, 0.0)
#179=IfcAdvancedFace((#169),#170,.F.)
#169=IfcFaceOuterBound(#168,.F.)
  (-0.5, 0.5, 0.0)->(-0.683012701892219, -0.183012701892219, 1.0)
  (-0.683012701892219, -0.183012701892219, 1.0)->(-0.183012701892219, 0.683012701892219, 1.0)
  (-0.183012701892219, 0.683012701892219, 1.0)->(0.5, 0.5, 0.0)
x (0.5, 0.5, 0.0)->(-0.5, 0.5, 0.0)

@thbeu
Copy link
Contributor Author

thbeu commented Jun 19, 2024

Thanks for the feedback. I did exactly the same with print-debugging on point level. I also tried to reverse edges individually and still failed. That's why I came up with the proposed changes. There are other fixes likely.

Before:

image

After:

image

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

Successfully merging this pull request may close these issues.

2 participants