b311480e |
1 | -- Created on: 1997-11-21 |
2 | -- Created by: Philippe MANGIN |
3 | -- Copyright (c) 1997-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
8 | -- This library is free software; you can redistribute it and/or modify it under |
9 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | -- by the Free Software Foundation, with special exception defined in the file |
11 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | -- distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
c8ea5b8e |
17 | |
7fd59977 |
18 | class Sweep from BRepFill |
19 | |
20 | ---Purpose: Topological Sweep Algorithm |
ff8178ef |
21 | -- Computes an Sweep shell using a generating |
22 | -- wire, an SectionLaw and an LocationLaw. |
7fd59977 |
23 | ---Level: Advanced |
24 | |
25 | uses |
26 | SectionLaw from BRepFill, |
27 | LocationLaw from BRepFill, |
28 | ApproxStyle from GeomFill, |
29 | TransitionStyle from BRepFill, |
30 | HCurve from Adaptor3d, |
31 | Shape from GeomAbs, |
32 | HArray2OfShape from TopTools, |
33 | ListOfShape from TopTools, |
c8ea5b8e |
34 | DataMapOfShapeShape from TopTools, |
35 | MapOfShape from TopTools, |
36 | DataMapOfShapeHArray2OfShape from BRepFill, |
7fd59977 |
37 | Wire from TopoDS, |
c8ea5b8e |
38 | Edge from TopoDS, |
7fd59977 |
39 | Shape from TopoDS, |
40 | Trsf from gp |
41 | |
42 | raises |
43 | NotDone, |
44 | OutOfRange, |
45 | ConstructionError |
46 | is |
47 | Create(Section : SectionLaw from BRepFill; |
48 | Location : LocationLaw from BRepFill; |
49 | WithKPart: Boolean) |
50 | returns Sweep from BRepFill; |
51 | |
52 | SetBounds(me : in out; |
53 | FirstShape, LastShape : Wire from TopoDS); |
54 | |
55 | SetTolerance(me : in out; |
56 | Tol3d : Real; |
57 | BoundTol : Real = 1.0; |
58 | Tol2d : Real = 1.0e-5; |
59 | TolAngular : Real = 1.0e-2); |
60 | ---Purpose: Set Approximation Tolerance |
61 | -- Tol3d : Tolerance to surface approximation |
62 | -- Tol2d : Tolerance used to perform curve approximation |
63 | -- Normaly the 2d curve are approximated with a |
64 | -- tolerance given by the resolution on support surfaces, |
65 | -- but if this tolerance is too large Tol2d is used. |
66 | -- TolAngular : Tolerance (in radian) to control the angle |
67 | -- beetween tangents on the section law and |
68 | -- tangent of iso-v on approximed surface |
69 | |
70 | SetAngularControl(me: in out; |
71 | AngleMin : Real = 0.01; |
72 | AngleMax : Real = 6.0) |
73 | ---Purpose: Tolerance To controle Corner management. |
74 | -- |
75 | -- If the discontinuity is lesser than <AngleMin> in radian The |
76 | -- Transition Performed will be alway "Modified" |
77 | -- |
78 | |
79 | -- If the discontinuity is greater than <AngleMax> in radian The |
80 | -- Transition "Round" replace the Transition "Right" |
81 | is static; |
82 | |
a31abc03 |
83 | SetForceApproxC1(me: in out; |
84 | ForceApproxC1 : Boolean from Standard); |
85 | ---Purpose: Set the flag that indicates attempt to approximate |
86 | -- a C1-continuous surface if a swept surface proved |
87 | -- to be C0. |
88 | |
89 | |
c8ea5b8e |
90 | Build(me : in out; |
91 | ReversedEdges : in out MapOfShape from TopTools; |
92 | Tapes : in out DataMapOfShapeHArray2OfShape from BRepFill; |
8e817497 |
93 | Rails : in out DataMapOfShapeHArray2OfShape from BRepFill; |
7fd59977 |
94 | Transition : TransitionStyle = BRepFill_Modified; |
7fd59977 |
95 | Continuity : Shape from GeomAbs = GeomAbs_C2; |
a31abc03 |
96 | Approx : ApproxStyle = GeomFill_Location; |
7fd59977 |
97 | Degmax : Integer = 11; |
98 | Segmax : Integer = 30); |
99 | |
100 | ---Purpose: Build the Sweeep Surface |
101 | -- Transition define Transition strategy |
102 | -- Approx define Approximation Strategy |
103 | -- - GeomFill_Section : The composed Function Location X Section |
104 | -- is directly approximed. |
105 | -- - GeomFill_Location : The location law is approximed, and the |
106 | -- SweepSurface is bulid algebric composition |
107 | -- of approximed location law and section law |
108 | -- This option is Ok, if Section.Surface() methode |
109 | -- is effective. |
110 | -- Continuity : The continuity in v waiting on the surface |
111 | -- Degmax : The maximum degree in v requiered on the surface |
112 | -- Segmax : The maximum number of span in v requiered on |
113 | -- the surface. |
114 | |
115 | CorrectApproxParameters(me: in out) |
116 | returns Boolean is private; |
117 | |
118 | BuildWire(me : in out; |
119 | Transition : TransitionStyle) |
120 | returns Boolean is private; |
121 | |
122 | BuildShell(me : in out; |
123 | Transition : TransitionStyle; |
c8ea5b8e |
124 | Vf, Vl : Integer; |
125 | ReversedEdges : in out MapOfShape from TopTools; |
126 | Tapes : in out DataMapOfShapeHArray2OfShape from BRepFill; |
8e817497 |
127 | Rails : in out DataMapOfShapeHArray2OfShape from BRepFill; |
7fd59977 |
128 | ExtendFirst : Real = 0.0; |
129 | ExtendLast : Real = 0.0) |
130 | returns Boolean is private; |
131 | |
132 | IsDone(me) |
133 | ---Purpose: Say if the Shape is Build. |
134 | returns Boolean; |
135 | |
136 | Shape(me) |
137 | ---Purpose: returns the Sweeping Shape |
138 | returns Shape from TopoDS; |
139 | |
140 | ErrorOnSurface(me) |
141 | ---Purpose: Get the Approximation error. |
142 | returns Real; |
143 | |
144 | SubShape(me) |
145 | returns HArray2OfShape from TopTools; |
146 | |
147 | InterFaces(me) |
148 | returns HArray2OfShape from TopTools; |
149 | |
150 | Sections(me) |
151 | returns HArray2OfShape from TopTools; |
152 | |
153 | PerformCorner(me : in out; Index : Integer; |
154 | Transition : TransitionStyle; |
155 | Bounds : HArray2OfShape from TopTools) |
156 | is private; |
157 | |
158 | EvalExtrapol(me; Index : Integer; |
159 | Transition : TransitionStyle) |
160 | returns Real |
161 | is private; |
162 | |
163 | MergeVertex(me; |
164 | V1 : Shape from TopoDS; |
165 | V2 : in out Shape from TopoDS) |
166 | returns Boolean is private; |
167 | |
168 | UpdateVertex(me; Ipath, Isec : Integer; |
169 | Error, Param : Real; |
170 | V : in out Shape from TopoDS) |
171 | is private; |
172 | |
c8ea5b8e |
173 | RebuildTopOrBottomEdge(me; aNewEdge: Edge from TopoDS; |
174 | anEdge: in out Edge from TopoDS; |
175 | ReversedEdges: in out MapOfShape from TopTools) |
176 | is private; |
177 | |
7fd59977 |
178 | fields |
179 | isDone : Boolean; |
180 | KPart : Boolean; |
181 | myTol3d : Real; |
182 | myBoundTol : Real; |
183 | myTol2d : Real; |
184 | myTolAngular : Real; |
185 | myAngMin : Real; |
186 | myAngMax : Real; |
187 | myApproxStyle : ApproxStyle from GeomFill; |
188 | myContinuity : Shape from GeomAbs; |
189 | myDegmax : Integer; |
190 | mySegmax : Integer; |
a31abc03 |
191 | myForceApproxC1 : Boolean; |
7fd59977 |
192 | myShape : Shape from TopoDS; |
193 | myLoc : LocationLaw from BRepFill; |
194 | mySec : SectionLaw from BRepFill; |
195 | myUEdges : HArray2OfShape from TopTools; |
196 | myVEdges : HArray2OfShape from TopTools; |
197 | myVEdgesModified : DataMapOfShapeShape from TopTools; |
198 | myFaces : HArray2OfShape from TopTools; |
199 | myAuxShape : ListOfShape from TopTools; |
200 | |
201 | Error : Real; |
202 | FirstShape, |
203 | LastShape : Wire from TopoDS; |
204 | end Sweep; |