]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOM_SWIG/GEOM_shellSolid.py
Salome HOME
Start potring to the VTK OpenGL2 backend.
[modules/geom.git] / src / GEOM_SWIG / GEOM_shellSolid.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20 #
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #
23
24 #==============================================================================
25 #  Info.
26 #  Bug (from script, bug)   : shellSolid_modified.py, PAL6611
27 #  Modified                 : 25/11/2004
28 #  Author                   : Kovaltchuk Alexey
29 #  Project                  : PAL/SALOME
30 #==============================================================================
31 # Imports
32 # -------
33 #
34 import salome
35 salome.salome_init()
36 import GEOM
37 from salome.geom import geomBuilder
38 geompy = geomBuilder.New(salome.myStudy)
39
40 # Interface with geometry
41 # -----------------------
42
43 #geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
44 geomgui = salome.ImportComponentGUI("GEOM")
45
46 # Interface with study
47 # --------------------
48
49 def addToStudy(shape, name):
50     i = geompy.addToStudy(shape, name)
51     salome.sg.updateObjBrowser(0)
52 #    geomgui.createAndDisplayGO(i)
53     return i
54
55 def setName(obj):
56     obj.SetName(salome.orb.object_to_string(obj))
57
58
59 def MakeVertex(x, y, z):
60     v = geompy.MakeVertex(x, y, z)
61     setName(v)
62     return v
63
64 def MakeEdge(v1, v2):
65     e = geompy.MakeEdge(v1, v2)
66     setName(e)
67     return e
68
69 def MakeArc(f, p, t):
70     e = geompy.MakeArc(f, p, t)
71     setName(e)
72     return e
73
74 def MakeArcCenter(c, f, t):
75     p = fkl(c, f, t)
76     e = geompy.MakeArc(f, p, t)
77     setName(e)
78     return e
79
80 # Face with 4 edges
81 # -----------------
82
83 # cf. makeTiledSurfByContour
84
85 def MakeQuadFace(e1, e2, e3, e4):
86     l = []
87     l.append(e1)
88     l.append(e2)
89     l.append(e3)
90     l.append(e4)
91     w = geompy.MakeWire(l)
92     f = geompy.MakeFace(w, 1)
93     setName(f)
94     return f
95
96 # cf. makeTiledSurfBetweenTwolines
97
98 def MakeQuadFaceEdge(e1, e2):
99     return fkl
100
101 # cf. makeTiledSurfByPointsOfContour
102 # cf. makeMesh
103
104 def MakeQuadFaceVertex(v1, v2, v3, v4):
105     l = []
106     e = MakeEdge(v1, v2)
107     l.append(e)
108     e = MakeEdge(v2, v3)
109     l.append(e)
110     e = MakeEdge(v3, v4)
111     l.append(e)
112     e = MakeEdge(v4, v1)
113     l.append(e)
114     w = geompy.MakeWire(l)
115     f = geompy.MakeFace(w, 1)
116     setName(f)
117     return f
118
119 # Solid with 6 faces
120 # ------------------
121
122 # cf. makePavedVolWithContour
123 # cf. makeVolWithEnvolope
124
125 def MakeHexaSolid(f1, f2, f3, f4, f5, f6):
126     l = []
127     l.append(f1)
128     l.append(f2)
129     l.append(f3)
130     l.append(f4)
131     l.append(f5)
132     l.append(f6)
133     s = geompy.MakeShell(l)
134 # FKL: bad shell
135     l = []
136     l.append(s)
137     s = geompy.MakeSolid(l)
138 # FKL: MakeSolid crash
139     setName(s)
140     return s
141
142 # cf. makeVolBetweenTwoSurfaces
143
144 def MakeHexaSolidFace(f1, f2):
145     return fkl
146
147 # Face (with 4 edges) and solid (with 6 faces)
148 # --------------------------------------------
149
150 # makeTiledSurfByRotationOfLine
151
152 def MakeRevolution(g, pt, ve, angle):
153     """
154     Creates a face  by rotation of an edge with an angle around an axis defined by a point and a vector or
155     creates a solid by rotation of a  face with an angle around an axis defined by a point and a vector
156     """
157     axis = geompy.MakeAxisStruct(pt.x, pt.y, pt.z, ve.x, ve.y, ve.z)
158     s = geompy.MakeRevolution(g, axis, angle)
159     setName(s)
160     return s
161
162 # cf. makeSurfSewingTwolines
163
164 def MakeSewing(ls):
165     """
166     Creates a face  by sewing common edges between a list of faces or
167     Creates a solid by sewing common faces between a list of solids
168     """
169     s = geompy.MakeSewing(ls)
170     setName(s)
171     return s
172
173 # cf. makeIntersectionBetweenTwoMeshes
174
175 def MakeCommon(s1, s2):
176     """
177     Creates the common face  between 2 faces or
178     Creates the common solid between 2 solids
179     """
180     s = geompy.MakeBoolean(s1, s2, 1)
181     setName(s)
182     return s
183
184 # cf. makeMerge
185
186 def MakeFuse(s1, s2):
187     """
188     Fuses 2 faces or 2 solids
189     """
190     s = geompy.MakeBoolean(s1, s2, 3)
191     setName(s)
192     return s
193
194 # Additional
195
196 def MakeCut(s1, s2):
197     """
198     Cuts 2 faces or 2 solids
199     """
200     s = geompy.MakeBoolean(s1, s2, 2)
201     setName(s)
202     return s
203
204 # Edge, face (with 4 edges) and solid (with 6 faces)
205 # --------------------------------------------------
206
207 # cf. makeSurfByTranslation
208 # cf. makeVolByTranslation
209
210 def MakePrism(s, v):
211     """
212     Creates a edge  defined by a vertex and along a vector
213     Creates a face  defined by a edge   and along a vector
214     Creates a solid defined by a face   and along a vector
215     """
216     r = geompy.MakePrism(s, point(0, 0, 0), v)
217     setName(r)
218     return r
219
220 # cf. homothety
221
222 def MakeScaleTransform(s, center, factor):
223     """
224     Creates a homothety of a geometric object
225     """
226     r = geompy.MakeScaleTransform(s, center, factor)
227     setName(r)
228     return r
229
230 # Vertex, edge, face (with 4 edges) and solid (with 6 faces)
231 # ----------------------------------------------------------
232
233 # cf. translate
234
235 def MakeTranslation(s, vx, vy, vz):
236     """
237     Translates a vertex, an edge, a face or a solid
238     """
239     r = geompy.MakeTranslation(s, vx, vy, vz)
240     setName(r)
241     return r
242
243 # cf. rotation
244
245 def MakeRotation(g, pt, ve, angle):
246     """
247     Creates a rotation of the geometric object with an angle around an axis defined by a point and a vector
248     """
249     axis = geompy.MakeAxisStruct(pt.x, pt.y, pt.z, ve.x, ve.y, ve.z)
250     s = geompy.MakeRotation(g, axis, angle)
251     setName(s)
252     return s
253
254 # cf. symmetryByPoint
255
256 def MakeMirrorByPoint(s, point):
257     """
258     Creates a symmetric object by point symetry
259     """
260     return fkl
261
262 # cf. symmetryByLine
263
264 def MakeMirrorByLine(s, line):
265     """
266     Creates a symmetric object by line symetry
267     """
268     return fkl
269
270 # cf. symmetryByPlane
271
272 def MakeMirrorByPlane(s, pt, ve):
273     """
274     Creates a symmetric object by plane symetry defined by a point and a normal vector
275     """
276     p = plane(pt, ve)
277     r = geompy.MakeMirrorByplane(s, p)
278     setName(r)
279     return r
280
281 # Compound
282 # --------
283
284 # Additional
285
286 def BlockMakeCompound(ls):
287     """
288     Creates a compound defined by a list and glue faces
289     """
290     c = MakeCompound(ls)
291     r = MakeGlueFaces(c, 1.e-5)
292     setName(r)
293     return r
294
295 # Boolean operators
296 # -----------------
297
298 def mergePointsNearBy(l, v):
299     """
300     Modifies a list of shape by replacing all vertex near a new vextex
301     """
302     return fkl
303
304 # Acces operators
305 # ---------------
306
307 def getCoords(v):
308     """
309     Gets the coordinates of the vertex
310     """
311     return fkl
312
313 def extractBeginPoint(e):
314     """
315     Gets the first point of an edge
316     """
317     return fkl
318
319 def extractEndPoint(e):
320     """
321     Gets the second point of an edge
322     """
323     return fkl
324
325 # fkl more functionalities
326
327 # Addionnal
328 # =========
329
330 # Check geometry
331 # --------------
332
333 def CheckQuadFace(f):
334     """
335     Checks if a face has 4 edges
336     """
337     return fkl
338
339 def CheckHexaSolid(s):
340     """
341     Checks if a solid has 6 faces and each faces have 4 edges
342     """
343     return fkl
344
345 # fkl more if other kind of solid like: tetra, penta, etc
346
347 # point for building
348 # ------------------
349
350 def point(x, y, z):
351     p = geompy.MakeVertex(x, y, z)
352     return p
353
354 def plane(pt, dir):
355     p = geompy.MakePlane(pt, d, 100)
356     return p
357
358 # Solid
359 # -----
360
361 def MakeCylinder(center, dir, radius, height):
362     s = geompy.MakeCylinder(center, dir, radius, height)
363     setName(s)
364     return s
365
366 def MakeBox(p1, p2):
367     s = geompy.MakeBoxTwoPnt(p1, p2)
368     setName(s)
369     return s
370
371 # Compound
372 # --------
373
374 def MakePartitionList(solids, tools):
375     """
376     Creates a list of shape by a partition of a list of solids by a list of tools
377     """
378     p = geompy.Partition(solids, tools, [], [], geompy.ShapeType["SHAPE"]);
379     l = geompy.SubShapeAll(p, geompy.ShapeType["SHAPE"])
380     return l
381
382 def MakePartition(solids, tools):
383     """
384     Creates a partition of a list of solids by a list of tools
385     """
386     l = MakePartitionList(solids, tools)
387     c = MakeCompound(l)
388     setName(c)
389     return c
390
391 def BlockMakeMultiTranslation1D(shape, dir, step, times):
392     m = geompy.MakeMultiTranslation1D(shape, dir, step, times)
393     c  = MakeGlueFaces(m, 1.e-5)
394     setName(c)
395     return c
396
397 def BlockMakeMultiTranslation2D(shape, dir1, step1, times1, dir2, step2, times2):
398     m  = geompy.MakeMultiTranslation2D(shape, dir1, step1, times1, dir2, step2, times2)
399     c  = MakeGlueFaces(m, 1.e-5)
400     setName(c)
401     return c
402
403 def BlockMakeMultiRotation1D(shape, dir, point, times):
404     m = geompy.MakeMultiRotation1D(shape, dir, point, times)
405     c  = MakeGlueFaces(m, 1.e-5)
406     setName(c)
407     return c
408
409 def BlockMakeMultiRotation2D(shape, dir, point, angle, times1, step, times2):
410     m = geompy.MakeMultiRotation2D(shape, dir, point, angle, times1, step, times2)
411     c  = MakeGlueFaces(m, 1.e-5)
412     setName(c)
413     return c
414
415 # internal
416 # --------
417
418 def MakeCompound(ls):
419     """
420     Creates a compound defined by a list
421     """
422     c = geompy.MakeCompound(ls)
423     return c
424
425 def MakeSewingShape(s, eps):
426     """
427     Creates a shape fully sewed
428     """
429     r = geompy.MakeSewingShape(s, eps)
430     return r
431
432 def MakeGlueFaces(s, eps):
433     """
434     Touched faces are replaced by one
435     """
436     r = geompy.MakeGlueFaces(s, eps)
437     return r
438
439
440 # Geometry
441 # ========
442
443 # A small cube centered and put on a great cube
444
445 # Points
446 # ------
447
448 greatPoint111 = point( 0,  0,  0)
449 greatPoint211 = point(10,  0,  0)
450 greatPoint311 = point(20,  0,  0)
451 greatPoint411 = point(30,  0,  0)
452
453 greatPoint121 = point( 0, 10,  0)
454 greatPoint221 = point(10, 10,  0)
455 greatPoint321 = point(20, 10,  0)
456 greatPoint421 = point(30, 10,  0)
457
458 greatPoint112 = point( 0,  0, 10)
459 greatPoint212 = point(10,  0, 10)
460 greatPoint312 = point(20,  0, 10)
461 greatPoint412 = point(30,  0, 10)
462
463 greatPoint122 = point( 0, 10, 10)
464 greatPoint222 = point(10, 10, 10)
465 greatPoint322 = point(20, 10, 10)
466 greatPoint422 = point(30, 10, 10)
467
468 greatPoint113 = point( 0,  0, 20)
469 greatPoint213 = point(10,  0, 20)
470 greatPoint313 = point(20,  0, 20)
471 greatPoint413 = point(30,  0, 20)
472
473 greatPoint123 = point( 0, 10, 20)
474 greatPoint223 = point(10, 10, 20)
475 greatPoint323 = point(20, 10, 20)
476 greatPoint423 = point(30, 10, 20)
477
478 greatPoint114 = point( 0,  0, 30)
479 greatPoint214 = point(10,  0, 30)
480 greatPoint314 = point(20,  0, 30)
481 greatPoint414 = point(30,  0, 30)
482
483 greatPoint124 = point( 0, 10, 30)
484 greatPoint224 = point(10, 10, 30)
485 greatPoint324 = point(20, 10, 30)
486 greatPoint424 = point(30, 10, 30)
487
488
489 smallPoint111 = greatPoint222
490 smallPoint211 = greatPoint322
491 smallPoint121 = point(10, 20, 10)
492 smallPoint221 = point(20, 20, 10)
493
494 smallPoint112 = greatPoint223
495 smallPoint212 = greatPoint323
496 smallPoint122 = point(10, 20, 20)
497 smallPoint222 = point(20, 20, 20)
498
499 # Edges
500 # -----
501
502 smallEdgeX11 = MakeEdge(smallPoint111, smallPoint211)
503 smallEdgeX21 = MakeEdge(smallPoint121, smallPoint221)
504 smallEdgeX12 = MakeEdge(smallPoint112, smallPoint212)
505 smallEdgeX22 = MakeEdge(smallPoint122, smallPoint222)
506
507 smallEdgeY11 = MakeEdge(smallPoint111, smallPoint121)
508 smallEdgeY21 = MakeEdge(smallPoint211, smallPoint221)
509 smallEdgeY12 = MakeEdge(smallPoint112, smallPoint122)
510 smallEdgeY22 = MakeEdge(smallPoint212, smallPoint222)
511
512 smallEdgeZ11 = MakeEdge(smallPoint111, smallPoint112)
513 smallEdgeZ21 = MakeEdge(smallPoint211, smallPoint212)
514 smallEdgeZ12 = MakeEdge(smallPoint121, smallPoint122)
515 smallEdgeZ22 = MakeEdge(smallPoint221, smallPoint222)
516
517
518 greatEdgeX111 = MakeEdge(greatPoint111, greatPoint211)
519 greatEdgeX211 = MakeEdge(greatPoint211, greatPoint311)
520 greatEdgeX311 = MakeEdge(greatPoint311, greatPoint411)
521 greatEdgeX121 = MakeEdge(greatPoint121, greatPoint221)
522 greatEdgeX221 = MakeEdge(greatPoint221, greatPoint321)
523 greatEdgeX321 = MakeEdge(greatPoint321, greatPoint421)
524
525 greatEdgeX112 = MakeEdge(greatPoint112, greatPoint212)
526 greatEdgeX212 = MakeEdge(greatPoint212, greatPoint312)
527 greatEdgeX312 = MakeEdge(greatPoint312, greatPoint412)
528 greatEdgeX122 = MakeEdge(greatPoint122, greatPoint222)
529 greatEdgeX222 = smallEdgeX11
530 greatEdgeX322 = MakeEdge(greatPoint322, greatPoint422)
531
532 greatEdgeX113 = MakeEdge(greatPoint113, greatPoint213)
533 greatEdgeX213 = MakeEdge(greatPoint213, greatPoint313)
534 greatEdgeX313 = MakeEdge(greatPoint313, greatPoint413)
535 greatEdgeX123 = MakeEdge(greatPoint123, greatPoint223)
536 greatEdgeX223 = smallEdgeX12
537 greatEdgeX323 = MakeEdge(greatPoint323, greatPoint423)
538
539 greatEdgeX114 = MakeEdge(greatPoint114, greatPoint214)
540 greatEdgeX214 = MakeEdge(greatPoint214, greatPoint314)
541 greatEdgeX314 = MakeEdge(greatPoint314, greatPoint414)
542 greatEdgeX124 = MakeEdge(greatPoint124, greatPoint224)
543 greatEdgeX224 = MakeEdge(greatPoint224, greatPoint324)
544 greatEdgeX324 = MakeEdge(greatPoint324, greatPoint424)
545
546 greatEdgeY11 = MakeEdge(greatPoint111, greatPoint121)
547 greatEdgeY21 = MakeEdge(greatPoint211, greatPoint221)
548 greatEdgeY31 = MakeEdge(greatPoint311, greatPoint321)
549 greatEdgeY41 = MakeEdge(greatPoint411, greatPoint421)
550
551 greatEdgeY12 = MakeEdge(greatPoint112, greatPoint122)
552 greatEdgeY22 = MakeEdge(greatPoint212, greatPoint222)
553 greatEdgeY32 = MakeEdge(greatPoint312, greatPoint322)
554 greatEdgeY42 = MakeEdge(greatPoint412, greatPoint422)
555
556 greatEdgeY13 = MakeEdge(greatPoint113, greatPoint123)
557 greatEdgeY23 = MakeEdge(greatPoint213, greatPoint223)
558 greatEdgeY33 = MakeEdge(greatPoint313, greatPoint323)
559 greatEdgeY43 = MakeEdge(greatPoint413, greatPoint423)
560
561 greatEdgeY14 = MakeEdge(greatPoint114, greatPoint124)
562 greatEdgeY24 = MakeEdge(greatPoint214, greatPoint224)
563 greatEdgeY34 = MakeEdge(greatPoint314, greatPoint324)
564 greatEdgeY44 = MakeEdge(greatPoint414, greatPoint424)
565
566 greatEdgeZ111 = MakeEdge(greatPoint111, greatPoint112)
567 greatEdgeZ211 = MakeEdge(greatPoint211, greatPoint212)
568 greatEdgeZ311 = MakeEdge(greatPoint311, greatPoint312)
569 greatEdgeZ411 = MakeEdge(greatPoint411, greatPoint412)
570
571 greatEdgeZ121 = MakeEdge(greatPoint121, greatPoint122)
572 greatEdgeZ221 = MakeEdge(greatPoint221, greatPoint222)
573 greatEdgeZ321 = MakeEdge(greatPoint321, greatPoint322)
574 greatEdgeZ421 = MakeEdge(greatPoint421, greatPoint422)
575
576 greatEdgeZ112 = MakeEdge(greatPoint112, greatPoint113)
577 greatEdgeZ212 = MakeEdge(greatPoint212, greatPoint213)
578 greatEdgeZ312 = MakeEdge(greatPoint312, greatPoint313)
579 greatEdgeZ412 = MakeEdge(greatPoint412, greatPoint413)
580
581 greatEdgeZ122 = MakeEdge(greatPoint122, greatPoint123)
582 greatEdgeZ222 = smallEdgeZ11
583 greatEdgeZ322 = smallEdgeZ21
584 greatEdgeZ422 = MakeEdge(greatPoint422, greatPoint423)
585
586 greatEdgeZ113 = MakeEdge(greatPoint113, greatPoint114)
587 greatEdgeZ213 = MakeEdge(greatPoint213, greatPoint214)
588 greatEdgeZ313 = MakeEdge(greatPoint313, greatPoint314)
589 greatEdgeZ413 = MakeEdge(greatPoint413, greatPoint414)
590
591 greatEdgeZ123 = MakeEdge(greatPoint123, greatPoint124)
592 greatEdgeZ223 = MakeEdge(greatPoint223, greatPoint224)
593 greatEdgeZ323 = MakeEdge(greatPoint323, greatPoint324)
594 greatEdgeZ423 = MakeEdge(greatPoint423, greatPoint424)
595
596 # Faces
597 # -----
598
599 smallFaceX1 = MakeQuadFace(smallEdgeY11, smallEdgeZ11, smallEdgeY12, smallEdgeZ12)
600 smallFaceX2 = MakeQuadFace(smallEdgeY21, smallEdgeZ21, smallEdgeY22, smallEdgeZ22)
601 smallFaceY1 = MakeQuadFace(smallEdgeX11, smallEdgeZ11, smallEdgeX12, smallEdgeZ21)
602 smallFaceY2 = MakeQuadFace(smallEdgeX21, smallEdgeZ12, smallEdgeX22, smallEdgeZ22)
603 smallFaceZ1 = MakeQuadFace(smallEdgeX11, smallEdgeY11, smallEdgeX21, smallEdgeY21)
604 smallFaceZ2 = MakeQuadFace(smallEdgeX12, smallEdgeY12, smallEdgeX22, smallEdgeY22)
605
606
607 greatFaceX11 = MakeQuadFace(greatEdgeY11, greatEdgeZ111, greatEdgeY12, greatEdgeZ121)
608 greatFaceX21 = MakeQuadFace(greatEdgeY21, greatEdgeZ211, greatEdgeY22, greatEdgeZ221)
609 greatFaceX31 = MakeQuadFace(greatEdgeY31, greatEdgeZ311, greatEdgeY32, greatEdgeZ321)
610 greatFaceX41 = MakeQuadFace(greatEdgeY41, greatEdgeZ411, greatEdgeY42, greatEdgeZ421)
611
612 greatFaceX12 = MakeQuadFace(greatEdgeY12, greatEdgeZ112, greatEdgeY13, greatEdgeZ122)
613 greatFaceX22 = MakeQuadFace(greatEdgeY22, greatEdgeZ212, greatEdgeY23, greatEdgeZ222)
614 greatFaceX32 = MakeQuadFace(greatEdgeY32, greatEdgeZ312, greatEdgeY33, greatEdgeZ322)
615 greatFaceX42 = MakeQuadFace(greatEdgeY42, greatEdgeZ412, greatEdgeY43, greatEdgeZ422)
616
617 greatFaceX13 = MakeQuadFace(greatEdgeY13, greatEdgeZ113, greatEdgeY14, greatEdgeZ123)
618 greatFaceX23 = MakeQuadFace(greatEdgeY23, greatEdgeZ213, greatEdgeY24, greatEdgeZ223)
619 greatFaceX33 = MakeQuadFace(greatEdgeY33, greatEdgeZ313, greatEdgeY34, greatEdgeZ323)
620 greatFaceX43 = MakeQuadFace(greatEdgeY43, greatEdgeZ413, greatEdgeY44, greatEdgeZ423)
621
622 greatFaceY111 = MakeQuadFace(greatEdgeX111, greatEdgeZ111, greatEdgeX112, greatEdgeZ211)
623 greatFaceY211 = MakeQuadFace(greatEdgeX211, greatEdgeZ211, greatEdgeX212, greatEdgeZ311)
624 greatFaceY311 = MakeQuadFace(greatEdgeX311, greatEdgeZ311, greatEdgeX312, greatEdgeZ411)
625 greatFaceY121 = MakeQuadFace(greatEdgeX121, greatEdgeZ121, greatEdgeX122, greatEdgeZ221)
626 greatFaceY221 = MakeQuadFace(greatEdgeX221, greatEdgeZ221, greatEdgeX222, greatEdgeZ321)
627 greatFaceY321 = MakeQuadFace(greatEdgeX321, greatEdgeZ321, greatEdgeX322, greatEdgeZ421)
628
629 greatFaceY112 = MakeQuadFace(greatEdgeX112, greatEdgeZ112, greatEdgeX113, greatEdgeZ212)
630 greatFaceY212 = MakeQuadFace(greatEdgeX212, greatEdgeZ212, greatEdgeX213, greatEdgeZ312)
631 greatFaceY312 = MakeQuadFace(greatEdgeX312, greatEdgeZ312, greatEdgeX313, greatEdgeZ412)
632 greatFaceY122 = MakeQuadFace(greatEdgeX122, greatEdgeZ122, greatEdgeX123, greatEdgeZ222)
633 greatFaceY222 = smallFaceY1
634 greatFaceY322 = MakeQuadFace(greatEdgeX322, greatEdgeZ322, greatEdgeX323, greatEdgeZ422)
635
636 greatFaceY113 = MakeQuadFace(greatEdgeX113, greatEdgeZ113, greatEdgeX114, greatEdgeZ213)
637 greatFaceY213 = MakeQuadFace(greatEdgeX213, greatEdgeZ213, greatEdgeX214, greatEdgeZ313)
638 greatFaceY313 = MakeQuadFace(greatEdgeX313, greatEdgeZ313, greatEdgeX314, greatEdgeZ413)
639 greatFaceY123 = MakeQuadFace(greatEdgeX123, greatEdgeZ123, greatEdgeX124, greatEdgeZ223)
640 greatFaceY223 = MakeQuadFace(greatEdgeX223, greatEdgeZ223, greatEdgeX224, greatEdgeZ323)
641 greatFaceY323 = MakeQuadFace(greatEdgeX323, greatEdgeZ323, greatEdgeX324, greatEdgeZ423)
642
643 greatFaceZ11 = MakeQuadFace(greatEdgeX111, greatEdgeY11, greatEdgeX121, greatEdgeY21)
644 greatFaceZ21 = MakeQuadFace(greatEdgeX211, greatEdgeY21, greatEdgeX221, greatEdgeY31)
645 greatFaceZ31 = MakeQuadFace(greatEdgeX311, greatEdgeY31, greatEdgeX321, greatEdgeY41)
646
647 greatFaceZ12 = MakeQuadFace(greatEdgeX112, greatEdgeY12, greatEdgeX122, greatEdgeY22)
648 greatFaceZ22 = MakeQuadFace(greatEdgeX212, greatEdgeY22, greatEdgeX222, greatEdgeY32)
649 greatFaceZ32 = MakeQuadFace(greatEdgeX312, greatEdgeY32, greatEdgeX322, greatEdgeY42)
650
651 greatFaceZ13 = MakeQuadFace(greatEdgeX113, greatEdgeY13, greatEdgeX123, greatEdgeY23)
652 greatFaceZ23 = MakeQuadFace(greatEdgeX213, greatEdgeY23, greatEdgeX223, greatEdgeY33)
653 greatFaceZ33 = MakeQuadFace(greatEdgeX313, greatEdgeY33, greatEdgeX323, greatEdgeY43)
654
655 greatFaceZ14 = MakeQuadFace(greatEdgeX114, greatEdgeY14, greatEdgeX124, greatEdgeY24)
656 greatFaceZ24 = MakeQuadFace(greatEdgeX214, greatEdgeY24, greatEdgeX224, greatEdgeY34)
657 greatFaceZ34 = MakeQuadFace(greatEdgeX314, greatEdgeY34, greatEdgeX324, greatEdgeY44)
658
659 # Solids
660 # ------
661
662 smallBlock   = MakeHexaSolid(smallFaceX1, smallFaceX2, smallFaceY1, smallFaceY2, smallFaceZ1, smallFaceZ2)
663
664 greatBlock11 = MakeHexaSolid(greatFaceX11, greatFaceX21, greatFaceY111, greatFaceY121, greatFaceZ11, greatFaceZ12)
665 greatBlock21 = MakeHexaSolid(greatFaceX21, greatFaceX31, greatFaceY211, greatFaceY221, greatFaceZ21, greatFaceZ22)
666 greatBlock31 = MakeHexaSolid(greatFaceX31, greatFaceX41, greatFaceY311, greatFaceY321, greatFaceZ31, greatFaceZ32)
667
668 greatBlock12 = MakeHexaSolid(greatFaceX12, greatFaceX22, greatFaceY112, greatFaceY122, greatFaceZ12, greatFaceZ13)
669 greatBlock22 = MakeHexaSolid(greatFaceX22, greatFaceX32, greatFaceY212, greatFaceY222, greatFaceZ22, greatFaceZ23)
670 greatBlock32 = MakeHexaSolid(greatFaceX32, greatFaceX42, greatFaceY312, greatFaceY322, greatFaceZ32, greatFaceZ33)
671
672 greatBlock13 = MakeHexaSolid(greatFaceX13, greatFaceX23, greatFaceY113, greatFaceY123, greatFaceZ13, greatFaceZ14)
673 greatBlock23 = MakeHexaSolid(greatFaceX23, greatFaceX33, greatFaceY213, greatFaceY223, greatFaceZ23, greatFaceZ24)
674 greatBlock33 = MakeHexaSolid(greatFaceX33, greatFaceX43, greatFaceY313, greatFaceY323, greatFaceZ33, greatFaceZ34)
675
676 # Compound
677 # --------
678
679 l = []
680 l.append(smallBlock)
681 l.append(greatBlock11)
682 l.append(greatBlock21)
683 l.append(greatBlock31)
684 l.append(greatBlock12)
685 l.append(greatBlock22)
686 l.append(greatBlock32)
687 l.append(greatBlock13)
688 l.append(greatBlock23)
689 l.append(greatBlock33)
690
691 piece = MakeCompound(l)
692
693 # Add in study
694 # ------------
695
696 idpiece = addToStudy(piece, "Cubes2pyGibi")
697 #geompy.InsertOp.Export(piece,"piece.brep", "BREP")