Commit | Line | Data |
---|---|---|

7fd59977 | 1 | -- File: BRepFill_Filling.cdl |

2 | -- Created: Wed Aug 26 11:47:28 1998 | |

3 | -- Author: Julia GERASIMOVA | |

4 | -- <jgv@clubox.nnov.matra-dtv.fr> | |

5 | ---Copyright: Matra Datavision 1998 | |

6 | ||

7 | ||

8 | class Filling from BRepFill | |

9 | ||

10 | ---Purpose: N-Side Filling | |

11 | -- This algorithm avoids to build a face from: | |

12 | -- * a set of edges defining the bounds of the face and some | |

13 | -- constraints the surface support has to satisfy | |

14 | -- * a set of edges and points defining some constraints | |

15 | -- the support surface has to satisfy | |

16 | -- * an initial surface to deform for satisfying the constraints | |

17 | -- * a set of parameters to control the constraints. | |

18 | -- | |

19 | -- The support surface of the face is computed by deformation | |

20 | -- of the initial surface in order to satisfy the given constraints. | |

21 | -- The set of bounding edges defines the wire of the face. | |

22 | -- | |

23 | -- If no initial surface is given, the algorithm computes it | |

24 | -- automatically. | |

25 | -- If the set of edges is not connected (Free constraint) | |

26 | -- missing edges are automatically computed. | |

27 | -- | |

28 | -- Limitations: | |

29 | -- * If some constraints are not compatible | |

30 | -- The algorithm does not take them into account. | |

31 | -- So the constraints will not be satisfyed in an area containing | |

32 | -- the incompatibilitries. | |

33 | -- * The constraints defining the bound of the face have to be | |

34 | -- entered in order to have a continuous wire. | |

35 | -- | |

36 | -- Other Applications: | |

37 | -- * Deformation of a face to satisfy internal constraints | |

38 | -- * Deformation of a face to improve Gi continuity with | |

39 | -- connected faces | |

40 | ||

41 | ---Level: Advanced | |

42 | ||

43 | uses | |

44 | Shape from TopoDS, | |

45 | Edge from TopoDS, | |

46 | Face from TopoDS, | |

47 | Pnt from gp, | |

48 | Shape from GeomAbs, | |

49 | BuildPlateSurface from GeomPlate, | |

50 | SequenceOfEdgeFaceAndOrder from BRepFill, | |

51 | SequenceOfFaceAndOrder from BRepFill, | |

52 | SequenceOfPointConstraint from GeomPlate, | |

01697018 J |
53 | SequenceOfShape from TopTools, |

54 | ListOfShape from TopTools, | |

55 | DataMapOfShapeListOfShape from TopTools, | |

7fd59977 | 56 | SequenceOfPnt from TColgp |

57 | ||

58 | raises | |

59 | NotDone, | |

60 | OutOfRange, | |

61 | ConstructionError | |

62 | ||

63 | is | |

64 | Create( Degree : Integer from Standard = 3; | |

65 | NbPtsOnCur : Integer from Standard = 15; | |

66 | NbIter : Integer from Standard = 2; | |

67 | Anisotropie : Boolean from Standard = Standard_False; | |

68 | Tol2d : Real from Standard = 0.00001; | |

69 | Tol3d : Real from Standard = 0.0001; | |

70 | TolAng : Real from Standard = 0.01; | |

71 | TolCurv : Real from Standard = 0.1; | |

72 | MaxDeg : Integer from Standard = 8; | |

73 | MaxSegments : Integer from Standard = 9 ) | |

74 | ---Purpose: Constructor | |

75 | -- | |

76 | returns Filling from BRepFill; | |

77 | ||

78 | ||

79 | SetConstrParam( me : in out; Tol2d : Real from Standard = 0.00001; | |

80 | Tol3d : Real from Standard = 0.0001; | |

81 | TolAng : Real from Standard = 0.01; | |

82 | TolCurv : Real from Standard = 0.1 ); | |

83 | ---Purpose: Sets the values of Tolerances used to control the constraint. | |

84 | -- Tol2d: | |

85 | -- Tol3d: it is the maximum distance allowed between the support surface | |

86 | -- and the constraints | |

87 | -- TolAng: it is the maximum angle allowed between the normal of the surface | |

88 | -- and the constraints | |

