mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0030940: BRepFilletAPI_MakeFillet algorithm fails on closed shell
1. Add check of configuration of corner in the end of spine. 2. Correct treatment of "smooth corners".
This commit is contained in:
@@ -44,16 +44,8 @@
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <ChFi3d.hxx>
|
||||
|
||||
//
|
||||
static void Correct2dPoint(const TopoDS_Face& theF, gp_Pnt2d& theP2d);
|
||||
//
|
||||
static BRepOffset_Type DefineConnectType(const TopoDS_Edge& E,
|
||||
const TopoDS_Face& F1,
|
||||
const TopoDS_Face& F2,
|
||||
const Standard_Real SinTol,
|
||||
const Standard_Boolean CorrectPoint);
|
||||
//
|
||||
static void CorrectOrientationOfTangent(gp_Vec& TangVec,
|
||||
const TopoDS_Vertex& aVertex,
|
||||
const TopoDS_Edge& anEdge)
|
||||
@@ -105,16 +97,17 @@ static void EdgeAnalyse(const TopoDS_Edge& E,
|
||||
// Tangent if the regularity is at least G1.
|
||||
if (BRep_Tool::HasContinuity(E,F1,F2)) {
|
||||
if (BRep_Tool::Continuity(E,F1,F2) > GeomAbs_C0) {
|
||||
I.Type(BRepOffset_Tangent);
|
||||
I.Type(ChFiDS_Tangential);
|
||||
LI.Append(I);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//
|
||||
BRepOffset_Type aType = DefineConnectType(E, F1, F2, SinTol, Standard_False);
|
||||
if(aType != BRepOffset_Tangent)
|
||||
ChFiDS_TypeOfConcavity aType = ChFi3d::DefineConnectType(E, F1, F2,
|
||||
SinTol, Standard_False);
|
||||
if(aType != ChFiDS_Tangential)
|
||||
{
|
||||
aType = DefineConnectType(E, F1, F2, SinTol, Standard_True);
|
||||
aType = ChFi3d::DefineConnectType(E, F1, F2, SinTol, Standard_True);
|
||||
}
|
||||
I.Type(aType);
|
||||
LI.Append(I);
|
||||
@@ -181,10 +174,10 @@ void BRepOffset_Analyse::Perform (const TopoDS_Shape& S,
|
||||
Standard_Real U1,U2;
|
||||
const TopoDS_Face& F = TopoDS::Face(L.First());
|
||||
BRep_Tool::Range(E,F,U1,U2);
|
||||
BRepOffset_Interval Inter(U1,U2,BRepOffset_Other);
|
||||
BRepOffset_Interval Inter(U1,U2,ChFiDS_Other);
|
||||
|
||||
if (! BRepTools::IsReallyClosed(E,F)) {
|
||||
Inter.Type(BRepOffset_FreeBoundary);
|
||||
Inter.Type(ChFiDS_FreeBound);
|
||||
}
|
||||
mapEdgeType(E).Append(Inter);
|
||||
}
|
||||
@@ -233,7 +226,7 @@ const
|
||||
//=======================================================================
|
||||
|
||||
void BRepOffset_Analyse::Edges(const TopoDS_Vertex& V,
|
||||
const BRepOffset_Type T,
|
||||
const ChFiDS_TypeOfConcavity T,
|
||||
TopTools_ListOfShape& LE)
|
||||
const
|
||||
{
|
||||
@@ -263,7 +256,7 @@ const
|
||||
//=======================================================================
|
||||
|
||||
void BRepOffset_Analyse::Edges(const TopoDS_Face& F,
|
||||
const BRepOffset_Type T,
|
||||
const ChFiDS_TypeOfConcavity T,
|
||||
TopTools_ListOfShape& LE)
|
||||
const
|
||||
{
|
||||
@@ -350,8 +343,8 @@ const TopTools_ListOfShape& BRepOffset_Analyse::Ancestors
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
|
||||
const BRepOffset_Type T ) const
|
||||
void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
|
||||
const ChFiDS_TypeOfConcavity T ) const
|
||||
{
|
||||
List.Clear();
|
||||
BRep_Builder B;
|
||||
@@ -377,9 +370,9 @@ void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
|
||||
const BRepOffset_Type T1,
|
||||
const BRepOffset_Type T2) const
|
||||
void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
|
||||
const ChFiDS_TypeOfConcavity T1,
|
||||
const ChFiDS_TypeOfConcavity T2) const
|
||||
{
|
||||
List.Clear();
|
||||
BRep_Builder B;
|
||||
@@ -409,7 +402,7 @@ void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
|
||||
void BRepOffset_Analyse::AddFaces (const TopoDS_Face& Face,
|
||||
TopoDS_Compound& Co,
|
||||
TopTools_MapOfShape& Map,
|
||||
const BRepOffset_Type T) const
|
||||
const ChFiDS_TypeOfConcavity T) const
|
||||
{
|
||||
BRep_Builder B;
|
||||
TopExp_Explorer exp(Face,TopAbs_EDGE);
|
||||
@@ -439,8 +432,8 @@ void BRepOffset_Analyse::AddFaces (const TopoDS_Face& Face,
|
||||
void BRepOffset_Analyse::AddFaces (const TopoDS_Face& Face,
|
||||
TopoDS_Compound& Co,
|
||||
TopTools_MapOfShape& Map,
|
||||
const BRepOffset_Type T1,
|
||||
const BRepOffset_Type T2) const
|
||||
const ChFiDS_TypeOfConcavity T1,
|
||||
const ChFiDS_TypeOfConcavity T2) const
|
||||
{
|
||||
BRep_Builder B;
|
||||
TopExp_Explorer exp(Face,TopAbs_EDGE);
|
||||
@@ -464,135 +457,3 @@ void BRepOffset_Analyse::AddFaces (const TopoDS_Face& Face,
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Correct2dPoint
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Correct2dPoint(const TopoDS_Face& theF, gp_Pnt2d& theP2d)
|
||||
{
|
||||
BRepAdaptor_Surface aBAS(theF, Standard_False);
|
||||
if (aBAS.GetType() < GeomAbs_BezierSurface) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
const Standard_Real coeff = 0.01;
|
||||
Standard_Real eps;
|
||||
Standard_Real u1, u2, v1, v2;
|
||||
//
|
||||
aBAS.Initialize(theF, Standard_True);
|
||||
u1 = aBAS.FirstUParameter();
|
||||
u2 = aBAS.LastUParameter();
|
||||
v1 = aBAS.FirstVParameter();
|
||||
v2 = aBAS.LastVParameter();
|
||||
if (!(Precision::IsInfinite(u1) || Precision::IsInfinite(u2)))
|
||||
{
|
||||
eps = Max(coeff*(u2 - u1), Precision::PConfusion());
|
||||
if (Abs(theP2d.X() - u1) < eps)
|
||||
{
|
||||
theP2d.SetX(u1 + eps);
|
||||
}
|
||||
if (Abs(theP2d.X() - u2) < eps)
|
||||
{
|
||||
theP2d.SetX(u2 - eps);
|
||||
}
|
||||
}
|
||||
if (!(Precision::IsInfinite(v1) || Precision::IsInfinite(v2)))
|
||||
{
|
||||
eps = Max(coeff*(v2 - v1), Precision::PConfusion());
|
||||
if (Abs(theP2d.Y() - v1) < eps)
|
||||
{
|
||||
theP2d.SetY(v1 + eps);
|
||||
}
|
||||
if (Abs(theP2d.Y() - v2) < eps)
|
||||
{
|
||||
theP2d.SetY(v2 - eps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DefineConnectType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepOffset_Type DefineConnectType(const TopoDS_Edge& E,
|
||||
const TopoDS_Face& F1,
|
||||
const TopoDS_Face& F2,
|
||||
const Standard_Real SinTol,
|
||||
const Standard_Boolean CorrectPoint)
|
||||
{
|
||||
TopLoc_Location L;
|
||||
Standard_Real f,l;
|
||||
|
||||
const Handle(Geom_Surface)& S1 = BRep_Tool::Surface(F1);
|
||||
const Handle(Geom_Surface)& S2 = BRep_Tool::Surface(F2);
|
||||
//
|
||||
Handle (Geom2d_Curve) C1 = BRep_Tool::CurveOnSurface(E,F1,f,l);
|
||||
Handle (Geom2d_Curve) C2 = BRep_Tool::CurveOnSurface(E,F2,f,l);
|
||||
|
||||
BRepAdaptor_Curve C(E);
|
||||
f = C.FirstParameter();
|
||||
l = C.LastParameter();
|
||||
//
|
||||
Standard_Real ParOnC = 0.5*(f+l);
|
||||
gp_Vec T1 = C.DN(ParOnC,1).Transformed(L.Transformation());
|
||||
if (T1.SquareMagnitude() > gp::Resolution()) {
|
||||
T1.Normalize();
|
||||
}
|
||||
|
||||
if (BRepOffset_Tool::OriEdgeInFace(E,F1) == TopAbs_REVERSED) {
|
||||
T1.Reverse();
|
||||
}
|
||||
if (F1.Orientation() == TopAbs_REVERSED) T1.Reverse();
|
||||
|
||||
gp_Pnt2d P = C1->Value(ParOnC);
|
||||
gp_Pnt P3;
|
||||
gp_Vec D1U,D1V;
|
||||
|
||||
if(CorrectPoint)
|
||||
Correct2dPoint(F1, P);
|
||||
//
|
||||
S1->D1(P.X(),P.Y(),P3,D1U,D1V);
|
||||
gp_Vec DN1(D1U^D1V);
|
||||
if (F1.Orientation() == TopAbs_REVERSED) DN1.Reverse();
|
||||
|
||||
P = C2->Value(ParOnC);
|
||||
if(CorrectPoint)
|
||||
Correct2dPoint(F2, P);
|
||||
S2->D1(P.X(),P.Y(),P3,D1U,D1V);
|
||||
gp_Vec DN2(D1U^D1V);
|
||||
if (F2.Orientation() == TopAbs_REVERSED) DN2.Reverse();
|
||||
|
||||
DN1.Normalize();
|
||||
DN2.Normalize();
|
||||
|
||||
gp_Vec ProVec = DN1^DN2;
|
||||
Standard_Real NormProVec = ProVec.Magnitude();
|
||||
|
||||
if (Abs(NormProVec) < SinTol) {
|
||||
// plane
|
||||
if (DN1.Dot(DN2) > 0) {
|
||||
//Tangent
|
||||
return BRepOffset_Tangent;
|
||||
}
|
||||
else {
|
||||
//Mixed not finished!
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout <<" faces locally mixed"<<std::endl;
|
||||
#endif
|
||||
return BRepOffset_Convex;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (NormProVec > gp::Resolution())
|
||||
ProVec.Normalize();
|
||||
Standard_Real Prod = T1.Dot(DN1^DN2);
|
||||
if (Prod > 0.) {
|
||||
//
|
||||
return BRepOffset_Convex;
|
||||
}
|
||||
else {
|
||||
//reenters
|
||||
return BRepOffset_Concave;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <BRepOffset_ListOfInterval.hxx>
|
||||
#include <BRepOffset_Type.hxx>
|
||||
#include <ChFiDS_TypeOfConcavity.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
class TopoDS_Shape;
|
||||
@@ -60,15 +60,21 @@ public:
|
||||
|
||||
//! Stores in <L> all the edges of Type <T>
|
||||
//! on the vertex <V>.
|
||||
Standard_EXPORT void Edges (const TopoDS_Vertex& V, const BRepOffset_Type T, TopTools_ListOfShape& L) const;
|
||||
Standard_EXPORT void Edges (const TopoDS_Vertex& V,
|
||||
const ChFiDS_TypeOfConcavity T,
|
||||
TopTools_ListOfShape& L) const;
|
||||
|
||||
//! Stores in <L> all the edges of Type <T>
|
||||
//! on the face <F>.
|
||||
Standard_EXPORT void Edges (const TopoDS_Face& F, const BRepOffset_Type T, TopTools_ListOfShape& L) const;
|
||||
Standard_EXPORT void Edges (const TopoDS_Face& F,
|
||||
const ChFiDS_TypeOfConcavity T,
|
||||
TopTools_ListOfShape& L) const;
|
||||
|
||||
//! set in <Edges> all the Edges of <Shape> which are
|
||||
//! tangent to <Edge> at the vertex <Vertex>.
|
||||
Standard_EXPORT void TangentEdges (const TopoDS_Edge& Edge, const TopoDS_Vertex& Vertex, TopTools_ListOfShape& Edges) const;
|
||||
Standard_EXPORT void TangentEdges (const TopoDS_Edge& Edge,
|
||||
const TopoDS_Vertex& Vertex,
|
||||
TopTools_ListOfShape& Edges) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean HasAncestor (const TopoDS_Shape& S) const;
|
||||
|
||||
@@ -76,19 +82,29 @@ public:
|
||||
|
||||
//! Explode in compounds of faces where
|
||||
//! all the connex edges are of type <Side>
|
||||
Standard_EXPORT void Explode (TopTools_ListOfShape& L, const BRepOffset_Type Type) const;
|
||||
Standard_EXPORT void Explode (TopTools_ListOfShape& L,
|
||||
const ChFiDS_TypeOfConcavity Type) const;
|
||||
|
||||
//! Explode in compounds of faces where
|
||||
//! all the connex edges are of type <Side1> or <Side2>
|
||||
Standard_EXPORT void Explode (TopTools_ListOfShape& L, const BRepOffset_Type Type1, const BRepOffset_Type Type2) const;
|
||||
Standard_EXPORT void Explode (TopTools_ListOfShape& L,
|
||||
const ChFiDS_TypeOfConcavity Type1,
|
||||
const ChFiDS_TypeOfConcavity Type2) const;
|
||||
|
||||
//! Add in <CO> the faces of the shell containing <Face>
|
||||
//! where all the connex edges are of type <Side>.
|
||||
Standard_EXPORT void AddFaces (const TopoDS_Face& Face, TopoDS_Compound& Co, TopTools_MapOfShape& Map, const BRepOffset_Type Type) const;
|
||||
Standard_EXPORT void AddFaces (const TopoDS_Face& Face,
|
||||
TopoDS_Compound& Co,
|
||||
TopTools_MapOfShape& Map,
|
||||
const ChFiDS_TypeOfConcavity Type) const;
|
||||
|
||||
//! Add in <CO> the faces of the shell containing <Face>
|
||||
//! where all the connex edges are of type <Side1> or <Side2>.
|
||||
Standard_EXPORT void AddFaces (const TopoDS_Face& Face, TopoDS_Compound& Co, TopTools_MapOfShape& Map, const BRepOffset_Type Type1, const BRepOffset_Type Type2) const;
|
||||
Standard_EXPORT void AddFaces (const TopoDS_Face& Face,
|
||||
TopoDS_Compound& Co,
|
||||
TopTools_MapOfShape& Map,
|
||||
const ChFiDS_TypeOfConcavity Type1,
|
||||
const ChFiDS_TypeOfConcavity Type2) const;
|
||||
|
||||
|
||||
|
||||
|
@@ -253,8 +253,8 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& /*SetOfFaces
|
||||
const BRepOffset_Analyse& Analyse,
|
||||
const BRepAlgo_Image& InitOffsetFace)
|
||||
{
|
||||
BRepOffset_Type OT = BRepOffset_Concave;
|
||||
if (mySide == TopAbs_OUT) OT = BRepOffset_Convex;
|
||||
ChFiDS_TypeOfConcavity OT = ChFiDS_Concave;
|
||||
if (mySide == TopAbs_OUT) OT = ChFiDS_Convex;
|
||||
TopExp_Explorer Exp(ShapeInit,TopAbs_EDGE);
|
||||
TopTools_ListOfShape LInt1,LInt2;
|
||||
TopoDS_Face F1,F2;
|
||||
@@ -349,7 +349,7 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& /*SetOfFaces
|
||||
// to the tube or if E2 is not a tangent edge.
|
||||
//-------------------------------------------------------
|
||||
const BRepOffset_ListOfInterval& L = Analyse.Type(E2);
|
||||
if (!L.IsEmpty() && L.First().Type() == BRepOffset_Tangent) {
|
||||
if (!L.IsEmpty() && L.First().Type() == ChFiDS_Tangential) {
|
||||
continue;
|
||||
}
|
||||
const TopTools_ListOfShape& AncE2 = Analyse.Ancestors(E2);
|
||||
@@ -511,13 +511,13 @@ void BRepOffset_Inter3d::ConnexIntByInt
|
||||
continue;
|
||||
}
|
||||
//
|
||||
BRepOffset_Type OT = L.First().Type();
|
||||
if (OT != BRepOffset_Convex && OT != BRepOffset_Concave) {
|
||||
ChFiDS_TypeOfConcavity OT = L.First().Type();
|
||||
if (OT != ChFiDS_Convex && OT != ChFiDS_Concave) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
if (OT == BRepOffset_Concave) CurSide = TopAbs_IN;
|
||||
else CurSide = TopAbs_OUT;
|
||||
if (OT == ChFiDS_Concave) CurSide = TopAbs_IN;
|
||||
else CurSide = TopAbs_OUT;
|
||||
//-----------------------------------------------------------
|
||||
// edge is of the proper type, return adjacent faces.
|
||||
//-----------------------------------------------------------
|
||||
|
@@ -33,7 +33,7 @@ BRepOffset_Interval::BRepOffset_Interval()
|
||||
|
||||
BRepOffset_Interval::BRepOffset_Interval(const Standard_Real U1,
|
||||
const Standard_Real U2,
|
||||
const BRepOffset_Type Type):
|
||||
const ChFiDS_TypeOfConcavity Type):
|
||||
f(U1),
|
||||
l(U2),
|
||||
type(Type)
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <BRepOffset_Type.hxx>
|
||||
#include <ChFiDS_TypeOfConcavity.hxx>
|
||||
|
||||
|
||||
|
||||
@@ -35,19 +35,21 @@ public:
|
||||
|
||||
Standard_EXPORT BRepOffset_Interval();
|
||||
|
||||
Standard_EXPORT BRepOffset_Interval(const Standard_Real U1, const Standard_Real U2, const BRepOffset_Type Type);
|
||||
Standard_EXPORT BRepOffset_Interval(const Standard_Real U1,
|
||||
const Standard_Real U2,
|
||||
const ChFiDS_TypeOfConcavity Type);
|
||||
|
||||
void First (const Standard_Real U);
|
||||
|
||||
void Last (const Standard_Real U);
|
||||
|
||||
void Type (const BRepOffset_Type T);
|
||||
void Type (const ChFiDS_TypeOfConcavity T);
|
||||
|
||||
Standard_Real First() const;
|
||||
|
||||
Standard_Real Last() const;
|
||||
|
||||
BRepOffset_Type Type() const;
|
||||
ChFiDS_TypeOfConcavity Type() const;
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +66,7 @@ private:
|
||||
|
||||
Standard_Real f;
|
||||
Standard_Real l;
|
||||
BRepOffset_Type type;
|
||||
ChFiDS_TypeOfConcavity type;
|
||||
|
||||
|
||||
};
|
||||
|
@@ -41,7 +41,7 @@ inline void BRepOffset_Interval::Last(const Standard_Real U)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void BRepOffset_Interval::Type(const BRepOffset_Type T)
|
||||
inline void BRepOffset_Interval::Type(const ChFiDS_TypeOfConcavity T)
|
||||
{
|
||||
type = T;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ inline Standard_Real BRepOffset_Interval::Last() const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline BRepOffset_Type BRepOffset_Interval::Type() const
|
||||
inline ChFiDS_TypeOfConcavity BRepOffset_Interval::Type() const
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
@@ -509,26 +509,26 @@ static void FillContours(const TopoDS_Shape& aShape,
|
||||
BRepTools_WireExplorer Wexp;
|
||||
|
||||
for (; Explo.More(); Explo.Next())
|
||||
{
|
||||
TopoDS_Face aFace = TopoDS::Face(Explo.Current());
|
||||
TopoDS_Iterator itf(aFace);
|
||||
for (; itf.More(); itf.Next())
|
||||
{
|
||||
TopoDS_Face aFace = TopoDS::Face(Explo.Current());
|
||||
TopoDS_Iterator itf(aFace);
|
||||
for (; itf.More(); itf.Next())
|
||||
TopoDS_Wire aWire = TopoDS::Wire(itf.Value());
|
||||
for (Wexp.Init(aWire, aFace); Wexp.More(); Wexp.Next())
|
||||
{
|
||||
TopoDS_Edge anEdge = Wexp.Current();
|
||||
if (BRep_Tool::Degenerated(anEdge))
|
||||
continue;
|
||||
const BRepOffset_ListOfInterval& Lint = Analyser.Type(anEdge);
|
||||
if (!Lint.IsEmpty() && Lint.First().Type() == ChFiDS_FreeBound)
|
||||
{
|
||||
TopoDS_Wire aWire = TopoDS::Wire(itf.Value());
|
||||
for (Wexp.Init(aWire, aFace); Wexp.More(); Wexp.Next())
|
||||
{
|
||||
TopoDS_Edge anEdge = Wexp.Current();
|
||||
if (BRep_Tool::Degenerated(anEdge))
|
||||
continue;
|
||||
const BRepOffset_ListOfInterval& Lint = Analyser.Type(anEdge);
|
||||
if (!Lint.IsEmpty() && Lint.First().Type() == BRepOffset_FreeBoundary)
|
||||
{
|
||||
MapEF.Bind(anEdge, aFace);
|
||||
Edges.Append(anEdge);
|
||||
}
|
||||
}
|
||||
MapEF.Bind(anEdge, aFace);
|
||||
Edges.Append(anEdge);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TopTools_ListIteratorOfListOfShape itl;
|
||||
while (!Edges.IsEmpty())
|
||||
@@ -1050,7 +1050,7 @@ void BRepOffset_MakeOffset::MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& the
|
||||
aCurOffset = myFaceOffset.IsBound(aF) ? myFaceOffset(aF) : myOffset;
|
||||
BRepOffset_Offset OF(aF, aCurOffset, ShapeTgt, OffsetOutside, myJoin);
|
||||
TopTools_ListOfShape Let;
|
||||
myAnalyse.Edges(aF,BRepOffset_Tangent,Let);
|
||||
myAnalyse.Edges(aF,ChFiDS_Tangential,Let);
|
||||
TopTools_ListIteratorOfListOfShape itl(Let);
|
||||
for (; itl.More(); itl.Next()) {
|
||||
const TopoDS_Edge& Cur = TopoDS::Edge(itl.Value());
|
||||
@@ -1063,14 +1063,14 @@ void BRepOffset_MakeOffset::MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& the
|
||||
TopExp::Vertices (OTE,OV1,OV2);
|
||||
TopTools_ListOfShape LE;
|
||||
if (!ShapeTgt.IsBound(V1)) {
|
||||
myAnalyse.Edges(V1,BRepOffset_Tangent,LE);
|
||||
myAnalyse.Edges(V1,ChFiDS_Tangential,LE);
|
||||
const TopTools_ListOfShape& LA =myAnalyse.Ancestors(V1);
|
||||
if (LE.Extent() == LA.Extent())
|
||||
ShapeTgt.Bind(V1,OV1);
|
||||
}
|
||||
if (!ShapeTgt.IsBound(V2)) {
|
||||
LE.Clear();
|
||||
myAnalyse.Edges(V2,BRepOffset_Tangent,LE);
|
||||
myAnalyse.Edges(V2,ChFiDS_Tangential,LE);
|
||||
const TopTools_ListOfShape& LA =myAnalyse.Ancestors(V2);
|
||||
if (LE.Extent() == LA.Extent())
|
||||
ShapeTgt.Bind(V2,OV2);
|
||||
@@ -1463,8 +1463,8 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
|
||||
//--------------------------------------------------------
|
||||
// Construction of tubes on edge.
|
||||
//--------------------------------------------------------
|
||||
BRepOffset_Type OT = BRepOffset_Convex;
|
||||
if (myOffset < 0.) OT = BRepOffset_Concave;
|
||||
ChFiDS_TypeOfConcavity OT = ChFiDS_Convex;
|
||||
if (myOffset < 0.) OT = ChFiDS_Concave;
|
||||
|
||||
for (Exp.Init(myShape,TopAbs_EDGE); Exp.More(); Exp.Next()) {
|
||||
const TopoDS_Edge& E = TopoDS::Edge(Exp.Current());
|
||||
@@ -1566,7 +1566,7 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
|
||||
// Particular processing if V is at least a free border.
|
||||
//-------------------------------------------------------------
|
||||
TopTools_ListOfShape LBF;
|
||||
myAnalyse.Edges(V,BRepOffset_FreeBoundary,LBF);
|
||||
myAnalyse.Edges(V,ChFiDS_FreeBound,LBF);
|
||||
if (!LBF.IsEmpty()) {
|
||||
Standard_Boolean First = Standard_True;
|
||||
for (it.Initialize(LE) ; it.More(); it.Next()) {
|
||||
@@ -1592,8 +1592,8 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
|
||||
//------------------------------------------------------
|
||||
// MAJ SD.
|
||||
//------------------------------------------------------
|
||||
BRepOffset_Type RT = BRepOffset_Concave;
|
||||
if (myOffset < 0.) RT = BRepOffset_Convex;
|
||||
ChFiDS_TypeOfConcavity RT = ChFiDS_Concave;
|
||||
if (myOffset < 0.) RT = ChFiDS_Convex;
|
||||
BRepOffset_DataMapIteratorOfDataMapOfShapeOffset It(MapSF);
|
||||
for ( ; It.More(); It.Next()) {
|
||||
const TopoDS_Shape& SI = It.Key();
|
||||
@@ -1737,8 +1737,8 @@ void BRepOffset_MakeOffset::ToContext (BRepOffset_DataMapOfShapeOffset& MapSF)
|
||||
// Reconstruction of faces.
|
||||
//---------------------------
|
||||
TopoDS_Face F,NF;
|
||||
BRepOffset_Type RT = BRepOffset_Concave;
|
||||
if (myOffset < 0.) RT = BRepOffset_Convex;
|
||||
ChFiDS_TypeOfConcavity RT = ChFiDS_Concave;
|
||||
if (myOffset < 0.) RT = ChFiDS_Convex;
|
||||
TopoDS_Shape OE,NE;
|
||||
TopAbs_Orientation Or;
|
||||
|
||||
@@ -1825,8 +1825,8 @@ void BRepOffset_MakeOffset::UpdateFaceOffset()
|
||||
CopiedMap.Assign(myFaceOffset);
|
||||
TopTools_DataMapIteratorOfDataMapOfShapeReal it(CopiedMap);
|
||||
|
||||
BRepOffset_Type RT = BRepOffset_Convex;
|
||||
if (myOffset < 0.) RT = BRepOffset_Concave;
|
||||
ChFiDS_TypeOfConcavity RT = ChFiDS_Convex;
|
||||
if (myOffset < 0.) RT = ChFiDS_Concave;
|
||||
|
||||
for ( ; it.More(); it.Next()) {
|
||||
const TopoDS_Face& F = TopoDS::Face(it.Key());
|
||||
@@ -1838,9 +1838,9 @@ void BRepOffset_MakeOffset::UpdateFaceOffset()
|
||||
TopTools_MapOfShape Dummy;
|
||||
Build.Add(Co,F);
|
||||
if (myJoin == GeomAbs_Arc)
|
||||
myAnalyse.AddFaces(F,Co,Dummy,BRepOffset_Tangent,RT);
|
||||
myAnalyse.AddFaces(F,Co,Dummy,ChFiDS_Tangential,RT);
|
||||
else
|
||||
myAnalyse.AddFaces(F,Co,Dummy,BRepOffset_Tangent);
|
||||
myAnalyse.AddFaces(F,Co,Dummy,ChFiDS_Tangential);
|
||||
|
||||
TopExp_Explorer exp(Co,TopAbs_FACE);
|
||||
for (; exp.More(); exp.Next()) {
|
||||
@@ -3133,7 +3133,7 @@ void BRepOffset_MakeOffset::SelectShells ()
|
||||
const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
|
||||
const TopTools_ListOfShape& LA = myAnalyse.Ancestors(E);
|
||||
if (LA.Extent() < 2) {
|
||||
if (myAnalyse.Type(E).First().Type() == BRepOffset_FreeBoundary) {
|
||||
if (myAnalyse.Type(E).First().Type() == ChFiDS_FreeBound) {
|
||||
FreeEdges.Add(E);
|
||||
}
|
||||
}
|
||||
@@ -3334,7 +3334,7 @@ void BRepOffset_MakeOffset::EncodeRegularity ()
|
||||
if ( myAnalyse.HasAncestor(Ed)) {
|
||||
const BRepOffset_ListOfInterval& LI = myAnalyse.Type(Ed);
|
||||
if (LI.Extent() == 1 &&
|
||||
LI.First().Type() == BRepOffset_Tangent) {
|
||||
LI.First().Type() == ChFiDS_Tangential) {
|
||||
B.Continuity(OE,F1,F2,GeomAbs_G1);
|
||||
}
|
||||
}
|
||||
|
@@ -180,26 +180,6 @@ void BRepOffset_Tool::EdgeVertices (const TopoDS_Edge& E,
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OriEdgeInFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopAbs_Orientation BRepOffset_Tool::OriEdgeInFace (const TopoDS_Edge& E,
|
||||
const TopoDS_Face& F )
|
||||
|
||||
{
|
||||
TopExp_Explorer Exp;
|
||||
Exp.Init(F.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
|
||||
|
||||
for (; Exp.More() ;Exp.Next()) {
|
||||
if (Exp.Current().IsSame(E)) {
|
||||
return Exp.Current().Orientation();
|
||||
}
|
||||
}
|
||||
throw Standard_ConstructionError("BRepOffset_Tool::OriEdgeInFace");
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FindPeriod
|
||||
//purpose :
|
||||
@@ -3008,8 +2988,8 @@ void BRepOffset_Tool::CheckBounds(const TopoDS_Face& F,
|
||||
const BRepOffset_ListOfInterval& L = Analyse.Type(anEdge);
|
||||
if (!L.IsEmpty() || BRep_Tool::Degenerated(anEdge))
|
||||
{
|
||||
BRepOffset_Type OT = L.First().Type();
|
||||
if (OT == BRepOffset_Tangent || BRep_Tool::Degenerated(anEdge))
|
||||
ChFiDS_TypeOfConcavity OT = L.First().Type();
|
||||
if (OT == ChFiDS_Tangential || BRep_Tool::Degenerated(anEdge))
|
||||
{
|
||||
Standard_Real fpar, lpar;
|
||||
Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(anEdge, F, fpar, lpar);
|
||||
|
@@ -53,10 +53,6 @@ public:
|
||||
//! taking account the orientation of Edge.
|
||||
Standard_EXPORT static void EdgeVertices (const TopoDS_Edge& E, TopoDS_Vertex& V1, TopoDS_Vertex& V2);
|
||||
|
||||
//! returns the cumul of the orientation of <Edge>
|
||||
//! and thc containing wire in <Face>
|
||||
Standard_EXPORT static TopAbs_Orientation OriEdgeInFace (const TopoDS_Edge& E, const TopoDS_Face& F);
|
||||
|
||||
//! <E> is a section between <F1> and <F2>. Computes
|
||||
//! <O1> the orientation of <E> in <F1> influenced by <F2>.
|
||||
//! idem for <O2>.
|
||||
|
@@ -1,30 +0,0 @@
|
||||
// Created on: 1995-10-12
|
||||
// Created by: Bruno DUMORTIER
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BRepOffset_Type_HeaderFile
|
||||
#define _BRepOffset_Type_HeaderFile
|
||||
|
||||
|
||||
enum BRepOffset_Type
|
||||
{
|
||||
BRepOffset_Concave,
|
||||
BRepOffset_Convex,
|
||||
BRepOffset_Tangent,
|
||||
BRepOffset_FreeBoundary,
|
||||
BRepOffset_Other
|
||||
};
|
||||
|
||||
#endif // _BRepOffset_Type_HeaderFile
|
@@ -34,4 +34,3 @@ BRepOffset_Offset.lxx
|
||||
BRepOffset_Status.hxx
|
||||
BRepOffset_Tool.cxx
|
||||
BRepOffset_Tool.hxx
|
||||
BRepOffset_Type.hxx
|
||||
|
Reference in New Issue
Block a user