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

b311480e | 1 | -- Created on: 1996-02-13 |

2 | -- Created by: Yves FRICAUD | |

3 | -- Copyright (c) 1996-1999 Matra Datavision | |

4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS | |

5 | -- | |

6 | -- The content of this file is subject to the Open CASCADE Technology Public | |

7 | -- License Version 6.5 (the "License"). You may not use the content of this file | |

8 | -- except in compliance with the License. Please obtain a copy of the License | |

9 | -- at http://www.opencascade.org and read it completely before using this file. | |

10 | -- | |

11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its | |

12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. | |

13 | -- | |

14 | -- The Original Code and all software distributed under the License is | |

15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the | |

16 | -- Initial Developer hereby disclaims all such warranties, including without | |

17 | -- limitation, any warranties of merchantability, fitness for a particular | |

18 | -- purpose or non-infringement. Please see the License for the specific terms | |

19 | -- and conditions governing the rights and limitations under the License. | |

20 | ||

7fd59977 | 21 | |

22 | ||

23 | -- Modified by skv - Tue Mar 15 16:17:37 2005 | |

24 | -- Add methods for supporting history. | |

25 | ||

26 | class MakeOffsetShape from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI | |

27 | ||

28 | ---Purpose: Describes functions to build a shell out of a shape. The | |

29 | -- result is an unlooped shape parallel to the source shape. | |

30 | -- A MakeOffsetShape object provides a framework for: | |

31 | -- - defining the construction of a shell | |

32 | -- - implementing the construction algorithm | |

33 | -- - consulting the result. | |

34 | ||

35 | uses | |

36 | MakeOffset from BRepOffset, | |

37 | Mode from BRepOffset, | |

38 | Shape from TopoDS, | |

39 | Face from TopoDS, | |

40 | Edge from TopoDS, | |

41 | Vertex from TopoDS, | |

42 | ListOfShape from TopTools, | |

43 | JoinType from GeomAbs | |

44 | ||

45 | is | |

46 | ||

47 | Create returns MakeOffsetShape from BRepOffsetAPI; | |

48 | ||

49 | Create ( S : Shape from TopoDS; | |

50 | Offset : Real from Standard; | |

51 | Tol : Real from Standard; | |

52 | Mode : Mode from BRepOffset = BRepOffset_Skin; | |

53 | Intersection : Boolean from Standard = Standard_False; | |

54 | SelfInter : Boolean from Standard = Standard_False; | |

55 | Join : JoinType from GeomAbs = GeomAbs_Arc) | |

56 | ---Purpose: Constructs a shape parallel to the shape S, where | |

57 | -- - S may be a face, a shell, a solid or a compound of these shape kinds; | |

58 | -- - Offset is the offset value. The offset shape is constructed: | |

59 | -- - outside S, if Offset is positive, | |

60 | -- - inside S, if Offset is negative; | |

61 | -- - Tol defines the coincidence tolerance criterion for generated shapes; | |

62 | -- - Mode defines the construction type of parallels | |

63 | -- applied to the free edges of shape S; currently, only one | |

64 | -- construction type is implemented, namely the one where the free | |

65 | -- edges do not generate parallels; this corresponds to the default | |

66 | -- value BRepOffset_Skin; | |

67 | -- - Intersection specifies how the algorithm must work in | |

68 | -- order to limit the parallels to two adjacent shapes: | |

69 | -- - if Intersection is false (default value), the intersection | |

70 | -- is calculated with the parallels to the two adjacent shapes, | |

71 | -- - if Intersection is true, the intersection is calculated by | |

72 | -- taking all generated parallels into account; this computation method is | |

73 | -- more general as it avoids some self-intersections generated in the | |

74 | -- offset shape from features of small dimensions on shape S, however this | |

75 | -- method has not been completely implemented and therefore is not | |

76 | -- recommended for use; | |

77 | -- - SelfInter tells the algorithm whether a computation | |

78 | -- to eliminate self-intersections must be applied to the resulting | |

79 | -- shape; however, as this functionality is not yet | |

80 | -- implemented, it is recommended to use the default value (false); | |

81 | -- - Join defines how to fill the holes that may appear between | |

82 | -- parallels to the two adjacent faces. It may take values | |

83 | -- GeomAbs_Arc or GeomAbs_Intersection: | |

84 | -- - if Join is equal to GeomAbs_Arc, then pipes are generated | |

85 | -- between two free edges of two adjacent parallels, | |

86 | -- and spheres are generated on "images" of vertices; | |

87 | -- it is the default value, | |

88 | -- - if Join is equal to GeomAbs_Intersection, then the parallels to the | |

89 | -- two adjacent faces are enlarged and intersected, | |

90 | -- so that there are no free edges on parallels to faces. | |

91 | -- Warnings | |

92 | -- 1. All the faces of the shape S should be based on the surfaces | |

93 | -- with continuity at least C1. | |

94 | -- 2. The offset value should be sufficiently small to avoid | |

95 | -- self-intersections in resulting shape. Otherwise these | |

96 | -- self-intersections may appear inside an offset face if its | |

97 | -- initial surface is not plane or sphere or cylinder, also some | |

98 | -- non-adjacent offset faces may intersect each other. Also, some | |

99 | -- offset surfaces may "turn inside out". | |

100 | -- 3. The algorithm may fail if the shape S contains vertices where | |

101 | -- more than 3 edges converge. | |

102 | -- 4. Since 3d-offset algorithm involves intersection of surfaces, | |

103 | -- it is under limitations of surface intersection algorithm. | |

104 | -- 5. A result cannot be generated if the underlying geometry of S is | |

105 | -- BSpline with continuity C0. | |

106 | -- Exceptions | |

107 | -- Geom_UndefinedDerivative if the underlying | |

108 | -- geometry of S is BSpline with continuity C0. | |

109 | returns MakeOffsetShape from BRepOffsetAPI; | |

110 | ||

111 | MakeOffset (me) returns MakeOffset from BRepOffset | |

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

113 | ---Level: Advanced | |

114 | is virtual; | |

115 | ||

116 | Build (me : in out) | |

117 | ---Purpose: Builds the resulting shape (redefined from MakeShape). | |

118 | ---Level: Public | |

119 | is redefined; | |

120 | ||

121 | ||

122 | Generated (me: in out; S : Shape from TopoDS) | |

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

124 | -- shape <S>. | |

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

126 | ---Level: Public | |

127 | returns ListOfShape from TopTools | |

128 | is redefined virtual; | |

129 | ||

130 | ||

131 | -- Modified by skv - Tue Mar 15 16:17:37 2005 Begin | |

132 | -- Add methods for supporting history. | |

133 | ||

134 | GeneratedEdge (me: in out; S : Shape from TopoDS) | |

135 | ---Purpose: Returns the list of edges generated from the shape <S>. | |

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

137 | ---Level: Public | |

138 | returns ListOfShape from TopTools; | |

139 | ||

140 | ||

141 | -- Query offset join type. | |

142 | ||

143 | GetJoinType(me) | |

144 | ---Purpose: Returns offset join type. | |

145 | returns JoinType from GeomAbs | |

146 | is static; | |

147 | ||

148 | ||

149 | -- Modified by skv - Tue Mar 15 16:17:37 2005 End | |

150 | ||

151 | fields | |

152 | ||

153 | myOffsetShape : MakeOffset from BRepOffset is protected; | |

154 | ||

155 | end MakeOffsetShape; |