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

b311480e | 1 | -- Created on: 1998-08-26 |

2 | -- Created by: Julia GERASIMOVA | |

3 | -- Copyright (c) 1998-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 | -- |

973c2be1 | 8 | -- This library is free software; you can redistribute it and / or modify it |

9 | -- under the terms of the GNU Lesser General Public version 2.1 as published | |

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 | |

17 | class Filling from BRepFill | |

18 | ||

19 | ---Purpose: N-Side Filling | |

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

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

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

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

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

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

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

27 | -- | |

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

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

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

31 | -- | |

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

33 | -- automatically. | |

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

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

36 | -- | |

37 | -- Limitations: | |

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

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

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

41 | -- the incompatibilitries. | |

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

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

44 | -- | |

45 | -- Other Applications: | |

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

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

48 | -- connected faces | |

49 | ||

50 | ---Level: Advanced | |

51 | ||

52 | uses | |

53 | Shape from TopoDS, | |

54 | Edge from TopoDS, | |

55 | Face from TopoDS, | |

56 | Pnt from gp, | |

57 | Shape from GeomAbs, | |

58 | BuildPlateSurface from GeomPlate, | |

59 | SequenceOfEdgeFaceAndOrder from BRepFill, | |

60 | SequenceOfFaceAndOrder from BRepFill, | |

61 | SequenceOfPointConstraint from GeomPlate, | |

01697018 J |
62 | SequenceOfShape from TopTools, |

63 | ListOfShape from TopTools, | |

64 | DataMapOfShapeListOfShape from TopTools, | |

7fd59977 | 65 | SequenceOfPnt from TColgp |

66 | ||

67 | raises | |

68 | NotDone, | |

69 | OutOfRange, | |

70 | ConstructionError | |

71 | ||

72 | is | |

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

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

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

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

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

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

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

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

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

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

83 | ---Purpose: Constructor | |

84 | -- | |

85 | returns Filling from BRepFill; | |

86 | ||

87 | ||

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

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

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

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

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

93 | -- Tol2d: | |

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

95 | -- and the constraints | |

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

97 | -- and the constraints | |

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

99 | -- the surface and the constraint | |

100 | ||

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

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

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

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

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

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

107 | -- ratio quality/performance. | |

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

109 | -- the deformation of the surface. | |

110 | -- The default value is 3 | |

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

112 | -- constraints. | |

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

114 | -- of the edges. | |

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

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

117 | -- increased. | |

118 | -- Anisotropie: | |

119 | ||

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

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

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

123 | -- | |

124 | ||

125 | ||

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

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

128 | ||

129 | ||

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

131 | Order : Shape from GeomAbs; | |

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

133 | returns Integer from Standard | |

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

135 | -- of the face | |

136 | -- Order: Order of the constraint: | |

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

138 | -- of the edge | |

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

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

141 | -- face of the edge | |

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

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

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

145 | raises ConstructionError from Standard; | |

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

147 | -- GeomAbs_G1 or GeomAbs_G2. | |

148 | ||

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

150 | Support : Face from TopoDS; | |

151 | Order : Shape from GeomAbs; | |

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

153 | returns Integer from Standard | |

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

155 | -- of the face | |

156 | -- Order: Order of the constraint: | |

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

158 | -- of the edge | |

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

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

161 | -- given face | |

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

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

164 | -- with the given face. | |

165 | raises ConstructionError from Standard; | |

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

167 | ||

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

169 | Order : Shape from GeomAbs ) | |

170 | returns Integer from Standard; | |

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

172 | -- be automatically recomputed. | |

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

174 | ||

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

176 | returns Integer from Standard; | |

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

178 | ||

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

180 | Support : Face from TopoDS; | |

181 | Order : Shape from GeomAbs ) | |

182 | returns Integer from Standard; | |

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

184 | ||

185 | ||

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

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

188 | is private; | |

189 | ||

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

191 | WireList : out ListOfShape from TopTools ) | |

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

193 | is private; | |

194 | ||

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

196 | VerSeq : out SequenceOfShape from TopTools ) | |

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

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

199 | is private; | |

200 | ||

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

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

203 | ||

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

205 | ||

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

207 | -- returns the resulting face | |

208 | ||

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

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

211 | -- shape <S>. | |

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

213 | ---Level: Public | |

214 | returns ListOfShape from TopTools; | |

7fd59977 | 215 | |

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

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

218 | ||

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

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

221 | ||

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

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

224 | ||

225 | ||

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

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

228 | ||

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

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

231 | ||

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

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

234 | ||

235 | fields | |

236 | ||

237 | myBuilder : BuildPlateSurface from GeomPlate; | |

238 | myBoundary : SequenceOfEdgeFaceAndOrder from BRepFill; | |

239 | myConstraints : SequenceOfEdgeFaceAndOrder from BRepFill; | |

240 | myFreeConstraints : SequenceOfFaceAndOrder from BRepFill; | |

241 | myPoints : SequenceOfPointConstraint from GeomPlate; | |

242 | ||

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

244 | myGenerated : ListOfShape from TopTools; | |

245 | ||

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

247 | ||

248 | myInitFace : Face from TopoDS; | |

249 | ||

250 | -- Tolerances | |

251 | myTol2d : Real from Standard; | |

252 | myTol3d : Real from Standard; | |

253 | myTolAng : Real from Standard; | |

254 | myTolCurv : Real from Standard; | |

255 | ||

256 | -- Parameters of approximation | |

257 | myMaxDeg : Integer from Standard; | |

258 | myMaxSegments : Integer from Standard; | |

259 | ||

260 | -- Parameters of resolution | |

261 | myDegree : Integer from Standard; | |

262 | myNbPtsOnCur : Integer from Standard; | |

263 | myNbIter : Integer from Standard; | |

264 | myAnisotropie : Boolean from Standard; | |

265 | ||

266 | myIsInitFaceGiven : Boolean from Standard; | |

267 | ||

268 | myIsDone : Boolean from Standard; | |

269 | ||

270 | end Filling; |