89 | -- TolCurv: it is the maximum difference of curvature allowed between | |

90 | -- the surface and the constraint | |

91 | ||

92 | SetResolParam( me : in out; Degree : Integer from Standard = 3; | |

93 | NbPtsOnCur : Integer from Standard = 15; | |

94 | NbIter : Integer from Standard = 2; | |

95 | Anisotropie : Boolean from Standard = Standard_False ); | |

96 | ---Purpose: Sets the parameters used for resolution. | |

97 | -- The default values of these parameters have been chosen for a good | |

98 | -- ratio quality/performance. | |

99 | -- Degree: it is the order of energy criterion to minimize for computing | |

100 | -- the deformation of the surface. | |

101 | -- The default value is 3 | |

102 | -- The recommanded value is i+2 where i is the maximum order of the | |

103 | -- constraints. | |

104 | -- NbPtsOnCur: it is the average number of points for discretisation | |

105 | -- of the edges. | |

106 | -- NbIter: it is the maximum number of iterations of the process. | |

107 | -- For each iteration the number of discretisation points is | |

108 | -- increased. | |

109 | -- Anisotropie: | |

110 | ||

111 | SetApproxParam( me : in out; MaxDeg : Integer from Standard = 8; | |

112 | MaxSegments : Integer from Standard = 9 ); | |

113 | ---Purpose: Sets the parameters used for approximation of the surface | |

114 | -- | |

115 | ||

116 | ||

117 | LoadInitSurface( me : in out; aFace : Face from TopoDS ); | |

118 | ---Purpose: Loads the initial Surface | |

119 | ||

120 | ||

121 | Add( me : in out; anEdge : Edge from TopoDS; | |

122 | Order : Shape from GeomAbs; | |

123 | IsBound : Boolean from Standard = Standard_True ) | |

124 | returns Integer from Standard | |

125 | ---Purpose: Adds a new constraint which also defines an edge of the wire | |

126 | -- of the face | |

127 | -- Order: Order of the constraint: | |

128 | -- GeomAbs_C0 : the surface has to pass by 3D representation | |

129 | -- of the edge | |

130 | -- GeomAbs_G1 : the surface has to pass by 3D representation | |

131 | -- of the edge and to respect tangency with the first | |

132 | -- face of the edge | |

133 | -- GeomAbs_G2 : the surface has to pass by 3D representation | |

134 | -- of the edge and to respect tangency and curvature | |

135 | -- with the first face of the edge. | |

136 | raises ConstructionError from Standard; | |

137 | -- if the edge has no representation on a face and Order is | |

138 | -- GeomAbs_G1 or GeomAbs_G2. | |

139 | ||

140 | Add( me : in out; anEdge : Edge from TopoDS; | |

141 | Support : Face from TopoDS; | |

142 | Order : Shape from GeomAbs; | |

143 | IsBound : Boolean from Standard = Standard_True ) | |

144 | returns Integer from Standard | |

145 | ---Purpose: Adds a new constraint which also defines an edge of the wire | |

146 | -- of the face | |

147 | -- Order: Order of the constraint: | |

148 | -- GeomAbs_C0 : the surface has to pass by 3D representation | |

149 | -- of the edge | |

150 | -- GeomAbs_G1 : the surface has to pass by 3D representation | |

151 | -- of the edge and to respect tangency with the | |

152 | -- given face | |

153 | -- GeomAbs_G2 : the surface has to pass by 3D representation | |

154 | -- of the edge and to respect tangency and curvature | |

155 | -- with the given face. | |

156 | raises ConstructionError from Standard; | |

157 | -- if the edge has no 2d representation on the given face | |

158 | ||

159 | Add( me : in out; Support : Face from TopoDS; | |

160 | Order : Shape from GeomAbs ) | |

161 | returns Integer from Standard; | |

162 | ---Purpose: Adds a free constraint on a face. The corresponding edge has to | |

163 | -- be automatically recomputed. | |

164 | -- It is always a bound. | |

165 | ||

166 | Add( me : in out; Point : Pnt from gp ) | |

167 | returns Integer from Standard; | |

168 | ---Purpose: Adds a punctual constraint | |

169 | ||

170 | Add( me : in out; U, V : Real from Standard; | |

171 | Support : Face from TopoDS; | |

172 | Order : Shape from GeomAbs ) | |

