mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +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:
parent
bf327822d6
commit
eff3eff916
@ -1857,3 +1857,9 @@ The following API changes have been made:
|
|||||||
@subsection upgrade_740_stdnamespace Standard_Stream.hxx no more has "using std::" statements
|
@subsection upgrade_740_stdnamespace Standard_Stream.hxx no more has "using std::" statements
|
||||||
*Standard_Stream.hxx* header, commonly included by other OCCT header files, does no more add entities from *std namespace* related to streams (like *std::cout*, *std::istream* and others) into global namespace.
|
*Standard_Stream.hxx* header, commonly included by other OCCT header files, does no more add entities from *std namespace* related to streams (like *std::cout*, *std::istream* and others) into global namespace.
|
||||||
The application code relying on this matter should be updated to either specify std namespace explicitly (like std::cout) or add "using std::" statements locally.
|
The application code relying on this matter should be updated to either specify std namespace explicitly (like std::cout) or add "using std::" statements locally.
|
||||||
|
|
||||||
|
@section upgrade_occt750 Upgrade to OCCT 7.5.0
|
||||||
|
|
||||||
|
@subsection upgrade_750_rename Renaming of types
|
||||||
|
|
||||||
|
Enumeration BRepOffset_Type is renamed to ChFiDS_TypeOfConcavity.
|
||||||
|
@ -149,9 +149,6 @@ static void TrimEdge (const TopoDS_Edge& Edge,
|
|||||||
TColStd_SequenceOfReal& ThePar,
|
TColStd_SequenceOfReal& ThePar,
|
||||||
TopTools_SequenceOfShape& S);
|
TopTools_SequenceOfShape& S);
|
||||||
|
|
||||||
static TopAbs_Orientation OriEdgeInFace (const TopoDS_Edge& E,
|
|
||||||
const TopoDS_Face& F);
|
|
||||||
|
|
||||||
static Standard_Integer PosOnFace (Standard_Real d1,
|
static Standard_Integer PosOnFace (Standard_Real d1,
|
||||||
Standard_Real d2,
|
Standard_Real d2,
|
||||||
Standard_Real d3);
|
Standard_Real d3);
|
||||||
@ -986,8 +983,8 @@ void BRepFill_Evolved::ElementaryPerform (const TopoDS_Face& Sp,
|
|||||||
// skin => same orientation E[0] , inverted orientation E[2]
|
// skin => same orientation E[0] , inverted orientation E[2]
|
||||||
// if contreskin it is inverted.
|
// if contreskin it is inverted.
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
E[0].Orientation(OriEdgeInFace(E[0],F[0]));
|
E[0].Orientation(BRepTools::OriEdgeInFace(E[0],F[0]));
|
||||||
E[2].Orientation(OriEdgeInFace(E[2],F[1]));
|
E[2].Orientation(BRepTools::OriEdgeInFace(E[2],F[1]));
|
||||||
|
|
||||||
if (DistanceToOZ(VF) < DistanceToOZ(VL) ) {
|
if (DistanceToOZ(VF) < DistanceToOZ(VL) ) {
|
||||||
// Skin
|
// Skin
|
||||||
@ -1199,14 +1196,14 @@ void BRepFill_Evolved::ElementaryPerform (const TopoDS_Face& Sp,
|
|||||||
TopTools_ListIteratorOfListOfShape itl;
|
TopTools_ListIteratorOfListOfShape itl;
|
||||||
const TopTools_ListOfShape& LF = myMap(CurrentSpine)(VCF);
|
const TopTools_ListOfShape& LF = myMap(CurrentSpine)(VCF);
|
||||||
|
|
||||||
TopAbs_Orientation Ori = OriEdgeInFace(TopoDS::Edge(LF.First()),
|
TopAbs_Orientation Ori = BRepTools::OriEdgeInFace(TopoDS::Edge(LF.First()),
|
||||||
CurrentFace);
|
CurrentFace);
|
||||||
for (itl.Initialize(LF), itl.Next(); itl.More(); itl.Next()) {
|
for (itl.Initialize(LF), itl.Next(); itl.More(); itl.Next()) {
|
||||||
TopoDS_Edge RE = TopoDS::Edge(itl.Value());
|
TopoDS_Edge RE = TopoDS::Edge(itl.Value());
|
||||||
MapBis(CurrentFace).Append(RE.Oriented(Ori));
|
MapBis(CurrentFace).Append(RE.Oriented(Ori));
|
||||||
}
|
}
|
||||||
const TopTools_ListOfShape& LL = myMap(CurrentSpine)(VCL);
|
const TopTools_ListOfShape& LL = myMap(CurrentSpine)(VCL);
|
||||||
Ori = OriEdgeInFace(TopoDS::Edge(LL.First()),CurrentFace);
|
Ori = BRepTools::OriEdgeInFace(TopoDS::Edge(LL.First()),CurrentFace);
|
||||||
for (itl.Initialize(LL), itl.Next() ; itl.More(); itl.Next()) {
|
for (itl.Initialize(LL), itl.Next() ; itl.More(); itl.Next()) {
|
||||||
TopoDS_Edge RE = TopoDS::Edge(itl.Value());
|
TopoDS_Edge RE = TopoDS::Edge(itl.Value());
|
||||||
MapBis(CurrentFace).Append(RE.Oriented(Ori));
|
MapBis(CurrentFace).Append(RE.Oriented(Ori));
|
||||||
@ -2920,26 +2917,6 @@ static TopAbs_Orientation Relative (const TopoDS_Wire& W1,
|
|||||||
|
|
||||||
return TopAbs_REVERSED;
|
return TopAbs_REVERSED;
|
||||||
}
|
}
|
||||||
//=======================================================================
|
|
||||||
//function : OriEdgeInFace
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
TopAbs_Orientation OriEdgeInFace (const TopoDS_Edge& E,
|
|
||||||
const TopoDS_Face& F )
|
|
||||||
|
|
||||||
{
|
|
||||||
TopExp_Explorer Exp(F.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
|
|
||||||
|
|
||||||
for (; Exp.More() ;Exp.Next()) {
|
|
||||||
if (Exp.Current().IsSame(E)) {
|
|
||||||
return Exp.Current().Orientation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw Standard_ConstructionError("BRepFill_Evolved::OriEdgeInFace");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsOnFace
|
//function : IsOnFace
|
||||||
|
@ -44,16 +44,8 @@
|
|||||||
#include <TopoDS_Vertex.hxx>
|
#include <TopoDS_Vertex.hxx>
|
||||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
#include <TopTools_MapOfShape.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,
|
static void CorrectOrientationOfTangent(gp_Vec& TangVec,
|
||||||
const TopoDS_Vertex& aVertex,
|
const TopoDS_Vertex& aVertex,
|
||||||
const TopoDS_Edge& anEdge)
|
const TopoDS_Edge& anEdge)
|
||||||
@ -105,16 +97,17 @@ static void EdgeAnalyse(const TopoDS_Edge& E,
|
|||||||
// Tangent if the regularity is at least G1.
|
// Tangent if the regularity is at least G1.
|
||||||
if (BRep_Tool::HasContinuity(E,F1,F2)) {
|
if (BRep_Tool::HasContinuity(E,F1,F2)) {
|
||||||
if (BRep_Tool::Continuity(E,F1,F2) > GeomAbs_C0) {
|
if (BRep_Tool::Continuity(E,F1,F2) > GeomAbs_C0) {
|
||||||
I.Type(BRepOffset_Tangent);
|
I.Type(ChFiDS_Tangential);
|
||||||
LI.Append(I);
|
LI.Append(I);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
BRepOffset_Type aType = DefineConnectType(E, F1, F2, SinTol, Standard_False);
|
ChFiDS_TypeOfConcavity aType = ChFi3d::DefineConnectType(E, F1, F2,
|
||||||
if(aType != BRepOffset_Tangent)
|
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);
|
I.Type(aType);
|
||||||
LI.Append(I);
|
LI.Append(I);
|
||||||
@ -181,10 +174,10 @@ void BRepOffset_Analyse::Perform (const TopoDS_Shape& S,
|
|||||||
Standard_Real U1,U2;
|
Standard_Real U1,U2;
|
||||||
const TopoDS_Face& F = TopoDS::Face(L.First());
|
const TopoDS_Face& F = TopoDS::Face(L.First());
|
||||||
BRep_Tool::Range(E,F,U1,U2);
|
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)) {
|
if (! BRepTools::IsReallyClosed(E,F)) {
|
||||||
Inter.Type(BRepOffset_FreeBoundary);
|
Inter.Type(ChFiDS_FreeBound);
|
||||||
}
|
}
|
||||||
mapEdgeType(E).Append(Inter);
|
mapEdgeType(E).Append(Inter);
|
||||||
}
|
}
|
||||||
@ -233,7 +226,7 @@ const
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepOffset_Analyse::Edges(const TopoDS_Vertex& V,
|
void BRepOffset_Analyse::Edges(const TopoDS_Vertex& V,
|
||||||
const BRepOffset_Type T,
|
const ChFiDS_TypeOfConcavity T,
|
||||||
TopTools_ListOfShape& LE)
|
TopTools_ListOfShape& LE)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
@ -263,7 +256,7 @@ const
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepOffset_Analyse::Edges(const TopoDS_Face& F,
|
void BRepOffset_Analyse::Edges(const TopoDS_Face& F,
|
||||||
const BRepOffset_Type T,
|
const ChFiDS_TypeOfConcavity T,
|
||||||
TopTools_ListOfShape& LE)
|
TopTools_ListOfShape& LE)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
@ -351,7 +344,7 @@ const TopTools_ListOfShape& BRepOffset_Analyse::Ancestors
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
|
void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
|
||||||
const BRepOffset_Type T ) const
|
const ChFiDS_TypeOfConcavity T ) const
|
||||||
{
|
{
|
||||||
List.Clear();
|
List.Clear();
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
@ -378,8 +371,8 @@ void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
|
void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
|
||||||
const BRepOffset_Type T1,
|
const ChFiDS_TypeOfConcavity T1,
|
||||||
const BRepOffset_Type T2) const
|
const ChFiDS_TypeOfConcavity T2) const
|
||||||
{
|
{
|
||||||
List.Clear();
|
List.Clear();
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
@ -409,7 +402,7 @@ void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
|
|||||||
void BRepOffset_Analyse::AddFaces (const TopoDS_Face& Face,
|
void BRepOffset_Analyse::AddFaces (const TopoDS_Face& Face,
|
||||||
TopoDS_Compound& Co,
|
TopoDS_Compound& Co,
|
||||||
TopTools_MapOfShape& Map,
|
TopTools_MapOfShape& Map,
|
||||||
const BRepOffset_Type T) const
|
const ChFiDS_TypeOfConcavity T) const
|
||||||
{
|
{
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
TopExp_Explorer exp(Face,TopAbs_EDGE);
|
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,
|
void BRepOffset_Analyse::AddFaces (const TopoDS_Face& Face,
|
||||||
TopoDS_Compound& Co,
|
TopoDS_Compound& Co,
|
||||||
TopTools_MapOfShape& Map,
|
TopTools_MapOfShape& Map,
|
||||||
const BRepOffset_Type T1,
|
const ChFiDS_TypeOfConcavity T1,
|
||||||
const BRepOffset_Type T2) const
|
const ChFiDS_TypeOfConcavity T2) const
|
||||||
{
|
{
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
TopExp_Explorer exp(Face,TopAbs_EDGE);
|
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 <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||||
#include <Standard_Real.hxx>
|
#include <Standard_Real.hxx>
|
||||||
#include <BRepOffset_ListOfInterval.hxx>
|
#include <BRepOffset_ListOfInterval.hxx>
|
||||||
#include <BRepOffset_Type.hxx>
|
#include <ChFiDS_TypeOfConcavity.hxx>
|
||||||
#include <TopTools_ListOfShape.hxx>
|
#include <TopTools_ListOfShape.hxx>
|
||||||
#include <TopTools_MapOfShape.hxx>
|
#include <TopTools_MapOfShape.hxx>
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
@ -60,15 +60,21 @@ public:
|
|||||||
|
|
||||||
//! Stores in <L> all the edges of Type <T>
|
//! Stores in <L> all the edges of Type <T>
|
||||||
//! on the vertex <V>.
|
//! 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>
|
//! Stores in <L> all the edges of Type <T>
|
||||||
//! on the face <F>.
|
//! 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
|
//! set in <Edges> all the Edges of <Shape> which are
|
||||||
//! tangent to <Edge> at the vertex <Vertex>.
|
//! 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;
|
Standard_EXPORT Standard_Boolean HasAncestor (const TopoDS_Shape& S) const;
|
||||||
|
|
||||||
@ -76,19 +82,29 @@ public:
|
|||||||
|
|
||||||
//! Explode in compounds of faces where
|
//! Explode in compounds of faces where
|
||||||
//! all the connex edges are of type <Side>
|
//! 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
|
//! Explode in compounds of faces where
|
||||||
//! all the connex edges are of type <Side1> or <Side2>
|
//! 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>
|
//! Add in <CO> the faces of the shell containing <Face>
|
||||||
//! where all the connex edges are of type <Side>.
|
//! 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>
|
//! Add in <CO> the faces of the shell containing <Face>
|
||||||
//! where all the connex edges are of type <Side1> or <Side2>.
|
//! 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 BRepOffset_Analyse& Analyse,
|
||||||
const BRepAlgo_Image& InitOffsetFace)
|
const BRepAlgo_Image& InitOffsetFace)
|
||||||
{
|
{
|
||||||
BRepOffset_Type OT = BRepOffset_Concave;
|
ChFiDS_TypeOfConcavity OT = ChFiDS_Concave;
|
||||||
if (mySide == TopAbs_OUT) OT = BRepOffset_Convex;
|
if (mySide == TopAbs_OUT) OT = ChFiDS_Convex;
|
||||||
TopExp_Explorer Exp(ShapeInit,TopAbs_EDGE);
|
TopExp_Explorer Exp(ShapeInit,TopAbs_EDGE);
|
||||||
TopTools_ListOfShape LInt1,LInt2;
|
TopTools_ListOfShape LInt1,LInt2;
|
||||||
TopoDS_Face F1,F2;
|
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.
|
// to the tube or if E2 is not a tangent edge.
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
const BRepOffset_ListOfInterval& L = Analyse.Type(E2);
|
const BRepOffset_ListOfInterval& L = Analyse.Type(E2);
|
||||||
if (!L.IsEmpty() && L.First().Type() == BRepOffset_Tangent) {
|
if (!L.IsEmpty() && L.First().Type() == ChFiDS_Tangential) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const TopTools_ListOfShape& AncE2 = Analyse.Ancestors(E2);
|
const TopTools_ListOfShape& AncE2 = Analyse.Ancestors(E2);
|
||||||
@ -511,12 +511,12 @@ void BRepOffset_Inter3d::ConnexIntByInt
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
BRepOffset_Type OT = L.First().Type();
|
ChFiDS_TypeOfConcavity OT = L.First().Type();
|
||||||
if (OT != BRepOffset_Convex && OT != BRepOffset_Concave) {
|
if (OT != ChFiDS_Convex && OT != ChFiDS_Concave) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (OT == BRepOffset_Concave) CurSide = TopAbs_IN;
|
if (OT == ChFiDS_Concave) CurSide = TopAbs_IN;
|
||||||
else CurSide = TopAbs_OUT;
|
else CurSide = TopAbs_OUT;
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
// edge is of the proper type, return adjacent faces.
|
// 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,
|
BRepOffset_Interval::BRepOffset_Interval(const Standard_Real U1,
|
||||||
const Standard_Real U2,
|
const Standard_Real U2,
|
||||||
const BRepOffset_Type Type):
|
const ChFiDS_TypeOfConcavity Type):
|
||||||
f(U1),
|
f(U1),
|
||||||
l(U2),
|
l(U2),
|
||||||
type(Type)
|
type(Type)
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <Standard_Handle.hxx>
|
#include <Standard_Handle.hxx>
|
||||||
|
|
||||||
#include <Standard_Real.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();
|
||||||
|
|
||||||
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 First (const Standard_Real U);
|
||||||
|
|
||||||
void Last (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 First() const;
|
||||||
|
|
||||||
Standard_Real Last() const;
|
Standard_Real Last() const;
|
||||||
|
|
||||||
BRepOffset_Type Type() const;
|
ChFiDS_TypeOfConcavity Type() const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -64,7 +66,7 @@ private:
|
|||||||
|
|
||||||
Standard_Real f;
|
Standard_Real f;
|
||||||
Standard_Real l;
|
Standard_Real l;
|
||||||
BRepOffset_Type type;
|
ChFiDS_TypeOfConcavity type;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -41,7 +41,7 @@ inline void BRepOffset_Interval::Last(const Standard_Real U)
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline void BRepOffset_Interval::Type(const BRepOffset_Type T)
|
inline void BRepOffset_Interval::Type(const ChFiDS_TypeOfConcavity T)
|
||||||
{
|
{
|
||||||
type = T;
|
type = T;
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ inline Standard_Real BRepOffset_Interval::Last() const
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline BRepOffset_Type BRepOffset_Interval::Type() const
|
inline ChFiDS_TypeOfConcavity BRepOffset_Interval::Type() const
|
||||||
{
|
{
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@ -521,7 +521,7 @@ static void FillContours(const TopoDS_Shape& aShape,
|
|||||||
if (BRep_Tool::Degenerated(anEdge))
|
if (BRep_Tool::Degenerated(anEdge))
|
||||||
continue;
|
continue;
|
||||||
const BRepOffset_ListOfInterval& Lint = Analyser.Type(anEdge);
|
const BRepOffset_ListOfInterval& Lint = Analyser.Type(anEdge);
|
||||||
if (!Lint.IsEmpty() && Lint.First().Type() == BRepOffset_FreeBoundary)
|
if (!Lint.IsEmpty() && Lint.First().Type() == ChFiDS_FreeBound)
|
||||||
{
|
{
|
||||||
MapEF.Bind(anEdge, aFace);
|
MapEF.Bind(anEdge, aFace);
|
||||||
Edges.Append(anEdge);
|
Edges.Append(anEdge);
|
||||||
@ -1050,7 +1050,7 @@ void BRepOffset_MakeOffset::MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& the
|
|||||||
aCurOffset = myFaceOffset.IsBound(aF) ? myFaceOffset(aF) : myOffset;
|
aCurOffset = myFaceOffset.IsBound(aF) ? myFaceOffset(aF) : myOffset;
|
||||||
BRepOffset_Offset OF(aF, aCurOffset, ShapeTgt, OffsetOutside, myJoin);
|
BRepOffset_Offset OF(aF, aCurOffset, ShapeTgt, OffsetOutside, myJoin);
|
||||||
TopTools_ListOfShape Let;
|
TopTools_ListOfShape Let;
|
||||||
myAnalyse.Edges(aF,BRepOffset_Tangent,Let);
|
myAnalyse.Edges(aF,ChFiDS_Tangential,Let);
|
||||||
TopTools_ListIteratorOfListOfShape itl(Let);
|
TopTools_ListIteratorOfListOfShape itl(Let);
|
||||||
for (; itl.More(); itl.Next()) {
|
for (; itl.More(); itl.Next()) {
|
||||||
const TopoDS_Edge& Cur = TopoDS::Edge(itl.Value());
|
const TopoDS_Edge& Cur = TopoDS::Edge(itl.Value());
|
||||||
@ -1063,14 +1063,14 @@ void BRepOffset_MakeOffset::MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& the
|
|||||||
TopExp::Vertices (OTE,OV1,OV2);
|
TopExp::Vertices (OTE,OV1,OV2);
|
||||||
TopTools_ListOfShape LE;
|
TopTools_ListOfShape LE;
|
||||||
if (!ShapeTgt.IsBound(V1)) {
|
if (!ShapeTgt.IsBound(V1)) {
|
||||||
myAnalyse.Edges(V1,BRepOffset_Tangent,LE);
|
myAnalyse.Edges(V1,ChFiDS_Tangential,LE);
|
||||||
const TopTools_ListOfShape& LA =myAnalyse.Ancestors(V1);
|
const TopTools_ListOfShape& LA =myAnalyse.Ancestors(V1);
|
||||||
if (LE.Extent() == LA.Extent())
|
if (LE.Extent() == LA.Extent())
|
||||||
ShapeTgt.Bind(V1,OV1);
|
ShapeTgt.Bind(V1,OV1);
|
||||||
}
|
}
|
||||||
if (!ShapeTgt.IsBound(V2)) {
|
if (!ShapeTgt.IsBound(V2)) {
|
||||||
LE.Clear();
|
LE.Clear();
|
||||||
myAnalyse.Edges(V2,BRepOffset_Tangent,LE);
|
myAnalyse.Edges(V2,ChFiDS_Tangential,LE);
|
||||||
const TopTools_ListOfShape& LA =myAnalyse.Ancestors(V2);
|
const TopTools_ListOfShape& LA =myAnalyse.Ancestors(V2);
|
||||||
if (LE.Extent() == LA.Extent())
|
if (LE.Extent() == LA.Extent())
|
||||||
ShapeTgt.Bind(V2,OV2);
|
ShapeTgt.Bind(V2,OV2);
|
||||||
@ -1463,8 +1463,8 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
|
|||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
// Construction of tubes on edge.
|
// Construction of tubes on edge.
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
BRepOffset_Type OT = BRepOffset_Convex;
|
ChFiDS_TypeOfConcavity OT = ChFiDS_Convex;
|
||||||
if (myOffset < 0.) OT = BRepOffset_Concave;
|
if (myOffset < 0.) OT = ChFiDS_Concave;
|
||||||
|
|
||||||
for (Exp.Init(myShape,TopAbs_EDGE); Exp.More(); Exp.Next()) {
|
for (Exp.Init(myShape,TopAbs_EDGE); Exp.More(); Exp.Next()) {
|
||||||
const TopoDS_Edge& E = TopoDS::Edge(Exp.Current());
|
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.
|
// Particular processing if V is at least a free border.
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
TopTools_ListOfShape LBF;
|
TopTools_ListOfShape LBF;
|
||||||
myAnalyse.Edges(V,BRepOffset_FreeBoundary,LBF);
|
myAnalyse.Edges(V,ChFiDS_FreeBound,LBF);
|
||||||
if (!LBF.IsEmpty()) {
|
if (!LBF.IsEmpty()) {
|
||||||
Standard_Boolean First = Standard_True;
|
Standard_Boolean First = Standard_True;
|
||||||
for (it.Initialize(LE) ; it.More(); it.Next()) {
|
for (it.Initialize(LE) ; it.More(); it.Next()) {
|
||||||
@ -1592,8 +1592,8 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
|
|||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
// MAJ SD.
|
// MAJ SD.
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
BRepOffset_Type RT = BRepOffset_Concave;
|
ChFiDS_TypeOfConcavity RT = ChFiDS_Concave;
|
||||||
if (myOffset < 0.) RT = BRepOffset_Convex;
|
if (myOffset < 0.) RT = ChFiDS_Convex;
|
||||||
BRepOffset_DataMapIteratorOfDataMapOfShapeOffset It(MapSF);
|
BRepOffset_DataMapIteratorOfDataMapOfShapeOffset It(MapSF);
|
||||||
for ( ; It.More(); It.Next()) {
|
for ( ; It.More(); It.Next()) {
|
||||||
const TopoDS_Shape& SI = It.Key();
|
const TopoDS_Shape& SI = It.Key();
|
||||||
@ -1737,8 +1737,8 @@ void BRepOffset_MakeOffset::ToContext (BRepOffset_DataMapOfShapeOffset& MapSF)
|
|||||||
// Reconstruction of faces.
|
// Reconstruction of faces.
|
||||||
//---------------------------
|
//---------------------------
|
||||||
TopoDS_Face F,NF;
|
TopoDS_Face F,NF;
|
||||||
BRepOffset_Type RT = BRepOffset_Concave;
|
ChFiDS_TypeOfConcavity RT = ChFiDS_Concave;
|
||||||
if (myOffset < 0.) RT = BRepOffset_Convex;
|
if (myOffset < 0.) RT = ChFiDS_Convex;
|
||||||
TopoDS_Shape OE,NE;
|
TopoDS_Shape OE,NE;
|
||||||
TopAbs_Orientation Or;
|
TopAbs_Orientation Or;
|
||||||
|
|
||||||
@ -1825,8 +1825,8 @@ void BRepOffset_MakeOffset::UpdateFaceOffset()
|
|||||||
CopiedMap.Assign(myFaceOffset);
|
CopiedMap.Assign(myFaceOffset);
|
||||||
TopTools_DataMapIteratorOfDataMapOfShapeReal it(CopiedMap);
|
TopTools_DataMapIteratorOfDataMapOfShapeReal it(CopiedMap);
|
||||||
|
|
||||||
BRepOffset_Type RT = BRepOffset_Convex;
|
ChFiDS_TypeOfConcavity RT = ChFiDS_Convex;
|
||||||
if (myOffset < 0.) RT = BRepOffset_Concave;
|
if (myOffset < 0.) RT = ChFiDS_Concave;
|
||||||
|
|
||||||
for ( ; it.More(); it.Next()) {
|
for ( ; it.More(); it.Next()) {
|
||||||
const TopoDS_Face& F = TopoDS::Face(it.Key());
|
const TopoDS_Face& F = TopoDS::Face(it.Key());
|
||||||
@ -1838,9 +1838,9 @@ void BRepOffset_MakeOffset::UpdateFaceOffset()
|
|||||||
TopTools_MapOfShape Dummy;
|
TopTools_MapOfShape Dummy;
|
||||||
Build.Add(Co,F);
|
Build.Add(Co,F);
|
||||||
if (myJoin == GeomAbs_Arc)
|
if (myJoin == GeomAbs_Arc)
|
||||||
myAnalyse.AddFaces(F,Co,Dummy,BRepOffset_Tangent,RT);
|
myAnalyse.AddFaces(F,Co,Dummy,ChFiDS_Tangential,RT);
|
||||||
else
|
else
|
||||||
myAnalyse.AddFaces(F,Co,Dummy,BRepOffset_Tangent);
|
myAnalyse.AddFaces(F,Co,Dummy,ChFiDS_Tangential);
|
||||||
|
|
||||||
TopExp_Explorer exp(Co,TopAbs_FACE);
|
TopExp_Explorer exp(Co,TopAbs_FACE);
|
||||||
for (; exp.More(); exp.Next()) {
|
for (; exp.More(); exp.Next()) {
|
||||||
@ -3133,7 +3133,7 @@ void BRepOffset_MakeOffset::SelectShells ()
|
|||||||
const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
|
const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
|
||||||
const TopTools_ListOfShape& LA = myAnalyse.Ancestors(E);
|
const TopTools_ListOfShape& LA = myAnalyse.Ancestors(E);
|
||||||
if (LA.Extent() < 2) {
|
if (LA.Extent() < 2) {
|
||||||
if (myAnalyse.Type(E).First().Type() == BRepOffset_FreeBoundary) {
|
if (myAnalyse.Type(E).First().Type() == ChFiDS_FreeBound) {
|
||||||
FreeEdges.Add(E);
|
FreeEdges.Add(E);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3334,7 +3334,7 @@ void BRepOffset_MakeOffset::EncodeRegularity ()
|
|||||||
if ( myAnalyse.HasAncestor(Ed)) {
|
if ( myAnalyse.HasAncestor(Ed)) {
|
||||||
const BRepOffset_ListOfInterval& LI = myAnalyse.Type(Ed);
|
const BRepOffset_ListOfInterval& LI = myAnalyse.Type(Ed);
|
||||||
if (LI.Extent() == 1 &&
|
if (LI.Extent() == 1 &&
|
||||||
LI.First().Type() == BRepOffset_Tangent) {
|
LI.First().Type() == ChFiDS_Tangential) {
|
||||||
B.Continuity(OE,F1,F2,GeomAbs_G1);
|
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
|
//function : FindPeriod
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -3008,8 +2988,8 @@ void BRepOffset_Tool::CheckBounds(const TopoDS_Face& F,
|
|||||||
const BRepOffset_ListOfInterval& L = Analyse.Type(anEdge);
|
const BRepOffset_ListOfInterval& L = Analyse.Type(anEdge);
|
||||||
if (!L.IsEmpty() || BRep_Tool::Degenerated(anEdge))
|
if (!L.IsEmpty() || BRep_Tool::Degenerated(anEdge))
|
||||||
{
|
{
|
||||||
BRepOffset_Type OT = L.First().Type();
|
ChFiDS_TypeOfConcavity OT = L.First().Type();
|
||||||
if (OT == BRepOffset_Tangent || BRep_Tool::Degenerated(anEdge))
|
if (OT == ChFiDS_Tangential || BRep_Tool::Degenerated(anEdge))
|
||||||
{
|
{
|
||||||
Standard_Real fpar, lpar;
|
Standard_Real fpar, lpar;
|
||||||
Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(anEdge, F, fpar, lpar);
|
Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(anEdge, F, fpar, lpar);
|
||||||
|
@ -53,10 +53,6 @@ public:
|
|||||||
//! taking account the orientation of Edge.
|
//! taking account the orientation of Edge.
|
||||||
Standard_EXPORT static void EdgeVertices (const TopoDS_Edge& E, TopoDS_Vertex& V1, TopoDS_Vertex& V2);
|
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
|
//! <E> is a section between <F1> and <F2>. Computes
|
||||||
//! <O1> the orientation of <E> in <F1> influenced by <F2>.
|
//! <O1> the orientation of <E> in <F1> influenced by <F2>.
|
||||||
//! idem for <O2>.
|
//! idem for <O2>.
|
||||||
|
@ -34,4 +34,3 @@ BRepOffset_Offset.lxx
|
|||||||
BRepOffset_Status.hxx
|
BRepOffset_Status.hxx
|
||||||
BRepOffset_Tool.cxx
|
BRepOffset_Tool.cxx
|
||||||
BRepOffset_Tool.hxx
|
BRepOffset_Tool.hxx
|
||||||
BRepOffset_Type.hxx
|
|
||||||
|
@ -1083,10 +1083,15 @@ static Standard_Integer shapeG1continuity (Draw_Interpretor& di, Standard_Intege
|
|||||||
It.Next();
|
It.Next();
|
||||||
face2=TopoDS::Face(It.Value());
|
face2=TopoDS::Face(It.Value());
|
||||||
|
|
||||||
|
Standard_Boolean IsSeam = face1.IsEqual(face2);
|
||||||
|
|
||||||
// calcul des deux pcurves
|
// calcul des deux pcurves
|
||||||
const Handle(Geom2d_Curve) c1 = BRep_Tool::CurveOnSurface
|
const Handle(Geom2d_Curve) c1 = BRep_Tool::CurveOnSurface
|
||||||
(TopoDS::Edge(edge),face1,f1,l1);
|
(TopoDS::Edge(edge),face1,f1,l1);
|
||||||
if (c1.IsNull()) return 1;
|
if (c1.IsNull()) return 1;
|
||||||
|
|
||||||
|
if (IsSeam)
|
||||||
|
edge.Reverse();
|
||||||
const Handle(Geom2d_Curve) c2 = BRep_Tool::CurveOnSurface
|
const Handle(Geom2d_Curve) c2 = BRep_Tool::CurveOnSurface
|
||||||
(TopoDS::Edge(edge),face2,f2,l2);
|
(TopoDS::Edge(edge),face2,f2,l2);
|
||||||
if (c2.IsNull()) return 1;
|
if (c2.IsNull()) return 1;
|
||||||
@ -1212,10 +1217,15 @@ static Standard_Integer shapeG0continuity (Draw_Interpretor& di, Standard_Intege
|
|||||||
It.Next();
|
It.Next();
|
||||||
face2=TopoDS::Face(It.Value());
|
face2=TopoDS::Face(It.Value());
|
||||||
|
|
||||||
|
Standard_Boolean IsSeam = face1.IsEqual(face2);
|
||||||
|
|
||||||
// calcul des deux pcurves
|
// calcul des deux pcurves
|
||||||
const Handle(Geom2d_Curve) c1 = BRep_Tool::CurveOnSurface
|
const Handle(Geom2d_Curve) c1 = BRep_Tool::CurveOnSurface
|
||||||
(TopoDS::Edge(edge),face1,f1,l1);
|
(TopoDS::Edge(edge),face1,f1,l1);
|
||||||
if (c1.IsNull()) return 1;
|
if (c1.IsNull()) return 1;
|
||||||
|
|
||||||
|
if (IsSeam)
|
||||||
|
edge.Reverse();
|
||||||
const Handle(Geom2d_Curve) c2 = BRep_Tool::CurveOnSurface
|
const Handle(Geom2d_Curve) c2 = BRep_Tool::CurveOnSurface
|
||||||
(TopoDS::Edge(edge),face2,f2,l2);
|
(TopoDS::Edge(edge),face2,f2,l2);
|
||||||
if (c2.IsNull()) return 1;
|
if (c2.IsNull()) return 1;
|
||||||
@ -1335,10 +1345,16 @@ static Standard_Integer shapeG2continuity (Draw_Interpretor& di, Standard_Intege
|
|||||||
face1=TopoDS::Face(It.Value());
|
face1=TopoDS::Face(It.Value());
|
||||||
It.Next();
|
It.Next();
|
||||||
face2=TopoDS::Face(It.Value());
|
face2=TopoDS::Face(It.Value());
|
||||||
|
|
||||||
|
Standard_Boolean IsSeam = face1.IsEqual(face2);
|
||||||
|
|
||||||
// calcul des deux pcurves
|
// calcul des deux pcurves
|
||||||
const Handle(Geom2d_Curve) c1 = BRep_Tool::CurveOnSurface
|
const Handle(Geom2d_Curve) c1 = BRep_Tool::CurveOnSurface
|
||||||
(TopoDS::Edge(edge),face1,f1,l1);
|
(TopoDS::Edge(edge),face1,f1,l1);
|
||||||
if (c1.IsNull()) return 1;
|
if (c1.IsNull()) return 1;
|
||||||
|
|
||||||
|
if (IsSeam)
|
||||||
|
edge.Reverse();
|
||||||
const Handle(Geom2d_Curve) c2 = BRep_Tool::CurveOnSurface
|
const Handle(Geom2d_Curve) c2 = BRep_Tool::CurveOnSurface
|
||||||
(TopoDS::Edge(edge),face2,f2,l2);
|
(TopoDS::Edge(edge),face2,f2,l2);
|
||||||
if (c2.IsNull()) return 1;
|
if (c2.IsNull()) return 1;
|
||||||
|
@ -1068,4 +1068,21 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : OriEdgeInFace
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
TopAbs_Orientation BRepTools::OriEdgeInFace (const TopoDS_Edge& E,
|
||||||
|
const TopoDS_Face& F )
|
||||||
|
|
||||||
|
{
|
||||||
|
TopExp_Explorer Exp(F.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
|
||||||
|
|
||||||
|
for (; Exp.More() ;Exp.Next()) {
|
||||||
|
if (Exp.Current().IsSame(E)) {
|
||||||
|
return Exp.Current().Orientation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw Standard_ConstructionError("BRepTools::OriEdgeInFace");
|
||||||
|
}
|
||||||
|
@ -223,6 +223,10 @@ public:
|
|||||||
const Standard_Real theF,
|
const Standard_Real theF,
|
||||||
const Standard_Real theL);
|
const Standard_Real theL);
|
||||||
|
|
||||||
|
//! returns the cumul of the orientation of <Edge>
|
||||||
|
//! and thc containing wire in <Face>
|
||||||
|
Standard_EXPORT static TopAbs_Orientation OriEdgeInFace(const TopoDS_Edge& theEdge,
|
||||||
|
const TopoDS_Face& theFace);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -1573,7 +1573,7 @@ void BiTgte_Blend::ComputeCenters()
|
|||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
TopTools_ListOfShape Let;
|
TopTools_ListOfShape Let;
|
||||||
if ( AS.ShapeType() == TopAbs_FACE) {
|
if ( AS.ShapeType() == TopAbs_FACE) {
|
||||||
myAnalyse.Edges(TopoDS::Face(AS),BRepOffset_Tangent,Let);
|
myAnalyse.Edges(TopoDS::Face(AS),ChFiDS_Tangential,Let);
|
||||||
}
|
}
|
||||||
TopTools_ListIteratorOfListOfShape itlet(Let);
|
TopTools_ListIteratorOfListOfShape itlet(Let);
|
||||||
|
|
||||||
@ -1589,14 +1589,14 @@ void BiTgte_Blend::ComputeCenters()
|
|||||||
TopExp::Vertices (OTE,OV1,OV2);
|
TopExp::Vertices (OTE,OV1,OV2);
|
||||||
TopTools_ListOfShape LE;
|
TopTools_ListOfShape LE;
|
||||||
if (!EdgeTgt.IsBound(V1)) {
|
if (!EdgeTgt.IsBound(V1)) {
|
||||||
myAnalyse.Edges(V1,BRepOffset_Tangent,LE);
|
myAnalyse.Edges(V1,ChFiDS_Tangential,LE);
|
||||||
const TopTools_ListOfShape& LA = myAnalyse.Ancestors(V1);
|
const TopTools_ListOfShape& LA = myAnalyse.Ancestors(V1);
|
||||||
if (LE.Extent() == LA.Extent())
|
if (LE.Extent() == LA.Extent())
|
||||||
EdgeTgt.Bind(V1,OV1);
|
EdgeTgt.Bind(V1,OV1);
|
||||||
}
|
}
|
||||||
if (!EdgeTgt.IsBound(V2)) {
|
if (!EdgeTgt.IsBound(V2)) {
|
||||||
LE.Clear();
|
LE.Clear();
|
||||||
myAnalyse.Edges(V2,BRepOffset_Tangent,LE);
|
myAnalyse.Edges(V2,ChFiDS_Tangential,LE);
|
||||||
const TopTools_ListOfShape& LA = myAnalyse.Ancestors(V2);
|
const TopTools_ListOfShape& LA = myAnalyse.Ancestors(V2);
|
||||||
if (LE.Extent() == LA.Extent())
|
if (LE.Extent() == LA.Extent())
|
||||||
EdgeTgt.Bind(V2,OV2);
|
EdgeTgt.Bind(V2,OV2);
|
||||||
@ -1637,8 +1637,8 @@ void BiTgte_Blend::ComputeCenters()
|
|||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
// Construction of tubes on edge.
|
// Construction of tubes on edge.
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
BRepOffset_Type OT = BRepOffset_Convex;
|
ChFiDS_TypeOfConcavity OT = ChFiDS_Convex;
|
||||||
if (myRadius < 0.) OT = BRepOffset_Concave;
|
if (myRadius < 0.) OT = ChFiDS_Concave;
|
||||||
|
|
||||||
TopTools_IndexedDataMapOfShapeListOfShape Map;
|
TopTools_IndexedDataMapOfShapeListOfShape Map;
|
||||||
TopExp::MapShapesAndAncestors(Co,TopAbs_EDGE,TopAbs_FACE,Map);
|
TopExp::MapShapesAndAncestors(Co,TopAbs_EDGE,TopAbs_FACE,Map);
|
||||||
@ -1724,8 +1724,8 @@ void BiTgte_Blend::ComputeCenters()
|
|||||||
|
|
||||||
// Proceed with MakeLoops
|
// Proceed with MakeLoops
|
||||||
TopTools_IndexedDataMapOfShapeListOfShape aDMVV;
|
TopTools_IndexedDataMapOfShapeListOfShape aDMVV;
|
||||||
BRepOffset_Type OT = BRepOffset_Concave;
|
ChFiDS_TypeOfConcavity OT = ChFiDS_Concave;
|
||||||
if (myRadius < 0.) OT = BRepOffset_Convex;
|
if (myRadius < 0.) OT = ChFiDS_Convex;
|
||||||
|
|
||||||
TopTools_ListOfShape LOF;
|
TopTools_ListOfShape LOF;
|
||||||
//it.Initialize(myFaces);
|
//it.Initialize(myFaces);
|
||||||
|
@ -29,6 +29,105 @@
|
|||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
#include <TopoDS_Edge.hxx>
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <BRepTools.hxx>
|
||||||
|
#include <IntTools_Tools.hxx>
|
||||||
|
|
||||||
|
static void Correct2dPoint(const TopoDS_Face& theF, gp_Pnt2d& theP2d);
|
||||||
|
//
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : DefineConnectType
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
ChFiDS_TypeOfConcavity ChFi3d::DefineConnectType(const TopoDS_Edge& E,
|
||||||
|
const TopoDS_Face& F1,
|
||||||
|
const TopoDS_Face& F2,
|
||||||
|
const Standard_Real SinTol,
|
||||||
|
const Standard_Boolean CorrectPoint)
|
||||||
|
{
|
||||||
|
const Handle(Geom_Surface)& S1 = BRep_Tool::Surface(F1);
|
||||||
|
const Handle(Geom_Surface)& S2 = BRep_Tool::Surface(F2);
|
||||||
|
//
|
||||||
|
Standard_Real f,l;
|
||||||
|
Handle (Geom2d_Curve) C1 = BRep_Tool::CurveOnSurface(E,F1,f,l);
|
||||||
|
//For the case of seam edge
|
||||||
|
TopoDS_Edge EE = E;
|
||||||
|
if (F1.IsSame(F2))
|
||||||
|
EE.Reverse();
|
||||||
|
Handle (Geom2d_Curve) C2 = BRep_Tool::CurveOnSurface(EE,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);
|
||||||
|
if (T1.SquareMagnitude() <= gp::Resolution())
|
||||||
|
{
|
||||||
|
ParOnC = IntTools_Tools::IntermediatePoint(f,l);
|
||||||
|
T1 = C.DN(ParOnC,1);
|
||||||
|
}
|
||||||
|
if (T1.SquareMagnitude() > gp::Resolution()) {
|
||||||
|
T1.Normalize();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BRepTools::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 (NormProVec < SinTol) {
|
||||||
|
// plane
|
||||||
|
if (DN1.Dot(DN2) > 0) {
|
||||||
|
//Tangent
|
||||||
|
return ChFiDS_Tangential;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//Mixed not finished!
|
||||||
|
#ifdef OCCT_DEBUG
|
||||||
|
std::cout <<" faces locally mixed"<<std::endl;
|
||||||
|
#endif
|
||||||
|
return ChFiDS_Convex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (NormProVec > gp::Resolution())
|
||||||
|
ProVec /= NormProVec;
|
||||||
|
Standard_Real Prod = T1.Dot(ProVec);
|
||||||
|
if (Prod > 0.) {
|
||||||
|
//
|
||||||
|
return ChFiDS_Convex;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//reenters
|
||||||
|
return ChFiDS_Concave;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ConcaveSide
|
//function : ConcaveSide
|
||||||
@ -290,3 +389,49 @@ Standard_Boolean ChFi3d::SameSide(const TopAbs_Orientation Or,
|
|||||||
}
|
}
|
||||||
return (o1 == o2);
|
return (o1 == o2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -24,8 +24,10 @@
|
|||||||
#include <Standard_Integer.hxx>
|
#include <Standard_Integer.hxx>
|
||||||
#include <TopAbs_Orientation.hxx>
|
#include <TopAbs_Orientation.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
|
#include <ChFiDS_TypeOfConcavity.hxx>
|
||||||
class BRepAdaptor_Surface;
|
class BRepAdaptor_Surface;
|
||||||
class TopoDS_Edge;
|
class TopoDS_Edge;
|
||||||
|
class TopoDS_Face;
|
||||||
class ChFi3d_Builder;
|
class ChFi3d_Builder;
|
||||||
class ChFi3d_ChBuilder;
|
class ChFi3d_ChBuilder;
|
||||||
class ChFi3d_FilBuilder;
|
class ChFi3d_FilBuilder;
|
||||||
@ -39,6 +41,12 @@ public:
|
|||||||
|
|
||||||
DEFINE_STANDARD_ALLOC
|
DEFINE_STANDARD_ALLOC
|
||||||
|
|
||||||
|
//! Defines the type of concavity in the edge of connection of two faces
|
||||||
|
Standard_EXPORT static ChFiDS_TypeOfConcavity DefineConnectType (const TopoDS_Edge& E,
|
||||||
|
const TopoDS_Face& F1,
|
||||||
|
const TopoDS_Face& F2,
|
||||||
|
const Standard_Real SinTol,
|
||||||
|
const Standard_Boolean CorrectPoint);
|
||||||
|
|
||||||
//! Returns Reversed in Or1 and(or) Or2 if
|
//! Returns Reversed in Or1 and(or) Or2 if
|
||||||
//! the concave edge defined by the interior of faces F1 and F2,
|
//! the concave edge defined by the interior of faces F1 and F2,
|
||||||
|
@ -4611,8 +4611,12 @@ Standard_Boolean ChFi3d_isTangentFaces(const TopoDS_Edge &theEdge,
|
|||||||
// Obtaining of pcurves of edge on two faces.
|
// Obtaining of pcurves of edge on two faces.
|
||||||
const Handle(Geom2d_Curve) aC2d1 = BRep_Tool::CurveOnSurface
|
const Handle(Geom2d_Curve) aC2d1 = BRep_Tool::CurveOnSurface
|
||||||
(theEdge, theFace1, aFirst, aLast);
|
(theEdge, theFace1, aFirst, aLast);
|
||||||
|
//For the case of seam edge
|
||||||
|
TopoDS_Edge EE = theEdge;
|
||||||
|
if (theFace1.IsSame(theFace2))
|
||||||
|
EE.Reverse();
|
||||||
const Handle(Geom2d_Curve) aC2d2 = BRep_Tool::CurveOnSurface
|
const Handle(Geom2d_Curve) aC2d2 = BRep_Tool::CurveOnSurface
|
||||||
(theEdge, theFace2, aFirst, aLast);
|
(EE, theFace2, aFirst, aLast);
|
||||||
if (aC2d1.IsNull() || aC2d2.IsNull())
|
if (aC2d1.IsNull() || aC2d2.IsNull())
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
|
|
||||||
|
@ -680,7 +680,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
|||||||
Standard_Integer NbG1Connections = 0;
|
Standard_Integer NbG1Connections = 0;
|
||||||
|
|
||||||
for(Standard_Integer ii = 1; ii <= 2; ii++){
|
for(Standard_Integer ii = 1; ii <= 2; ii++){
|
||||||
TopoDS_Edge E[3],Ec;
|
TopoDS_Edge E[3];
|
||||||
TopoDS_Vertex V;
|
TopoDS_Vertex V;
|
||||||
ChFiDS_State sst;
|
ChFiDS_State sst;
|
||||||
Standard_Integer iedge;
|
Standard_Integer iedge;
|
||||||
@ -705,44 +705,61 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
|
|||||||
|
|
||||||
if(sst == ChFiDS_BreakPoint){
|
if(sst == ChFiDS_BreakPoint){
|
||||||
TopTools_ListIteratorOfListOfShape It;//,Jt;
|
TopTools_ListIteratorOfListOfShape It;//,Jt;
|
||||||
Standard_Integer i = 0;
|
|
||||||
Standard_Boolean sommetpourri = Standard_False;
|
Standard_Boolean sommetpourri = Standard_False;
|
||||||
TopTools_IndexedMapOfShape EdgesOfV;
|
TopTools_IndexedMapOfOrientedShape EdgesOfV;
|
||||||
//to avoid repeating of edges
|
TopTools_MapOfShape Edges;
|
||||||
|
Edges.Add(E[0]);
|
||||||
|
EdgesOfV.Add(E[0]);
|
||||||
|
Standard_Integer IndOfE = 0;
|
||||||
for (It.Initialize(myVEMap(V)); It.More(); It.Next())
|
for (It.Initialize(myVEMap(V)); It.More(); It.Next())
|
||||||
EdgesOfV.Add(It.Value());
|
|
||||||
for (Standard_Integer ind = 1; ind <= EdgesOfV.Extent(); ind++) {
|
|
||||||
Ec = TopoDS::Edge(EdgesOfV(ind));
|
|
||||||
Standard_Boolean bonedge = !BRep_Tool::Degenerated(Ec);
|
|
||||||
if (bonedge)
|
|
||||||
{
|
{
|
||||||
|
TopoDS_Edge anEdge = TopoDS::Edge(It.Value());
|
||||||
|
if (BRep_Tool::Degenerated(anEdge))
|
||||||
|
continue;
|
||||||
TopoDS_Face F1, F2;
|
TopoDS_Face F1, F2;
|
||||||
ChFi3d_conexfaces(Ec, F1, F2, myEFMap);
|
ChFi3d_conexfaces(anEdge, F1, F2, myEFMap);
|
||||||
if (!F2.IsNull() && ChFi3d_isTangentFaces(Ec, F1, F2, GeomAbs_G2))
|
if (!F2.IsNull() && ChFi3d_isTangentFaces(anEdge, F1, F2, GeomAbs_G2)) //smooth edge
|
||||||
{
|
{
|
||||||
bonedge = Standard_False;
|
|
||||||
if (!F1.IsSame(F2))
|
if (!F1.IsSame(F2))
|
||||||
NbG1Connections++;
|
NbG1Connections++;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(bonedge){
|
if (Edges.Add(anEdge))
|
||||||
if (!Ec.IsSame(E[0]))
|
|
||||||
{
|
{
|
||||||
if( i < 2 ){
|
EdgesOfV.Add(anEdge);
|
||||||
i++;
|
if (IndOfE < 2)
|
||||||
E[i] = Ec;
|
{
|
||||||
|
IndOfE++;
|
||||||
|
E[IndOfE] = anEdge;
|
||||||
}
|
}
|
||||||
else{
|
}
|
||||||
#ifdef OCCT_DEBUG
|
else
|
||||||
std::cout<<"top has more than 3 edges"<<std::endl;
|
{
|
||||||
#endif
|
TopoDS_Vertex V1, V2;
|
||||||
|
TopExp::Vertices(anEdge, V1, V2);
|
||||||
|
if (V1.IsSame(V2)) //edge is closed - two ends of the edge in the vertex
|
||||||
|
{
|
||||||
|
Standard_Integer anInd = EdgesOfV.FindIndex(anEdge);
|
||||||
|
if (anInd == 0)
|
||||||
|
anInd = EdgesOfV.FindIndex(anEdge.Reversed());
|
||||||
|
anEdge = TopoDS::Edge(EdgesOfV(anInd));
|
||||||
|
anEdge.Reverse();
|
||||||
|
if (EdgesOfV.Add(anEdge))
|
||||||
|
{
|
||||||
|
if (IndOfE < 2)
|
||||||
|
{
|
||||||
|
IndOfE++;
|
||||||
|
E[IndOfE] = anEdge;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EdgesOfV.Extent() != 3)
|
||||||
sommetpourri = Standard_True;
|
sommetpourri = Standard_True;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(i != 2) sommetpourri = Standard_True;
|
|
||||||
if(!sommetpourri){
|
if(!sommetpourri){
|
||||||
sst = ChFi3d_EdgeState(E,myEFMap);
|
sst = ChFi3d_EdgeState(E,myEFMap);
|
||||||
}
|
}
|
||||||
@ -828,6 +845,12 @@ Standard_Boolean ChFi3d_Builder::PerformElement(const Handle(ChFiDS_Spine)& Spin
|
|||||||
ff2 = ff1; ff1 = FirstFace;
|
ff2 = ff1; ff1 = FirstFace;
|
||||||
}
|
}
|
||||||
myEdgeFirstFace.Bind(Ec, FirstFace);
|
myEdgeFirstFace.Bind(Ec, FirstFace);
|
||||||
|
|
||||||
|
//Define concavity
|
||||||
|
ChFiDS_TypeOfConcavity TypeOfConcavity = ChFi3d::DefineConnectType(Ec, ff1, ff2,
|
||||||
|
1.e-5, Standard_True);
|
||||||
|
Spine->SetTypeOfConcavity(TypeOfConcavity);
|
||||||
|
|
||||||
Standard_Boolean ToRestrict = (Offset > 0)? Standard_True : Standard_False;
|
Standard_Boolean ToRestrict = (Offset > 0)? Standard_True : Standard_False;
|
||||||
BRepAdaptor_Surface Sb1(ff1, ToRestrict);
|
BRepAdaptor_Surface Sb1(ff1, ToRestrict);
|
||||||
BRepAdaptor_Surface Sb2(ff2, ToRestrict);
|
BRepAdaptor_Surface Sb2(ff2, ToRestrict);
|
||||||
@ -852,8 +875,11 @@ Standard_Boolean ChFi3d_Builder::PerformElement(const Handle(ChFiDS_Spine)& Spin
|
|||||||
CEc.D1(Wl,P2,V1);
|
CEc.D1(Wl,P2,V1);
|
||||||
Wl = BRep_Tool::Parameter(LVEc,Ec);
|
Wl = BRep_Tool::Parameter(LVEc,Ec);
|
||||||
CEc.D1(Wl,P2,V2);
|
CEc.D1(Wl,P2,V2);
|
||||||
if (V1.IsParallel(V2,ta)) {
|
Standard_Boolean IsFaceTangency = FaceTangency(Ec,Ec,VStart);
|
||||||
if (FaceTangency(Ec,Ec,VStart)) {
|
if (V1.IsParallel(V2,ta) ||
|
||||||
|
IsFaceTangency)
|
||||||
|
{
|
||||||
|
if (IsFaceTangency) {
|
||||||
CurSt = ChFiDS_Closed;
|
CurSt = ChFiDS_Closed;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1943,13 +1943,21 @@ void ChFi3d_FilBuilder::ExtentThreeCorner(const TopoDS_Vertex& V,
|
|||||||
if (Spine->IsTangencyExtremity((Sens == 1))) return; //No extension on queue
|
if (Spine->IsTangencyExtremity((Sens == 1))) return; //No extension on queue
|
||||||
Standard_Real dU = Spine->LastParameter(Spine->NbEdges());
|
Standard_Real dU = Spine->LastParameter(Spine->NbEdges());
|
||||||
if (Sens == 1){
|
if (Sens == 1){
|
||||||
|
if (!(Spine->GetTypeOfConcavity() == ChFiDS_Convex &&
|
||||||
|
Spine->FirstStatus() == ChFiDS_OnSame))
|
||||||
|
{
|
||||||
Spine->SetFirstParameter(-dU*Coeff);
|
Spine->SetFirstParameter(-dU*Coeff);
|
||||||
Spine->SetFirstTgt(0.);
|
Spine->SetFirstTgt(0.);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
|
if (!(Spine->GetTypeOfConcavity() == ChFiDS_Convex &&
|
||||||
|
Spine->LastStatus() == ChFiDS_OnSame))
|
||||||
|
{
|
||||||
Spine->SetLastParameter(dU*(1.+Coeff));
|
Spine->SetLastParameter(dU*(1.+Coeff));
|
||||||
Spine->SetLastTgt(dU);
|
Spine->SetLastTgt(dU);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
check.Append(Stripe);
|
check.Append(Stripe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include <Standard_Transient.hxx>
|
#include <Standard_Transient.hxx>
|
||||||
#include <GeomAbs_CurveType.hxx>
|
#include <GeomAbs_CurveType.hxx>
|
||||||
#include <ChFiDS_ChamfMode.hxx>
|
#include <ChFiDS_ChamfMode.hxx>
|
||||||
|
#include <ChFiDS_TypeOfConcavity.hxx>
|
||||||
class TopoDS_Edge;
|
class TopoDS_Edge;
|
||||||
class ChFiDS_HElSpine;
|
class ChFiDS_HElSpine;
|
||||||
class gp_Lin;
|
class gp_Lin;
|
||||||
@ -201,8 +202,14 @@ public:
|
|||||||
|
|
||||||
ChFiDS_State Status (const Standard_Boolean IsFirst) const;
|
ChFiDS_State Status (const Standard_Boolean IsFirst) const;
|
||||||
|
|
||||||
|
//! returns the type of concavity in the connection
|
||||||
|
ChFiDS_TypeOfConcavity GetTypeOfConcavity() const;
|
||||||
|
|
||||||
void SetStatus (const ChFiDS_State S, const Standard_Boolean IsFirst);
|
void SetStatus (const ChFiDS_State S, const Standard_Boolean IsFirst);
|
||||||
|
|
||||||
|
//! sets the type of concavity in the connection
|
||||||
|
void SetTypeOfConcavity (const ChFiDS_TypeOfConcavity theType);
|
||||||
|
|
||||||
//! returns if the set of edges starts (or end) on
|
//! returns if the set of edges starts (or end) on
|
||||||
//! Tangency point.
|
//! Tangency point.
|
||||||
Standard_Boolean IsTangencyExtremity (const Standard_Boolean IsFirst) const;
|
Standard_Boolean IsTangencyExtremity (const Standard_Boolean IsFirst) const;
|
||||||
@ -264,6 +271,7 @@ private:
|
|||||||
BRepAdaptor_Curve myCurve;
|
BRepAdaptor_Curve myCurve;
|
||||||
BRepAdaptor_Curve myOffsetCurve;
|
BRepAdaptor_Curve myOffsetCurve;
|
||||||
Standard_Integer indexofcurve;
|
Standard_Integer indexofcurve;
|
||||||
|
ChFiDS_TypeOfConcavity myTypeOfConcavity;
|
||||||
ChFiDS_State firstState;
|
ChFiDS_State firstState;
|
||||||
ChFiDS_State lastState;
|
ChFiDS_State lastState;
|
||||||
TopTools_SequenceOfShape spine;
|
TopTools_SequenceOfShape spine;
|
||||||
|
@ -16,6 +16,16 @@
|
|||||||
|
|
||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetTypeOfConcavity
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
inline void ChFiDS_Spine::SetTypeOfConcavity(const ChFiDS_TypeOfConcavity theType)
|
||||||
|
{
|
||||||
|
myTypeOfConcavity = theType;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetFirstStatus
|
//function : SetFirstStatus
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -36,6 +46,17 @@ inline void ChFiDS_Spine::SetLastStatus(const ChFiDS_State S)
|
|||||||
{
|
{
|
||||||
lastState = S;
|
lastState = S;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : GetTypeOfConcavity
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
inline ChFiDS_TypeOfConcavity ChFiDS_Spine::GetTypeOfConcavity()const
|
||||||
|
{
|
||||||
|
return myTypeOfConcavity;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : FirstStatus
|
//function : FirstStatus
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@ -14,17 +14,17 @@
|
|||||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
// commercial license or contractual agreement.
|
// commercial license or contractual agreement.
|
||||||
|
|
||||||
#ifndef _BRepOffset_Type_HeaderFile
|
#ifndef _ChFiDS_TypeOfConcavity_HeaderFile
|
||||||
#define _BRepOffset_Type_HeaderFile
|
#define _ChFiDS_TypeOfConcavity_HeaderFile
|
||||||
|
|
||||||
|
|
||||||
enum BRepOffset_Type
|
enum ChFiDS_TypeOfConcavity
|
||||||
{
|
{
|
||||||
BRepOffset_Concave,
|
ChFiDS_Concave,
|
||||||
BRepOffset_Convex,
|
ChFiDS_Convex,
|
||||||
BRepOffset_Tangent,
|
ChFiDS_Tangential,
|
||||||
BRepOffset_FreeBoundary,
|
ChFiDS_FreeBound,
|
||||||
BRepOffset_Other
|
ChFiDS_Other
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _BRepOffset_Type_HeaderFile
|
#endif // _ChFiDS_TypeOfConcavity_HeaderFile
|
@ -46,3 +46,4 @@ ChFiDS_StripeMap.lxx
|
|||||||
ChFiDS_SurfData.cxx
|
ChFiDS_SurfData.cxx
|
||||||
ChFiDS_SurfData.hxx
|
ChFiDS_SurfData.hxx
|
||||||
ChFiDS_SurfData.lxx
|
ChFiDS_SurfData.lxx
|
||||||
|
ChFiDS_TypeOfConcavity.hxx
|
@ -8,3 +8,4 @@ TKTopAlgo
|
|||||||
TKG3d
|
TKG3d
|
||||||
TKBool
|
TKBool
|
||||||
TKShHealing
|
TKShHealing
|
||||||
|
TKBO
|
||||||
|
23
tests/bugs/modalg_7/bug30940_1
Normal file
23
tests/bugs/modalg_7/bug30940_1
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
puts "=================================================================="
|
||||||
|
puts "OCC30940: BRepFilletAPI_MakeFillet algorithm fails on closed shell"
|
||||||
|
puts "=================================================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
brestore [locate_data_file bug30940_compfaces.brep] b
|
||||||
|
|
||||||
|
sewing a 0.0001 b
|
||||||
|
explode a e
|
||||||
|
|
||||||
|
blend result a 0.1 a_1 0.1 a_2 0.1 a_3 0.1 a_4 0.1 a_5 0.1 a_6 0.1 a_7 0.1 a_8 0.1 a_9 0.1 a_10 0.1 a_11 0.1 a_12
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
|
||||||
|
checknbshapes result -shell 1 -face 26 -wire 26 -edge 56 -vertex 30
|
||||||
|
|
||||||
|
set tolres [checkmaxtol result]
|
||||||
|
|
||||||
|
if { ${tolres} > 0.001} {
|
||||||
|
puts "Error: bad tolerance of result"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkprops result -v 276.831
|
25
tests/bugs/modalg_7/bug30940_2
Normal file
25
tests/bugs/modalg_7/bug30940_2
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
puts "=================================================================="
|
||||||
|
puts "OCC30940: BRepFilletAPI_MakeFillet algorithm fails on closed shell"
|
||||||
|
puts "=================================================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
beziercurve q 4 0 0 0 10 0 0 0 10 0 0 0 0
|
||||||
|
mkedge q q
|
||||||
|
wire q q
|
||||||
|
mkplane q q
|
||||||
|
prism q q 0 0 10
|
||||||
|
explode q e
|
||||||
|
|
||||||
|
blend result q 0.5 q_3
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
|
||||||
|
checknbshapes result -face 4 -edge 5 -vertex 3
|
||||||
|
|
||||||
|
set tolres [checkmaxtol result]
|
||||||
|
|
||||||
|
if { ${tolres} > 1.e-4} {
|
||||||
|
puts "Error: bad tolerance of result"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkprops result -v 149.268 -deps 1.e-5
|
25
tests/bugs/modalg_7/bug30940_3
Normal file
25
tests/bugs/modalg_7/bug30940_3
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
puts "=================================================================="
|
||||||
|
puts "OCC30940: BRepFilletAPI_MakeFillet algorithm fails on closed shell"
|
||||||
|
puts "=================================================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
beziercurve q 4 0 0 0 10 0 0 0 10 0 0 0 0
|
||||||
|
mkedge q q
|
||||||
|
wire q q
|
||||||
|
mkplane q q
|
||||||
|
prism q q 0 0 10
|
||||||
|
explode q e
|
||||||
|
|
||||||
|
blend result q 0.5 q_1
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
|
||||||
|
checknbshapes result -face 4 -edge 6 -vertex 4
|
||||||
|
|
||||||
|
set tolres [checkmaxtol result]
|
||||||
|
|
||||||
|
if { ${tolres} > 1.01e-7} {
|
||||||
|
puts "Error: bad tolerance of result"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkprops result -v 149.398 -deps 1.e-5
|
25
tests/bugs/modalg_7/bug30940_4
Normal file
25
tests/bugs/modalg_7/bug30940_4
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
puts "=================================================================="
|
||||||
|
puts "OCC30940: BRepFilletAPI_MakeFillet algorithm fails on closed shell"
|
||||||
|
puts "=================================================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
beziercurve q 4 0 0 0 10 0 0 0 10 0 0 0 0
|
||||||
|
mkedge q q
|
||||||
|
wire q q
|
||||||
|
mkplane q q
|
||||||
|
prism q q 0 0 10
|
||||||
|
explode q e
|
||||||
|
|
||||||
|
blend result q 0.5 q_1 0.5 q_2 0.5 q_3
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
|
||||||
|
checknbshapes result -face 8 -edge 14 -vertex 6
|
||||||
|
|
||||||
|
set tolres [checkmaxtol result]
|
||||||
|
|
||||||
|
if { ${tolres} > 1.e-4} {
|
||||||
|
puts "Error: bad tolerance of result"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkprops result -v 147.953 -deps 1.e-5
|
25
tests/bugs/modalg_7/bug30940_5
Normal file
25
tests/bugs/modalg_7/bug30940_5
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
puts "=================================================================="
|
||||||
|
puts "OCC30940: BRepFilletAPI_MakeFillet algorithm fails on closed shell"
|
||||||
|
puts "=================================================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
beziercurve q 5 0 0 0 0 -10 0 50 50 0 -10 0 0 0 0 0
|
||||||
|
mkedge q q
|
||||||
|
wire q q
|
||||||
|
mkplane q q
|
||||||
|
prism q q 0 0 10
|
||||||
|
explode q e
|
||||||
|
|
||||||
|
blend result q 0.1 q_3
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
|
||||||
|
checknbshapes result -face 4 -edge 5 -vertex 3
|
||||||
|
|
||||||
|
set tolres [checkmaxtol result]
|
||||||
|
|
||||||
|
if { ${tolres} > 1.e-4} {
|
||||||
|
puts "Error: bad tolerance of result"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkprops result -v 1028.46 -deps 1.e-5
|
25
tests/bugs/modalg_7/bug30940_6
Normal file
25
tests/bugs/modalg_7/bug30940_6
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
puts "=================================================================="
|
||||||
|
puts "OCC30940: BRepFilletAPI_MakeFillet algorithm fails on closed shell"
|
||||||
|
puts "=================================================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
beziercurve q 5 0 0 0 0 -10 0 50 50 0 -10 0 0 0 0 0
|
||||||
|
mkedge q q
|
||||||
|
wire q q
|
||||||
|
mkplane q q
|
||||||
|
prism q q 0 0 10
|
||||||
|
explode q e
|
||||||
|
|
||||||
|
blend result q 0.1 q_1 0.1 q_2 0.1 q_3
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
|
||||||
|
checknbshapes result -face 8 -edge 14 -vertex 8
|
||||||
|
|
||||||
|
set tolres [checkmaxtol result]
|
||||||
|
|
||||||
|
if { ${tolres} > 1.e-4} {
|
||||||
|
puts "Error: bad tolerance of result"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkprops result -v 1028.37 -deps 1.e-5
|
23
tests/bugs/modalg_7/bug31030
Normal file
23
tests/bugs/modalg_7/bug31030
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
puts "========================================================================"
|
||||||
|
puts "OCC31030: BRepFilletAPI_MakeFillet algorithm fails on almost smooth edge"
|
||||||
|
puts "========================================================================"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
brestore [locate_data_file bug31030_compfaces.brep] b
|
||||||
|
|
||||||
|
sewing a 0.0001 b
|
||||||
|
explode a e
|
||||||
|
|
||||||
|
blend result a 0.1 a_3
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
|
||||||
|
checknbshapes result -shell 1 -face 4 -wire 4 -edge 5 -vertex 3
|
||||||
|
|
||||||
|
set tolres [checkmaxtol result]
|
||||||
|
|
||||||
|
if { ${tolres} > 0.0003} {
|
||||||
|
puts "Error: bad tolerance of result"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkprops result -v 1850.13
|
Loading…
x
Reference in New Issue
Block a user