mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024249: Crash on ShapeFix_Shape
MAIN CHANGES: FixAddNaturalBound: the boundaries of "natural bound addition" are restricted: a face, that does not contains an outer wire, should not have any infinite UV boundaries due to new face building (with using a surface) requires specified UV boundaries. FixAddNaturalBound: myResult is updated in FixAddNaturalBound when the method creates a new face with natural boundary. myResult is required to be updated for next "fix small-area wires" algorithm IsPeriodicConicalLoop: incorrect working BRepTools_WireExplorer was replaced on TopoDS_Iterator. a natural bound is added to all the faces are constructed with UV-periodical surfaces (not only sphere and torus; e.g., closed b-splines) other: ShapeAnalysis: ReverceSeq renamed to ReverseSeq BRep_Tool Pnt and Tolerance has the check for null TShape Test cases for issue CR24249 required null checks were added test cases were corrected according to their new behavior Correction test case for issue CR24249
This commit is contained in:
@@ -128,7 +128,7 @@ Standard_Real ShapeAnalysis::AdjustToPeriod(const Standard_Real Val,
|
||||
//purpose : auxilary
|
||||
//=======================================================================
|
||||
template<class HSequence>
|
||||
static inline void ReverceSeq (HSequence& Seq)
|
||||
static inline void ReverseSeq (HSequence& Seq)
|
||||
{
|
||||
Standard_Integer j=Seq.Length();
|
||||
for(Standard_Integer i=1; i<Seq.Length(); i++) {
|
||||
@@ -157,7 +157,7 @@ Standard_Real ShapeAnalysis::TotCross2D(const Handle(ShapeExtend_WireData)& sewd
|
||||
TColgp_SequenceOfPnt2d SeqPnt;
|
||||
ShapeAnalysis_Curve::GetSamplePoints (c2d, f2d, l2d, SeqPnt);
|
||||
if( edge.Orientation()==1 )
|
||||
ReverceSeq(SeqPnt);
|
||||
ReverseSeq(SeqPnt);
|
||||
if(nbc==1) {
|
||||
fuv=SeqPnt.Value(1);
|
||||
uv0=fuv;
|
||||
@@ -200,7 +200,7 @@ Standard_Real ShapeAnalysis::ContourArea(const TopoDS_Wire& theWire)
|
||||
continue;
|
||||
nbc++;
|
||||
if( edge.Orientation()==TopAbs_REVERSED )
|
||||
ReverceSeq(aSeqPnt);
|
||||
ReverseSeq(aSeqPnt);
|
||||
if(nbc==1) {
|
||||
fuv=aSeqPnt.Value(1);
|
||||
uv0=fuv;
|
||||
|
@@ -432,8 +432,14 @@ Standard_Boolean ShapeAnalysis_Edge::CheckCurve3dWithPCurve (const TopoDS_Edge&
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
Standard_Real preci1 = BRep_Tool::Tolerance (FirstVertex (edge)),
|
||||
preci2 = BRep_Tool::Tolerance (LastVertex (edge));
|
||||
TopoDS_Vertex aFirstVert = FirstVertex (edge);
|
||||
TopoDS_Vertex aLastVert = LastVertex (edge);
|
||||
|
||||
if (aFirstVert.IsNull() || aLastVert.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
Standard_Real preci1 = BRep_Tool::Tolerance (aFirstVert),
|
||||
preci2 = BRep_Tool::Tolerance (aLastVert);
|
||||
|
||||
gp_Pnt2d p2d1 = c2d->Value (f2d),
|
||||
p2d2 = c2d->Value (l2d);
|
||||
|
@@ -807,6 +807,10 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated (const Standard_Integer nu
|
||||
TopoDS_Vertex V0 = sae.LastVertex (E1);
|
||||
TopoDS_Vertex V1 = sae.FirstVertex (E2);
|
||||
TopoDS_Vertex V2 = sae.LastVertex (E2);
|
||||
|
||||
if (Vp.IsNull() || V0.IsNull() || V1.IsNull() || V2.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
gp_Pnt pp = BRep_Tool::Pnt (Vp); //:i9
|
||||
gp_Pnt p0 = BRep_Tool::Pnt (V0);
|
||||
gp_Pnt p1 = BRep_Tool::Pnt (V1);
|
||||
|
Reference in New Issue
Block a user