IntTools_ShrunkRange::Perform fails

I have a data set from Autodesk Revit which creates a facetted shape to an accuracy of 1e-9. When I try and build the shape in Opencascade and cut a simple shape from it using BRepAlgoAPI_Cut I get a warning/error 6 indicating that the Shrunk Range is wrong, the message is
[PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge 254
Digging into the code the problem is in IntTools_ShrunkRange::Perform checking the condition if (t11>t2 || t12

The problem is that t1 and t2 are equal therefore this will always fail and raise an error. Can anyone advise why t1 and t2 are equal? I have seen comment that this may be due to tolerances but mathmetically I don't see how this can be. Does anyone know what causes the shrunk range to return equal values for the first and last parameter so that I may track down a solution in my data please

Evgeny Lodyzhehsky's picture

Dear Steve Lockley.

t1 and t2 must not be equal.
[t1,t2] is just parametric range for 3D-Curve of the edge.
If you have t1=t2 then the edge (Edge 254) is not valid.

Try to use BRepCheck_Analyzer on the arguments of
BRepAlgoAPI_Cut.

Steve Lockley's picture

Dear Lodyzhensky
thanks for this reply, I will run the checks as you suggest. I sense this may be an error in the data I am inputting, do you know what condition in the data might cause t1 and t2 to be equal (is it an overlapping face?)

Steve Lockley's picture

I have run BRepCheck_Analyzer which reports that the shape is Valid, I have also run the Shape Analysis tools and they report no errors either.
The BRepAlgoAPI_Cut class only creates a warning, rather than an error about the Shrunk Range but if I ignore this warning and continue to process the cut it fails in
void TopOpeBRep_FacesFiller::VP_PositionOnL(TopOpeBRep_LineInter& L)

due to an error in the destructor
Geom2dInt_IntConicCurveOfGInter::~Geom2dInt_IntConicCurveOfGInter()

Steve Lockley's picture

Just in case anyone can help attached is the BREP file of the shape that is causing my problem, at the moment I find this hard to read but am hoping one of the experts might see the problem

Attachments: 
sergey zaritchny's picture

Hi Steve,
Nevertheless simple test shows that the provided shape is not valid:

Draw[7]> restore faultyShape.brep fa
fa
Draw[9]> whatis fa
fa is a shape SOLID FORWARD Free Modified

Draw[10]> checkshape fa
On Shape faulty_1 :
BRepCheck_IntersectingWires
On Shape faulty_2 :
BRepCheck_IntersectingWires
On Shape faulty_3 :
BRepCheck_NotConnected
Shape faulty_3 on shape faulty_4 :
BRepCheck_NotConnected

Faulty shapes in variables faulty_1 to faulty_4
===============

So, you may try to rebuild the shape checking sub-shape validity after each step more accurately.
Regards
Sergey

Steve Lockley's picture

Really appreciate this help Sergey, so basically I have been given a shape from Revit that has Wires that intersect, since i only have simple bounded faces here can I assume this means that I have bounded faces that intersect. Do you know if there is any ShapeFix tool that would find these faces or wires and resolve them?

sergey zaritchny's picture

output informs you that some wires of your shape are invalid.
For analysis and fix you may use API of ShapeAnalysis and ShapeFix packages.
If you will not succeed I would suggest you to make request for the dedicated
customer support - http://www.opencascade.org/about/contacts/.
Regards
Sergey