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

b311480e | 1 | -- Created on: 1995-09-18 |

2 | -- Created by: Bruno DUMORTIER | |

3 | -- Copyright (c) 1995-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 | class MakeOffset from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI | |

18 | ||

19 | ---Purpose: Describes algorithms for offsetting wires from a set of | |

20 | -- wires contained in a planar face. | |

21 | -- A MakeOffset object provides a framework for: | |

22 | -- - defining the construction of an offset, | |

23 | -- - implementing the construction algorithm, and | |

24 | -- - consulting the result. | |

25 | ||

26 | uses | |

27 | Shape from TopoDS, | |

28 | Wire from TopoDS, | |

29 | Face from TopoDS, | |

30 | ListOfShape from TopTools, | |

31 | OffsetWire from BRepFill, | |

32 | ListOfOffsetWire from BRepFill, | |

33 | JoinType from GeomAbs | |

34 | ||

35 | ||

36 | raises | |

8b595ab7 | 37 | NotDone from StdFail |

7fd59977 | 38 | |

39 | is | |

40 | Create returns MakeOffset from BRepOffsetAPI; | |

41 | ---Purpose: Constructs an algorithm for creating an empty offset | |

42 | Create( Spine : Face from TopoDS; | |

6a442250 | 43 | Join : JoinType from GeomAbs = GeomAbs_Arc; |

44 | IsOpenResult : Boolean from Standard = Standard_False) | |

7fd59977 | 45 | returns MakeOffset from BRepOffsetAPI; |

46 | ---Purpose: Constructs an algorithm for creating an algorithm | |

47 | -- to build parallels to the spine Spine | |

48 | Init( me : in out; | |

49 | Spine : Face from TopoDS; | |

6a442250 | 50 | Join : JoinType from GeomAbs = GeomAbs_Arc; |

51 | IsOpenResult : Boolean from Standard = Standard_False) | |

7fd59977 | 52 | ---Purpose: Initializes the algorithm to construct parallels to the spine Spine. |

53 | -- Join defines the type of parallel generated by the | |

0e0f7a7c | 54 | -- salient vertices of the spine. |

55 | -- The default type is GeomAbs_Arc where the vertices generate | |

56 | -- sections of a circle. | |

57 | -- If join type is GeomAbs_Intersection, the edges that | |

58 | -- intersect in a salient vertex generate the edges | |

59 | -- prolonged until intersection. | |

7fd59977 | 60 | is static; |

61 | ||

62 | Create( Spine : Wire from TopoDS; | |

6a442250 | 63 | Join : JoinType from GeomAbs = GeomAbs_Arc; |

64 | IsOpenResult : Boolean from Standard = Standard_False) | |

7fd59977 | 65 | returns MakeOffset from BRepOffsetAPI; |

66 | ||

67 | Init( me : in out; | |

6a442250 | 68 | Join : JoinType from GeomAbs = GeomAbs_Arc; |

69 | IsOpenResult : Boolean from Standard = Standard_False) | |

7fd59977 | 70 | ---Purpose: Initialize the evaluation of Offseting. |

71 | is static; | |

72 | ||

73 | AddWire (me : in out; | |

74 | Spine : Wire from TopoDS) | |

75 | ---Purpose: Initializes the algorithm to construct parallels to the wire Spine. | |

76 | is static; | |

77 | ||

78 | Perform (me : in out; | |

79 | Offset : Real from Standard; | |

80 | Alt : Real from Standard = 0.0) | |

81 | ---Purpose: Computes a parallel to the spine at distance Offset and | |

82 | -- at an altitude Alt from the plane of the spine in relation | |

83 | -- to the normal to the spine. | |

8b595ab7 | 84 | -- Exceptions: StdFail_NotDone if the offset is not built. |

7fd59977 | 85 | raises |

8b595ab7 | 86 | NotDone from StdFail |

7fd59977 | 87 | is static; |

88 | ||

89 | ||

90 | Build(me : in out) | |

91 | is redefined; | |

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

93 | ---Level: Public | |

94 | ||

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

96 | ---Purpose: returns a list of the created shapes | |

97 | -- from the shape <S>. | |

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

99 | ---Level: Public | |

100 | returns ListOfShape from TopTools | |

101 | is redefined; | |

102 | ||

103 | ||

104 | fields | |

105 | ||

106 | myIsInitialized : Boolean from Standard; | |

107 | myLastIsLeft : Boolean from Standard; | |

108 | myJoin : JoinType from GeomAbs; | |

6a442250 | 109 | myIsOpenResult : Boolean from Standard; |

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

111 | myWires : ListOfShape from TopTools; | |

112 | myLeft : ListOfOffsetWire from BRepFill; | |

113 | myRight : ListOfOffsetWire from BRepFill; | |

114 | ||

115 | end MakeOffset; |