mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0025926: 3D offset in mode "Complete" with Join type "Intersection"
3D offset algorithm extension for degenerate (colliding) cases. Patch for version 6.9.1 of Open CASCADE. It includes the following commits: Revision: 5a9dc37f84bb8c6c7ac1e43c1dbcf484b4261321 Author: emv <emv@opencascade.com> Date: 22/10/15 9:00:54 AM Message: Make the possibility to produce empty result in case of any invalidity (spikes, self-intersections, faces inversion) optional. ---- Modified: src/BRepOffset/BRepOffset_MakeOffset.cdl Modified: src/BRepOffset/BRepOffset_MakeOffset.cxx Modified: src/BRepTest/BRepTest_FeatureCommands.cxx Revision: aadba9a3f585693eddff1ea29b7063a08320ee23 Author: emv <emv@opencascade.com> Date: 16/10/15 10:21:57 AM Message: Due to the small inaccuracy of the calculation of the bi-normal direction (direction inside the face on the edge) the criterion on the coincidence of these directions has been weakened. ---- Modified: src/BRepOffset/BRepOffset_MakeOffset.cxx Revision: 3564da4b4d631c8ed627d7ca7697328d6c371aae Author: emv <emv@opencascade.com> Date: 15/10/15 11:52:23 AM Message: The option to remove INTERNAL edges from the faces of the result of Offset operation has been added into Offset API. By default these edges will be kept in the result. To remove these edges make sure to set the corresponding flag to TRUE when initializing the Offset algo. void BRepOffset_MakeOffset::Initialize(const TopoDS_Shape& S, const Standard_Real Offset, const Standard_Real Tol, const BRepOffset_Mode Mode, const Standard_Boolean Inter, const Standard_Boolean SelfInter, const GeomAbs_JoinType Join, const Standard_Boolean RemoveIntEdges, const Standard_Boolean Thickening) ---- Modified: src/BRepOffset/BRepOffset_MakeOffset.cdl Modified: src/BRepOffset/BRepOffset_MakeOffset.cxx Modified: src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.cdl Modified: src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.cxx Modified: src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.cdl Modified: src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.cxx Modified: src/BRepTest/BRepTest_FeatureCommands.cxx Revision:fe25cda7b7
Author: emv <emv@opencascade.com> Date: 08/10/15 12:11:06 PM Message: Temporary patch to produce empty result in case of any invalidity (spikes, self-intersections, faces inversion). ---- Modified: src/BRepOffset/BRepOffset_MakeOffset.cxx Revision:0fe92803d2
Author: emv <emv@opencascade.com> Date: 27/08/15 11:21:55 AM Message: Using local face tolerance for edges intersection. ---- Modified: src/BRepOffset/BRepOffset_MakeOffset.cxx Revision:7a38094a2b
Author: emv <emv@opencascade.com> Date: 10/07/15 12:52:58 PM Message: Corrections in splitting faces and making shells functions. ---- Modified: src/BRepOffset/BRepOffset_MakeOffset.cxx Revision:2102c85e9f
Author: emv <emv@opencascade.com> Date: 07/07/15 2:18:28 PM Message: 3D Offset algorithm extension for the cases with the shapes having the faces connected only by the VERTEX. ---- Modified: src/BRepOffset/BRepOffset_Inter2d.cdl Modified: src/BRepOffset/BRepOffset_Inter2d.cxx Modified: src/BRepOffset/BRepOffset_Inter3d.cxx Modified: src/BRepOffset/BRepOffset_MakeOffset.cxx Revision:c4362927dc
Author: emv <emv@opencascade.com> Date: 30/06/15 12:22:42 PM Message: Fix for correct shells splitting when building solids. ---- Modified: src/BOPAlgo/BOPAlgo_MakerVolume.cxx Modified: src/BOPAlgo/BOPAlgo_ShellSplitter.cxx Revision:ee5d676aee
Author: emv <emv@opencascade.com> Date: 17/06/15 11:30:10 AM Message: Treatment of the shells with free edges has been changed to keep the faces with internal edges. ---- Modified: src/BRepAlgo/BRepAlgo_Tool.cxx Revision:999dacb4d0
Author: emv <emv@opencascade.com> Date: 04/06/15 10:53:22 AM Message: 0025926: 3D offset in mode "Complete" with Join type "Intersection" 3D offset algorithm extension for degenerate (colliding) cases. ---- Modified: src/BRepOffset/BRepOffset_Inter2d.cxx Modified: src/BRepOffset/BRepOffset_Inter3d.cxx Modified: src/BRepOffset/BRepOffset_MakeOffset.cdl Modified: src/BRepOffset/BRepOffset_MakeOffset.cxx
This commit is contained in:
@@ -52,8 +52,16 @@ TopoDS_Shape BRepAlgo_Tool::Deboucle3D(const TopoDS_Shape& S,
|
|||||||
|
|
||||||
Standard_Boolean JeGarde = Standard_True;
|
Standard_Boolean JeGarde = Standard_True;
|
||||||
for ( Standard_Integer i = 1; i <= Map.Extent() && JeGarde; i++) {
|
for ( Standard_Integer i = 1; i <= Map.Extent() && JeGarde; i++) {
|
||||||
if (Map(i).Extent() < 2) {
|
const TopTools_ListOfShape& aLF = Map(i);
|
||||||
const TopoDS_Edge& anEdge = TopoDS::Edge(Map.FindKey(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) &&
|
if (!Boundary.Contains(anEdge) &&
|
||||||
!BRep_Tool::Degenerated(anEdge) )
|
!BRep_Tool::Degenerated(anEdge) )
|
||||||
JeGarde = Standard_False;
|
JeGarde = Standard_False;
|
||||||
|
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
class Inter2d from BRepOffset
|
class Inter2d from BRepOffset
|
||||||
|
|
||||||
---Purpose: Computes the intersections betwwen edges on a face
|
---Purpose: Computes the intersections betwwen edges on a face
|
||||||
-- stores result is SD as AsDes from BRepOffset.
|
-- stores result is SD as AsDes from BRepOffset.
|
||||||
|
|
||||||
uses
|
uses
|
||||||
AsDes from BRepAlgo,
|
AsDes from BRepAlgo,
|
||||||
@@ -30,27 +30,28 @@ uses
|
|||||||
Real from Standard
|
Real from Standard
|
||||||
|
|
||||||
is
|
is
|
||||||
Compute(myclass ; AsDes : AsDes from BRepAlgo;
|
Compute(myclass ; AsDes : AsDes from BRepAlgo;
|
||||||
F : Face from TopoDS;
|
F : Face from TopoDS;
|
||||||
NewEdges : IndexedMapOfShape from TopTools;
|
NewEdges : IndexedMapOfShape from TopTools;
|
||||||
Tol : Real from Standard);
|
Tol : Real from Standard);
|
||||||
|
|
||||||
---Purpose: Computes the intersections between the edges stored
|
---Purpose: Computes the intersections between the edges stored
|
||||||
-- is AsDes as descendants of <F> . Intersections is computed
|
-- is AsDes as descendants of <F> . Intersections is computed
|
||||||
-- between two edges if one of them is bound in NewEdges.
|
-- between two edges if one of them is bound in NewEdges.
|
||||||
|
|
||||||
|
|
||||||
-- Modified by skv - Fri Dec 26 16:53:16 2003 OCC4455 Begin
|
-- Modified by skv - Fri Dec 26 16:53:16 2003 OCC4455 Begin
|
||||||
-- Add another parameter: offset value.
|
-- Add another parameter: offset value.
|
||||||
ConnexIntByInt(myclass ;
|
ConnexIntByInt(myclass ;
|
||||||
FI : Face from TopoDS;
|
FI : Face from TopoDS;
|
||||||
OFI : in out Offset from BRepOffset;
|
OFI : in out Offset from BRepOffset;
|
||||||
MES : in out DataMapOfShapeShape from TopTools;
|
MES : in out DataMapOfShapeShape from TopTools;
|
||||||
Build : DataMapOfShapeShape from TopTools;
|
Build : DataMapOfShapeShape from TopTools;
|
||||||
AsDes : AsDes from BRepAlgo;
|
AsDes : AsDes from BRepAlgo;
|
||||||
Offset: Real from Standard;
|
AsDes2d : AsDes from BRepAlgo;
|
||||||
Tol : Real from Standard);
|
Offset : Real from Standard;
|
||||||
|
Tol : Real from Standard);
|
||||||
-- Modified by skv - Fri Dec 26 16:53:16 2003 OCC4455 End
|
-- Modified by skv - Fri Dec 26 16:53:16 2003 OCC4455 End
|
||||||
|
|
||||||
end Inter2d;
|
end Inter2d;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
class MakeOffset from BRepOffset
|
class MakeOffset from BRepOffset
|
||||||
|
|
||||||
---Purpose:
|
---Purpose:
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Image from BRepAlgo,
|
Image from BRepAlgo,
|
||||||
@@ -36,47 +36,53 @@ uses
|
|||||||
Edge from TopoDS,
|
Edge from TopoDS,
|
||||||
MapOfShape from TopTools,
|
MapOfShape from TopTools,
|
||||||
IndexedMapOfShape from TopTools,
|
IndexedMapOfShape from TopTools,
|
||||||
ListOfShape from TopTools,
|
ListOfShape from TopTools,
|
||||||
|
DataMapOfShapeShape from TopTools,
|
||||||
|
IndexedDataMapOfShapeListOfShape from TopTools,
|
||||||
MakeLoops from BRepOffset
|
MakeLoops from BRepOffset
|
||||||
|
|
||||||
is
|
is
|
||||||
|
|
||||||
Create;
|
Create;
|
||||||
|
|
||||||
Create ( S : Shape from TopoDS;
|
Create ( S : Shape from TopoDS;
|
||||||
Offset : Real from Standard;
|
Offset : Real from Standard;
|
||||||
Tol : Real from Standard;
|
Tol : Real from Standard;
|
||||||
Mode : Mode from BRepOffset = BRepOffset_Skin;
|
Mode : Mode from BRepOffset = BRepOffset_Skin;
|
||||||
Intersection : Boolean from Standard = Standard_False;
|
Intersection : Boolean from Standard = Standard_False;
|
||||||
SelfInter : Boolean from Standard = Standard_False;
|
SelfInter : Boolean from Standard = Standard_False;
|
||||||
Join : JoinType from GeomAbs = GeomAbs_Arc;
|
Join : JoinType from GeomAbs = GeomAbs_Arc;
|
||||||
Thickening : Boolean from Standard = Standard_False)
|
RemoveIntEdges : Boolean from Standard = Standard_False;
|
||||||
returns MakeOffset from BRepOffset;
|
Thickening : Boolean from Standard = Standard_False;
|
||||||
|
RemoveInvalidFaces: Boolean from Standard = Standard_False)
|
||||||
|
returns MakeOffset from BRepOffset;
|
||||||
|
|
||||||
---Category: Initialization.
|
---Category: Initialization.
|
||||||
|
|
||||||
Initialize (me : in out;
|
Initialize (me : in out;
|
||||||
S : Shape from TopoDS;
|
S : Shape from TopoDS;
|
||||||
Offset : Real from Standard;
|
Offset : Real from Standard;
|
||||||
Tol : Real from Standard;
|
Tol : Real from Standard;
|
||||||
Mode : Mode from BRepOffset = BRepOffset_Skin;
|
Mode : Mode from BRepOffset = BRepOffset_Skin;
|
||||||
Intersection : Boolean from Standard = Standard_False;
|
Intersection : Boolean from Standard = Standard_False;
|
||||||
SelfInter : Boolean from Standard = Standard_False;
|
SelfInter : Boolean from Standard = Standard_False;
|
||||||
Join : JoinType from GeomAbs = GeomAbs_Arc;
|
Join : JoinType from GeomAbs = GeomAbs_Arc;
|
||||||
Thickening : Boolean from Standard = Standard_False)
|
RemoveIntEdges : Boolean from Standard = Standard_False;
|
||||||
|
Thickening : Boolean from Standard = Standard_False;
|
||||||
|
RemoveInvalidFaces: Boolean from Standard = Standard_False)
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
Clear (me : in out)
|
Clear (me : in out)
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
AddFace (me : in out; F : Face from TopoDS) is static;
|
AddFace (me : in out; F : Face from TopoDS) is static;
|
||||||
---Purpose: Add Closing Faces, <F> has to be in the initial
|
---Purpose: Add Closing Faces, <F> has to be in the initial
|
||||||
-- shape S.
|
-- shape S.
|
||||||
|
|
||||||
SetOffsetOnFace (me : in out;
|
SetOffsetOnFace (me : in out;
|
||||||
F : Face from TopoDS;
|
F : Face from TopoDS;
|
||||||
Off : Real from Standard) is static;
|
Off : Real from Standard) is static;
|
||||||
---Purpose: set the offset <Off> on the Face <F>
|
---Purpose: set the offset <Off> on the Face <F>
|
||||||
|
|
||||||
|
|
||||||
---Category: Computation.
|
---Category: Computation.
|
||||||
@@ -88,7 +94,7 @@ is
|
|||||||
---Category: Querying.
|
---Category: Querying.
|
||||||
|
|
||||||
GetAnalyse(me)
|
GetAnalyse(me)
|
||||||
---C++: return const &
|
---C++: return const &
|
||||||
returns Analyse from BRepOffset
|
returns Analyse from BRepOffset
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
@@ -96,18 +102,18 @@ is
|
|||||||
is static;
|
is static;
|
||||||
|
|
||||||
Shape (me)
|
Shape (me)
|
||||||
---C++: return const &
|
---C++: return const &
|
||||||
returns Shape from TopoDS
|
returns Shape from TopoDS
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
Error (me) returns Error from BRepOffset;
|
Error (me) returns Error from BRepOffset;
|
||||||
---Purpose: returns information if IsDone() = FALSE.
|
---Purpose: returns information if IsDone() = FALSE.
|
||||||
|
|
||||||
|
|
||||||
OffsetFacesFromShapes (me)
|
OffsetFacesFromShapes (me)
|
||||||
---Purpose: Returns <Image> containing links between initials
|
---Purpose: Returns <Image> containing links between initials
|
||||||
-- shapes and offset faces.
|
-- shapes and offset faces.
|
||||||
---C++: return const &
|
---C++: return const &
|
||||||
returns Image from BRepAlgo
|
returns Image from BRepAlgo
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
@@ -115,24 +121,24 @@ is
|
|||||||
-- Query offset join type.
|
-- Query offset join type.
|
||||||
|
|
||||||
GetJoinType(me)
|
GetJoinType(me)
|
||||||
---Purpose: Returns myJoin.
|
---Purpose: Returns myJoin.
|
||||||
returns JoinType from GeomAbs
|
returns JoinType from GeomAbs
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
-- Add methods for supporting history.
|
-- Add methods for supporting history.
|
||||||
|
|
||||||
OffsetEdgesFromShapes (me)
|
OffsetEdgesFromShapes (me)
|
||||||
---Purpose: Returns <Image> containing links between initials
|
---Purpose: Returns <Image> containing links between initials
|
||||||
-- shapes and offset edges.
|
-- shapes and offset edges.
|
||||||
---C++: return const &
|
---C++: return const &
|
||||||
returns Image from BRepAlgo
|
returns Image from BRepAlgo
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
-- Modified by skv - Tue Mar 15 16:17:37 2005 End
|
-- Modified by skv - Tue Mar 15 16:17:37 2005 End
|
||||||
|
|
||||||
ClosingFaces (me)
|
ClosingFaces (me)
|
||||||
---Purpose: Returns the list of closing faces stores by AddFace
|
---Purpose: Returns the list of closing faces stores by AddFace
|
||||||
---C++: return const &
|
---C++: return const &
|
||||||
returns IndexedMapOfShape from TopTools
|
returns IndexedMapOfShape from TopTools
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
@@ -156,18 +162,30 @@ is
|
|||||||
|
|
||||||
BuildOffsetByInter ( me : in out )
|
BuildOffsetByInter ( me : in out )
|
||||||
is static private;
|
is static private;
|
||||||
|
|
||||||
|
BuildSplitsOfFaces (me:in out;
|
||||||
|
theLF : ListOfShape from TopTools;
|
||||||
|
theAsDes : AsDes from BRepAlgo;
|
||||||
|
theOrMap : out IndexedDataMapOfShapeListOfShape from TopTools;
|
||||||
|
theImage : out Image from BRepAlgo;
|
||||||
|
theLFail : out ListOfShape from TopTools;
|
||||||
|
bLimited : Boolean from Standard)
|
||||||
|
is static private;
|
||||||
|
---Purpose:
|
||||||
|
-- Building splits of the offset faces by the section curves
|
||||||
|
-- between the neighboring faces.
|
||||||
|
|
||||||
SelfInter (me : in out ;
|
SelfInter (me : in out ;
|
||||||
Modif : in out MapOfShape from TopTools)
|
Modif : in out MapOfShape from TopTools)
|
||||||
is static private;
|
is static private;
|
||||||
|
|
||||||
Intersection3D (me : in out;
|
Intersection3D (me : in out;
|
||||||
Inter : in out Inter3d from BRepOffset)
|
Inter : in out Inter3d from BRepOffset)
|
||||||
is static private;
|
is static private;
|
||||||
|
|
||||||
Intersection2D ( me : in out ;
|
Intersection2D ( me : in out ;
|
||||||
Modif : IndexedMapOfShape from TopTools;
|
Modif : IndexedMapOfShape from TopTools;
|
||||||
NewEdges : IndexedMapOfShape from TopTools)
|
NewEdges : IndexedMapOfShape from TopTools)
|
||||||
is static private;
|
is static private;
|
||||||
|
|
||||||
MakeLoops ( me : in out ;
|
MakeLoops ( me : in out ;
|
||||||
@@ -187,7 +205,7 @@ is
|
|||||||
|
|
||||||
SelectShells (me : in out)
|
SelectShells (me : in out)
|
||||||
is static private;
|
is static private;
|
||||||
|
|
||||||
EncodeRegularity( me : in out)
|
EncodeRegularity( me : in out)
|
||||||
is static private;
|
is static private;
|
||||||
|
|
||||||
@@ -195,20 +213,24 @@ is
|
|||||||
is static private;
|
is static private;
|
||||||
|
|
||||||
ToContext (me : in out;
|
ToContext (me : in out;
|
||||||
MapSF : in out DataMapOfShapeOffset from BRepOffset)
|
MapSF : in out DataMapOfShapeOffset from BRepOffset)
|
||||||
is static private;
|
is static private;
|
||||||
|
|
||||||
UpdateFaceOffset (me: in out)
|
UpdateFaceOffset (me: in out)
|
||||||
---Purpose: Private method use to update the map face<->offset
|
---Purpose: Private method use to update the map face<->offset
|
||||||
is static private;
|
is static private;
|
||||||
|
|
||||||
CorrectConicalFaces (me: in out)
|
CorrectConicalFaces (me: in out)
|
||||||
---Purpose: Private method used to correct degenerated edges on conical faces
|
---Purpose: Private method used to correct degenerated edges on conical faces
|
||||||
is static private;
|
is static private;
|
||||||
|
|
||||||
MakeMissingWalls (me: in out)
|
MakeMissingWalls (me: in out)
|
||||||
---Purpose: Private method used to build walls for thickening the shell
|
---Purpose: Private method used to build walls for thickening the shell
|
||||||
is static private;
|
is static private;
|
||||||
|
|
||||||
|
RemoveInternalEdges (me: in out)
|
||||||
|
---Purpose: Removes INTERNAL edges from the faces
|
||||||
|
is static private;
|
||||||
|
|
||||||
fields
|
fields
|
||||||
|
|
||||||
@@ -218,13 +240,15 @@ fields
|
|||||||
myMode : Mode from BRepOffset;
|
myMode : Mode from BRepOffset;
|
||||||
myInter : Boolean from Standard;
|
myInter : Boolean from Standard;
|
||||||
mySelfInter : Boolean from Standard;
|
mySelfInter : Boolean from Standard;
|
||||||
myJoin : JoinType from GeomAbs;
|
myJoin : JoinType from GeomAbs;
|
||||||
|
myRemoveIntEdges : Boolean from Standard;
|
||||||
myThickening : Boolean from Standard;
|
myThickening : Boolean from Standard;
|
||||||
|
myRemoveInvalidFaces : Boolean from Standard;
|
||||||
|
|
||||||
myFaceOffset : DataMapOfShapeReal from TopTools;
|
myFaceOffset : DataMapOfShapeReal from TopTools;
|
||||||
|
|
||||||
myFaces : IndexedMapOfShape from TopTools;
|
myFaces : IndexedMapOfShape from TopTools;
|
||||||
myAnalyse : Analyse from BRepOffset;
|
myAnalyse : Analyse from BRepOffset;
|
||||||
|
|
||||||
myOffsetShape : Shape from TopoDS; -- Result
|
myOffsetShape : Shape from TopoDS; -- Result
|
||||||
myInitOffsetFace : Image from BRepAlgo;
|
myInitOffsetFace : Image from BRepAlgo;
|
||||||
@@ -240,5 +264,4 @@ fields
|
|||||||
myBadShape : Shape from TopoDS;
|
myBadShape : Shape from TopoDS;
|
||||||
myIsPerformSewing: Boolean from Standard; -- Handle bad walls in thicksolid mode.
|
myIsPerformSewing: Boolean from Standard; -- Handle bad walls in thicksolid mode.
|
||||||
|
|
||||||
|
|
||||||
end MakeOffset;
|
end MakeOffset;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -46,7 +46,8 @@ is
|
|||||||
Mode : Mode from BRepOffset = BRepOffset_Skin;
|
Mode : Mode from BRepOffset = BRepOffset_Skin;
|
||||||
Intersection : Boolean from Standard = Standard_False;
|
Intersection : Boolean from Standard = Standard_False;
|
||||||
SelfInter : Boolean from Standard = Standard_False;
|
SelfInter : Boolean from Standard = Standard_False;
|
||||||
Join : JoinType from GeomAbs = GeomAbs_Arc)
|
Join : JoinType from GeomAbs = GeomAbs_Arc;
|
||||||
|
RemoveIntEdges:Boolean from Standard = Standard_False)
|
||||||
---Purpose: Constructs a shape parallel to the shape S, where
|
---Purpose: Constructs a shape parallel to the shape S, where
|
||||||
-- - S may be a face, a shell, a solid or a compound of these shape kinds;
|
-- - S may be a face, a shell, a solid or a compound of these shape kinds;
|
||||||
-- - Offset is the offset value. The offset shape is constructed:
|
-- - Offset is the offset value. The offset shape is constructed:
|
||||||
@@ -82,6 +83,8 @@ is
|
|||||||
-- - if Join is equal to GeomAbs_Intersection, then the parallels to the
|
-- - if Join is equal to GeomAbs_Intersection, then the parallels to the
|
||||||
-- two adjacent faces are enlarged and intersected,
|
-- two adjacent faces are enlarged and intersected,
|
||||||
-- so that there are no free edges on parallels to faces.
|
-- 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
|
-- Warnings
|
||||||
-- 1. All the faces of the shape S should be based on the surfaces
|
-- 1. All the faces of the shape S should be based on the surfaces
|
||||||
-- with continuity at least C1.
|
-- with continuity at least C1.
|
||||||
|
@@ -43,9 +43,11 @@ BRepOffsetAPI_MakeOffsetShape::BRepOffsetAPI_MakeOffsetShape
|
|||||||
const BRepOffset_Mode Mode,
|
const BRepOffset_Mode Mode,
|
||||||
const Standard_Boolean Intersection,
|
const Standard_Boolean Intersection,
|
||||||
const Standard_Boolean SelfInter,
|
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, RemoveIntEdges);
|
||||||
Build();
|
Build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -53,7 +53,8 @@ is
|
|||||||
Mode : Mode from BRepOffset = BRepOffset_Skin;
|
Mode : Mode from BRepOffset = BRepOffset_Skin;
|
||||||
Intersection : Boolean from Standard = Standard_False;
|
Intersection : Boolean from Standard = Standard_False;
|
||||||
SelfInter : Boolean from Standard = Standard_False;
|
SelfInter : Boolean from Standard = Standard_False;
|
||||||
Join : JoinType from GeomAbs = GeomAbs_Arc)
|
Join : JoinType from GeomAbs = GeomAbs_Arc;
|
||||||
|
RemoveIntEdges : Boolean from Standard = Standard_False)
|
||||||
---Purpose: Constructs a hollowed solid from
|
---Purpose: Constructs a hollowed solid from
|
||||||
-- the solid S by removing the set of faces ClosingFaces from S, where:
|
-- the solid S by removing the set of faces ClosingFaces from S, where:
|
||||||
-- Offset defines the thickness of the walls. Its sign indicates
|
-- Offset defines the thickness of the walls. Its sign indicates
|
||||||
@@ -88,6 +89,8 @@ is
|
|||||||
-- then the parallels to the two adjacent faces are
|
-- then the parallels to the two adjacent faces are
|
||||||
-- enlarged and intersected, so that there are no free
|
-- enlarged and intersected, so that there are no free
|
||||||
-- edges on parallels to faces.
|
-- edges on parallels to faces.
|
||||||
|
-- - RemoveIntEdges flag defines whether to remove the INTERNAL edges
|
||||||
|
-- from the result or not.
|
||||||
-- Warnings
|
-- Warnings
|
||||||
-- Since the algorithm of MakeThickSolid is based on
|
-- Since the algorithm of MakeThickSolid is based on
|
||||||
-- MakeOffsetShape algorithm, the warnings are the same as for
|
-- MakeOffsetShape algorithm, the warnings are the same as for
|
||||||
|
@@ -44,9 +44,11 @@ BRepOffsetAPI_MakeThickSolid::BRepOffsetAPI_MakeThickSolid
|
|||||||
const BRepOffset_Mode Mode,
|
const BRepOffset_Mode Mode,
|
||||||
const Standard_Boolean Intersection,
|
const Standard_Boolean Intersection,
|
||||||
const Standard_Boolean SelfInter,
|
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, RemoveIntEdges);
|
||||||
TopTools_ListIteratorOfListOfShape it(ClosingFaces);
|
TopTools_ListIteratorOfListOfShape it(ClosingFaces);
|
||||||
for (; it.More(); it.Next()) {
|
for (; it.More(); it.Next()) {
|
||||||
myOffsetShape.AddFace(TopoDS::Face(it.Value()));
|
myOffsetShape.AddFace(TopoDS::Face(it.Value()));
|
||||||
|
@@ -803,7 +803,7 @@ static Standard_Integer SPLS(Draw_Interpretor& ,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Integer thickshell(Draw_Interpretor& ,
|
Standard_Integer thickshell(Draw_Interpretor& ,
|
||||||
Standard_Integer n, const char** a)
|
Standard_Integer n, const char** a)
|
||||||
{
|
{
|
||||||
|
|
||||||
//OSD_Chronometer Clock;
|
//OSD_Chronometer Clock;
|
||||||
@@ -818,9 +818,9 @@ Standard_Integer thickshell(Draw_Interpretor& ,
|
|||||||
if (n > 4)
|
if (n > 4)
|
||||||
{
|
{
|
||||||
if (!strcmp(a[4],"i"))
|
if (!strcmp(a[4],"i"))
|
||||||
JT = GeomAbs_Intersection;
|
JT = GeomAbs_Intersection;
|
||||||
if (!strcmp(a[4],"t"))
|
if (!strcmp(a[4],"t"))
|
||||||
JT = GeomAbs_Tangent;
|
JT = GeomAbs_Tangent;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean Inter = Standard_False; //Standard_True;
|
Standard_Boolean Inter = Standard_False; //Standard_True;
|
||||||
@@ -829,7 +829,7 @@ Standard_Integer thickshell(Draw_Interpretor& ,
|
|||||||
Tol = Draw::Atof(a[5]);
|
Tol = Draw::Atof(a[5]);
|
||||||
|
|
||||||
BRepOffset_MakeOffset B;
|
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_False, Standard_True);
|
||||||
|
|
||||||
// Clock.Start();
|
// Clock.Start();
|
||||||
|
|
||||||
@@ -849,7 +849,7 @@ Standard_Integer thickshell(Draw_Interpretor& ,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Integer offsetshape(Draw_Interpretor& ,
|
Standard_Integer offsetshape(Draw_Interpretor& ,
|
||||||
Standard_Integer n, const char** a)
|
Standard_Integer n, const char** a)
|
||||||
{
|
{
|
||||||
|
|
||||||
//OSD_Chronometer Clock;
|
//OSD_Chronometer Clock;
|
||||||
@@ -907,63 +907,73 @@ static Standard_Boolean theYaBouchon;
|
|||||||
static Standard_Real TheTolerance = Precision::Confusion();
|
static Standard_Real TheTolerance = Precision::Confusion();
|
||||||
static Standard_Boolean TheInter = Standard_False;
|
static Standard_Boolean TheInter = Standard_False;
|
||||||
static GeomAbs_JoinType TheJoin = GeomAbs_Arc;
|
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 offsetparameter(Draw_Interpretor& di,
|
||||||
Standard_Integer n, const char** a)
|
Standard_Integer n, const char** a)
|
||||||
{
|
{
|
||||||
if ( n == 1 ) {
|
if ( n == 1 ) {
|
||||||
//cout << " OffsetParameter Tol Inter(c/p) JoinType(a/i)" << endl;
|
di << " OffsetParameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k) RemoveInvalidFaces(r/k)]" << "\n";
|
||||||
//cout << " Current Values" << endl;
|
|
||||||
//cout << " --> Tolerance :" << TheTolerance << endl;
|
|
||||||
//cout << " --> TheInter :";
|
|
||||||
di << " OffsetParameter Tol Inter(c/p) JoinType(a/i)" << "\n";
|
|
||||||
di << " Current Values" << "\n";
|
di << " Current Values" << "\n";
|
||||||
di << " --> Tolerance :" << TheTolerance << "\n";
|
di << " --> Tolerance : " << TheTolerance << "\n";
|
||||||
di << " --> TheInter :";
|
di << " --> TheInter : ";
|
||||||
if ( TheInter) {
|
if ( TheInter) {
|
||||||
//cout << "Complet" ;
|
|
||||||
di << "Complet" ;
|
di << "Complet" ;
|
||||||
} else {
|
} else {
|
||||||
//cout << "Partial";
|
|
||||||
di << "Partial";
|
di << "Partial";
|
||||||
}
|
}
|
||||||
//cout << endl << " --> TheJoin :";
|
di << "\n" << " --> TheJoin : ";
|
||||||
di << "\n" << " --> TheJoin :";
|
|
||||||
|
|
||||||
switch (TheJoin) {
|
switch (TheJoin) {
|
||||||
//case GeomAbs_Arc: cout << " Arc"; break;
|
case GeomAbs_Arc: di << "Arc"; break;
|
||||||
//case GeomAbs_Intersection: cout << " Intersection"; break;
|
case GeomAbs_Intersection: di << "Intersection"; break;
|
||||||
case GeomAbs_Arc: di << " Arc"; break;
|
|
||||||
case GeomAbs_Intersection: di << " Intersection"; break;
|
|
||||||
default:
|
default:
|
||||||
break ;
|
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";
|
di << "\n";
|
||||||
|
//
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( n < 4 ) return 1;
|
if ( n < 4 ) return 1;
|
||||||
|
//
|
||||||
TheTolerance = Draw::Atof(a[1]);
|
TheTolerance = Draw::Atof(a[1]);
|
||||||
TheInter = strcmp(a[2],"p");
|
TheInter = strcmp(a[2],"p");
|
||||||
|
//
|
||||||
if ( !strcmp(a[3],"a")) TheJoin = GeomAbs_Arc;
|
if ( !strcmp(a[3],"a")) TheJoin = GeomAbs_Arc;
|
||||||
else if ( !strcmp(a[3],"i")) TheJoin = GeomAbs_Intersection;
|
else if ( !strcmp(a[3],"i")) TheJoin = GeomAbs_Intersection;
|
||||||
else if ( !strcmp(a[3],"t")) TheJoin = GeomAbs_Tangent;
|
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
|
//function : offsetinit
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Integer offsetload(Draw_Interpretor& ,
|
Standard_Integer offsetload(Draw_Interpretor& ,
|
||||||
Standard_Integer n, const char** a)
|
Standard_Integer n, const char** a)
|
||||||
{
|
{
|
||||||
if ( n < 2) return 1;
|
if ( n < 2) return 1;
|
||||||
TopoDS_Shape S = DBRep::Get(a[1]);
|
TopoDS_Shape S = DBRep::Get(a[1]);
|
||||||
@@ -973,7 +983,8 @@ Standard_Integer offsetload(Draw_Interpretor& ,
|
|||||||
TheRadius = Of;
|
TheRadius = Of;
|
||||||
// Standard_Boolean Inter = Standard_True;
|
// 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,
|
||||||
|
RemoveIntEdges,Standard_False,RemoveInvalidFaces);
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
// recuperation et chargement des bouchons.
|
// recuperation et chargement des bouchons.
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
@@ -1076,7 +1087,7 @@ Standard_Integer offsetperform(Draw_Interpretor& theCommands,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
static Standard_Integer Debou(Draw_Interpretor& theCommands,
|
static Standard_Integer Debou(Draw_Interpretor& theCommands,
|
||||||
Standard_Integer narg, const char** a)
|
Standard_Integer narg, const char** a)
|
||||||
{
|
{
|
||||||
Standard_Integer i ;
|
Standard_Integer i ;
|
||||||
Standard_Integer newnarg ;
|
Standard_Integer newnarg ;
|
||||||
|
Reference in New Issue
Block a user