projects
/
occt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
0026419: [Regression?] Export of a reversed face leads to crash in 6.9.0 although...
[occt.git]
/
src
/
BRepToIGES
/
BRepToIGES_BRShell.cxx
diff --git
a/src/BRepToIGES/BRepToIGES_BRShell.cxx
b/src/BRepToIGES/BRepToIGES_BRShell.cxx
index
ed7ea18
..
c0885f7
100644
(file)
--- a/
src/BRepToIGES/BRepToIGES_BRShell.cxx
+++ b/
src/BRepToIGES/BRepToIGES_BRShell.cxx
@@
-17,16
+17,13
@@
//:n3 abv 8 Feb 99: PRO17820: BRepTools::OuterWire() -> ShapeAnalysis::OuterWire
//szv#4 S4163
//:n3 abv 8 Feb 99: PRO17820: BRepTools::OuterWire() -> ShapeAnalysis::OuterWire
//szv#4 S4163
-#include <BRepToIGES_BRShell.ixx>
-#include <BRepToIGES_BRWire.hxx>
-
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
+#include <BRepToIGES_BREntity.hxx>
+#include <BRepToIGES_BRShell.hxx>
+#include <BRepToIGES_BRWire.hxx>
#include <BRepTools.hxx>
#include <BRepTools.hxx>
-
-#include <gp.hxx>
-#include <gp_Trsf.hxx>
-
+#include <Geom2d_Curve.hxx>
#include <Geom_ConicalSurface.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_ConicalSurface.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
@@
-34,52
+31,40
@@
#include <Geom_Surface.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_ToroidalSurface.hxx>
#include <Geom_Surface.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_ToroidalSurface.hxx>
-#include <Geom2d_Curve.hxx>
-
#include <GeomToIGES_GeomSurface.hxx>
#include <GeomToIGES_GeomSurface.hxx>
-
+#include <gp.hxx>
+#include <gp_Trsf.hxx>
#include <IGESBasic_Group.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESData_IGESEntity.hxx>
#include <IGESBasic_Group.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESData_IGESEntity.hxx>
-
#include <IGESGeom_CurveOnSurface.hxx>
#include <IGESGeom_HArray1OfCurveOnSurface.hxx>
#include <IGESGeom_CurveOnSurface.hxx>
#include <IGESGeom_HArray1OfCurveOnSurface.hxx>
-#include <IGESGeom_TrimmedSurface.hxx>
#include <IGESGeom_SurfaceOfRevolution.hxx>
#include <IGESGeom_SurfaceOfRevolution.hxx>
-
+#include <IGESGeom_TrimmedSurface.hxx>
#include <Interface_Macros.hxx>
#include <Interface_Macros.hxx>
-
-#include <NCollection_Map.hxx>
+#include <Message_ProgressIndicator.hxx>
#include <NCollection_IncAllocator.hxx>
#include <NCollection_IncAllocator.hxx>
-
+#include <NCollection_Map.hxx>
+#include <ShapeAlgo.hxx>
+#include <ShapeAlgo_AlgoContainer.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
-
+#include <TopAbs_ShapeEnum.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
#include <TopLoc_Location.hxx>
-
-#include <TopTools_ShapeMapHasher.hxx>
-
#include <TopoDS.hxx>
#include <TopoDS.hxx>
-#include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Shell.hxx>
+#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Wire.hxx>
-#include <TopoDS_Shape.hxx>
-
-#include <TopAbs_ShapeEnum.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-
-#include <ShapeAlgo.hxx>
-#include <ShapeAlgo_AlgoContainer.hxx>
-
-#include <Message_ProgressIndicator.hxx>
+#include <TopTools_ShapeMapHasher.hxx>
#include <Transfer_FinderProcess.hxx>
//=============================================================================
// BRepToIGES_BRShell
//=============================================================================
#include <Transfer_FinderProcess.hxx>
//=============================================================================
// BRepToIGES_BRShell
//=============================================================================
-
BRepToIGES_BRShell::BRepToIGES_BRShell()
{
}
BRepToIGES_BRShell::BRepToIGES_BRShell()
{
}
@@
-147,13
+132,19
@@
Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
BRep_Builder B;
TopLoc_Location aLoc;
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(start, aLoc);
BRep_Builder B;
TopLoc_Location aLoc;
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(start, aLoc);
+ while (aSurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
+ {
+ // take basis surface, because pcurves will be transformed, so trim will be shifted,
+ // accorded to new face bounds
+ Handle(Geom_RectangularTrimmedSurface) aTrimmedSurf =
+ Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf);
+ aSurf = aTrimmedSurf->BasisSurface();
+ }
aSurf = aSurf->UReversed();
aSurf = aSurf->UReversed();
- Standard_Real U1, U2, V1, V2;
- aSurf->Bounds(U1, U2, V1, V2);
Standard_Real aTol = BRep_Tool::Tolerance(start);
B.MakeFace(myface, aSurf, aLoc ,aTol);
// set specifics flags of a Face
Standard_Real aTol = BRep_Tool::Tolerance(start);
B.MakeFace(myface, aSurf, aLoc ,aTol);
// set specifics flags of a Face
-
B.NaturalRestriction(myface, BRep_Tool::NaturalRestriction(start));
+ B.NaturalRestriction(myface, BRep_Tool::NaturalRestriction(start));
//add wires
TopoDS_Wire anOuter = TopoDS::Wire(ShapeAlgo::AlgoContainer()->OuterWire(start));
TopExp_Explorer ex;
//add wires
TopoDS_Wire anOuter = TopoDS::Wire(ShapeAlgo::AlgoContainer()->OuterWire(start));
TopExp_Explorer ex;
@@
-170,7
+161,14
@@
Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
B.Add(myface, W);
}
}
B.Add(myface, W);
}
}
+
// mirror pcurves
// mirror pcurves
+ Standard_Real U1, U2, V1, V2;
+ aSurf->Bounds(U1, U2, V1, V2);
+ Standard_Real aCenter = 0.5 * (U1 + U2);
+ gp_Trsf2d T;
+ gp_Ax2d axis(gp_Pnt2d(aCenter, V1), gp_Dir2d(0.,1.));
+ T.SetMirror(axis);
NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> aMap (101, new NCollection_IncAllocator);
for (ex.Init(myface,TopAbs_EDGE);ex.More(); ex.Next()) {
TopoDS_Edge anEdge = TopoDS::Edge(ex.Current());
NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> aMap (101, new NCollection_IncAllocator);
for (ex.Init(myface,TopAbs_EDGE);ex.More(); ex.Next()) {
TopoDS_Edge anEdge = TopoDS::Edge(ex.Current());
@@
-181,9
+179,6
@@
Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
Handle(Geom2d_Curve) aCurve1, aCurve2;
aCurve1 = BRep_Tool::CurveOnSurface(anEdge, start, f, l);
aTol = BRep_Tool::Tolerance(anEdge);
Handle(Geom2d_Curve) aCurve1, aCurve2;
aCurve1 = BRep_Tool::CurveOnSurface(anEdge, start, f, l);
aTol = BRep_Tool::Tolerance(anEdge);
- gp_Trsf2d T;
- gp_Ax2d axis(gp_Pnt2d(0.5 * (U1 + U2), V1), gp_Dir2d(0.,1.));
- T.SetMirror(axis);
if (!aCurve1.IsNull()) {
aCurve1 = Handle(Geom2d_Curve)::DownCast(aCurve1->Transformed(T));
if (BRepTools::IsReallyClosed(anEdge, start)) {
if (!aCurve1.IsNull()) {
aCurve1 = Handle(Geom2d_Curve)::DownCast(aCurve1->Transformed(T));
if (BRepTools::IsReallyClosed(anEdge, start)) {
@@
-191,7
+186,10
@@
Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
aCurve2 = BRep_Tool::CurveOnSurface(revEdge, start, f, l);
if (!aCurve2.IsNull()) {
aCurve2 = Handle(Geom2d_Curve)::DownCast(aCurve2->Transformed(T));
aCurve2 = BRep_Tool::CurveOnSurface(revEdge, start, f, l);
if (!aCurve2.IsNull()) {
aCurve2 = Handle(Geom2d_Curve)::DownCast(aCurve2->Transformed(T));
- B.UpdateEdge(anEdge, aCurve1, aCurve2, myface, aTol);
+ if (anEdge.Orientation() == TopAbs_FORWARD)
+ B.UpdateEdge(anEdge, aCurve1, aCurve2, myface, aTol);
+ else
+ B.UpdateEdge(anEdge, aCurve2, aCurve1, myface, aTol);
}
else {
B.UpdateEdge(anEdge, aCurve1, myface, aTol);
}
else {
B.UpdateEdge(anEdge, aCurve1, myface, aTol);
@@
-313,15
+311,13
@@
Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
// returns the TrimmedSurface
// --------------------------
// returns the TrimmedSurface
// --------------------------
- Standard_Boolean Flag = Standard_True;
Handle(IGESGeom_TrimmedSurface) TrimmedSurf = new IGESGeom_TrimmedSurface;
if (BRep_Tool::NaturalRestriction(start)) {
//if face bounds and surface bounds are same, outer wire is unnecessary
Handle(IGESGeom_TrimmedSurface) TrimmedSurf = new IGESGeom_TrimmedSurface;
if (BRep_Tool::NaturalRestriction(start)) {
//if face bounds and surface bounds are same, outer wire is unnecessary
- Standard_Boolean Flag = Standard_False;
- TrimmedSurf-> Init (ISurf, Flag, NULL, Tab);
+ TrimmedSurf-> Init (ISurf, Standard_False, NULL, Tab);
}
else
}
else
- TrimmedSurf-> Init (ISurf,
Flag
, IOuter, Tab);
+ TrimmedSurf-> Init (ISurf,
Standard_True
, IOuter, Tab);
res = TrimmedSurf;
SetShapeResult ( start, res );
res = TrimmedSurf;
SetShapeResult ( start, res );