Archived issue #0032968
TopLoc_Location::IsEqual and BRep_CurveOnSurface::IsCurveOnSurface seem to not match with each other
Description
I'm trying to use BRep_Tool::CurveOnSurface to retrieve a Handle(Geom2d_Curve).
I'm working with a step model i imported using STEPControl_Reader.
The model is correctly displayed.
I also checked the TopoDS_Edge and the TopoDS_Face i'm passing to BRep_Tool::CurveOnSurface with BRepCheck_Analyzer and it returns IsValid() == true for both.
When debugging i can see that the BRep_TEdge contains four BRep_CurveRepresentation, a BRep_Curve3D, two BRep_CurveOnSurface and a BRep_CurveOn2Surfaces.
BRep_Tool::CurveOnSurface iterates through all BRep_CurveRepresentation of the TopoDS_Edge and calls BRep_CurveOnSurface::IsCurveOnSurface for each BRep_CurveRepresentation.
BRep_CurveOnSurface::IsCurveOnSurface compares the surfaces by pointers and the TopLoc_Locations using this Equal implementation which, and this is the reason why in this case BRep_Tool::CurveOnSurface returns a null Handle, returns false if one returns true for IsIdentity().
I honestly don't know what's the reasoning behind this implementation.
I was thinking that maybe transformations are not supposed to be empty (because that's what TopLoc_Location::IsIdentity() checks) but STEPControl_Reader doesn't report any errors and BRepCheck_Analyzer says everything is valid.
I might be able to work around this by looping through all curves myself and replacing empty location with actual identity transformations but it feels wrong.
What am i missing?
I'm working with a step model i imported using STEPControl_Reader.
The model is correctly displayed.
I also checked the TopoDS_Edge and the TopoDS_Face i'm passing to BRep_Tool::CurveOnSurface with BRepCheck_Analyzer and it returns IsValid() == true for both.
When debugging i can see that the BRep_TEdge contains four BRep_CurveRepresentation, a BRep_Curve3D, two BRep_CurveOnSurface and a BRep_CurveOn2Surfaces.
BRep_Tool::CurveOnSurface iterates through all BRep_CurveRepresentation of the TopoDS_Edge and calls BRep_CurveOnSurface::IsCurveOnSurface for each BRep_CurveRepresentation.
BRep_CurveOnSurface::IsCurveOnSurface compares the surfaces by pointers and the TopLoc_Locations using this Equal implementation which, and this is the reason why in this case BRep_Tool::CurveOnSurface returns a null Handle, returns false if one returns true for IsIdentity().
I honestly don't know what's the reasoning behind this implementation.
I was thinking that maybe transformations are not supposed to be empty (because that's what TopLoc_Location::IsIdentity() checks) but STEPControl_Reader doesn't report any errors and BRepCheck_Analyzer says everything is valid.
I might be able to work around this by looping through all curves myself and replacing empty location with actual identity transformations but it feels wrong.
What am i missing?
Steps to reproduce
Iterate through all edges, take the first face of each, and try BRep_Tool::CurveOnSurface
Additional information
I'm unsure what's the better place; i also posted this here: https://dev.opencascade.org/content/toploclocationisequal-and-brepcurveonsurfaceiscurveonsurface-seem-not-match-each-other
Public activity
1 archived note
Participants are labeled by their role within this record.
Question answered here: https://dev.opencascade.org/content/toploclocationisequal-and-brepcurveonsurfaceiscurveonsurface-seem-not-match-each-other
Sorry for the double post.
Sorry for the double post.