mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0029204: BRepOffsetAPI_MakePipeShell produces invalid result and raises exception in Draw
1.The algorithm searching the section in the corner (ChooseSection) is modified to be able to find simple cases with rather big tolerance. 2. The constructor of BRepFill_Section is modified: now it removes locations in the shape of section like it was done in BRepFill_Pipe. 3. Correction of U-edges by Same Parameter has been added to the method BRepFill_Sweep::Build.
This commit is contained in:
@@ -22,6 +22,9 @@
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <ShapeUpgrade_RemoveLocations.hxx>
|
||||
|
||||
BRepFill_Section::BRepFill_Section() :islaw(0),
|
||||
ispunctual(0),
|
||||
@@ -41,12 +44,19 @@ BRepFill_Section::BRepFill_Section(const TopoDS_Shape& Profile,
|
||||
contact(WithContact),
|
||||
correction(WithCorrection)
|
||||
{
|
||||
if (Profile.ShapeType() == TopAbs_WIRE)
|
||||
wire = TopoDS::Wire(Profile);
|
||||
else if (Profile.ShapeType() == TopAbs_VERTEX)
|
||||
myOriginalShape = Profile;
|
||||
|
||||
ShapeUpgrade_RemoveLocations RemLoc;
|
||||
RemLoc.SetRemoveLevel(TopAbs_COMPOUND);
|
||||
RemLoc.Remove(Profile);
|
||||
TopoDS_Shape aProfile = RemLoc.GetResult();
|
||||
|
||||
if (aProfile.ShapeType() == TopAbs_WIRE)
|
||||
wire = TopoDS::Wire(aProfile);
|
||||
else if (aProfile.ShapeType() == TopAbs_VERTEX)
|
||||
{
|
||||
ispunctual = Standard_True;
|
||||
TopoDS_Vertex aVertex = TopoDS::Vertex(Profile);
|
||||
TopoDS_Vertex aVertex = TopoDS::Vertex(aProfile);
|
||||
BRep_Builder BB;
|
||||
|
||||
TopoDS_Edge DegEdge;
|
||||
@@ -67,3 +77,58 @@ void BRepFill_Section::Set(const Standard_Boolean IsLaw)
|
||||
{
|
||||
islaw = IsLaw;
|
||||
}
|
||||
|
||||
TopoDS_Shape BRepFill_Section::ModifiedShape(const TopoDS_Shape& theShape) const
|
||||
{
|
||||
TopoDS_Shape aModifiedShape;
|
||||
|
||||
switch (theShape.ShapeType())
|
||||
{
|
||||
case TopAbs_WIRE:
|
||||
if (theShape.IsSame(myOriginalShape))
|
||||
aModifiedShape = wire;
|
||||
break;
|
||||
case TopAbs_EDGE:
|
||||
{
|
||||
TopoDS_Iterator itor(myOriginalShape);
|
||||
TopoDS_Iterator itw(wire);
|
||||
for (; itor.More(); itor.Next(),itw.Next())
|
||||
{
|
||||
const TopoDS_Shape& anOriginalEdge = itor.Value();
|
||||
const TopoDS_Shape& anEdge = itw.Value();
|
||||
if (anOriginalEdge.IsSame(theShape))
|
||||
{
|
||||
aModifiedShape = anEdge;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TopAbs_VERTEX:
|
||||
if (theShape.IsSame(myOriginalShape))
|
||||
{
|
||||
TopExp_Explorer Explo(wire, TopAbs_VERTEX);
|
||||
aModifiedShape = Explo.Current();
|
||||
}
|
||||
else
|
||||
{
|
||||
TopExp_Explorer ExpOrig(myOriginalShape, TopAbs_VERTEX);
|
||||
TopExp_Explorer ExpWire(wire, TopAbs_VERTEX);
|
||||
for (; ExpOrig.More(); ExpOrig.Next(),ExpWire.Next())
|
||||
{
|
||||
const TopoDS_Shape& anOriginalVertex = ExpOrig.Current();
|
||||
const TopoDS_Shape& aVertex = ExpWire.Current();
|
||||
if (anOriginalVertex.IsSame(theShape))
|
||||
{
|
||||
aModifiedShape = aVertex;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return aModifiedShape;
|
||||
}
|
||||
|
Reference in New Issue
Block a user