b311480e |
1 | -- Created on: 1993-07-21 |
2 | -- Created by: Remi LEQUETTE |
3 | -- Copyright (c) 1993-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 | class MakeSolid from BRepBuilderAPI inherits MakeShape from BRepBuilderAPI |
24 | |
25 | ---Purpose: Describes functions to build a solid from shells. |
26 | -- A solid is made of one shell, or a series of shells, which |
27 | -- do not intersect each other. One of these shells |
28 | -- constitutes the outside skin of the solid. It may be closed |
29 | -- (a finite solid) or open (an infinite solid). Other shells |
30 | -- form hollows (cavities) in these previous ones. Each |
31 | -- must bound a closed volume. |
32 | -- A MakeSolid object provides a framework for: |
33 | -- - defining and implementing the construction of a solid, and |
34 | -- - consulting the result. |
35 | |
36 | uses |
37 | Solid from TopoDS, |
38 | CompSolid from TopoDS, |
39 | Shell from TopoDS, |
40 | Shape from TopoDS, |
41 | MakeSolid from BRepLib |
42 | |
43 | raises |
44 | NotDone from StdFail |
45 | |
46 | is |
47 | |
48 | Create |
49 | ---Purpose: Initializes the construction of a solid. An empty solid is |
50 | -- considered to cover the whole space. The Add function |
51 | -- is used to define shells to bound it. |
52 | returns MakeSolid from BRepBuilderAPI; |
53 | |
54 | ---------------------------------------------- |
55 | -- From Compsolid |
56 | ---------------------------------------------- |
57 | |
58 | Create(S : CompSolid from TopoDS) |
59 | ---Purpose: Make a solid from a CompSolid. |
60 | ---Level: Public |
61 | returns MakeSolid from BRepBuilderAPI; |
62 | |
63 | -- this algorithm removes all inner faces amd make solid from compsolid |
64 | |
65 | ---------------------------------------------- |
66 | -- From shells |
67 | ---------------------------------------------- |
68 | |
69 | Create(S : Shell from TopoDS) |
70 | ---Purpose: Make a solid from a shell. |
71 | ---Level: Public |
72 | returns MakeSolid from BRepBuilderAPI; |
73 | |
74 | |
75 | Create(S1,S2 : Shell from TopoDS) |
76 | ---Purpose: Make a solid from two shells. |
77 | ---Level: Public |
78 | returns MakeSolid from BRepBuilderAPI; |
79 | |
80 | Create(S1,S2,S3 : Shell from TopoDS) |
81 | ---Purpose: Make a solid from three shells. |
82 | ---Level: Public |
83 | returns MakeSolid from BRepBuilderAPI; |
84 | |
85 | ---Purpose: Constructs a solid |
86 | -- - covering the whole space, or |
87 | -- - from shell S, or |
88 | -- - from two shells S1 and S2, or |
89 | -- - from three shells S1, S2 and S3, or |
90 | -- Warning |
91 | -- No check is done to verify the conditions of coherence |
92 | -- of the resulting solid. In particular, S1, S2 (and S3) must |
93 | -- not intersect each other. |
94 | -- Besides, after all shells have been added using the Add |
95 | -- function, one of these shells should constitute the outside |
96 | -- skin of the solid; it may be closed (a finite solid) or open |
97 | -- (an infinite solid). Other shells form hollows (cavities) in |
98 | -- these previous ones. Each must bound a closed volume. |
99 | |
100 | ---------------------------------------------- |
101 | -- From solid and shells |
102 | ---------------------------------------------- |
103 | |
104 | Create(So : Solid from TopoDS) |
105 | ---Purpose: Make a solid from a solid. Usefull for adding later. |
106 | ---Level: Public |
107 | returns MakeSolid from BRepBuilderAPI; |
108 | |
109 | Create(So : Solid from TopoDS; S : Shell from TopoDS) |
110 | ---Purpose: Add a shell to a solid. |
111 | ---Level: Public |
112 | returns MakeSolid from BRepBuilderAPI; |
113 | |
114 | ---Purpose: |
115 | -- Constructs a solid: |
116 | -- - from the solid So, to which shells can be added, or |
117 | -- - by adding the shell S to the solid So. |
118 | -- Warning |
119 | -- No check is done to verify the conditions of coherence |
120 | -- of the resulting solid. In particular S must not intersect the solid S0. |
121 | -- Besides, after all shells have been added using the Add |
122 | -- function, one of these shells should constitute the outside |
123 | -- skin of the solid. It may be closed (a finite solid) or open |
124 | -- (an infinite solid). Other shells form hollows (cavities) in |
125 | -- the previous ones. Each must bound a closed volume. |
126 | |
127 | ---------------------------------------------- |
128 | -- Auxiliary methods |
129 | ---------------------------------------------- |
130 | |
131 | Add(me : in out; S : Shell from TopoDS) |
132 | ---Purpose: Adds the shell to the current solid. |
133 | -- Warning |
134 | -- No check is done to verify the conditions of coherence |
135 | -- of the resulting solid. In particular, S must not intersect |
136 | -- other shells of the solid under construction. |
137 | -- Besides, after all shells have been added, one of |
138 | -- these shells should constitute the outside skin of the |
139 | -- solid. It may be closed (a finite solid) or open (an |
140 | -- infinite solid). Other shells form hollows (cavities) in |
141 | -- these previous ones. Each must bound a closed volume. |
142 | is static; |
143 | |
144 | ---------------------------------------------- |
145 | -- Results |
146 | ---------------------------------------------- |
147 | |
148 | IsDone(me) returns Boolean |
149 | ---Purpose: Returns true if the solid is built. |
150 | -- For this class, a solid under construction is always valid. |
151 | -- If no shell has been added, it could be a whole-space |
152 | -- solid. However, no check was done to verify the |
153 | -- conditions of coherence of the resulting solid. |
154 | is redefined; |
155 | |
156 | Solid(me) returns Solid from TopoDS |
157 | ---Purpose: Returns the new Solid. |
158 | -- |
159 | ---C++: return const & |
160 | ---C++: alias "Standard_EXPORT operator TopoDS_Solid() const;" |
161 | ---Level: Public |
162 | raises |
163 | NotDone from StdFail |
164 | is static; |
165 | |
166 | IsDeleted (me: in out; S : Shape from TopoDS) |
167 | returns Boolean |
168 | is redefined; |
169 | |
170 | fields |
171 | |
172 | myMakeSolid : MakeSolid from BRepLib; |
173 | |
174 | end MakeSolid; |