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

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

2 | -- Created by: Yves FRICAUD | |

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

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

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

19 | ||

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

21 | ||

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

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

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

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

26 | -- - implementing the construction algorithm | |

27 | -- - consulting the result. | |

28 | ||

29 | uses | |

30 | MakeOffset from BRepOffset, | |

31 | Mode from BRepOffset, | |

32 | Shape from TopoDS, | |

33 | Face from TopoDS, | |

34 | Edge from TopoDS, | |

35 | Vertex from TopoDS, | |

36 | ListOfShape from TopTools, | |

37 | JoinType from GeomAbs | |

38 | ||

39 | is | |

40 | ||

41 | Create returns MakeOffsetShape from BRepOffsetAPI; | |

42 | ||

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

44 | Offset : Real from Standard; | |

45 | Tol : Real from Standard; | |

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

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

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

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

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

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

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

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

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

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

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

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

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

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

60 | -- value BRepOffset_Skin; | |

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

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

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

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

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

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

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

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

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

70 | -- recommended for use; | |

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

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

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

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

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

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

77 | -- GeomAbs_Arc or GeomAbs_Intersection: | |

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

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

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

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

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

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

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

85 | -- Warnings | |

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

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

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

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

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

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

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

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

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

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

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

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

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

99 | -- BSpline with continuity C0. | |

100 | -- Exceptions | |

101 | -- Geom_UndefinedDerivative if the underlying | |

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

103 | returns MakeOffsetShape from BRepOffsetAPI; | |

104 | ||

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

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

107 | ---Level: Advanced | |

108 | is virtual; | |

109 | ||

110 | Build (me : in out) | |

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

112 | ---Level: Public | |

113 | is redefined; | |

114 | ||

115 | ||

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

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

118 | -- shape <S>. | |

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

120 | ---Level: Public | |

121 | returns ListOfShape from TopTools | |

122 | is redefined virtual; | |

123 | ||

124 | ||

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

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

127 | ||

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

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

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

131 | ---Level: Public | |

132 | returns ListOfShape from TopTools; | |

133 | ||

134 | ||

135 | -- Query offset join type. | |

136 | ||

137 | GetJoinType(me) | |

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

139 | returns JoinType from GeomAbs | |

140 | is static; | |

141 | ||

142 | ||

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

144 | ||

145 | fields | |

146 | ||

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

148 | ||

149 | end MakeOffsetShape; |