mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0025926: 3D offset in mode "Complete" with Join type "Intersection"
Extension for colliding cases (Limited to work on planar cases only). Test cases for issue CR25926 Update of test-cases according to the new behavior
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
TopoDS_Shape BRepAlgo_Tool::Deboucle3D(const TopoDS_Shape& S,
|
||||
const TopTools_MapOfShape& Boundary)
|
||||
const TopTools_MapOfShape& Boundary)
|
||||
{
|
||||
TopoDS_Shape SS;
|
||||
|
||||
@@ -49,12 +49,19 @@ TopoDS_Shape BRepAlgo_Tool::Deboucle3D(const TopoDS_Shape& S,
|
||||
|
||||
Standard_Boolean JeGarde = Standard_True;
|
||||
for ( Standard_Integer i = 1; i <= Map.Extent() && JeGarde; i++) {
|
||||
if (Map(i).Extent() < 2) {
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge(Map.FindKey(i));
|
||||
if (!Boundary.Contains(anEdge) &&
|
||||
!BRep_Tool::Degenerated(anEdge) )
|
||||
JeGarde = Standard_False;
|
||||
}
|
||||
const TopTools_ListOfShape& aLF = Map(i);
|
||||
if (aLF.Extent() < 2) {
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge(Map.FindKey(i));
|
||||
if (anEdge.Orientation() == TopAbs_INTERNAL) {
|
||||
const TopoDS_Face& aFace = TopoDS::Face(aLF.First());
|
||||
if (aFace.Orientation() != TopAbs_INTERNAL) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (!Boundary.Contains(anEdge) &&
|
||||
!BRep_Tool::Degenerated(anEdge) )
|
||||
JeGarde = Standard_False;
|
||||
}
|
||||
}
|
||||
if ( JeGarde) SS = S;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -41,31 +41,27 @@ public:
|
||||
//! Computes the intersections between the edges stored
|
||||
//! is AsDes as descendants of <F> . Intersections is computed
|
||||
//! between two edges if one of them is bound in NewEdges.
|
||||
Standard_EXPORT static void Compute (const Handle(BRepAlgo_AsDes)& AsDes, const TopoDS_Face& F, const TopTools_IndexedMapOfShape& NewEdges, const Standard_Real Tol);
|
||||
Standard_EXPORT static void Compute (const Handle(BRepAlgo_AsDes)& AsDes,
|
||||
const TopoDS_Face& F,
|
||||
const TopTools_IndexedMapOfShape& NewEdges,
|
||||
const Standard_Real Tol);
|
||||
|
||||
Standard_EXPORT static void ConnexIntByInt (const TopoDS_Face& FI, BRepOffset_Offset& OFI, TopTools_DataMapOfShapeShape& MES, const TopTools_DataMapOfShapeShape& Build, const Handle(BRepAlgo_AsDes)& AsDes, const Standard_Real Offset, const Standard_Real Tol);
|
||||
Standard_EXPORT static void ConnexIntByInt (const TopoDS_Face& FI,
|
||||
BRepOffset_Offset& OFI,
|
||||
TopTools_DataMapOfShapeShape& MES,
|
||||
const TopTools_DataMapOfShapeShape& Build,
|
||||
const Handle(BRepAlgo_AsDes)& AsDes,
|
||||
const Handle(BRepAlgo_AsDes)& AsDes2d,
|
||||
const Standard_Real Offset,
|
||||
const Standard_Real Tol);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepOffset_Inter2d_HeaderFile
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -53,9 +53,9 @@ public:
|
||||
|
||||
Standard_EXPORT void ConnexIntByArc (const TopTools_ListOfShape& SetOfFaces, const TopoDS_Shape& ShapeInit, const BRepOffset_Analyse& Analyse, const BRepAlgo_Image& InitOffsetFace);
|
||||
|
||||
Standard_EXPORT void ConnexIntByInt (const TopoDS_Shape& SI, const BRepOffset_DataMapOfShapeOffset& MapSF, const BRepOffset_Analyse& A, TopTools_DataMapOfShapeShape& MES, TopTools_DataMapOfShapeShape& Build, TopTools_ListOfShape& Failed);
|
||||
Standard_EXPORT void ConnexIntByInt (const TopoDS_Shape& SI, const BRepOffset_DataMapOfShapeOffset& MapSF, const BRepOffset_Analyse& A, TopTools_DataMapOfShapeShape& MES, TopTools_DataMapOfShapeShape& Build, TopTools_ListOfShape& Failed, const Standard_Boolean bIsPlanar = Standard_False);
|
||||
|
||||
Standard_EXPORT void ContextIntByInt (const TopTools_IndexedMapOfShape& ContextFaces, const Standard_Boolean ExtentContext, const BRepOffset_DataMapOfShapeOffset& MapSF, const BRepOffset_Analyse& A, TopTools_DataMapOfShapeShape& MES, TopTools_DataMapOfShapeShape& Build, TopTools_ListOfShape& Failed);
|
||||
Standard_EXPORT void ContextIntByInt (const TopTools_IndexedMapOfShape& ContextFaces, const Standard_Boolean ExtentContext, const BRepOffset_DataMapOfShapeOffset& MapSF, const BRepOffset_Analyse& A, TopTools_DataMapOfShapeShape& MES, TopTools_DataMapOfShapeShape& Build, TopTools_ListOfShape& Failed, const Standard_Boolean bIsPlanar = Standard_False);
|
||||
|
||||
Standard_EXPORT void ContextIntByArc (const TopTools_IndexedMapOfShape& ContextFaces, const Standard_Boolean ExtentContext, const BRepOffset_Analyse& Analyse, const BRepAlgo_Image& InitOffsetFace, BRepAlgo_Image& InitOffsetEdge);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -53,9 +53,27 @@ public:
|
||||
|
||||
Standard_EXPORT BRepOffset_MakeOffset();
|
||||
|
||||
Standard_EXPORT BRepOffset_MakeOffset(const TopoDS_Shape& S, const Standard_Real Offset, const Standard_Real Tol, const BRepOffset_Mode Mode = BRepOffset_Skin, const Standard_Boolean Intersection = Standard_False, const Standard_Boolean SelfInter = Standard_False, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean Thickening = Standard_False);
|
||||
Standard_EXPORT BRepOffset_MakeOffset(const TopoDS_Shape& S,
|
||||
const Standard_Real Offset,
|
||||
const Standard_Real Tol,
|
||||
const BRepOffset_Mode Mode = BRepOffset_Skin,
|
||||
const Standard_Boolean Intersection = Standard_False,
|
||||
const Standard_Boolean SelfInter = Standard_False,
|
||||
const GeomAbs_JoinType Join = GeomAbs_Arc,
|
||||
const Standard_Boolean Thickening = Standard_False,
|
||||
const Standard_Boolean RemoveIntEdges = Standard_False,
|
||||
const Standard_Boolean RemoveInvalidFaces = Standard_False);
|
||||
|
||||
Standard_EXPORT void Initialize (const TopoDS_Shape& S, const Standard_Real Offset, const Standard_Real Tol, const BRepOffset_Mode Mode = BRepOffset_Skin, const Standard_Boolean Intersection = Standard_False, const Standard_Boolean SelfInter = Standard_False, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean Thickening = Standard_False);
|
||||
Standard_EXPORT void Initialize (const TopoDS_Shape& S,
|
||||
const Standard_Real Offset,
|
||||
const Standard_Real Tol,
|
||||
const BRepOffset_Mode Mode = BRepOffset_Skin,
|
||||
const Standard_Boolean Intersection = Standard_False,
|
||||
const Standard_Boolean SelfInter = Standard_False,
|
||||
const GeomAbs_JoinType Join = GeomAbs_Arc,
|
||||
const Standard_Boolean Thickening = Standard_False,
|
||||
const Standard_Boolean RemoveIntEdges = Standard_False,
|
||||
const Standard_Boolean RemoveInvalidFaces = Standard_False);
|
||||
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
@@ -106,20 +124,24 @@ public:
|
||||
Standard_EXPORT const TopoDS_Shape& GetBadShape() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void BuildOffsetByArc();
|
||||
|
||||
Standard_EXPORT void BuildOffsetByInter();
|
||||
|
||||
//! Building splits of the offset faces by the section curves
|
||||
//! between the neighboring faces.
|
||||
Standard_EXPORT void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF,
|
||||
const Handle(BRepAlgo_AsDes)& theAsDes,
|
||||
TopTools_IndexedDataMapOfShapeListOfShape& theOrigins,
|
||||
BRepAlgo_Image& theImage,
|
||||
TopTools_ListOfShape& theLFailed,
|
||||
const Standard_Boolean bLimited);
|
||||
|
||||
Standard_EXPORT void SelfInter (TopTools_MapOfShape& Modif);
|
||||
|
||||
@@ -152,6 +174,10 @@ private:
|
||||
//! Private method used to build walls for thickening the shell
|
||||
Standard_EXPORT void MakeMissingWalls();
|
||||
|
||||
//! Removes INTERNAL edges from the result
|
||||
Standard_EXPORT void RemoveInternalEdges();
|
||||
|
||||
|
||||
|
||||
Standard_Real myOffset;
|
||||
Standard_Real myTol;
|
||||
@@ -161,6 +187,8 @@ private:
|
||||
Standard_Boolean mySelfInter;
|
||||
GeomAbs_JoinType myJoin;
|
||||
Standard_Boolean myThickening;
|
||||
Standard_Boolean myRemoveIntEdges;
|
||||
Standard_Boolean myRemoveInvalidFaces;
|
||||
TopTools_DataMapOfShapeReal myFaceOffset;
|
||||
TopTools_IndexedMapOfShape myFaces;
|
||||
BRepOffset_Analyse myAnalyse;
|
||||
@@ -174,15 +202,9 @@ private:
|
||||
BRepOffset_Error myError;
|
||||
BRepOffset_MakeLoops myMakeLoops;
|
||||
Standard_Boolean myIsPerformSewing; // Handle bad walls in thicksolid mode.
|
||||
Standard_Boolean myIsPlanar;
|
||||
TopoDS_Shape myBadShape;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepOffset_MakeOffset_HeaderFile
|
||||
|
@@ -43,9 +43,11 @@ BRepOffsetAPI_MakeOffsetShape::BRepOffsetAPI_MakeOffsetShape
|
||||
const BRepOffset_Mode Mode,
|
||||
const Standard_Boolean Intersection,
|
||||
const Standard_Boolean SelfInter,
|
||||
const GeomAbs_JoinType Join)
|
||||
const GeomAbs_JoinType Join,
|
||||
const Standard_Boolean RemoveIntEdges)
|
||||
{
|
||||
myOffsetShape.Initialize (S,Offset,Tol,Mode,Intersection,SelfInter,Join);
|
||||
myOffsetShape.Initialize (S,Offset,Tol,Mode,Intersection,SelfInter,
|
||||
Join, Standard_False, RemoveIntEdges);
|
||||
Build();
|
||||
}
|
||||
|
||||
|
@@ -82,6 +82,8 @@ public:
|
||||
//! - if Join is equal to GeomAbs_Intersection, then the parallels to the
|
||||
//! two adjacent faces are enlarged and intersected,
|
||||
//! so that there are no free edges on parallels to faces.
|
||||
//! RemoveIntEdges flag defines whether to remove the INTERNAL edges
|
||||
//! from the result or not.
|
||||
//! Warnings
|
||||
//! 1. All the faces of the shape S should be based on the surfaces
|
||||
//! with continuity at least C1.
|
||||
@@ -100,8 +102,15 @@ public:
|
||||
//! Exceptions
|
||||
//! Geom_UndefinedDerivative if the underlying
|
||||
//! geometry of S is BSpline with continuity C0.
|
||||
Standard_EXPORT BRepOffsetAPI_MakeOffsetShape(const TopoDS_Shape& S, const Standard_Real Offset, const Standard_Real Tol, const BRepOffset_Mode Mode = BRepOffset_Skin, const Standard_Boolean Intersection = Standard_False, const Standard_Boolean SelfInter = Standard_False, const GeomAbs_JoinType Join = GeomAbs_Arc);
|
||||
|
||||
Standard_EXPORT BRepOffsetAPI_MakeOffsetShape(const TopoDS_Shape& S,
|
||||
const Standard_Real Offset,
|
||||
const Standard_Real Tol,
|
||||
const BRepOffset_Mode Mode = BRepOffset_Skin,
|
||||
const Standard_Boolean Intersection = Standard_False,
|
||||
const Standard_Boolean SelfInter = Standard_False,
|
||||
const GeomAbs_JoinType Join = GeomAbs_Arc,
|
||||
const Standard_Boolean RemoveIntEdges = Standard_False);
|
||||
|
||||
Standard_EXPORT virtual const BRepOffset_MakeOffset& MakeOffset() const;
|
||||
|
||||
//! Builds the resulting shape (redefined from MakeShape).
|
||||
|
@@ -44,9 +44,11 @@ BRepOffsetAPI_MakeThickSolid::BRepOffsetAPI_MakeThickSolid
|
||||
const BRepOffset_Mode Mode,
|
||||
const Standard_Boolean Intersection,
|
||||
const Standard_Boolean SelfInter,
|
||||
const GeomAbs_JoinType Join)
|
||||
const GeomAbs_JoinType Join,
|
||||
const Standard_Boolean RemoveIntEdges)
|
||||
{
|
||||
myOffsetShape.Initialize (S,Offset,Tol,Mode,Intersection,SelfInter,Join);
|
||||
myOffsetShape.Initialize (S,Offset,Tol,Mode,Intersection,SelfInter,
|
||||
Join, Standard_False, RemoveIntEdges);
|
||||
TopTools_ListIteratorOfListOfShape it(ClosingFaces);
|
||||
for (; it.More(); it.Next()) {
|
||||
myOffsetShape.AddFace(TopoDS::Face(it.Value()));
|
||||
|
@@ -88,11 +88,21 @@ public:
|
||||
//! then the parallels to the two adjacent faces are
|
||||
//! enlarged and intersected, so that there are no free
|
||||
//! edges on parallels to faces.
|
||||
//! RemoveIntEdges flag defines whether to remove the INTERNAL edges
|
||||
//! from the result or not.
|
||||
//! Warnings
|
||||
//! Since the algorithm of MakeThickSolid is based on
|
||||
//! MakeOffsetShape algorithm, the warnings are the same as for
|
||||
//! MakeOffsetShape.
|
||||
Standard_EXPORT BRepOffsetAPI_MakeThickSolid(const TopoDS_Shape& S, const TopTools_ListOfShape& ClosingFaces, const Standard_Real Offset, const Standard_Real Tol, const BRepOffset_Mode Mode = BRepOffset_Skin, const Standard_Boolean Intersection = Standard_False, const Standard_Boolean SelfInter = Standard_False, const GeomAbs_JoinType Join = GeomAbs_Arc);
|
||||
Standard_EXPORT BRepOffsetAPI_MakeThickSolid(const TopoDS_Shape& S,
|
||||
const TopTools_ListOfShape& ClosingFaces,
|
||||
const Standard_Real Offset,
|
||||
const Standard_Real Tol,
|
||||
const BRepOffset_Mode Mode = BRepOffset_Skin,
|
||||
const Standard_Boolean Intersection = Standard_False,
|
||||
const Standard_Boolean SelfInter = Standard_False,
|
||||
const GeomAbs_JoinType Join = GeomAbs_Arc,
|
||||
const Standard_Boolean RemoveIntEdges = Standard_False);
|
||||
|
||||
//! Builds the resulting shape (redefined from MakeOffsetShape).
|
||||
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
|
||||
|
@@ -865,7 +865,7 @@ Standard_Integer thickshell(Draw_Interpretor& theCommands,
|
||||
Tol = Draw::Atof(a[5]);
|
||||
|
||||
BRepOffset_MakeOffset B;
|
||||
B.Initialize(S,Of,Tol,BRepOffset_Skin,Inter,0,JT, Standard_True);
|
||||
B.Initialize(S,Of,Tol,BRepOffset_Skin,Inter,0,JT,Standard_True);
|
||||
|
||||
B.MakeOffsetShape();
|
||||
|
||||
@@ -942,63 +942,73 @@ static Standard_Boolean theYaBouchon;
|
||||
static Standard_Real TheTolerance = Precision::Confusion();
|
||||
static Standard_Boolean TheInter = Standard_False;
|
||||
static GeomAbs_JoinType TheJoin = GeomAbs_Arc;
|
||||
static Standard_Boolean RemoveIntEdges = Standard_False;
|
||||
static Standard_Boolean RemoveInvalidFaces = Standard_False;
|
||||
|
||||
Standard_Integer offsetparameter(Draw_Interpretor& di,
|
||||
Standard_Integer n, const char** a)
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
if ( n == 1 ) {
|
||||
//cout << " OffsetParameter Tol Inter(c/p) JoinType(a/i)" << endl;
|
||||
//cout << " Current Values" << endl;
|
||||
//cout << " --> Tolerance :" << TheTolerance << endl;
|
||||
//cout << " --> TheInter :";
|
||||
di << " OffsetParameter Tol Inter(c/p) JoinType(a/i)" << "\n";
|
||||
di << " OffsetParameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k) RemoveInvalidFaces(r/k)]" << "\n";
|
||||
di << " Current Values" << "\n";
|
||||
di << " --> Tolerance :" << TheTolerance << "\n";
|
||||
di << " --> TheInter :";
|
||||
di << " --> Tolerance : " << TheTolerance << "\n";
|
||||
di << " --> TheInter : ";
|
||||
if ( TheInter) {
|
||||
//cout << "Complet" ;
|
||||
di << "Complet" ;
|
||||
} else {
|
||||
//cout << "Partial";
|
||||
di << "Partial";
|
||||
}
|
||||
//cout << endl << " --> TheJoin :";
|
||||
di << "\n" << " --> TheJoin :";
|
||||
di << "\n" << " --> TheJoin : ";
|
||||
|
||||
switch (TheJoin) {
|
||||
//case GeomAbs_Arc: cout << " Arc"; break;
|
||||
//case GeomAbs_Intersection: cout << " Intersection"; break;
|
||||
case GeomAbs_Arc: di << " Arc"; break;
|
||||
case GeomAbs_Intersection: di << " Intersection"; break;
|
||||
case GeomAbs_Arc: di << "Arc"; break;
|
||||
case GeomAbs_Intersection: di << "Intersection"; break;
|
||||
default:
|
||||
break ;
|
||||
}
|
||||
//cout << endl;
|
||||
//
|
||||
di << "\n" << " --> Internal Edges : ";
|
||||
if (RemoveIntEdges) {
|
||||
di << "Remove";
|
||||
}
|
||||
else {
|
||||
di << "Keep";
|
||||
}
|
||||
//
|
||||
di << "\n" << " --> Invalid Faces : ";
|
||||
if (RemoveInvalidFaces) {
|
||||
di << "Remove";
|
||||
}
|
||||
else {
|
||||
di << "Keep";
|
||||
}
|
||||
di << "\n";
|
||||
|
||||
//
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( n < 4 ) return 1;
|
||||
|
||||
//
|
||||
TheTolerance = Draw::Atof(a[1]);
|
||||
TheInter = strcmp(a[2],"p");
|
||||
|
||||
//
|
||||
if ( !strcmp(a[3],"a")) TheJoin = GeomAbs_Arc;
|
||||
else if ( !strcmp(a[3],"i")) TheJoin = GeomAbs_Intersection;
|
||||
else if ( !strcmp(a[3],"t")) TheJoin = GeomAbs_Tangent;
|
||||
|
||||
return 0;
|
||||
//
|
||||
RemoveIntEdges = (n >= 5) ? !strcmp(a[4], "r") : Standard_False;
|
||||
RemoveInvalidFaces = (n == 6) ? !strcmp(a[5], "r") : Standard_False;
|
||||
//
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : offsetinit
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer offsetload(Draw_Interpretor& ,
|
||||
Standard_Integer n, const char** a)
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
if ( n < 2) return 1;
|
||||
TopoDS_Shape S = DBRep::Get(a[1]);
|
||||
@@ -1008,7 +1018,8 @@ Standard_Integer offsetload(Draw_Interpretor& ,
|
||||
TheRadius = Of;
|
||||
// Standard_Boolean Inter = Standard_True;
|
||||
|
||||
TheOffset.Initialize(S,Of,TheTolerance,BRepOffset_Skin,TheInter,0,TheJoin);
|
||||
TheOffset.Initialize(S,Of,TheTolerance,BRepOffset_Skin,TheInter,0,TheJoin,
|
||||
Standard_False, RemoveIntEdges, RemoveInvalidFaces);
|
||||
//------------------------------------------
|
||||
// recuperation et chargement des bouchons.
|
||||
//----------------------------------------
|
||||
|
Reference in New Issue
Block a user