mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-18 14:27:39 +03:00
0023511: The function BRepTools::UVBounds provides icorrect result for a face
Range of changing of some analytic curves is computed by other methods. It allows computing face's boundaries with more precise. Tolerance was increased to provide successful work of some algorithms. Functions BRepOffsetAPI_MiddlePath::Build() and ApproxWithPCurves(...) (file IntTools_FaceFace.cxx) were changed according to new result of algorithm's work. It is possibly for "outboundaried faces" (see bug#23675) to compute incorrect UV-Bounds, when first parameter is more than last. To avoid it, extended control of computed bounds was added. Function for fail sameparameter fixing was added to HLRAppli_ReflectLines to avoid creation bad shapes after algorithm's work. In file ShapeFix_ComposeShell.cxx only text formatting was changed. Some test cases are changed according to their new behavior. Added test case bugs/moddata_3/bug23511
This commit is contained in:
@@ -460,67 +460,74 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con
|
||||
seqw.Clear();
|
||||
|
||||
// Init seqw by initial set of wires (with corresponding orientation)
|
||||
for ( TopoDS_Iterator iw(myFace,Standard_False); iw.More(); iw.Next() ) {
|
||||
//smh#8
|
||||
for ( TopoDS_Iterator iw(myFace,Standard_False); iw.More(); iw.Next() )
|
||||
{
|
||||
TopoDS_Shape tmpW = Context()->Apply ( iw.Value() ) ;
|
||||
if(tmpW.ShapeType() != TopAbs_WIRE) {
|
||||
if(tmpW.ShapeType() == TopAbs_VERTEX) {
|
||||
if(tmpW.ShapeType() != TopAbs_WIRE)
|
||||
{
|
||||
if(tmpW.ShapeType() == TopAbs_VERTEX)
|
||||
{
|
||||
ShapeFix_WireSegment seg; //(( isOuter ? TopAbs_REVERSED : TopAbs_FORWARD ) );
|
||||
seg.SetVertex(TopoDS::Vertex(tmpW));
|
||||
seg.Orientation(tmpW.Orientation());
|
||||
seqw.Append ( seg );
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
TopoDS_Wire wire = TopoDS::Wire ( tmpW );
|
||||
|
||||
Standard_Boolean isNonManifold = ( wire.Orientation() != TopAbs_REVERSED &&
|
||||
wire.Orientation() != TopAbs_FORWARD );
|
||||
|
||||
|
||||
|
||||
// protect against INTERNAL/EXTERNAL wires
|
||||
// if ( wire.Orientation() != TopAbs_REVERSED &&
|
||||
// wire.Orientation() != TopAbs_FORWARD ) continue;
|
||||
// if ( wire.Orientation() != TopAbs_REVERSED &&
|
||||
// wire.Orientation() != TopAbs_FORWARD ) continue;
|
||||
|
||||
// determine orientation of the wire
|
||||
// TopoDS_Face face = TopoDS::Face ( myFace.EmptyCopied() );
|
||||
// B.Add ( face, wire );
|
||||
// Standard_Boolean isOuter = ShapeAnalysis::IsOuterBound ( face );
|
||||
// TopoDS_Face face = TopoDS::Face ( myFace.EmptyCopied() );
|
||||
// B.Add ( face, wire );
|
||||
// Standard_Boolean isOuter = ShapeAnalysis::IsOuterBound ( face );
|
||||
|
||||
if(isNonManifold) {
|
||||
|
||||
if(isNonManifold)
|
||||
{
|
||||
Handle(ShapeExtend_WireData) sbwd = new ShapeExtend_WireData ( wire ,Standard_True,Standard_False);
|
||||
//pdn protection againts of wires w/o edges
|
||||
Standard_Integer nbEdges = sbwd->NbEdges();
|
||||
if(nbEdges) {
|
||||
|
||||
if(nbEdges)
|
||||
{
|
||||
//wire segments for non-manifold topology should have INTERNAL orientation
|
||||
ShapeFix_WireSegment seg ( sbwd, TopAbs_INTERNAL);
|
||||
seqw.Append ( seg );
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
//splitting wires containing manifold and non-manifold parts on a separate
|
||||
//wire segment
|
||||
|
||||
//wire segment
|
||||
Handle(ShapeExtend_WireData) sbwdM = new ShapeExtend_WireData();
|
||||
Handle(ShapeExtend_WireData) sbwdNM = new ShapeExtend_WireData();
|
||||
sbwdNM->ManifoldMode() = Standard_False;
|
||||
TopoDS_Iterator aIt(wire);
|
||||
for( ; aIt.More(); aIt.Next()) {
|
||||
for( ; aIt.More(); aIt.Next())
|
||||
{
|
||||
TopoDS_Edge E = TopoDS::Edge ( aIt.Value() );
|
||||
if(E.Orientation() == TopAbs_FORWARD || E.Orientation() == TopAbs_REVERSED)
|
||||
sbwdM->Add(E);
|
||||
else
|
||||
sbwdNM->Add(E);
|
||||
}
|
||||
|
||||
Standard_Integer nbMEdges = sbwdM->NbEdges();
|
||||
Standard_Integer nbNMEdges = sbwdNM->NbEdges();
|
||||
if(nbNMEdges) {
|
||||
|
||||
if(nbNMEdges)
|
||||
{
|
||||
ShapeFix_WireSegment seg ( sbwdNM, TopAbs_INTERNAL); //(( isOuter ? TopAbs_REVERSED : TopAbs_FORWARD ) );
|
||||
seqw.Append ( seg );
|
||||
}
|
||||
|
||||
if(nbMEdges) {
|
||||
// Orientation is set so as to allow the segment to be traversed in only one direction
|
||||
// skl 01.04.2002
|
||||
@@ -528,7 +535,8 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con
|
||||
sfw->Load ( sbwdM );
|
||||
Standard_Integer stat=0;
|
||||
Handle(Geom_Surface) gs = BRep_Tool::Surface(myFace);
|
||||
if( gs->IsUPeriodic() && gs->IsVPeriodic() ) {
|
||||
if( gs->IsUPeriodic() && gs->IsVPeriodic() )
|
||||
{
|
||||
// For torus-like shapes, first reorder in 2d since reorder is indifferent in 3d
|
||||
ShapeAnalysis_WireOrder sawo(Standard_False, 0);
|
||||
ShapeAnalysis_Edge sae;
|
||||
@@ -541,6 +549,7 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con
|
||||
continue;
|
||||
sawo.Add(c2d->Value(f).XY(),c2d->Value(l).XY());
|
||||
}
|
||||
|
||||
sawo.Perform();
|
||||
stat = (sawo.Status() < 0 ? -1 : 1);
|
||||
sfw->FixReorder(sawo);
|
||||
@@ -550,7 +559,8 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con
|
||||
if (sfw->StatusReorder(ShapeExtend_DONE3))
|
||||
stat=-1;
|
||||
|
||||
if( stat < 0 ) {
|
||||
if(stat < 0)
|
||||
{
|
||||
BRep_Builder B;
|
||||
TopoDS_Shape dummy = myFace.EmptyCopied();
|
||||
TopoDS_Face face = TopoDS::Face ( dummy );
|
||||
@@ -569,7 +579,6 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con
|
||||
seqw.Append ( seg );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1417,6 +1417,8 @@ static Standard_Boolean CheckWire (const TopoDS_Wire &wire,
|
||||
vec.SetX(0);
|
||||
vec.SetY(0);
|
||||
ShapeAnalysis_Edge sae;
|
||||
|
||||
isuopen = isvopen = 0;
|
||||
isDeg = Standard_True;
|
||||
for ( TopoDS_Iterator ed(wire); ed.More(); ed.Next() ) {
|
||||
TopoDS_Edge edge = TopoDS::Edge ( ed.Value() );
|
||||
@@ -1427,17 +1429,48 @@ static Standard_Boolean CheckWire (const TopoDS_Wire &wire,
|
||||
return Standard_False;
|
||||
vec += c2d->Value(l).XY() - c2d->Value(f).XY();
|
||||
}
|
||||
isuopen = ( Abs ( Abs ( vec.X() ) - dU ) < 0.1 * dU ? ( vec.X() >0 ? 1 : -1 ) : 0 );
|
||||
isvopen = ( Abs ( Abs ( vec.Y() ) - dV ) < 0.1 * dV ? ( vec.Y() >0 ? 1 : -1 ) : 0 );
|
||||
|
||||
Standard_Real aDelta = Abs(vec.X())-dU;
|
||||
if(Abs(aDelta) < 0.1*dU)
|
||||
{
|
||||
if(vec.X() > 0.0)
|
||||
{
|
||||
isuopen = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
isuopen = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
isuopen = 0;
|
||||
}
|
||||
|
||||
aDelta = Abs(vec.Y())-dV;
|
||||
if(Abs(aDelta) < 0.1*dV)
|
||||
{
|
||||
if(vec.Y() > 0.0)
|
||||
{
|
||||
isvopen = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
isvopen = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
isvopen = 0;
|
||||
}
|
||||
|
||||
return isuopen || isvopen;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FixMissingSeam
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ShapeFix_Face::FixMissingSeam()
|
||||
{
|
||||
Standard_Boolean uclosed = mySurf->IsUClosed();
|
||||
@@ -1480,8 +1513,8 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam()
|
||||
}
|
||||
}
|
||||
|
||||
URange = Abs ( SUL - SUF );
|
||||
VRange = Abs ( SVL - SVF );
|
||||
URange = Min(Abs (SUL - SUF), Precision::Infinite());
|
||||
VRange = Min(Abs(SVL - SVF), Precision::Infinite());
|
||||
// Standard_Real UTol = 0.2 * URange, VTol = 0.2 * VRange;
|
||||
Standard_Integer ismodeu = 0, ismodev = 0; //szv#4:S4163:12Mar99 was Boolean
|
||||
Standard_Integer isdeg1=0, isdeg2=0;
|
||||
|
Reference in New Issue
Block a user