173 | returns Integer from Standard; | |

174 | ---Purpose: Adds a punctual constraint. | |

175 | ||

176 | ||

177 | AddConstraints( me : in out; SeqOfConstraints : SequenceOfEdgeFaceAndOrder from BRepFill ) | |

178 | ---Purpose: Adds constraints to builder | |

179 | is private; | |

180 | ||

01697018 J |
181 | BuildWires( me : in out; EdgeList : in out ListOfShape from TopTools; |

182 | WireList : out ListOfShape from TopTools ) | |

7fd59977 | 183 | ---Purpose: Builds wires of maximum length |

184 | is private; | |

185 | ||

01697018 J |
186 | FindExtremitiesOfHoles( me; WireList : ListOfShape from TopTools; |

187 | VerSeq : out SequenceOfShape from TopTools ) | |

7fd59977 | 188 | ---Purpose: Finds extremities of future edges to fix the holes between wires. |

189 | -- Can properly operate only with convex contour | |

190 | is private; | |

191 | ||

192 | Build( me : in out ); | |

193 | ---Purpose: Builds the resulting faces | |

194 | ||

195 | IsDone(me) returns Boolean from Standard; | |

196 | ||

197 | Face(me) returns Face from TopoDS; | |

198 | -- returns the resulting face | |

199 | ||

01697018 J |
200 | Generated (me: in out; S : Shape from TopoDS) |

201 | ---Purpose: Returns the list of shapes generated from the | |

202 | -- shape <S>. | |

203 | ---C++: return const & | |

204 | ---Level: Public | |

205 | returns ListOfShape from TopTools; | |

7fd59977 | 206 | |

207 | G0Error(me) returns Real from Standard; | |

208 | -- returns the max distance between the result and the constraints | |

209 | ||

210 | G1Error(me) returns Real from Standard; | |

211 | -- returns the max angle between the result and the constraints | |

212 | ||

213 | G2Error(me) returns Real from Standard; | |

214 | -- returns the max difference of curvature between the result and the constraints | |

215 | ||

216 | ||

217 | G0Error( me : in out; Index : Integer from Standard ) returns Real from Standard; | |

218 | -- returns the max distance between the result and the constraint Index | |

219 | ||

220 | G1Error( me : in out; Index : Integer from Standard ) returns Real from Standard; | |

221 | -- returns the max angle between the result and the constraint Index | |

222 | ||

223 | G2Error( me : in out; Index : Integer from Standard ) returns Real from Standard; | |

224 | -- returns the max difference of curvature between the result and the constraint Index | |

225 | ||

226 | fields | |

227 | ||

228 | myBuilder : BuildPlateSurface from GeomPlate; | |

229 | myBoundary : SequenceOfEdgeFaceAndOrder from BRepFill; | |

230 | myConstraints : SequenceOfEdgeFaceAndOrder from BRepFill; | |

231 | myFreeConstraints : SequenceOfFaceAndOrder from BRepFill; | |

232 | myPoints : SequenceOfPointConstraint from GeomPlate; | |

233 | ||

01697018 J |
234 | myOldNewMap : DataMapOfShapeListOfShape from TopTools; |

235 | myGenerated : ListOfShape from TopTools; | |

236 | ||

7fd59977 | 237 | myFace : Face from TopoDS; |

238 | ||

239 | myInitFace : Face from TopoDS; | |

240 | ||

241 | -- Tolerances | |

242 | myTol2d : Real from Standard; | |

243 | myTol3d : Real from Standard; | |

244 | myTolAng : Real from Standard; | |

245 | myTolCurv : Real from Standard; | |

246 | ||

247 | -- Parameters of approximation | |

248 | myMaxDeg : Integer from Standard; | |

249 | myMaxSegments : Integer from Standard; | |

250 | ||

251 | -- Parameters of resolution | |

252 | myDegree : Integer from Standard; | |

253 | myNbPtsOnCur : Integer from Standard; | |

254 | myNbIter : Integer from Standard; | |

255 | myAnisotropie : Boolean from Standard; | |

256 | ||

257 | myIsInitFaceGiven : Boolean from Standard; | |

258 | ||

259 | myIsDone : Boolean from Standard; | |

260 | ||

261 | end Filling; |