7fd59977 |
1 | -- File: BRepFill_Sweep.cdl |
2 | -- Created: Fri Nov 21 14:07:48 1997 |
3 | -- Author: Philippe MANGIN |
4 | -- <pmn@sgi29> |
5 | ---Copyright: Matra Datavision 1997 |
6 | |
7 | |
8 | class Sweep from BRepFill |
9 | |
10 | ---Purpose: Topological Sweep Algorithm |
11 | ---Level: Advanced |
12 | |
13 | uses |
14 | SectionLaw from BRepFill, |
15 | LocationLaw from BRepFill, |
16 | ApproxStyle from GeomFill, |
17 | TransitionStyle from BRepFill, |
18 | HCurve from Adaptor3d, |
19 | Shape from GeomAbs, |
20 | HArray2OfShape from TopTools, |
21 | ListOfShape from TopTools, |
22 | DataMapOfShapeShape from TopTools, |
23 | Wire from TopoDS, |
24 | Shape from TopoDS, |
25 | Trsf from gp |
26 | |
27 | raises |
28 | NotDone, |
29 | OutOfRange, |
30 | ConstructionError |
31 | is |
32 | Create(Section : SectionLaw from BRepFill; |
33 | Location : LocationLaw from BRepFill; |
34 | WithKPart: Boolean) |
35 | returns Sweep from BRepFill; |
36 | |
37 | SetBounds(me : in out; |
38 | FirstShape, LastShape : Wire from TopoDS); |
39 | |
40 | SetTolerance(me : in out; |
41 | Tol3d : Real; |
42 | BoundTol : Real = 1.0; |
43 | Tol2d : Real = 1.0e-5; |
44 | TolAngular : Real = 1.0e-2); |
45 | ---Purpose: Set Approximation Tolerance |
46 | -- Tol3d : Tolerance to surface approximation |
47 | -- Tol2d : Tolerance used to perform curve approximation |
48 | -- Normaly the 2d curve are approximated with a |
49 | -- tolerance given by the resolution on support surfaces, |
50 | -- but if this tolerance is too large Tol2d is used. |
51 | -- TolAngular : Tolerance (in radian) to control the angle |
52 | -- beetween tangents on the section law and |
53 | -- tangent of iso-v on approximed surface |
54 | |
55 | SetAngularControl(me: in out; |
56 | AngleMin : Real = 0.01; |
57 | AngleMax : Real = 6.0) |
58 | ---Purpose: Tolerance To controle Corner management. |
59 | -- |
60 | -- If the discontinuity is lesser than <AngleMin> in radian The |
61 | -- Transition Performed will be alway "Modified" |
62 | -- |
63 | |
64 | -- If the discontinuity is greater than <AngleMax> in radian The |
65 | -- Transition "Round" replace the Transition "Right" |
66 | is static; |
67 | |
68 | Build(me : in out; |
69 | Transition : TransitionStyle = BRepFill_Modified; |
70 | Approx : ApproxStyle = GeomFill_Location; |
71 | Continuity : Shape from GeomAbs = GeomAbs_C2; |
72 | Degmax : Integer = 11; |
73 | Segmax : Integer = 30); |
74 | |
75 | ---Purpose: Build the Sweeep Surface |
76 | -- Transition define Transition strategy |
77 | -- Approx define Approximation Strategy |
78 | -- - GeomFill_Section : The composed Function Location X Section |
79 | -- is directly approximed. |
80 | -- - GeomFill_Location : The location law is approximed, and the |
81 | -- SweepSurface is bulid algebric composition |
82 | -- of approximed location law and section law |
83 | -- This option is Ok, if Section.Surface() methode |
84 | -- is effective. |
85 | -- Continuity : The continuity in v waiting on the surface |
86 | -- Degmax : The maximum degree in v requiered on the surface |
87 | -- Segmax : The maximum number of span in v requiered on |
88 | -- the surface. |
89 | |
90 | CorrectApproxParameters(me: in out) |
91 | returns Boolean is private; |
92 | |
93 | BuildWire(me : in out; |
94 | Transition : TransitionStyle) |
95 | returns Boolean is private; |
96 | |
97 | BuildShell(me : in out; |
98 | Transition : TransitionStyle; |
99 | Vf, Vl : Integer; |
100 | ExtendFirst : Real = 0.0; |
101 | ExtendLast : Real = 0.0) |
102 | returns Boolean is private; |
103 | |
104 | IsDone(me) |
105 | ---Purpose: Say if the Shape is Build. |
106 | returns Boolean; |
107 | |
108 | Shape(me) |
109 | ---Purpose: returns the Sweeping Shape |
110 | returns Shape from TopoDS; |
111 | |
112 | ErrorOnSurface(me) |
113 | ---Purpose: Get the Approximation error. |
114 | returns Real; |
115 | |
116 | SubShape(me) |
117 | returns HArray2OfShape from TopTools; |
118 | |
119 | InterFaces(me) |
120 | returns HArray2OfShape from TopTools; |
121 | |
122 | Sections(me) |
123 | returns HArray2OfShape from TopTools; |
124 | |
125 | PerformCorner(me : in out; Index : Integer; |
126 | Transition : TransitionStyle; |
127 | Bounds : HArray2OfShape from TopTools) |
128 | is private; |
129 | |
130 | EvalExtrapol(me; Index : Integer; |
131 | Transition : TransitionStyle) |
132 | returns Real |
133 | is private; |
134 | |
135 | MergeVertex(me; |
136 | V1 : Shape from TopoDS; |
137 | V2 : in out Shape from TopoDS) |
138 | returns Boolean is private; |
139 | |
140 | UpdateVertex(me; Ipath, Isec : Integer; |
141 | Error, Param : Real; |
142 | V : in out Shape from TopoDS) |
143 | is private; |
144 | |
145 | fields |
146 | isDone : Boolean; |
147 | KPart : Boolean; |
148 | myTol3d : Real; |
149 | myBoundTol : Real; |
150 | myTol2d : Real; |
151 | myTolAngular : Real; |
152 | myAngMin : Real; |
153 | myAngMax : Real; |
154 | myApproxStyle : ApproxStyle from GeomFill; |
155 | myContinuity : Shape from GeomAbs; |
156 | myDegmax : Integer; |
157 | mySegmax : Integer; |
158 | myShape : Shape from TopoDS; |
159 | myLoc : LocationLaw from BRepFill; |
160 | mySec : SectionLaw from BRepFill; |
161 | myUEdges : HArray2OfShape from TopTools; |
162 | myVEdges : HArray2OfShape from TopTools; |
163 | myVEdgesModified : DataMapOfShapeShape from TopTools; |
164 | myFaces : HArray2OfShape from TopTools; |
165 | myAuxShape : ListOfShape from TopTools; |
166 | |
167 | Error : Real; |
168 | FirstShape, |
169 | LastShape : Wire from TopoDS; |
170 | end Sweep; |