GPencil Tools: Canvas rotate improvement
[blender-addons.git] / archimesh / achm_kitchen_maker.py
blob28118259303c50b2abf6bd3898298f82c81dd1d7
1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
19 # <pep8 compliant>
21 # ----------------------------------------------------------
22 # Automatic generation of kitchen cabinet
23 # Author: Antonio Vazquez (antonioya)
25 # ----------------------------------------------------------
26 import bpy
27 from math import pi, fabs
28 from copy import copy
29 from sys import exc_info
30 from datetime import datetime
31 from time import time
32 from bpy.types import Operator, PropertyGroup
33 from bpy.props import StringProperty, EnumProperty, FloatProperty, IntProperty, BoolProperty, CollectionProperty
34 from bpy_extras.io_utils import ExportHelper
35 from .achm_tools import *
37 # ----------------------------------------------------------
38 # Define rotation types
39 # ----------------------------------------------------------
40 RotationType_Default = 9
41 RotationType_R90CW = 1
42 RotationType_R90CCW = 2
43 RotationType_R180 = 3
46 # ----------------------------------------------------------
47 # Export menu UI
48 # ----------------------------------------------------------
49 class ARCHIMESH_OT_ExportInventory(Operator, ExportHelper):
50 bl_idname = "io_export.kitchen_inventory"
51 bl_description = 'Export kitchen inventory (.txt)'
52 bl_category = 'View'
53 bl_label = "Export"
55 # From ExportHelper. Filter filenames.
56 filename_ext = ".txt"
57 filter_glob: StringProperty(
58 default="*.txt",
59 options={'HIDDEN'},
62 filepath: StringProperty(
63 name="File Path",
64 description="File path used for exporting room data file",
65 maxlen=1024, default="",
68 # ----------------------------------------------------------
69 # Execute
70 # ----------------------------------------------------------
71 # noinspection PyUnusedLocal
72 def execute(self, context):
73 # noinspection PyBroadException
74 try:
75 # -------------------------------
76 # extract path and filename
77 # -------------------------------
78 (filepath, filename) = os.path.split(self.properties.filepath)
79 print('Exporting %s' % filename)
80 # -------------------------------
81 # Open output file
82 # -------------------------------
83 realpath = os.path.realpath(os.path.expanduser(self.properties.filepath))
84 fout = open(realpath, 'w')
86 st = datetime.fromtimestamp(time()).strftime('%Y-%m-%d %H:%M:%S')
87 fout.write("# Archimesh kitchen inventory\n")
88 fout.write("# " + st + "\n")
89 mylist = getinventory()
90 for e in mylist:
91 fout.write(e + "\n")
93 fout.close()
94 self.report({'INFO'}, realpath + "successfully exported")
95 except:
96 e = exc_info()[0]
97 self.report({'ERROR'}, "Unable to export inventory " + e)
99 return {'FINISHED'}
102 # ----------------------------------------------------------
103 # Generate inventory list
104 # ----------------------------------------------------------
105 def getinventory():
106 # Get List of boxes in the scene
107 unitobj = []
108 for obj in bpy.context.scene.objects:
109 # noinspection PyBroadException
110 try:
111 if obj["archimesh.sku"] is not None:
112 unitobj.extend([obj["archimesh.sku"]])
113 except:
114 pass
115 # ----------------------------------------
116 # Get number of unit structures (boxes)
117 # ----------------------------------------
118 boxes = []
119 boxestot = []
120 for u in unitobj:
121 key = u[:1] + u[8:28]
122 if key not in boxes:
123 boxes.extend([key])
124 boxestot.extend([1])
125 else:
126 x = boxes.index(key)
127 boxestot[x] += 1
128 # ----------------------------------------
129 # Get number of doors and drawer fronts
130 # ----------------------------------------
131 door = []
132 doortot = []
133 handles = 0
134 for u in unitobj:
135 if u[1:2] != "W":
136 w = float(u[36:42])
137 key = u[1:2] + "%06.3f" % w + u[22:28]
138 else: # Drawers
139 # calculate separation
140 sz = float(u[22:28])
141 gap = 0.001
142 dist = sz - (gap * int(u[2:4]))
143 space = dist / int(u[2:4])
144 key = u[1:2] + u[8:15] + "%06.3f" % space
146 n = int(u[2:4])
147 # handles
148 if u[4:5] == "1":
149 handles += n
150 if key not in door:
151 door.extend([key])
152 doortot.extend([n])
153 else:
154 x = door.index(key)
155 doortot[x] += n
156 # ----------------------------------------
157 # Get number of Shelves
158 # ----------------------------------------
159 shelves = []
160 shelvestot = []
161 for u in unitobj:
162 if int(u[5:7]) > 0:
163 w = float(u[8:14])
164 n = int(u[5:7])
165 th = float(u[29:35])
167 key = "%0.2f x %0.2f x %0.3f" % (w - (th * 2), float(u[15:21]) - th, th) # subtract board thickness
169 if key not in shelves:
170 shelves.extend([key])
171 shelvestot.extend([n])
172 else:
173 x = shelves.index(key)
174 shelvestot[x] += n
176 # ----------------------------------------
177 # Get Countertop size
178 # "T%06.3fx%06.3fx%06.3f-%06.3f"
179 # ----------------------------------------
180 t = 0
181 z = 0
182 for obj in bpy.context.scene.objects:
183 # noinspection PyBroadException
184 try:
185 if obj["archimesh.top_sku"] is not None:
186 u = obj["archimesh.top_sku"]
187 t += float(u[1:7])
188 z += float(u[22:28])
189 except:
190 pass
192 # ----------------------------------------
193 # Get Baseboard size
194 # ----------------------------------------
195 b = 0
196 btxt = None
197 for obj in bpy.context.scene.objects:
198 # noinspection PyBroadException
199 try:
200 if obj["archimesh.base_sku"] is not None:
201 u = obj["archimesh.base_sku"]
202 b += float(u[1:6])
203 btxt = "%0.3f x %0.3f" % (float(u[8:14]), float(u[15:21]))
204 except:
205 pass
207 # ----------------------------------------
208 # Prepare output data
209 # ----------------------------------------
210 output = []
211 output.extend(["Units\tDescription\tDimensions"])
212 for i in range(0, len(boxes)):
213 if boxes[i][:1] == "F":
214 typ = "Floor unit\t"
215 else:
216 typ = "Wall unit\t"
218 txt = "%0.2f x %0.2f x %0.2f" % (float(boxes[i][1:7]), float(boxes[i][8:14]), float(boxes[i][15:21]))
219 output.extend([str(boxestot[i]) + "\t" + typ + txt])
221 for i in range(0, len(door)):
222 if door[i][:1] == "D" or door[i][:1] == "L":
223 typ = "Solid door\t"
224 elif door[i][:1] == "G":
225 typ = "Glass door\t"
226 elif door[i][:1] == "W":
227 typ = "Drawer front\t"
228 else:
229 typ = "????\t"
231 txt = "%0.3f x %0.3f" % (float(door[i][1:7]), float(door[i][8:14]))
232 output.extend([str(doortot[i]) + "\t" + typ + txt])
234 for i in range(0, len(shelves)):
235 output.extend([str(shelvestot[i]) + "\tShelf\t" + shelves[i]])
237 output.extend([str(handles) + "\tHandle"])
238 if t > 0:
239 output.extend([str(round(t, 2)) + "\tCountertop (linear length)"])
240 if z > 0:
241 output.extend([str(round(z, 2)) + "\tCountertop wall piece(linear length)"])
242 if b > 0:
243 output.extend([str(round(b, 2)) + "\tBaseboard (linear length) " + btxt])
245 return output
248 # ------------------------------------------------------------------
249 # Define property group class for cabinet properties
250 # This is managed as an array of objects
251 # ------------------------------------------------------------------
252 class CabinetProperties(PropertyGroup):
253 # Cabinet width
254 sX: FloatProperty(
255 name='width', min=0.001, max=10, default=0.60, precision=3,
256 description='Cabinet width',
258 wY: FloatProperty(
259 name='', min=-10, max=10, default=0, precision=3,
260 description='Modify depth size',
262 wZ: FloatProperty(
263 name='', min=-10, max=10, default=0, precision=3,
264 description='Modify height size',
267 # Cabinet position shift
268 pX: FloatProperty(
269 name='', min=-10, max=10, default=0, precision=3,
270 description='Position x shift',
272 pY: FloatProperty(
273 name='', min=-10, max=10, default=0, precision=3,
274 description='Position y shift',
276 pZ: FloatProperty(
277 name='', min=-10, max=10, default=0, precision=3,
278 description='Position z shift',
281 # Door type
282 dType: EnumProperty(
283 items=(
284 ('1', "Single R", ""),
285 ('2', "Single L", ""),
286 ('3', "Single T", ""),
287 ('4', "Glass R", ""),
288 ('5', "Glass L", ""),
289 ('6', "Glass T", ""),
290 ('7', "Drawers", ""),
291 ('8', "Double", ""),
292 ('11', "Double Glass", ""),
293 ('10', "Corner R", ""),
294 ('9', "Corner L", ""),
295 ('99', "None", "")),
296 name="Door",
297 description="Type of front door or drawers",
300 # Shelves
301 sNum: IntProperty(
302 name='Shelves', min=0, max=10, default=1,
303 description='Number total of shelves',
305 # Drawers
306 dNum: IntProperty(
307 name='Num', min=1, max=10, default=3,
308 description='Number total of drawers',
310 # Glass Factor
311 gF: FloatProperty(
312 name='', min=0.001, max=1, default=0.1, precision=3,
313 description='Glass ratio',
315 # Handle flag
316 hand: BoolProperty(
317 name="Handle",
318 description="Create a handle", default=True,
320 # Left baseboard
321 bL: BoolProperty(
322 name="Left Baseboard",
323 description="Create a left baseboard", default=False,
325 # Right baseboard
326 bR: BoolProperty(
327 name="Right Baseboard",
328 description="Create a left baseboard", default=False,
330 # Fill countertop spaces
331 tC: BoolProperty(
332 name="Countertop fill",
333 description="Fill empty spaces with countertop", default=True,
335 # Add countertop edge
336 tE: BoolProperty(
337 name="Countertop edge",
338 description="Add edge to countertop", default=True,
340 # cabinet rotation
341 rotate: EnumProperty(
342 items=(
343 ('9', "Default", ""),
344 ('1', "90 CW", ""),
345 ('2', "90 CCW", ""),
346 ('3', "180", ""),
348 name="Rotate",
349 description="Rotate cabinet relative to previous one",
353 bpy.utils.register_class(CabinetProperties)
356 # ------------------------------------------------------------------
357 # Define UI class
358 # Kitchens
359 # ------------------------------------------------------------------
360 class ARCHIMESH_OT_Kitchen(Operator):
361 bl_idname = "mesh.archimesh_kitchen"
362 bl_label = "Cabinets"
363 bl_description = "Cabinet Generator"
364 bl_category = 'View'
365 bl_options = {'REGISTER', 'UNDO'}
367 # Define properties
368 type_cabinet: EnumProperty(
369 items=(('1', "Floor", ""),
370 ('2', "Wall", "")),
371 name="Type",
372 description="Type of cabinets",
374 oldtype: EnumProperty(
375 items=(('1', "Floor", ""),
376 ('2', "Wall", "")),
377 name="Type",
378 description="Type of cabinets",
381 thickness: FloatProperty(
382 name='Thickness', min=0.001, max=5, default=0.018, precision=3,
383 description='Board thickness',
385 depth: FloatProperty(
386 name='Depth', min=0.001, max=50, default=0.59, precision=3,
387 description='Default cabinet depth',
389 height: FloatProperty(
390 name='Height', min=0.001, max=50, default=0.70, precision=3,
391 description='Default cabinet height',
393 handle: EnumProperty(
394 items=(
395 ('1', "Model 1", ""),
396 ('2', "Model 2", ""),
397 ('3', "Model 3", ""),
398 ('4', "Model 4", ""),
399 ('5', "Model 5", ""),
400 ('6', "Model 6", ""),
401 ('7', "Model 7", ""),
402 ('8', "Model 8", ""),
403 ('9', "None", ""),
405 name="Handle",
406 description="Type of handle",
408 handle_x: FloatProperty(
409 name='', min=0.001, max=10,
410 default=0.05, precision=3,
411 description='Displacement in X relative position (limited to door size)',
413 handle_z: FloatProperty(
414 name='', min=0.001, max=10,
415 default=0.05, precision=3,
416 description='Displacement in Z relative position (limited to door size)',
419 baseboard: BoolProperty(
420 name="Baseboard",
421 description="Create a baseboard automatically",
422 default=True,
424 baseheight: FloatProperty(
425 name='height', min=0.001, max=10,
426 default=0.16, precision=3,
427 description='Baseboard height',
429 basefactor: FloatProperty(
430 name='sink', min=0, max=1,
431 default=0.90, precision=3,
432 description='Baseboard sink',
435 countertop: BoolProperty(
436 name="Countertop",
437 description="Create a countertop automatically (only default cabinet height)",
438 default=True,
440 counterheight: FloatProperty(
441 name='height', min=0.001, max=10,
442 default=0.02, precision=3,
443 description='Countertop height',
445 counterextend: FloatProperty(
446 name='extend', min=0.001, max=10,
447 default=0.03, precision=3,
448 description='Countertop extent',
451 fitZ: BoolProperty(
452 name="Floor origin in Z=0",
453 description="Use Z=0 axis as vertical origin floor position",
454 default=True,
456 moveZ: FloatProperty(
457 name='Z position', min=0.001, max=10,
458 default=1.5, precision=3,
459 description='Wall cabinet Z position from floor',
462 cabinet_num: IntProperty(
463 name='Number of Cabinets', min=1, max=30,
464 default=1,
465 description='Number total of cabinets in the Kitchen',
467 cabinets: CollectionProperty(type=CabinetProperties)
469 # Materials
470 crt_mat: BoolProperty(
471 name="Create default Cycles materials",
472 description="Create default materials for Cycles render",
473 default=True,
476 # -----------------------------------------------------
477 # Draw (create UI interface)
478 # -----------------------------------------------------
479 # noinspection PyUnusedLocal
480 def draw(self, context):
481 layout = self.layout
482 space = bpy.context.space_data
483 if not space.local_view:
484 # Imperial units warning
485 if bpy.context.scene.unit_settings.system == "IMPERIAL":
486 row = layout.row()
487 row.label(text="Warning: Imperial units not supported", icon='COLOR_RED')
489 box = layout.box()
490 row = box.row()
491 row.prop(self, 'type_cabinet')
493 row.prop(self, 'thickness')
494 row = box.row()
495 row.prop(self, 'depth')
496 row.prop(self, 'height')
497 row = box.row()
498 row.prop(self, 'handle')
499 if self.handle != "9":
500 row.prop(self, 'handle_x')
501 row.prop(self, 'handle_z')
503 if self.type_cabinet == "1":
504 row = box.row()
505 row.prop(self, "countertop")
506 if self.countertop:
507 row.prop(self, "counterheight")
508 row.prop(self, "counterextend")
509 row = box.row()
510 row.prop(self, 'baseboard')
511 if self.baseboard:
512 row.prop(self, 'baseheight')
513 row.prop(self, 'basefactor', slider=True)
515 row = box.row()
516 row.prop(self, 'fitZ')
517 if self.type_cabinet == "2":
518 row.prop(self, 'moveZ')
520 # Cabinet number
521 row = box.row()
522 row.prop(self, 'cabinet_num')
523 # Add menu for cabinets
524 if self.cabinet_num > 0:
525 for idx in range(0, self.cabinet_num):
526 box = layout.box()
527 add_cabinet(self, box, idx + 1, self.cabinets[idx])
529 box = layout.box()
530 if not context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}:
531 box.enabled = False
532 box.prop(self, 'crt_mat')
533 else:
534 row = layout.row()
535 row.label(text="Warning: Operator does not work in local view mode", icon='ERROR')
537 # -----------------------------------------------------
538 # Execute
539 # -----------------------------------------------------
540 # noinspection PyUnusedLocal
541 def execute(self, context):
542 if bpy.context.mode == "OBJECT":
543 # Set default values
544 if self.oldtype != self.type_cabinet:
545 if self.type_cabinet == "1": # Floor
546 self.depth = 0.59
547 self.height = 0.70
549 if self.type_cabinet == "2": # Wall
550 self.depth = 0.35
551 self.height = 0.70
552 self.oldtype = self.type_cabinet
554 # Create all elements
555 for i in range(len(self.cabinets) - 1, self.cabinet_num):
556 self.cabinets.add()
558 # Create cabinets
559 create_kitchen_mesh(self)
560 return {'FINISHED'}
561 else:
562 self.report({'WARNING'}, "Archimesh: Option only valid in Object mode")
563 return {'CANCELLED'}
566 # -----------------------------------------------------
567 # Add cabinet parameters
568 # -----------------------------------------------------
569 def add_cabinet(self, box, num, cabinet):
570 doortype = cabinet.dType
571 row = box.row()
572 row.label(text="Cabinet " + str(num))
573 row.prop(cabinet, 'sX')
575 row = box.row()
576 row.prop(cabinet, 'wY')
577 row.prop(cabinet, 'wZ')
578 row.prop(cabinet, 'rotate')
580 row = box.row()
581 row.prop(cabinet, 'pX')
582 row.prop(cabinet, 'pY')
583 row.prop(cabinet, 'pZ')
585 row = box.row()
586 row.prop(cabinet, 'dType')
587 if doortype == "7": # Drawers
588 row.prop(cabinet, 'dNum') # drawers number
589 else:
590 row.prop(cabinet, 'sNum') # shelves number
591 # Glass ratio
592 if doortype == "4" or doortype == "5" or doortype == "6" or doortype == "11":
593 row.prop(cabinet, 'gF', slider=True) # shelves number
594 # Handle
595 row = box.row()
596 if self.handle != "9":
597 row.prop(cabinet, 'hand')
598 if self.baseboard and self.type_cabinet == "1":
599 row.prop(cabinet, 'bL')
600 row.prop(cabinet, 'bR')
602 if self.countertop and self.type_cabinet == "1":
603 row = box.row()
604 row.prop(cabinet, 'tC')
605 row.prop(cabinet, 'tE')
608 # ------------------------------------------------------------------------------
609 # Generate mesh data
610 # All custom values are passed using self container (self.myvariable)
611 # ------------------------------------------------------------------------------
612 def create_kitchen_mesh(self):
613 # deactivate others
614 for o in bpy.data.objects:
615 if o.select_get() is True:
616 o.select_set(False)
617 bpy.ops.object.select_all(action='DESELECT')
618 # Create cabinets
619 generate_cabinets(self)
621 return
624 # ------------------------------------------------------------------------------
625 # Generate cabinet
626 # All custom values are passed using self container (self.myvariable)
627 # ------------------------------------------------------------------------------
628 def generate_cabinets(self):
630 boxes = []
631 bases = []
632 location = bpy.context.scene.cursor.location
633 myloc = copy(location) # copy location to keep 3D cursor position
634 # Fit to floor
635 if self.fitZ:
636 myloc[2] = 0
637 # Move to wall position
638 if self.type_cabinet == "2": # wall
639 myloc[2] = myloc[2] + self.moveZ
640 # Baseboard
641 if self.type_cabinet == "1" and self.baseboard: # floor
642 myloc[2] = myloc[2] + self.baseheight # add baseboard position for bottom
644 # Create cabinets
645 lastx = myloc[0]
646 lasty = myloc[1]
647 lastrot = 0 # last rotation
648 # ------------------------------------------------------------------------------
649 # Cabinets
651 # By default all cabinets are created in X axis and later are rotated if needed
652 # the default rotation means keep last rotation, not 0, so if the previous
653 # cabinet is 90CW, the next one will be the same. To back to 0, you must select
654 # 90 CCW.
655 # ------------------------------------------------------------------------------
656 for i in range(0, self.cabinet_num):
657 mydata = create_box(self.type_cabinet, "Cabinet" + str(i + 1),
658 self.thickness,
659 self.cabinets[i].sX, self.depth + self.cabinets[i].wY, self.height + self.cabinets[i].wZ,
660 self.cabinets[i].pX + lastx,
661 self.cabinets[i].pY + lasty,
662 myloc[2] + self.cabinets[i].pZ,
663 self.cabinets[i].dType, self.cabinets[i].dNum, self.cabinets[i].sNum, self.cabinets[i].gF,
664 self.crt_mat,
665 self.cabinets[i].hand, self.handle, self.handle_x, self.handle_z, self.depth)
666 mybox = mydata[0]
667 # LastX is the sum of initial position + width of the cabinet.
668 lastx = mydata[1]
669 # add SKU property
670 sku = createunitsku(self, self.cabinets[i])
671 mydata[0]["archimesh.sku"] = sku
673 # Save rotation type
674 myrotationtype = int(self.cabinets[i].rotate)
676 # ---------------------------------------------------------
677 # Calculate new rotation angle
679 # ---------------------------------------------------------
680 myrot = lastrot
681 # ----------
682 # Default
683 # ----------
684 if myrotationtype == RotationType_Default:
685 myrot = myrot # do no change rotation
686 # ----------
687 # 90 CW
688 # ----------
689 if myrotationtype == RotationType_R90CW:
690 myrot += -pi / 2
691 # ----------
692 # 90 CCW
693 # ----------
694 if myrotationtype == RotationType_R90CCW:
695 myrot += pi / 2
696 # ----------
697 # 180
698 # ----------
699 if myrotationtype == RotationType_R180:
700 myrot = myrot + pi
702 # Save the rotation for next cabinet
703 lastrot = myrot
704 angle = myrot - ((2 * pi) * (myrot // (2 * pi))) # clamp one revolution
706 # -------------------------------------------
707 # Countertop (only default height cabinet)
708 # 9-Default, 1-90CW, 2-90CCW, 3-180
709 # -------------------------------------------
710 if self.countertop and self.type_cabinet == "1" and self.cabinets[i].wZ == 0:
711 w = self.cabinets[i].sX
712 # fill (depend on orientation)
713 if self.cabinets[i].tC:
714 # 0 or 180 degrees
715 if angle == 0 or angle == pi:
716 w += fabs(self.cabinets[i].pX)
717 # 90 or 270 degrees
718 if angle == (3 * pi) / 2 or angle == pi / 2:
719 w += fabs(self.cabinets[i].pY)
721 mycountertop = create_countertop("Countertop" + str(i + 1),
723 self.depth + self.cabinets[i].wY,
724 self.counterheight, self.counterextend,
725 self.crt_mat, self.cabinets[i].dType, self.depth,
726 self.cabinets[i].tE)
727 # -------------------------------
728 # Fill countertop spaces
729 # -------------------------------
730 if self.cabinets[i].tC:
731 # Default
732 if angle == 0:
733 if self.cabinets[i].pX >= 0:
734 mycountertop.location[0] = -self.cabinets[i].pX
735 else:
736 mycountertop.location[0] = 0
738 # 90CW
739 if angle == (3 * pi) / 2:
740 if self.cabinets[i].pY >= 0:
741 mycountertop.location[0] = 0
742 else:
743 mycountertop.location[0] = self.cabinets[i].pY
744 # 90CCW
745 if angle == pi / 2:
746 if self.cabinets[i].pY >= 0:
747 mycountertop.location[0] = self.cabinets[i].pY * -1
748 else:
749 mycountertop.location[0] = 0
750 # 180
751 if angle == pi:
752 mycountertop.location[0] = 0
754 mycountertop.location[2] = self.height
755 mycountertop.parent = mydata[0]
756 # --------------------
757 # add countertop SKU
758 # --------------------
759 t = w
760 # if corner, remove size
761 if self.cabinets[i].dType == "9" or self.cabinets[i].dType == "10":
762 t = t - self.cabinets[i].sX
764 mycountertop["archimesh.top_sku"] = "T%06.3fx%06.3fx%06.3f-%06.3f" % (t,
765 self.depth + self.cabinets[
766 i].wY + self.counterextend,
767 self.counterheight,
769 # ----------------
770 # Baseboard
771 # ----------------
772 if self.baseboard and self.type_cabinet == "1":
773 gap = (self.depth + self.cabinets[i].wY) - ((self.depth + self.cabinets[i].wY) * self.basefactor)
774 mybase = create_baseboard("Baseboard" + str(i + 1),
775 self.cabinets[i].sX, self.thickness, self.baseheight,
776 self.crt_mat, self.cabinets[i].bL, self.cabinets[i].bR,
777 (self.depth + self.cabinets[i].wY) * self.basefactor, self.cabinets[i].dType, gap)
778 bases.extend([mybase])
779 mybase.location[1] = (self.depth + self.cabinets[i].wY) * self.basefactor * -1
780 mybase.location[2] = -self.baseheight
781 mybase.parent = mydata[0]
782 # --------------------
783 # add base SKU
784 # --------------------
785 t = self.cabinets[i].sX
786 # Add sides
787 if self.cabinets[i].bR is True:
788 t = t + (self.depth + self.cabinets[i].wY) * self.basefactor
789 if self.cabinets[i].bL is True:
790 t = t + (self.depth + self.cabinets[i].wY) * self.basefactor
792 mybase["archimesh.base_sku"] = "B%06.3fx%06.3fx%06.3f" % (t, self.thickness, self.baseheight)
794 # Rotate
795 mybox.rotation_euler = (0, 0, myrot)
797 # -----------------------------------------
798 # Calculate new position for next cabinet
799 # -----------------------------------------
800 xm = 0
801 ym = 0
803 # 0 degrees
804 if angle == 0:
805 lastx = lastx
806 lasty = lasty
807 # 90 degrees
808 if angle == pi / 2:
809 ym = -self.cabinets[i].sX
810 lastx = lastx - self.cabinets[i].sX - self.cabinets[i].pX
811 lasty = lasty + self.cabinets[i].sX + self.cabinets[i].pY
812 # 180 degrees
813 if angle == pi:
814 lastx -= 2 * (self.cabinets[i].sX + self.cabinets[i].pX)
815 # 270 degrees
816 if angle == (3 * pi) / 2:
817 xm = self.depth - self.counterextend
818 lastx = lastx - self.cabinets[i].sX - self.cabinets[i].pX
819 lasty = lasty - self.cabinets[i].sX - self.cabinets[i].pX + self.cabinets[i].pY
821 myl = mybox.location
822 # noinspection PyUnresolvedReferences
823 mybox.location = (myl.x + xm, myl.y + ym, myl.z)
825 # ---------------------------------------
826 # Save box
827 # ---------------------------------------
828 boxes.extend([mybox])
830 # refine cabinets
831 for box in boxes:
832 remove_doubles(box)
833 set_normals(box)
835 # refine baseboard
836 for base in bases:
837 remove_doubles(base)
838 set_normals(base)
840 # Create materials
841 if self.crt_mat and bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}:
842 mat = create_diffuse_material("Cabinet_material", False, 0.8, 0.8, 0.8)
843 for box in boxes:
844 set_material(box, mat)
846 return
849 # ------------------------------------------------------------------------------
850 # Create cabinet box
852 # thickness: wood thickness
853 # sX: Size in X axis
854 # sY: Size in Y axis
855 # sZ: Size in Z axis
856 # pX: position X axis
857 # pY: position Y axis
858 # pZ: position Z axis
859 # doorType: Type of door or drawers
860 # drawers: Number of drawers
861 # shelves: Number of shelves
862 # gF: Glass size factor
863 # mat: Flag for creating materials
864 # handle: handle visibility flag
865 # handle_model: Type of handle
866 # handle_x: Position of handle in X axis
867 # handle_z: Position of handle in Z axis
868 # depth: Default depth
869 # ------------------------------------------------------------------------------
870 def create_box(type_cabinet, objname, thickness, sx, sy, sz, px, py, pz, doortype, drawers, shelves, gf, mat,
871 handle, handle_model, handle_x, handle_z, depth):
872 myvertex = []
873 myfaces = []
874 # external faces
875 myvertex.extend(
876 [(0, 0, 0), (0, -sy, 0), (0, -sy, sz), (0, 0, sz), (sx, 0, 0), (sx, -sy, 0), (sx, -sy, sz), (sx, 0, sz)])
877 myfaces.extend([(0, 1, 2, 3), (4, 5, 6, 7), (0, 4, 7, 3), (0, 1, 5, 4), (3, 2, 6, 7)])
879 # internal faces
880 myvertex.extend([(thickness, -thickness, thickness), (thickness, -sy, thickness),
881 (thickness, -sy, sz - thickness), (thickness, -thickness, sz - thickness),
882 (sx - thickness, -thickness, thickness), (sx - thickness, -sy, thickness),
883 (sx - thickness, -sy, sz - thickness), (sx - thickness, -thickness, sz - thickness)])
885 myfaces.extend([(8, 9, 10, 11), (12, 13, 14, 15), (8, 12, 15, 11), (8, 9, 13, 12), (11, 10, 14, 15)])
886 myfaces.extend([(1, 9, 10, 2), (2, 6, 14, 10), (6, 5, 13, 14), (5, 1, 9, 13)])
888 # -----------------
889 # shelves
890 # -----------------
891 v = 16 # vertice number
892 if doortype != "7": # Drawers
893 # calculate separation
894 dist = sz - (thickness * 2)
895 space = dist / (shelves + 1)
896 posz1 = thickness + space
898 for x in range(shelves):
899 posz2 = posz1 - thickness
900 myvertex.extend([(thickness, -thickness, posz1), (thickness, -sy, posz1),
901 (thickness, -sy, posz2), (thickness, -thickness, posz2),
902 (sx - thickness, -thickness, posz1), (sx - thickness, -sy, posz1),
903 (sx - thickness, -sy, posz2), (sx - thickness, -thickness, posz2)])
905 myfaces.extend([(v, v + 1, v + 2, v + 3), (v + 4, v + 5, v + 6, v + 7), (v, v + 4, v + 7, v + 3),
906 (v, v + 1, v + 5, v + 4), (v + 3, v + 2, v + 6, v + 7), (v + 1, v + 2, v + 6, v + 5)])
907 v += 8
908 posz1 += space
910 mymesh = bpy.data.meshes.new(objname)
911 myobject = bpy.data.objects.new(objname, mymesh)
913 myobject.location[0] = px
914 myobject.location[1] = py
915 myobject.location[2] = pz
916 bpy.context.collection.objects.link(myobject)
918 mymesh.from_pydata(myvertex, [], myfaces)
919 mymesh.update(calc_edges=True)
921 # ---------------------------------------
922 # Drawers
923 # ---------------------------------------
924 if doortype == "7": # Drawers
925 # calculate separation
926 gap = 0.001
927 dist = sz - (gap * drawers)
928 space = dist / drawers
929 posz1 = 0
931 for x in range(drawers):
932 mydrawer = create_drawer("Drawer", thickness, sx, sy, space, mat, handle,
933 handle_model, handle_z)
934 mydrawer.location[1] = -sy
935 mydrawer.location[2] = posz1
936 mydrawer.parent = myobject
937 remove_doubles(mydrawer)
938 set_normals(mydrawer)
939 posz1 = posz1 + space + gap # gap
941 # ---------------------------------------
942 # Doors
943 # ---------------------------------------
944 if doortype != "99" and doortype != "7": # None or Drawers
945 if doortype == "1" or doortype == "2" or doortype == "3" or doortype == "4" \
946 or doortype == "5" or doortype == "6": # single door
947 mydoor = create_door(type_cabinet, objname + "_Door", thickness, sx, sz, doortype, gf, mat, handle,
948 handle_model, handle_x, handle_z, 0.001)
949 mydoor.parent = myobject
950 mydoor.location[1] = -sy - 0.001 # add 1 mm gap
951 remove_doubles(mydoor)
952 set_normals(mydoor)
954 else: # double doors
955 if doortype == "8" or doortype == "10" or doortype == "11":
956 # Glass or not
957 if doortype != "11":
958 typ = "2"
959 else:
960 typ = "5"
962 # Adjust corner doors
963 dwidth = sx / 2
964 if doortype == "10":
965 dwidth = sx - depth - thickness - 0.001
967 mydoor1 = create_door(type_cabinet, objname + "_Door_L", thickness, dwidth, sz, typ, gf, mat,
968 handle,
969 handle_model, handle_x, handle_z, 0.0005) # left
970 mydoor1.location[1] = -sy - 0.001 # add 1 mm gap
971 mydoor1.parent = myobject
972 remove_doubles(mydoor1)
973 set_normals(mydoor1)
975 if doortype == "8" or doortype == "9" or doortype == "11":
976 # Glass or not
977 if doortype != "11":
978 typ = "1"
979 else:
980 typ = "4"
982 # Adjust corner doors
983 dwidth = sx / 2
984 if doortype == "9":
985 dwidth = sx - depth - thickness - 0.001
987 mydoor2 = create_door(type_cabinet, objname + "_Door_R", thickness, dwidth, sz, typ, gf, mat,
988 handle,
989 handle_model, handle_x, handle_z, 0.0005) # right
990 mydoor2.location[1] = -sy - 0.001 # add 1 mm gap
991 mydoor2.location[0] = sx
992 mydoor2.parent = myobject
993 remove_doubles(mydoor2)
994 set_normals(mydoor2)
996 return myobject, px + sx
999 # ------------------------------------------------------------------------------
1000 # Create baseboard
1002 # sX: Size in X axis
1003 # sY: Size in Y axis
1004 # sZ: Size in Z axis
1005 # mat: Flag for creating materials
1006 # bL: Flag to create left side
1007 # bR: Flag to create right side
1008 # depth: depth or position of baseboard
1009 # gap: space to close in corners
1010 # ------------------------------------------------------------------------------
1011 def create_baseboard(objname, sx, sy, sz, mat, bl, br, depth, doortype, gap):
1012 myvertex = []
1013 myfaces = []
1014 p = 0
1015 # external faces
1016 myvertex.extend(
1017 [(0, 0, 0), (0, -sy, 0), (0, -sy, sz), (0, 0, sz), (sx, 0, 0), (sx, -sy, 0), (sx, -sy, sz), (sx, 0, sz)])
1018 myfaces.extend([(0, 1, 2, 3), (4, 5, 6, 7), (0, 4, 7, 3), (0, 1, 5, 4), (3, 2, 6, 7), (1, 5, 6, 2)])
1019 # left side
1020 f = 8
1021 if bl:
1022 myvertex.extend(
1023 [(0, 0, 0), (0, depth, 0), (0, depth, sz), (0, 0, sz), (sy, 0, 0), (sy, depth, 0), (sy, depth, sz),
1024 (sy, 0, sz)])
1025 myfaces.extend(
1026 [(f, f + 1, f + 2, f + 3), (f + 4, f + 5, f + 6, f + 7), (f, f + 4, f + 7, f + 3), (f, f + 1, f + 5, f + 4),
1027 (f + 3, f + 2, f + 6, f + 7), (f + 1, f + 5, f + 6, f + 2)])
1028 f += 8
1029 # right side
1030 if br:
1031 p = sx - sy
1032 myvertex.extend([(p, 0, 0), (p, depth, 0), (p, depth, sz), (p, 0, sz), (p + sy, 0, 0), (p + sy, depth, 0),
1033 (p + sy, depth, sz), (p + sy, 0, sz)])
1034 myfaces.extend(
1035 [(f, f + 1, f + 2, f + 3), (f + 4, f + 5, f + 6, f + 7), (f, f + 4, f + 7, f + 3), (f, f + 1, f + 5, f + 4),
1036 (f + 3, f + 2, f + 6, f + 7), (f + 1, f + 5, f + 6, f + 2)])
1037 f += 8
1038 # Corners
1039 if doortype == "9" or doortype == "10":
1040 if doortype == "9":
1041 p = depth + sy
1042 if doortype == "10":
1043 p = sx - depth - sy
1045 size = gap * -2
1046 myvertex.extend([(p, -sy, 0), (p, size, 0), (p, size, sz), (p, -sy, sz), (p + sy, -sy, 0), (p + sy, size, 0),
1047 (p + sy, size, sz), (p + sy, -sy, sz)])
1048 myfaces.extend(
1049 [(f, f + 1, f + 2, f + 3), (f + 4, f + 5, f + 6, f + 7), (f, f + 4, f + 7, f + 3), (f, f + 1, f + 5, f + 4),
1050 (f + 3, f + 2, f + 6, f + 7), (f + 1, f + 5, f + 6, f + 2)])
1052 mymesh = bpy.data.meshes.new(objname)
1053 mybaseboard = bpy.data.objects.new(objname, mymesh)
1055 mybaseboard.location[0] = 0
1056 mybaseboard.location[1] = 0
1057 mybaseboard.location[2] = 0
1058 bpy.context.collection.objects.link(mybaseboard)
1060 mymesh.from_pydata(myvertex, [], myfaces)
1061 mymesh.update(calc_edges=True)
1063 # Material
1064 if mat and bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}:
1065 mat = create_diffuse_material("Baseboard_material", False, 0.8, 0.8, 0.8)
1066 set_material(mybaseboard, mat)
1068 return mybaseboard
1071 # ------------------------------------------------------------------------------
1072 # Create Countertop
1074 # sX: Size in X axis
1075 # sY: Size in Y axis
1076 # sZ: Size in Z axis
1077 # mat: Flag for creating materials
1078 # doorType: Type of door
1079 # depth: Depth of the cabinets
1080 # edge: add countertop edge
1081 # ------------------------------------------------------------------------------
1082 def create_countertop(objname, sx, sy, sz, over, mat, doortype, depth, edge):
1083 oy = 0.02
1084 oz = 0.05 + sz
1086 myvertex = []
1087 myfaces = []
1088 # if corner the size is less
1089 ts = 0
1090 tx = sx
1092 if doortype == "9":
1093 ts = sx - (sx - over - depth)
1094 tx = sx
1096 if doortype == "10":
1097 ts = 0
1098 tx = sx - over - depth
1100 # external faces
1101 myvertex.extend([(ts, 0, 0), (ts, -sy - over, 0), (ts, -sy - over, sz), (ts, 0, sz),
1102 (tx, 0, 0), (tx, -sy - over, 0), (tx, -sy - over, sz), (tx, 0, sz)])
1103 myfaces.extend([(0, 1, 2, 3), (4, 5, 6, 7), (0, 4, 7, 3), (0, 1, 5, 4), (3, 2, 6, 7), (1, 5, 6, 2)])
1104 # Back
1105 ts = 0
1106 tx = sx
1108 if doortype == "9":
1109 ts = oy
1111 if doortype == "10":
1112 tx -= oy
1113 # Add edge
1114 if edge is True:
1115 myvertex.extend([(ts, 0, sz), (ts, -oy, sz), (ts, -oy, oz), (ts, 0, oz),
1116 (tx, 0, sz), (tx, -oy, sz), (tx, -oy, oz), (tx, 0, oz)])
1117 myfaces.extend(
1118 [(8, 9, 10, 11), (12, 13, 14, 15), (8, 12, 15, 11), (8, 9, 13, 12), (11, 10, 14, 15), (9, 13, 14, 10)])
1120 mymesh = bpy.data.meshes.new(objname)
1121 mycountertop = bpy.data.objects.new(objname, mymesh)
1123 mycountertop.location[0] = 0
1124 mycountertop.location[1] = 0
1125 mycountertop.location[2] = 0
1126 bpy.context.collection.objects.link(mycountertop)
1128 mymesh.from_pydata(myvertex, [], myfaces)
1129 mymesh.update(calc_edges=True)
1131 # Material
1132 if mat and bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}:
1133 mat = create_diffuse_material("countertop_material", False, 0, 0, 0, 0.2, 0.2, 0.2, 0.15)
1134 set_material(mycountertop, mat)
1136 return mycountertop
1139 # ------------------------------------------------------------------------------
1140 # Create cabinet door
1142 # type_cabinet: Type of cabinet (floor or wall)
1143 # objName: Name of the created object
1144 # thickness: wood thickness
1145 # sX: Size in X axis
1146 # sY: Size in Y axis
1147 # sZ: Size in Z axis
1148 # doorType: Type of door or drawers
1149 # gF: Glass size factor
1150 # mat: Flag for creating materials
1151 # handle: handle visibility flag
1152 # handle_model: Type of handle
1153 # handle_x: Position of handle in X axis
1154 # handle_z: Position of handle in Z axis
1155 # gapX: size of the horizontal gap
1156 # ------------------------------------------------------------------------------
1157 def create_door(type_cabinet, objname, thickness, sx, sz, doortype, gf, mat, handle, handle_model, handle_x,
1158 handle_z, gapx):
1160 myvertex = []
1161 myfaces = []
1163 # Left open
1164 f = -1 # right
1165 if doortype == "2" or doortype == "5" or doortype == "10":
1166 f = 1
1167 # add small gap in width
1168 sx = sx - gapx
1169 # add small gap in top zone
1170 sz -= 0.002
1171 # External Frame
1172 myvertex.extend([(0, 0, 0), (0, -thickness, 0), (0, -thickness, sz), (0, 0, sz), (sx * f, 0, 0),
1173 (sx * f, -thickness, 0), (sx * f, -thickness, sz), (sx * f, 0, sz)])
1174 myfaces.extend([(0, 1, 2, 3), (4, 5, 6, 7), (0, 1, 5, 4), (3, 2, 6, 7)])
1175 # ---------------
1176 # Solid door
1177 # ---------------
1178 if doortype == "1" or doortype == "2" or doortype == "3" \
1179 or doortype == "8" or doortype == "9" or doortype == "10":
1180 myfaces.extend([(0, 4, 7, 3), (1, 2, 6, 5)])
1181 # ---------------
1182 # Glass door
1183 # ---------------
1184 if doortype == "4" or doortype == "5" or doortype == "6" or doortype == "11":
1185 w = sx * gf # calculate frame size W
1186 h = sz * gf # calculate frame size V
1188 myvertex.extend([(w * f, 0, h), (w * f, -thickness, h), (w * f, -thickness, sz - h), (w * f, 0, sz - h),
1189 ((sx - w) * f, 0, h),
1190 ((sx - w) * f, -thickness, h), ((sx - w) * f, -thickness, sz - h), ((sx - w) * f, 0, sz - h)])
1191 myfaces.extend([(8, 9, 10, 11), (12, 13, 14, 15), (8, 11, 15, 12), (10, 11, 15, 14), (8, 12, 13, 9),
1192 (1, 9, 10, 2), (5, 13, 14, 6), (6, 2, 10, 14), (5, 1, 9, 13),
1193 (0, 3, 11, 8), (12, 15, 7, 4), (4, 0, 8, 12), (11, 3, 7, 15)])
1195 mymesh = bpy.data.meshes.new(objname)
1196 mydoor = bpy.data.objects.new(objname, mymesh)
1197 if f == -1:
1198 mydoor.location[0] = sx
1199 else:
1200 mydoor.location[0] = 0
1202 mydoor.location[1] = 0
1203 mydoor.location[2] = 0
1204 bpy.context.collection.objects.link(mydoor)
1206 mymesh.from_pydata(myvertex, [], myfaces)
1207 mymesh.update(calc_edges=True)
1209 # ----------------------------------------------
1210 # Handles
1211 # RT: Put handle in right side top
1212 # LT: Put handle in left side top
1213 # RB: Put handle in right side bottom
1214 # LB: Put handle in left side bottom
1215 # T: Put handle in top side middle
1216 # B: Put handle in bottom side middle
1218 # The position is reverse to the open direction
1219 # of the door
1220 # ----------------------------------------------
1221 hpos = "RT" # Right by default
1222 if handle:
1223 # -----------------
1224 # Floor units
1225 # -----------------
1226 if type_cabinet == "1":
1227 if doortype == "1" or doortype == "4" or doortype == "9": # Right
1228 hpos = "LT"
1229 if doortype == "2" or doortype == "5" or doortype == "10": # Left
1230 hpos = "RT"
1231 if doortype == "3" or doortype == "6":
1232 hpos = "T"
1233 # -----------------
1234 # Wall units
1235 # -----------------
1236 if type_cabinet == "2":
1237 if doortype == "1" or doortype == "4" or doortype == "9": # Right
1238 hpos = "LB"
1239 if doortype == "2" or doortype == "5" or doortype == "10": # Left
1240 hpos = "RB"
1241 if doortype == "3" or doortype == "6":
1242 hpos = "B"
1244 create_handle(handle_model, mydoor, thickness, hpos, mat, handle_x, handle_z)
1246 if mat and bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}:
1247 # Door material
1248 mat = create_diffuse_material("Door_material", False, 0.8, 0.8, 0.8, 0.279, 0.337, 0.6, 0.2)
1249 set_material(mydoor, mat)
1250 # Add Glass
1251 if doortype == "4" or doortype == "5" or doortype == "6" or doortype == "11":
1252 mat = create_glass_material("DoorGlass_material", False)
1253 mydoor.data.materials.append(mat)
1254 select_faces(mydoor, 6, True)
1255 set_material_faces(mydoor, 1)
1257 # Limit rotation axis
1258 if hpos != "T" and hpos != "TM" and hpos != "B":
1259 mydoor.lock_rotation = (True, True, False)
1261 return mydoor
1264 # ------------------------------------------------------------------------------
1265 # Create drawers
1267 # thickness: wood thickness
1268 # sX: Size in X axis
1269 # sY: Size in Y axis
1270 # sZ: Size in Z axis
1271 # mat: Flag for creating materials
1272 # handle: handle visibility flag
1273 # handle_model: Type of handle
1274 # handle_z: Position of handle in Z axis
1275 # ------------------------------------------------------------------------------
1276 def create_drawer(objname, thickness, sx, sy, sz, mat, handle, handle_model, handle_z):
1277 myvertex = []
1278 myfaces = []
1279 # Front face
1280 myvertex.extend([(0, 0, 0), (0, -thickness, 0), (0, -thickness, sz), (0, 0, sz), (sx, 0, 0), (sx, -thickness, 0),
1281 (sx, -thickness, sz), (sx, 0, sz)])
1282 myfaces.extend([(0, 1, 2, 3), (4, 5, 6, 7), (0, 4, 7, 3), (0, 1, 5, 4), (3, 2, 6, 7), (1, 2, 6, 5)])
1284 # internal faces (thickness cm gap)
1285 myvertex.extend([(thickness, 0, thickness),
1286 (thickness, sy - thickness, thickness),
1287 (sx - thickness, sy - thickness, thickness),
1288 (sx - thickness, 0, thickness),
1289 (thickness * 2, 0, thickness),
1290 (thickness * 2, sy - thickness * 2, thickness),
1291 (sx - thickness * 2, sy - thickness * 2, thickness),
1292 (sx - thickness * 2, 0, thickness)])
1294 myfaces.extend([(8, 9, 13, 12), (13, 9, 10, 14), (14, 10, 11, 15), (12, 13, 14, 15)])
1295 h = sz * 0.7
1296 myvertex.extend([(thickness, 0, h),
1297 (thickness, sy - thickness, h),
1298 (sx - thickness, sy - thickness, h),
1299 (sx - thickness, 0, h),
1300 (thickness * 2, 0, h),
1301 (thickness * 2, sy - thickness * 2, h),
1302 (sx - thickness * 2, sy - thickness * 2, h),
1303 (sx - thickness * 2, 0, h)])
1304 myfaces.extend(
1305 [(16, 17, 21, 20), (21, 17, 18, 22), (22, 18, 19, 23), (8, 9, 17, 16), (9, 10, 18, 17), (10, 11, 19, 18),
1306 (12, 13, 21, 20), (13, 14, 22, 21), (14, 15, 23, 22)])
1308 mymesh = bpy.data.meshes.new(objname)
1309 mydrawer = bpy.data.objects.new(objname, mymesh)
1311 mydrawer.location[0] = 0
1312 mydrawer.location[1] = 0
1313 mydrawer.location[2] = 0
1314 bpy.context.collection.objects.link(mydrawer)
1316 mymesh.from_pydata(myvertex, [], myfaces)
1317 mymesh.update(calc_edges=True)
1319 # Handle
1320 if handle:
1321 model = handle_model
1322 # Drawers always horizontal handle, so override values
1323 if model == "1":
1324 model = "3"
1326 if model == "4":
1327 model = "2"
1329 create_handle(model, mydrawer, thickness, "TM", mat, 0, handle_z) # always in the top area/middle
1331 # Material
1332 if mat and bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}:
1333 mat = create_diffuse_material("Drawer_material", False, 0.8, 0.8, 0.8, 0.6, 0.6, 0.6, 0.2)
1334 set_material(mydrawer, mat)
1336 # Lock transformation
1337 mydrawer.lock_location = (True, False, True) # only Y axis
1339 return mydrawer
1342 # ------------------------------------------------------------------------------
1343 # Create Handles
1345 # model: handle model
1346 # myDoor: Door that has the handle
1347 # thickness: thickness of board
1348 # handle_position: position of the handle
1349 # RT: Put handle in right side top
1350 # LT: Put handle in left side top
1351 # RB: Put handle in right side bottom
1352 # LB: Put handle in left side bottom
1353 # T: Put handle in top side middle
1354 # TM: Put handle in top side middle (drawers)
1355 # B: Put handle in bottom side middle
1356 # mat: create default cycles material
1357 # handle_x: Position of handle in X axis
1358 # handle_z: Position of handle in Z axis
1359 # ------------------------------------------------------------------------------
1360 def create_handle(model, mydoor, thickness, handle_position, mat, handle_x, handle_z):
1361 if model == "9":
1362 return None
1364 # Retry mesh data
1365 if model == "1" or model == "3":
1366 mydata = handle_model_01()
1367 elif model == "2" or model == "4":
1368 mydata = handle_model_02()
1369 elif model == "5":
1370 mydata = handle_model_05()
1371 elif model == "6":
1372 mydata = handle_model_06()
1373 elif model == "7":
1374 mydata = handle_model_07()
1375 elif model == "8":
1376 mydata = handle_model_08()
1377 else:
1378 mydata = handle_model_01() # default model
1380 # move data
1381 myvertex = mydata[0]
1382 myfaces = mydata[1]
1384 mymesh = bpy.data.meshes.new("Handle")
1385 myhandle = bpy.data.objects.new("Handle", mymesh)
1387 bpy.context.collection.objects.link(myhandle)
1389 mymesh.from_pydata(myvertex, [], myfaces)
1390 mymesh.update(calc_edges=True)
1392 # Position handle
1393 myhandle.location.y = -thickness
1394 # Calculate dimensions
1395 if model == "1" or model == "4" or model == "5" or model == "6":
1396 width = myhandle.dimensions.z / 2
1397 height = myhandle.dimensions.x / 2
1398 else:
1399 width = myhandle.dimensions.x / 2
1400 height = myhandle.dimensions.z / 2
1401 # Limit handle position to door dimensions
1402 if handle_x + width > mydoor.dimensions.x:
1403 handle_x = mydoor.dimensions.x - 0.01
1405 if handle_z + height > mydoor.dimensions.z:
1406 handle_z = mydoor.dimensions.z - 0.01
1408 # Position in X axis
1409 if handle_position == "LT" or handle_position == "LB":
1410 myhandle.location.x = -mydoor.dimensions.x + handle_x + width
1412 if handle_position == "RT" or handle_position == "RB":
1413 myhandle.location.x = mydoor.dimensions.x - handle_x - width
1415 # Position in Z axis
1416 if handle_position == "RT" or handle_position == "LT":
1417 if mydoor.dimensions.z - handle_z - height > 1.2:
1418 myhandle.location.z = 1.2
1419 else:
1420 myhandle.location.z = mydoor.dimensions.z - handle_z - height
1422 if handle_position == "RB" or handle_position == "LB":
1423 myhandle.location.z = handle_z + height
1425 # Position for Middle point
1426 if handle_position == "T" or handle_position == "B":
1427 myhandle.location.x = -mydoor.dimensions.x / 2
1429 if handle_position == "TM":
1430 myhandle.location.x = mydoor.dimensions.x / 2
1432 if handle_position == "T" or handle_position == "TM":
1433 myhandle.location.z = mydoor.dimensions.z - handle_z - height
1435 if handle_position == "B":
1436 myhandle.location.z = handle_z - height
1438 # rotate
1439 if handle_position != "T" and handle_position != "B" and handle_position != "TM":
1440 yrot = 0
1441 if model == "1":
1442 yrot = pi / 2
1444 if model == "4":
1445 if handle_position == "LT" or handle_position == "LB":
1446 yrot = -pi / 2
1447 else:
1448 yrot = pi / 2
1450 myhandle.rotation_euler = (0, yrot, 0.0) # radians PI=180
1452 # parent
1453 myhandle.parent = mydoor
1454 # Materials
1455 if mat and bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}:
1456 mat = create_glossy_material("Handle_material", False, 0.733, 0.779, 0.8, 0.733, 0.779, 0.8, 0.02)
1457 set_material(myhandle, mat)
1459 # Smooth
1460 if model == "1" or model == "3":
1461 set_smooth(myhandle)
1462 set_modifier_subsurf(myhandle)
1464 if model == "5" or model == "6" or model == "7" or model == "8":
1465 set_smooth(myhandle)
1467 return myhandle
1470 # ----------------------------------------------
1471 # Handle model 01
1472 # ----------------------------------------------
1473 def handle_model_01():
1474 # ------------------------------------
1475 # Mesh data
1476 # ------------------------------------
1477 minx = -0.07222598791122437
1478 maxx = 0.07222597301006317
1479 maxy = 6.545917585754069e-08
1480 minz = -0.004081448074430227
1481 maxz = 0.004081418737769127
1483 # Vertex
1484 myvertex = [(maxx - 0.013172730803489685, -0.025110241025686264, maxz - 0.0003106782678514719),
1485 (maxx - 0.01216559112071991, -0.027320515364408493, maxz - 0.0011954230722039938),
1486 (maxx - 0.011492643505334854, -0.028797375038266182, maxz - 0.0025195349007844925),
1487 (maxx - 0.011256333440542221, -0.029315980151295662, maxz - 0.0040814326939546675),
1488 (maxx - 0.011492643505334854, -0.02879737690091133, minz + 0.0025195364141836762),
1489 (maxx - 0.01216559112071991, -0.02732051908969879, minz + 0.0011954230722039938),
1490 (maxx - 0.013172730803489685, -0.025110244750976562, minz + 0.0003106798976659775),
1491 (maxx - 0.014360729604959488, -0.022503048181533813, minz),
1492 (maxx - 0.01554873213171959, -0.019895851612091064, minz + 0.00031067943200469017),
1493 (maxx - 0.016555871814489365, -0.017685577273368835, minz + 0.001195424236357212),
1494 (maxx - 0.01722881942987442, -0.016208721324801445, minz + 0.0025195354828611016),
1495 (maxx - 0.017465125769376755, -0.015690118074417114, minz + 0.00408143286244389),
1496 (maxx - 0.01722881942987442, -0.016208721324801445, maxz - 0.0025195367634296417),
1497 (maxx - 0.016555871814489365, -0.017685577273368835, maxz - 0.0011954237706959248),
1498 (maxx - 0.01554873213171959, -0.019895853474736214, maxz - 0.00031068059615790844),
1499 (maxx - 0.014360729604959488, -0.022503050044178963, maxz),
1500 (maxx - 0.00908602774143219, -0.022446047514677048, maxz - 0.0003106782678514719),
1501 (maxx - 0.007382020354270935, -0.024176951497793198, maxz - 0.0011954226065427065),
1502 (maxx - 0.006243452429771423, -0.025333505123853683, maxz - 0.002519535133615136),
1503 (maxx - 0.005843624472618103, -0.025739632546901703, maxz - 0.004081432702012222),
1504 (maxx - 0.006243452429771423, -0.025333506986498833, minz + 0.0025195362977683544),
1505 (maxx - 0.007382020354270935, -0.024176953360438347, minz + 0.0011954230722039938),
1506 (maxx - 0.00908602774143219, -0.022446051239967346, minz + 0.0003106798976659775),
1507 (maxx - 0.011096026748418808, -0.020404310896992683, minz),
1508 (maxx - 0.013106036931276321, -0.01836257427930832, minz + 0.0003106796648353338),
1509 (maxx - 0.014810033142566681, -0.01663167029619217, minz + 0.001195424236357212),
1510 (maxx - 0.015948612242937088, -0.015475118532776833, minz + 0.0025195355992764235),
1511 (maxx - 0.016348421573638916, -0.015068991109728813, minz + 0.004081432861045897),
1512 (maxx - 0.015948612242937088, -0.015475118532776833, maxz - 0.00251953664701432),
1513 (maxx - 0.014810033142566681, -0.01663167029619217, maxz - 0.0011954233050346375),
1514 (maxx - 0.013106033205986023, -0.01836257241666317, maxz - 0.0003106803633272648),
1515 (maxx - 0.011096026748418808, -0.020404312759637833, maxz - 4.656612873077393e-10),
1516 (maxx - 0.004618480801582336, -0.01468262542039156, maxz - 0.0008190707303583622),
1517 (maxx - 0.002191290259361267, -0.014774298295378685, maxz - 0.001584529411047697),
1518 (maxx - 0.0005694925785064697, -0.014835557900369167, maxz - 0.002730117877945304),
1519 (maxx, -0.014857066795229912, maxz - 0.004081432337202706),
1520 (maxx - 0.0005694925785064697, -0.014835558831691742, minz + 0.002730119973421097),
1521 (maxx - 0.002191290259361267, -0.014774300158023834, minz + 0.001584530808031559),
1522 (maxx - 0.004618480801582336, -0.01468262542039156, minz + 0.0008190732914954424),
1523 (maxx - 0.0074815452098846436, -0.014574488624930382, minz + 0.000550281023606658),
1524 (maxx - 0.010344602167606354, -0.014466354623436928, minz + 0.0008190732914954424),
1525 (maxx - 0.012771788984537125, -0.01437467709183693, minz + 0.0015845317393541336),
1526 (maxx - 0.014393582940101624, -0.01431342400610447, minz + 0.002730119158513844),
1527 (maxx - 0.014963079243898392, -0.014291912317276001, maxz - 0.004081433403984924),
1528 (maxx - 0.014393582940101624, -0.01431342400610447, maxz - 0.0027301193913444877),
1529 (maxx - 0.012771788984537125, -0.014374678023159504, maxz - 0.0015845298767089844),
1530 (maxx - 0.010344602167606354, -0.014466352760791779, maxz - 0.0008190723601728678),
1531 (maxx - 0.0074815452098846436, -0.014574489556252956, maxz - 0.0005502800922840834),
1532 (maxx - 0.004618480801582336, maxy - 2.029310053330846e-11, maxz - 0.0008190718945115805),
1533 (maxx - 0.002191290259361267, maxy - 7.808864666003501e-11, maxz - 0.0015845305752009153),
1534 (maxx - 0.0005694925785064697, maxy - 1.645759084567544e-10, maxz - 0.002730119042098522),
1535 (maxx, maxy - 2.665956344571896e-10, minz + 0.004081433353314345),
1536 (maxx - 0.0005694925785064697, maxy - 3.686153604576248e-10, minz + 0.0027301188092678785),
1537 (maxx - 0.002191290259361267, maxy - 4.5510972768170177e-10, minz + 0.0015845296438783407),
1538 (maxx - 0.004618480801582336, maxy - 5.128981683810707e-10, minz + 0.0008190721273422241),
1539 (maxx - 0.0074815452098846436, maxy - 5.331912689143792e-10, minz + 0.0005502798594534397),
1540 (maxx - 0.010344602167606354, maxy - 5.128981683810707e-10, minz + 0.0008190721273422241),
1541 (maxx - 0.012771788984537125, maxy - 4.5510972768170177e-10, minz + 0.0015845305752009153),
1542 (maxx - 0.014393582940101624, maxy - 3.686153604576248e-10, minz + 0.0027301181107759476),
1543 (maxx - 0.014963079243898392, maxy - 2.665956344571896e-10, minz + 0.00408143232919933),
1544 (maxx - 0.014393582940101624, maxy - 1.645759084567544e-10, maxz - 0.002730120439082384),
1545 (maxx - 0.012771788984537125, maxy - 7.808864666003501e-11, maxz - 0.0015845310408622026),
1546 (maxx - 0.010344602167606354, maxy - 2.029310053330846e-11, maxz - 0.000819073524326086),
1547 (maxx - 0.0074815452098846436, maxy, maxz - 0.0005502812564373016),
1548 (minx + 0.013172738254070282, -0.025110241025686264, maxz - 0.0003106782678514719),
1549 (minx + 0.012165598571300507, -0.027320515364408493, maxz - 0.0011954230722039938),
1550 (minx + 0.011492650955915451, -0.028797375038266182, maxz - 0.0025195349007844925),
1551 (minx + 0.011256340891122818, -0.029315980151295662, maxz - 0.0040814326939546675),
1552 (minx + 0.011492650955915451, -0.02879737690091133, minz + 0.0025195364141836762),
1553 (minx + 0.012165598571300507, -0.02732051908969879, minz + 0.0011954230722039938),
1554 (minx + 0.013172738254070282, -0.025110244750976562, minz + 0.0003106798976659775),
1555 (minx + 0.014360737055540085, -0.022503048181533813, minz),
1556 (minx + 0.015548739582300186, -0.019895851612091064, minz + 0.00031067943200469017),
1557 (minx + 0.01655587926506996, -0.017685577273368835, minz + 0.001195424236357212),
1558 (minx + 0.017228826880455017, -0.016208721324801445, minz + 0.0025195354828611016),
1559 (minx + 0.01746513321995735, -0.015690118074417114, minz + 0.00408143286244389),
1560 (minx + 0.017228826880455017, -0.016208721324801445, maxz - 0.0025195367634296417),
1561 (minx + 0.01655587926506996, -0.017685577273368835, maxz - 0.0011954237706959248),
1562 (minx + 0.015548739582300186, -0.019895853474736214, maxz - 0.00031068059615790844),
1563 (minx + 0.014360737055540085, -0.022503050044178963, maxz),
1564 (maxx - 0.07222597673535347, -0.022503051906824112, maxz),
1565 (maxx - 0.07222597673535347, -0.019637949764728546, maxz - 0.00031068059615790844),
1566 (maxx - 0.07222597673535347, -0.01720903068780899, maxz - 0.0011954237706959248),
1567 (maxx - 0.07222597673535347, -0.015586081892251968, maxz - 0.0025195368798449636),
1568 (maxx - 0.07222597673535347, -0.015016178600490093, minz + 0.004081432688119335),
1569 (maxx - 0.07222597673535347, -0.015586081892251968, minz + 0.00251953536644578),
1570 (maxx - 0.07222597673535347, -0.01720903068780899, minz + 0.001195424236357212),
1571 (maxx - 0.07222597673535347, -0.019637947902083397, minz + 0.00031067943200469017),
1572 (maxx - 0.07222597673535347, -0.022503051906824112, minz),
1573 (maxx - 0.07222597673535347, -0.025368154048919678, minz + 0.0003106798976659775),
1574 (maxx - 0.07222597673535347, -0.027797073125839233, minz + 0.0011954230722039938),
1575 (maxx - 0.07222597673535347, -0.029420025646686554, minz + 0.0025195364141836762),
1576 (maxx - 0.07222597673535347, -0.029989928007125854, maxz - 0.004081432643072702),
1577 (maxx - 0.07222597673535347, -0.029420021921396255, maxz - 0.0025195349007844925),
1578 (maxx - 0.07222597673535347, -0.027797069400548935, maxz - 0.0011954230722039938),
1579 (maxx - 0.07222597673535347, -0.025368154048919678, maxz - 0.0003106782678514719),
1580 (minx + 0.00908602774143219, -0.022446047514677048, maxz - 0.0003106782678514719),
1581 (minx + 0.007382035255432129, -0.024176951497793198, maxz - 0.0011954226065427065),
1582 (minx + 0.006243467330932617, -0.025333505123853683, maxz - 0.002519535133615136),
1583 (minx + 0.005843639373779297, -0.025739632546901703, maxz - 0.004081432702012222),
1584 (minx + 0.006243467330932617, -0.025333506986498833, minz + 0.0025195362977683544),
1585 (minx + 0.007382035255432129, -0.024176953360438347, minz + 0.0011954230722039938),
1586 (minx + 0.00908602774143219, -0.022446051239967346, minz + 0.0003106798976659775),
1587 (minx + 0.011096034198999405, -0.020404310896992683, minz),
1588 (minx + 0.013106044381856918, -0.01836257427930832, minz + 0.0003106796648353338),
1589 (minx + 0.014810040593147278, -0.01663167029619217, minz + 0.001195424236357212),
1590 (minx + 0.015948619693517685, -0.015475118532776833, minz + 0.0025195355992764235),
1591 (minx + 0.016348429024219513, -0.015068991109728813, minz + 0.004081432861045897),
1592 (minx + 0.015948619693517685, -0.015475118532776833, maxz - 0.00251953664701432),
1593 (minx + 0.014810040593147278, -0.01663167029619217, maxz - 0.0011954233050346375),
1594 (minx + 0.01310604065656662, -0.01836257241666317, maxz - 0.0003106803633272648),
1595 (minx + 0.011096034198999405, -0.020404312759637833, maxz - 4.656612873077393e-10),
1596 (minx + 0.004618480801582336, -0.01468262542039156, maxz - 0.0008190707303583622),
1597 (minx + 0.002191305160522461, -0.014774298295378685, maxz - 0.001584529411047697),
1598 (minx + 0.0005695074796676636, -0.014835557900369167, maxz - 0.002730117877945304),
1599 (minx, -0.014857066795229912, maxz - 0.004081432337202706),
1600 (minx + 0.0005694925785064697, -0.014835558831691742, minz + 0.002730119973421097),
1601 (minx + 0.002191290259361267, -0.014774300158023834, minz + 0.001584530808031559),
1602 (minx + 0.004618480801582336, -0.01468262542039156, minz + 0.0008190732914954424),
1603 (minx + 0.0074815452098846436, -0.014574488624930382, minz + 0.000550281023606658),
1604 (minx + 0.01034460961818695, -0.014466354623436928, minz + 0.0008190732914954424),
1605 (minx + 0.012771796435117722, -0.01437467709183693, minz + 0.0015845317393541336),
1606 (minx + 0.01439359039068222, -0.01431342400610447, minz + 0.002730119158513844),
1607 (minx + 0.014963086694478989, -0.014291912317276001, maxz - 0.004081433403984924),
1608 (minx + 0.01439359039068222, -0.01431342400610447, maxz - 0.0027301193913444877),
1609 (minx + 0.012771796435117722, -0.014374678023159504, maxz - 0.0015845298767089844),
1610 (minx + 0.01034460961818695, -0.014466352760791779, maxz - 0.0008190723601728678),
1611 (minx + 0.0074815452098846436, -0.014574489556252956, maxz - 0.0005502800922840834),
1612 (minx + 0.004618480801582336, maxy - 2.029310053330846e-11, maxz - 0.0008190718945115805),
1613 (minx + 0.002191305160522461, maxy - 7.808864666003501e-11, maxz - 0.0015845305752009153),
1614 (minx + 0.0005695074796676636, maxy - 1.645759084567544e-10, maxz - 0.002730119042098522),
1615 (minx, maxy - 2.665956344571896e-10, minz + 0.004081433353314345),
1616 (minx + 0.0005694925785064697, maxy - 3.686153604576248e-10, minz + 0.0027301188092678785),
1617 (minx + 0.002191290259361267, maxy - 4.5510972768170177e-10, minz + 0.0015845296438783407),
1618 (minx + 0.004618480801582336, maxy - 5.128981683810707e-10, minz + 0.0008190721273422241),
1619 (minx + 0.0074815452098846436, maxy - 5.331912689143792e-10, minz + 0.0005502798594534397),
1620 (minx + 0.01034460961818695, maxy - 5.128981683810707e-10, minz + 0.0008190721273422241),
1621 (minx + 0.012771796435117722, maxy - 4.5510972768170177e-10, minz + 0.0015845305752009153),
1622 (minx + 0.01439359039068222, maxy - 3.686153604576248e-10, minz + 0.0027301181107759476),
1623 (minx + 0.014963086694478989, maxy - 2.665956344571896e-10, minz + 0.00408143232919933),
1624 (minx + 0.01439359039068222, maxy - 1.645759084567544e-10, maxz - 0.002730120439082384),
1625 (minx + 0.012771796435117722, maxy - 7.808864666003501e-11, maxz - 0.0015845310408622026),
1626 (minx + 0.01034460961818695, maxy - 2.029310053330846e-11, maxz - 0.000819073524326086),
1627 (minx + 0.0074815452098846436, maxy, maxz - 0.0005502812564373016)]
1629 # Faces
1630 myfaces = [(90, 89, 6, 5), (88, 87, 8, 7), (86, 85, 10, 9), (84, 83, 12, 11), (80, 95, 0, 15),
1631 (82, 81, 14, 13), (93, 92, 3, 2), (91, 90, 5, 4), (89, 88, 7, 6), (87, 86, 9, 8),
1632 (85, 84, 11, 10), (95, 94, 1, 0), (83, 82, 13, 12), (94, 93, 2, 1), (81, 80, 15, 14),
1633 (92, 91, 4, 3), (2, 3, 19, 18), (13, 14, 30, 29), (15, 0, 16, 31), (11, 12, 28, 27),
1634 (9, 10, 26, 25), (7, 8, 24, 23), (5, 6, 22, 21), (3, 4, 20, 19), (14, 15, 31, 30),
1635 (1, 2, 18, 17), (12, 13, 29, 28), (0, 1, 17, 16), (10, 11, 27, 26), (8, 9, 25, 24),
1636 (6, 7, 23, 22), (4, 5, 21, 20), (19, 20, 36, 35), (30, 31, 47, 46), (17, 18, 34, 33),
1637 (28, 29, 45, 44), (16, 17, 33, 32), (26, 27, 43, 42), (24, 25, 41, 40), (22, 23, 39, 38),
1638 (20, 21, 37, 36), (18, 19, 35, 34), (29, 30, 46, 45), (31, 16, 32, 47), (27, 28, 44, 43),
1639 (25, 26, 42, 41), (23, 24, 40, 39), (21, 22, 38, 37), (36, 37, 53, 52), (34, 35, 51, 50),
1640 (45, 46, 62, 61), (47, 32, 48, 63), (43, 44, 60, 59), (41, 42, 58, 57), (39, 40, 56, 55),
1641 (37, 38, 54, 53), (35, 36, 52, 51), (46, 47, 63, 62), (33, 34, 50, 49), (44, 45, 61, 60),
1642 (32, 33, 49, 48), (42, 43, 59, 58), (40, 41, 57, 56), (38, 39, 55, 54), (90, 69, 70, 89),
1643 (88, 71, 72, 87), (86, 73, 74, 85), (84, 75, 76, 83), (80, 79, 64, 95), (82, 77, 78, 81),
1644 (93, 66, 67, 92), (91, 68, 69, 90), (89, 70, 71, 88), (87, 72, 73, 86), (85, 74, 75, 84),
1645 (95, 64, 65, 94), (83, 76, 77, 82), (94, 65, 66, 93), (81, 78, 79, 80), (92, 67, 68, 91),
1646 (66, 98, 99, 67), (77, 109, 110, 78), (79, 111, 96, 64), (75, 107, 108, 76), (73, 105, 106, 74),
1647 (71, 103, 104, 72), (69, 101, 102, 70), (67, 99, 100, 68), (78, 110, 111, 79), (65, 97, 98, 66),
1648 (76, 108, 109, 77), (64, 96, 97, 65), (74, 106, 107, 75), (72, 104, 105, 73), (70, 102, 103, 71),
1649 (68, 100, 101, 69), (99, 115, 116, 100), (110, 126, 127, 111), (97, 113, 114, 98), (108, 124, 125, 109),
1650 (96, 112, 113, 97), (106, 122, 123, 107), (104, 120, 121, 105), (102, 118, 119, 103),
1651 (100, 116, 117, 101),
1652 (98, 114, 115, 99), (109, 125, 126, 110), (111, 127, 112, 96), (107, 123, 124, 108),
1653 (105, 121, 122, 106),
1654 (103, 119, 120, 104), (101, 117, 118, 102), (116, 132, 133, 117), (114, 130, 131, 115),
1655 (125, 141, 142, 126),
1656 (127, 143, 128, 112), (123, 139, 140, 124), (121, 137, 138, 122), (119, 135, 136, 120),
1657 (117, 133, 134, 118),
1658 (115, 131, 132, 116), (126, 142, 143, 127), (113, 129, 130, 114), (124, 140, 141, 125),
1659 (112, 128, 129, 113),
1660 (122, 138, 139, 123), (120, 136, 137, 121), (118, 134, 135, 119)]
1662 return myvertex, myfaces
1665 # ----------------------------------------------
1666 # Handle model 02
1667 # ----------------------------------------------
1668 def handle_model_02():
1669 # ------------------------------------
1670 # Mesh data
1671 # ------------------------------------
1672 minx = -0.09079331159591675
1673 maxx = 0.09079315513372421
1674 maxy = 0
1675 minz = -0.018363870680332184
1676 maxz = 0.0015741242095828056
1678 # Vertex
1679 myvertex = [(maxx, maxy, maxz - 9.313225746154785e-10),
1680 (maxx, maxy, maxz - 0.0031482474878430367),
1681 (maxx, -0.02426009438931942, maxz - 0.0031482460908591747),
1682 (maxx, -0.02426009438931942, maxz),
1683 (maxx, -0.02727462910115719, maxz),
1684 (maxx, -0.02727462910115719, maxz - 0.0031482460908591747),
1685 (maxx, -0.02426009625196457, minz + 0.002603583037853241),
1686 (maxx, -0.027274630963802338, minz + 0.002603583037853241),
1687 (maxx, -0.02426009625196457, minz),
1688 (maxx, -0.027274630963802338, minz),
1689 (maxx, -0.021415365859866142, minz + 0.002603583037853241),
1690 (maxx, -0.02141536772251129, minz),
1691 (maxx - 0.0907932324437013, -0.02426009438931942, maxz - 0.0031482460908591747),
1692 (maxx - 0.0907932324437013, -0.02426009438931942, maxz),
1693 (minx, maxy, maxz - 9.313225746154785e-10),
1694 (minx, maxy, maxz - 0.0031482474878430367),
1695 (minx, -0.02426009438931942, maxz - 0.0031482460908591747),
1696 (minx, -0.02426009438931942, maxz),
1697 (minx, -0.02727462910115719, maxz),
1698 (minx, -0.02727462910115719, maxz - 0.0031482460908591747),
1699 (maxx - 0.0907932324437013, -0.02727462910115719, maxz),
1700 (maxx - 0.0907932324437013, maxy, maxz - 9.313225746154785e-10),
1701 (maxx - 0.0907932324437013, -0.02727462910115719, maxz - 0.0031482460908591747),
1702 (maxx - 0.0907932324437013, maxy, maxz - 0.0031482474878430367),
1703 (maxx - 0.0907932324437013, -0.02426009625196457, minz + 0.002603583037853241),
1704 (minx, -0.02426009625196457, minz + 0.002603583037853241),
1705 (minx, -0.027274630963802338, minz + 0.002603583037853241),
1706 (maxx - 0.0907932324437013, -0.027274630963802338, minz + 0.002603583037853241),
1707 (maxx - 0.0907932324437013, -0.02426009625196457, minz),
1708 (minx, -0.02426009625196457, minz),
1709 (minx, -0.027274630963802338, minz),
1710 (maxx - 0.0907932324437013, -0.027274630963802338, minz),
1711 (maxx - 0.0907932324437013, -0.021415365859866142, minz + 0.002603583037853241),
1712 (minx, -0.021415365859866142, minz + 0.002603583037853241),
1713 (maxx - 0.0907932324437013, -0.02141536772251129, minz),
1714 (minx, -0.02141536772251129, minz)]
1716 # Faces
1717 myfaces = [(2, 5, 7, 6), (13, 3, 0, 21), (3, 2, 1, 0), (7, 27, 31, 9), (23, 21, 0, 1),
1718 (5, 22, 27, 7), (4, 5, 2, 3), (2, 12, 23, 1), (20, 4, 3, 13), (5, 4, 20, 22),
1719 (12, 2, 6, 24), (9, 31, 28, 8), (6, 7, 9, 8), (32, 10, 11, 34), (6, 8, 11, 10),
1720 (8, 28, 34, 11), (24, 6, 10, 32), (16, 25, 26, 19), (13, 21, 14, 17), (17, 14, 15, 16),
1721 (26, 30, 31, 27), (23, 15, 14, 21), (19, 26, 27, 22), (18, 17, 16, 19), (16, 15, 23, 12),
1722 (20, 13, 17, 18), (19, 22, 20, 18), (22, 27, 24, 12), (12, 24, 25, 16), (30, 29, 28, 31),
1723 (25, 29, 30, 26), (27, 31, 28, 24), (28, 34, 32, 24), (32, 34, 35, 33), (25, 33, 35, 29),
1724 (29, 35, 34, 28), (24, 32, 33, 25)]
1726 return myvertex, myfaces
1729 # ----------------------------------------------
1730 # Handle model 05
1731 # ----------------------------------------------
1732 def handle_model_05():
1733 # ------------------------------------
1734 # Mesh data
1735 # ------------------------------------
1736 minx = -0.012873317115008831
1737 maxx = 0.012873315252363682
1738 maxy = 6.581399869531879e-10
1739 minz = -0.012873317115008831
1740 maxz = 0.012873315252363682
1742 # Vertex
1743 myvertex = [(maxx - 0.01287331552838386, maxy, maxz - 0.008879524189978838),
1744 (maxx - 0.01287331552838386, -0.004451401997357607, maxz - 0.008879524189978838),
1745 (maxx - 0.012094165373127908, maxy, maxz - 0.008956264238804579),
1746 (maxx - 0.012094165373127908, -0.004451401997357607, maxz - 0.008956263773143291),
1747 (maxx - 0.011344957514666021, maxy, maxz - 0.00918353395536542),
1748 (maxx - 0.011344957514666021, -0.004451401997357607, maxz - 0.009183533489704132),
1749 (maxx - 0.010654483688995242, maxy, maxz - 0.00955259962938726),
1750 (maxx - 0.010654483688995242, -0.004451401997357607, maxz - 0.009552599163725972),
1751 (maxx - 0.010049278382211924, maxy, maxz - 0.010049279080703855),
1752 (maxx - 0.010049278382211924, -0.004451401997357607, maxz - 0.010049278382211924),
1753 (maxx - 0.009552599163725972, maxy - 6.581399869531879e-10, maxz - 0.01065448485314846),
1754 (maxx - 0.009552599163725972, -0.004451401997357607, maxz - 0.01065448415465653),
1755 (maxx - 0.009183533489704132, maxy - 6.581399869531879e-10, maxz - 0.011344958445988595),
1756 (maxx - 0.009183533489704132, -0.004451401997357607, maxz - 0.011344957863911986),
1757 (maxx - 0.008956263773143291, maxy - 6.581399869531879e-10, maxz - 0.0120941661298275),
1758 (maxx - 0.008956263773143291, -0.004451401997357607, maxz - 0.012094165605958551),
1759 (maxx - 0.008879524189978838, maxy - 6.581399869531879e-10, maxz - 0.012873315995101497),
1760 (maxx - 0.008879524189978838, -0.004451401997357607, maxz - 0.012873315519886824),
1761 (maxx - 0.008956263307482004, maxy - 6.581399869531879e-10, minz + 0.012094166420865804),
1762 (maxx - 0.008956263307482004, -0.004451401997357607, minz + 0.01209416682831943),
1763 (maxx - 0.009183533024042845, maxy - 6.581399869531879e-10, minz + 0.011344958795234561),
1764 (maxx - 0.009183533024042845, -0.004451401997357607, minz + 0.011344959260895848),
1765 (maxx - 0.009552599163725972, maxy - 6.581399869531879e-10, minz + 0.01065448415465653),
1766 (maxx - 0.009552599163725972, -0.004451401997357607, minz + 0.01065448485314846),
1767 (maxx - 0.010049278382211924, -6.581399869531879e-10, minz + 0.010049278847873211),
1768 (maxx - 0.010049278382211924, -0.004451401997357607, minz + 0.010049279546365142),
1769 (maxx - 0.010654483921825886, -6.581399869531879e-10, minz + 0.00955259962938726),
1770 (maxx - 0.010654483921825886, -0.004451401997357607, minz + 0.009552600095048547),
1771 (maxx - 0.011344958213157952, -6.581399869531879e-10, minz + 0.009183533256873488),
1772 (maxx - 0.011344958213157952, -0.004451401997357607, minz + 0.009183533489704132),
1773 (maxx - 0.012094166362658143, -6.581399869531879e-10, minz + 0.008956264238804579),
1774 (maxx - 0.012094166362658143, -0.004451401997357607, minz + 0.008956264238804579),
1775 (minx + 0.012873315537646146, -6.581399869531879e-10, minz + 0.008879524655640125),
1776 (minx + 0.012873315537646146, -0.004451401997357607, minz + 0.008879525121301413),
1777 (minx + 0.012094165082089603, -6.581399869531879e-10, minz + 0.008956264238804579),
1778 (minx + 0.012094165082089603, -0.004451401997357607, minz + 0.008956264704465866),
1779 (minx + 0.011344957165420055, -6.581399869531879e-10, minz + 0.009183534886687994),
1780 (minx + 0.011344957165420055, -0.004451401997357607, minz + 0.009183535352349281),
1781 (minx + 0.010654483223333955, -6.581399869531879e-10, minz + 0.009552601026371121),
1782 (minx + 0.010654483223333955, -0.004451401997357607, minz + 0.009552601724863052),
1783 (minx + 0.010049277916550636, -6.581399869531879e-10, minz + 0.010049280477687716),
1784 (minx + 0.010049277916550636, -0.004451401997357607, minz + 0.010049281176179647),
1785 (minx + 0.009552598698064685, maxy - 6.581399869531879e-10, minz + 0.010654486482962966),
1786 (minx + 0.009552598698064685, -0.004451401997357607, minz + 0.010654486948624253),
1787 (minx + 0.009183533024042845, maxy - 6.581399869531879e-10, minz + 0.011344961123540998),
1788 (minx + 0.009183533024042845, -0.004451401997357607, minz + 0.011344961589202285),
1789 (minx + 0.008956264238804579, maxy - 6.581399869531879e-10, minz + 0.01209416938945651),
1790 (minx + 0.008956264238804579, -0.004451401997357607, minz + 0.012094169855117798),
1791 (minx + 0.008879525121301413, maxy - 6.581399869531879e-10, maxz - 0.012873312440222273),
1792 (minx + 0.008879525121301413, -0.004451401997357607, maxz - 0.012873311965007517),
1793 (minx + 0.008956265170127153, maxy - 6.581399869531879e-10, maxz - 0.012094162055291235),
1794 (minx + 0.008956265170127153, -0.004451401997357607, maxz - 0.012094161589629948),
1795 (minx + 0.009183535818010569, maxy - 6.581399869531879e-10, maxz - 0.01134495425503701),
1796 (minx + 0.009183535818010569, -0.004451401997357607, maxz - 0.011344953789375722),
1797 (minx + 0.009552602656185627, maxy - 6.581399869531879e-10, maxz - 0.010654480429366231),
1798 (minx + 0.009552602656185627, -0.004451401997357607, maxz - 0.010654479963704944),
1799 (minx + 0.01004928327165544, maxy, maxz - 0.010049275355413556),
1800 (minx + 0.01004928327165544, -0.004451401997357607, maxz - 0.010049275122582912),
1801 (minx + 0.010654489509761333, maxy, maxz - 0.009552596602588892),
1802 (minx + 0.010654489509761333, -0.004451401997357607, maxz - 0.009552596136927605),
1803 (minx + 0.011344964150339365, maxy, maxz - 0.00918353139422834),
1804 (minx + 0.011344964150339365, -0.004451401997357607, maxz - 0.009183531161397696),
1805 (minx + 0.012094172765500844, maxy, maxz - 0.008956263307482004),
1806 (minx + 0.012094172765500844, -0.004451401997357607, maxz - 0.00895626237615943),
1807 (minx + 0.01287331571475725, -0.01000460609793663, maxz),
1808 (maxx - 0.010361857246607542, -0.01000460609793663, maxz - 0.0002473592758178711),
1809 (maxx - 0.00794691126793623, -0.01000460609793663, maxz - 0.0009799236431717873),
1810 (maxx - 0.005721285007894039, -0.01000460609793663, maxz - 0.002169545739889145),
1811 (maxx - 0.0037705078721046448, -0.01000460609793663, maxz - 0.0037705088034272194),
1812 (maxx - 0.002169545739889145, -0.01000460609793663, maxz - 0.005721286870539188),
1813 (maxx - 0.0009799227118492126, -0.010004607029259205, maxz - 0.007946912664920092),
1814 (maxx - 0.00024735741317272186, -0.010004607029259205, maxz - 0.010361858177930117),
1815 (maxx, -0.010004607029259205, minz + 0.012873315524888684),
1816 (maxx - 0.00024735648185014725, -0.010004607029259205, minz + 0.010361856315284967),
1817 (maxx - 0.0009799227118492126, -0.010004607029259205, minz + 0.007946911733597517),
1818 (maxx - 0.002169545739889145, -0.01000460796058178, minz + 0.005721283610910177),
1819 (maxx - 0.0037705078721046448, -0.01000460796058178, minz + 0.003770505078136921),
1820 (maxx - 0.005721286404877901, -0.01000460796058178, minz + 0.002169542945921421),
1821 (maxx - 0.007946913596242666, -0.01000460796058178, minz + 0.0009799208492040634),
1822 (maxx - 0.010361860506236553, -0.01000460796058178, minz + 0.00024735648185014725),
1823 (minx + 0.012873311520098518, -0.01000460796058178, minz),
1824 (minx + 0.010361851193010807, -0.01000460796058178, minz + 0.00024735648185014725),
1825 (minx + 0.007946905214339495, -0.01000460796058178, minz + 0.0009799255058169365),
1826 (minx + 0.005721278488636017, -0.01000460796058178, minz + 0.0021695485338568687),
1827 (minx + 0.003770500421524048, -0.01000460796058178, minz + 0.0037705106660723686),
1828 (minx + 0.002169538289308548, -0.01000460796058178, minz + 0.005721290595829487),
1829 (minx + 0.0009799189865589142, -0.010004607029259205, minz + 0.007946919184178114),
1830 (minx + 0.000247354619204998, -0.010004607029259205, minz + 0.010361866094172001),
1831 (minx, -0.010004607029259205, maxz - 0.012873305383929612),
1832 (minx + 0.0002473592758178711, -0.010004607029259205, maxz - 0.010361845139414072),
1833 (minx + 0.0009799282997846603, -0.010004607029259205, maxz - 0.007946899626404047),
1834 (minx + 0.0021695513278245926, -0.01000460609793663, maxz - 0.005721272900700569),
1835 (minx + 0.003770517185330391, -0.01000460609793663, maxz - 0.003770497627556324),
1836 (minx + 0.005721298512071371, -0.01000460609793663, maxz - 0.0021695364266633987),
1837 (minx + 0.00794692849740386, -0.01000460609793663, maxz - 0.0009799161925911903),
1838 (minx + 0.010361875407397747, -0.01000460609793663, maxz - 0.000247354619204998),
1839 (minx + 0.01287331571475725, -0.012252332642674446, maxz),
1840 (maxx - 0.010361857246607542, -0.012252332642674446, maxz - 0.0002473592758178711),
1841 (maxx - 0.00794691126793623, -0.012252332642674446, maxz - 0.0009799236431717873),
1842 (maxx - 0.005721285007894039, -0.012252332642674446, maxz - 0.002169545739889145),
1843 (maxx - 0.0037705078721046448, -0.012252332642674446, maxz - 0.0037705088034272194),
1844 (maxx - 0.002169545739889145, -0.012252332642674446, maxz - 0.005721286870539188),
1845 (maxx - 0.0009799227118492126, -0.012252334505319595, maxz - 0.007946912664920092),
1846 (maxx - 0.00024735741317272186, -0.012252334505319595, maxz - 0.010361858177930117),
1847 (maxx, -0.012252334505319595, minz + 0.012873315638136429),
1848 (maxx - 0.00024735648185014725, -0.012252334505319595, minz + 0.010361856315284967),
1849 (maxx - 0.0009799227118492126, -0.012252334505319595, minz + 0.007946911733597517),
1850 (maxx - 0.002169545739889145, -0.01225233543664217, minz + 0.005721283610910177),
1851 (maxx - 0.0037705078721046448, -0.01225233543664217, minz + 0.003770505078136921),
1852 (maxx - 0.005721286404877901, -0.01225233543664217, minz + 0.002169542945921421),
1853 (maxx - 0.007946913596242666, -0.01225233543664217, minz + 0.0009799208492040634),
1854 (maxx - 0.010361860506236553, -0.01225233543664217, minz + 0.00024735648185014725),
1855 (minx + 0.012873311520098518, -0.01225233543664217, minz),
1856 (minx + 0.010361851193010807, -0.01225233543664217, minz + 0.00024735648185014725),
1857 (minx + 0.007946905214339495, -0.01225233543664217, minz + 0.0009799255058169365),
1858 (minx + 0.005721278488636017, -0.01225233543664217, minz + 0.0021695485338568687),
1859 (minx + 0.003770500421524048, -0.01225233543664217, minz + 0.0037705106660723686),
1860 (minx + 0.002169538289308548, -0.01225233543664217, minz + 0.005721290595829487),
1861 (minx + 0.0009799189865589142, -0.012252334505319595, minz + 0.007946919184178114),
1862 (minx + 0.000247354619204998, -0.012252334505319595, minz + 0.010361866094172001),
1863 (minx, -0.012252334505319595, maxz - 0.012873305270680646),
1864 (minx + 0.0002473592758178711, -0.012252334505319595, maxz - 0.010361845139414072),
1865 (minx + 0.0009799282997846603, -0.012252334505319595, maxz - 0.007946899626404047),
1866 (minx + 0.0021695513278245926, -0.012252332642674446, maxz - 0.005721272900700569),
1867 (minx + 0.003770517185330391, -0.012252332642674446, maxz - 0.003770497627556324),
1868 (minx + 0.005721298512071371, -0.012252332642674446, maxz - 0.0021695364266633987),
1869 (minx + 0.00794692849740386, -0.012252332642674446, maxz - 0.0009799161925911903),
1870 (minx + 0.010361875407397747, -0.012252332642674446, maxz - 0.000247354619204998),
1871 (minx + 0.01287331597587027, -0.012252331711351871, maxz - 0.006033936515450478),
1872 (maxx - 0.011539019644260406, -0.012252331711351871, maxz - 0.006165354512631893),
1873 (maxx - 0.010255999164655805, -0.012252331711351871, maxz - 0.006554554216563702),
1874 (maxx - 0.009073560824617743, -0.012252332642674446, maxz - 0.007186579518020153),
1875 (maxx - 0.008037144783884287, -0.012252332642674446, maxz - 0.008037144318223),
1876 (maxx - 0.007186580915004015, -0.012252332642674446, maxz - 0.009073559893295169),
1877 (maxx - 0.006554554216563702, -0.012252332642674446, maxz - 0.010255998698994517),
1878 (maxx - 0.006165354512631893, -0.012252332642674446, maxz - 0.011539018712937832),
1879 (maxx - 0.006033937446773052, -0.012252332642674446, maxz - 0.012873314963572108),
1880 (maxx - 0.0061653535813093185, -0.012252332642674446, minz + 0.011539021041244268),
1881 (maxx - 0.006554554216563702, -0.012252332642674446, minz + 0.01025600079447031),
1882 (maxx - 0.007186580915004015, -0.012252332642674446, minz + 0.009073561755940318),
1883 (maxx - 0.008037144783884287, -0.012252332642674446, minz + 0.008037145715206861),
1884 (maxx - 0.009073561057448387, -0.012252332642674446, minz + 0.007186580449342728),
1885 (maxx - 0.010256000561639667, -0.012252334505319595, minz + 0.006554553750902414),
1886 (maxx - 0.011539021274074912, -0.012252334505319595, minz + 0.0061653549782931805),
1887 (minx + 0.012873313747317816, -0.012252334505319595, minz + 0.006033938378095627),
1888 (minx + 0.01153901673387736, -0.012252334505319595, minz + 0.0061653549782931805),
1889 (minx + 0.01025599567219615, -0.012252334505319595, minz + 0.0065545570105314255),
1890 (minx + 0.009073557797819376, -0.012252332642674446, minz + 0.007186583708971739),
1891 (minx + 0.008037141524255276, -0.012252332642674446, minz + 0.008037148043513298),
1892 (minx + 0.007186576724052429, -0.012252332642674446, minz + 0.00907356571406126),
1893 (minx + 0.006554551888257265, -0.012252332642674446, minz + 0.010256004752591252),
1894 (minx + 0.006165352184325457, -0.012252332642674446, minz + 0.011539026163518429),
1895 (minx + 0.006033936981111765, -0.012252332642674446, maxz - 0.012873308875832823),
1896 (minx + 0.006165355443954468, -0.012252332642674446, maxz - 0.011539011728018522),
1897 (minx + 0.006554556544870138, -0.012252332642674446, maxz - 0.010255991481244564),
1898 (minx + 0.007186584174633026, -0.012252332642674446, maxz - 0.00907355290837586),
1899 (minx + 0.008037150837481022, -0.012252332642674446, maxz - 0.008037138264626265),
1900 (minx + 0.009073568508028984, -0.012252332642674446, maxz - 0.007186574395745993),
1901 (minx + 0.010256008245050907, -0.012252331711351871, maxz - 0.006554548628628254),
1902 (minx + 0.011539029655978084, -0.012252331711351871, maxz - 0.006165351718664169),
1903 (maxx - 0.01237887132447213, -0.012252329848706722, maxz - 0.010387574089691043),
1904 (maxx - 0.011465257033705711, -0.012252329848706722, maxz - 0.01076600537635386),
1905 (maxx - 0.01108119694981724, -0.012252329848706722, maxz - 0.011081195320002735),
1906 (maxx - 0.010766007238999009, -0.012252329848706722, maxz - 0.011465255171060562),
1907 (maxx - 0.010531799867749214, -0.012252329848706722, maxz - 0.01190342620247975),
1908 (maxx - 0.01108119694981724, -0.012252329848706722, minz + 0.01108119951095432),
1909 (maxx - 0.011903428356163204, -0.012252329848706722, minz + 0.010531801730394363),
1910 (minx + 0.012378871033433825, -0.012252329848706722, minz + 0.010387577582150698),
1911 (minx + 0.011465256451629102, -0.012252329848706722, minz + 0.01076600980013609),
1912 (minx + 0.01076600607484579, -0.012252329848706722, minz + 0.011465260875411332),
1913 (minx + 0.010531799402087927, -0.012252329848706722, minz + 0.011903432430699468),
1914 (minx + 0.010338877560570836, -0.012252329848706722, maxz - 0.01287331168983985),
1915 (minx + 0.010531801264733076, -0.012252329848706722, maxz - 0.01190342364134267),
1916 (minx + 0.011081199743784964, -0.012252329848706722, maxz - 0.011081192875280976),
1917 (minx + 0.011465260293334723, -0.012252329848706722, maxz - 0.010766003280878067),
1918 (maxx - 0.01287331586396423, -0.012252329848706722, maxz - 0.010338874999433756),
1919 (maxx - 0.011903427948709577, -0.012252329848706722, maxz - 0.010531798237934709),
1920 (maxx - 0.010387575486674905, -0.012252329848706722, maxz - 0.012378869636449963),
1921 (maxx - 0.010338877094909549, -0.012252329848706722, maxz - 0.012873313945746867),
1922 (maxx - 0.010387575486674905, -0.012252329848706722, minz + 0.012378874002024531),
1923 (maxx - 0.010531799867749214, -0.012252329848706722, minz + 0.011903430917300284),
1924 (maxx - 0.010766007238999009, -0.012252329848706722, minz + 0.011465259245596826),
1925 (maxx - 0.011465257382951677, -0.012252329848706722, minz + 0.010766008868813515),
1926 (maxx - 0.01237887202296406, -0.012252329848706722, minz + 0.010387577582150698),
1927 (minx + 0.01287331567758343, -0.012252329848706722, minz + 0.010338879656046629),
1928 (minx + 0.011903427541255951, -0.012252329848706722, minz + 0.010531802894547582),
1929 (minx + 0.011081196367740631, -0.012252329848706722, minz + 0.011081200325861573),
1930 (minx + 0.010387575021013618, -0.012252329848706722, minz + 0.01237887586466968),
1931 (minx + 0.01038757641799748, -0.012252329848706722, maxz - 0.012378867017105222),
1932 (minx + 0.010766008868813515, -0.012252329848706722, maxz - 0.011465252609923482),
1933 (minx + 0.011903432314284146, -0.012252329848706722, maxz - 0.01053179637528956),
1934 (minx + 0.01237887580646202, -0.012252329848706722, maxz - 0.010387573391199112)]
1936 # Faces
1937 myfaces = [(0, 1, 3, 2), (2, 3, 5, 4), (4, 5, 7, 6), (6, 7, 9, 8), (8, 9, 11, 10),
1938 (10, 11, 13, 12), (12, 13, 15, 14), (14, 15, 17, 16), (16, 17, 19, 18), (18, 19, 21, 20),
1939 (20, 21, 23, 22), (22, 23, 25, 24), (24, 25, 27, 26), (26, 27, 29, 28), (28, 29, 31, 30),
1940 (30, 31, 33, 32), (32, 33, 35, 34), (34, 35, 37, 36), (36, 37, 39, 38), (38, 39, 41, 40),
1941 (40, 41, 43, 42), (42, 43, 45, 44), (44, 45, 47, 46), (46, 47, 49, 48), (48, 49, 51, 50),
1942 (50, 51, 53, 52), (52, 53, 55, 54), (54, 55, 57, 56), (56, 57, 59, 58), (58, 59, 61, 60),
1943 (60, 61, 63, 62), (62, 63, 1, 0), (45, 43, 85, 86), (23, 21, 74, 75), (51, 49, 88, 89),
1944 (7, 5, 66, 67), (29, 27, 77, 78), (57, 55, 91, 92), (35, 33, 80, 81), (13, 11, 69, 70),
1945 (63, 61, 94, 95), (41, 39, 83, 84), (19, 17, 72, 73), (47, 45, 86, 87), (3, 1, 64, 65),
1946 (25, 23, 75, 76), (53, 51, 89, 90), (9, 7, 67, 68), (31, 29, 78, 79), (59, 57, 92, 93),
1947 (37, 35, 81, 82), (15, 13, 70, 71), (1, 63, 95, 64), (43, 41, 84, 85), (21, 19, 73, 74),
1948 (49, 47, 87, 88), (5, 3, 65, 66), (27, 25, 76, 77), (55, 53, 90, 91), (11, 9, 68, 69),
1949 (33, 31, 79, 80), (61, 59, 93, 94), (39, 37, 82, 83), (17, 15, 71, 72), (89, 88, 120, 121),
1950 (67, 66, 98, 99), (78, 77, 109, 110), (87, 86, 118, 119), (65, 64, 96, 97), (76, 75, 107, 108),
1951 (64, 95, 127, 96), (85, 84, 116, 117), (74, 73, 105, 106), (94, 93, 125, 126), (83, 82, 114, 115),
1952 (72, 71, 103, 104), (92, 91, 123, 124), (81, 80, 112, 113), (70, 69, 101, 102), (90, 89, 121, 122),
1953 (68, 67, 99, 100), (79, 78, 110, 111), (88, 87, 119, 120), (66, 65, 97, 98), (77, 76, 108, 109),
1954 (86, 85, 117, 118), (75, 74, 106, 107), (95, 94, 126, 127), (84, 83, 115, 116), (73, 72, 104, 105),
1955 (93, 92, 124, 125), (82, 81, 113, 114), (71, 70, 102, 103), (91, 90, 122, 123), (69, 68, 100, 101),
1956 (80, 79, 111, 112), (123, 122, 154, 155), (101, 100, 132, 133), (112, 111, 143, 144),
1957 (121, 120, 152, 153),
1958 (99, 98, 130, 131), (110, 109, 141, 142), (119, 118, 150, 151), (97, 96, 128, 129), (108, 107, 139, 140),
1959 (96, 127, 159, 128), (117, 116, 148, 149), (106, 105, 137, 138), (126, 125, 157, 158),
1960 (115, 114, 146, 147),
1961 (104, 103, 135, 136), (124, 123, 155, 156), (113, 112, 144, 145), (102, 101, 133, 134),
1962 (122, 121, 153, 154),
1963 (100, 99, 131, 132), (111, 110, 142, 143), (120, 119, 151, 152), (98, 97, 129, 130),
1964 (109, 108, 140, 141),
1965 (118, 117, 149, 150), (107, 106, 138, 139), (127, 126, 158, 159), (116, 115, 147, 148),
1966 (105, 104, 136, 137),
1967 (125, 124, 156, 157), (114, 113, 145, 146), (103, 102, 134, 135), (157, 156, 173, 174),
1968 (133, 132, 162, 163),
1969 (134, 133, 163, 164), (132, 131, 161, 162), (150, 149, 169, 170), (146, 145, 167, 185),
1970 (135, 134, 164, 177),
1971 (155, 154, 172, 189), (144, 143, 183, 184), (153, 152, 171, 188), (131, 130, 176, 161),
1972 (142, 141, 182, 166),
1973 (151, 150, 170, 187), (129, 128, 175, 160), (140, 139, 181, 165), (128, 159, 191, 175),
1974 (149, 148, 186, 169),
1975 (138, 137, 179, 180), (158, 157, 174, 190), (147, 146, 185, 168), (136, 135, 177, 178),
1976 (156, 155, 189, 173),
1977 (145, 144, 184, 167), (154, 153, 188, 172), (143, 142, 166, 183), (152, 151, 187, 171),
1978 (130, 129, 160, 176),
1979 (141, 140, 165, 182), (139, 138, 180, 181), (159, 158, 190, 191), (148, 147, 168, 186),
1980 (137, 136, 178, 179),
1981 (175, 191, 190, 174, 173, 189, 172, 188, 171, 187, 170, 169, 186, 168, 185, 167, 184, 183, 166, 182, 165,
1982 181, 180, 179, 178, 177, 164, 163, 162, 161, 176, 160)]
1984 return myvertex, myfaces
1987 # ----------------------------------------------
1988 # Handle model 06
1989 # ----------------------------------------------
1990 def handle_model_06():
1991 # ------------------------------------
1992 # Mesh data
1993 # ------------------------------------
1994 minx = -0.021158458665013313
1995 maxx = 0.021158456802368164
1996 maxy = 6.581399869531879e-10
1997 minz = -0.021158462390303612
1998 maxz = 0.021158454939723015
2000 # Vertex
2001 myvertex = [(maxx - 0.021158457078388343, maxy, maxz - 0.01716466387733817),
2002 (maxx - 0.021158457078388343, -0.004451401997357607, maxz - 0.01716466387733817),
2003 (maxx - 0.02037930692313239, maxy, maxz - 0.017241403926163912),
2004 (maxx - 0.02037930692313239, -0.004451401997357607, maxz - 0.017241403460502625),
2005 (maxx - 0.019630099064670503, maxy, maxz - 0.017468673642724752),
2006 (maxx - 0.019630099064670503, -0.004451401997357607, maxz - 0.017468673177063465),
2007 (maxx - 0.018939625238999724, maxy, maxz - 0.017837739316746593),
2008 (maxx - 0.018939625238999724, -0.004451401997357607, maxz - 0.017837738851085305),
2009 (maxx - 0.018334419932216406, maxy, maxz - 0.018334418768063188),
2010 (maxx - 0.018334419932216406, -0.004451401997357607, maxz - 0.018334418069571257),
2011 (maxx - 0.017837740713730454, maxy - 6.581399869531879e-10, maxz - 0.018939624540507793),
2012 (maxx - 0.017837740713730454, -0.004451401997357607, maxz - 0.018939623842015862),
2013 (maxx - 0.017468675039708614, maxy - 6.581399869531879e-10, maxz - 0.01963009813334793),
2014 (maxx - 0.017468675039708614, -0.004451401997357607, maxz - 0.01963009755127132),
2015 (maxx - 0.017241405323147774, maxy - 6.581399869531879e-10, maxz - 0.020379305817186832),
2016 (maxx - 0.017241405323147774, -0.004451401997357607, maxz - 0.020379305293317884),
2017 (maxx - 0.01716466573998332, maxy - 6.581399869531879e-10, maxz - 0.02115845568246083),
2018 (maxx - 0.01716466573998332, -0.004451401997357607, maxz - 0.021158455207246157),
2019 (maxx - 0.017241404857486486, maxy - 6.581399869531879e-10, minz + 0.020379311696160585),
2020 (maxx - 0.017241404857486486, -0.004451401997357607, minz + 0.02037931210361421),
2021 (maxx - 0.017468674574047327, maxy - 6.581399869531879e-10, minz + 0.01963010407052934),
2022 (maxx - 0.017468674574047327, -0.004451401997357607, minz + 0.01963010453619063),
2023 (maxx - 0.017837740713730454, maxy - 6.581399869531879e-10, minz + 0.01893962942995131),
2024 (maxx - 0.017837740713730454, -0.004451401997357607, minz + 0.01893963012844324),
2025 (maxx - 0.018334419932216406, -6.581399869531879e-10, minz + 0.01833442412316799),
2026 (maxx - 0.018334419932216406, -0.004451401997357607, minz + 0.018334424821659923),
2027 (maxx - 0.018939625471830368, -6.581399869531879e-10, minz + 0.01783774490468204),
2028 (maxx - 0.018939625471830368, -0.004451401997357607, minz + 0.017837745370343328),
2029 (maxx - 0.019630099763162434, -6.581399869531879e-10, minz + 0.01746867853216827),
2030 (maxx - 0.019630099763162434, -0.004451401997357607, minz + 0.017468678764998913),
2031 (maxx - 0.020379307912662625, -6.581399869531879e-10, minz + 0.01724140951409936),
2032 (maxx - 0.020379307912662625, -0.004451401997357607, minz + 0.01724140951409936),
2033 (minx + 0.02115845708765063, -6.581399869531879e-10, minz + 0.017164669930934906),
2034 (minx + 0.02115845708765063, -0.004451401997357607, minz + 0.017164670396596193),
2035 (minx + 0.020379306632094085, -6.581399869531879e-10, minz + 0.01724140951409936),
2036 (minx + 0.020379306632094085, -0.004451401997357607, minz + 0.017241409979760647),
2037 (minx + 0.019630098715424538, -6.581399869531879e-10, minz + 0.017468680161982775),
2038 (minx + 0.019630098715424538, -0.004451401997357607, minz + 0.017468680627644062),
2039 (minx + 0.018939624773338437, -6.581399869531879e-10, minz + 0.017837746301665902),
2040 (minx + 0.018939624773338437, -0.004451401997357607, minz + 0.017837747000157833),
2041 (minx + 0.01833441946655512, -6.581399869531879e-10, minz + 0.018334425752982497),
2042 (minx + 0.01833441946655512, -0.004451401997357607, minz + 0.018334426451474428),
2043 (minx + 0.017837740248069167, maxy - 6.581399869531879e-10, minz + 0.018939631758257747),
2044 (minx + 0.017837740248069167, -0.004451401997357607, minz + 0.018939632223919034),
2045 (minx + 0.017468674574047327, maxy - 6.581399869531879e-10, minz + 0.019630106398835778),
2046 (minx + 0.017468674574047327, -0.004451401997357607, minz + 0.019630106864497066),
2047 (minx + 0.01724140578880906, maxy - 6.581399869531879e-10, minz + 0.02037931466475129),
2048 (minx + 0.01724140578880906, -0.004451401997357607, minz + 0.02037931513041258),
2049 (minx + 0.017164666671305895, maxy - 6.581399869531879e-10, maxz - 0.021158452127581606),
2050 (minx + 0.017164666671305895, -0.004451401997357607, maxz - 0.02115845165236685),
2051 (minx + 0.017241406720131636, maxy - 6.581399869531879e-10, maxz - 0.02037930174265057),
2052 (minx + 0.017241406720131636, -0.004451401997357607, maxz - 0.02037930127698928),
2053 (minx + 0.01746867736801505, maxy - 6.581399869531879e-10, maxz - 0.019630093942396343),
2054 (minx + 0.01746867736801505, -0.004451401997357607, maxz - 0.019630093476735055),
2055 (minx + 0.01783774420619011, maxy - 6.581399869531879e-10, maxz - 0.018939620116725564),
2056 (minx + 0.01783774420619011, -0.004451401997357607, maxz - 0.018939619651064277),
2057 (minx + 0.018334424821659923, maxy, maxz - 0.01833441504277289),
2058 (minx + 0.018334424821659923, -0.004451401997357607, maxz - 0.018334414809942245),
2059 (minx + 0.018939631059765816, maxy, maxz - 0.017837736289948225),
2060 (minx + 0.018939631059765816, -0.004451401997357607, maxz - 0.017837735824286938),
2061 (minx + 0.019630105700343847, maxy, maxz - 0.017468671081587672),
2062 (minx + 0.019630105700343847, -0.004451401997357607, maxz - 0.01746867084875703),
2063 (minx + 0.020379314315505326, maxy, maxz - 0.017241402994841337),
2064 (minx + 0.020379314315505326, -0.004451401997357607, maxz - 0.017241402063518763),
2065 (minx + 0.02115845651317172, -0.01480177417397499, maxz),
2066 (maxx - 0.017030648421496153, -0.01480177417397499, maxz - 0.00040655583143234253),
2067 (maxx - 0.013061466626822948, -0.01480177417397499, maxz - 0.0016105938702821732),
2068 (maxx - 0.00940344762057066, -0.01480177417397499, maxz - 0.0035658441483974457),
2069 (maxx - 0.006197170354425907, -0.01480177417397499, maxz - 0.006197171285748482),
2070 (maxx - 0.0035658441483974457, -0.01480177417397499, maxz - 0.009403450414538383),
2071 (maxx - 0.0016105901449918747, -0.014801775105297565, maxz - 0.013061468489468098),
2072 (maxx - 0.0004065539687871933, -0.014801775105297565, maxz - 0.017030649818480015),
2073 (maxx, -0.014801775105297565, minz + 0.0211584585064859),
2074 (maxx - 0.0004065539687871933, -0.014801775105297565, minz + 0.017030648421496153),
2075 (maxx - 0.0016105901449918747, -0.014801775105297565, minz + 0.013061468489468098),
2076 (maxx - 0.0035658441483974457, -0.01480177603662014, minz + 0.00940344762057066),
2077 (maxx - 0.006197170354425907, -0.01480177603662014, minz + 0.006197166629135609),
2078 (maxx - 0.009403450414538383, -0.01480177603662014, minz + 0.0035658422857522964),
2079 (maxx - 0.013061470352113247, -0.01480177603662014, minz + 0.0016105901449918747),
2080 (maxx - 0.017030653543770313, -0.01480177603662014, minz + 0.0004065539687871933),
2081 (minx + 0.02115844961887081, -0.01480177603662014, minz),
2082 (minx + 0.017030637711286545, -0.01480177603662014, minz + 0.0004065539687871933),
2083 (minx + 0.013061455450952053, -0.01480177603662014, minz + 0.0016105975955724716),
2084 (minx + 0.009403438307344913, -0.01480177603662014, minz + 0.0035658497363328934),
2085 (minx + 0.006197156384587288, -0.01480177603662014, minz + 0.006197175942361355),
2086 (minx + 0.003565831109881401, -0.01480177603662014, minz + 0.00940345972776413),
2087 (minx + 0.001610584557056427, -0.014801775105297565, minz + 0.013061481527984142),
2088 (minx + 0.0004065483808517456, -0.014801775105297565, minz + 0.01703066425397992),
2089 (minx, -0.014801775105297565, maxz - 0.021158439990372813),
2090 (minx + 0.00040655583143234253, -0.014801775105297565, maxz - 0.01703062793239951),
2091 (minx + 0.0016105994582176208, -0.014801775105297565, maxz - 0.013061447069048882),
2092 (minx + 0.0035658515989780426, -0.01480177417397499, maxz - 0.009403428062796593),
2093 (minx + 0.006197184324264526, -0.01480177417397499, maxz - 0.006197153590619564),
2094 (minx + 0.00940346997231245, -0.01480177417397499, maxz - 0.003565829247236252),
2095 (minx + 0.013061493635177612, -0.01480177417397499, maxz - 0.0016105808317661285),
2096 (minx + 0.017030677758157253, -0.01480177417397499, maxz - 0.00040655024349689484),
2097 (minx + 0.02115845651317172, -0.017049500718712807, maxz),
2098 (maxx - 0.017030648421496153, -0.017049500718712807, maxz - 0.00040655583143234253),
2099 (maxx - 0.013061466626822948, -0.017049500718712807, maxz - 0.0016105938702821732),
2100 (maxx - 0.00940344762057066, -0.017049500718712807, maxz - 0.0035658441483974457),
2101 (maxx - 0.006197170354425907, -0.017049500718712807, maxz - 0.006197171285748482),
2102 (maxx - 0.0035658441483974457, -0.017049500718712807, maxz - 0.009403450414538383),
2103 (maxx - 0.0016105901449918747, -0.017049502581357956, maxz - 0.013061468489468098),
2104 (maxx - 0.0004065539687871933, -0.017049502581357956, maxz - 0.017030649818480015),
2105 (maxx, -0.017049502581357956, maxz - 0.021158458637408728),
2106 (maxx - 0.0004065539687871933, -0.017049502581357956, minz + 0.017030648421496153),
2107 (maxx - 0.0016105901449918747, -0.017049502581357956, minz + 0.013061468489468098),
2108 (maxx - 0.0035658441483974457, -0.017049502581357956, minz + 0.00940344762057066),
2109 (maxx - 0.006197170354425907, -0.017049502581357956, minz + 0.006197166629135609),
2110 (maxx - 0.009403450414538383, -0.017049502581357956, minz + 0.0035658422857522964),
2111 (maxx - 0.013061470352113247, -0.017049502581357956, minz + 0.0016105901449918747),
2112 (maxx - 0.017030653543770313, -0.017049502581357956, minz + 0.0004065539687871933),
2113 (minx + 0.02115844961887081, -0.017049502581357956, minz),
2114 (minx + 0.017030637711286545, -0.017049502581357956, minz + 0.0004065539687871933),
2115 (minx + 0.013061455450952053, -0.017049502581357956, minz + 0.0016105975955724716),
2116 (minx + 0.009403438307344913, -0.017049502581357956, minz + 0.0035658497363328934),
2117 (minx + 0.006197156384587288, -0.017049502581357956, minz + 0.006197175942361355),
2118 (minx + 0.003565831109881401, -0.017049502581357956, minz + 0.00940345972776413),
2119 (minx + 0.001610584557056427, -0.017049502581357956, minz + 0.013061481527984142),
2120 (minx + 0.0004065483808517456, -0.017049502581357956, minz + 0.01703066425397992),
2121 (minx, -0.017049502581357956, maxz - 0.02115843980423726),
2122 (minx + 0.00040655583143234253, -0.017049502581357956, maxz - 0.01703062793239951),
2123 (minx + 0.0016105994582176208, -0.017049502581357956, maxz - 0.013061447069048882),
2124 (minx + 0.0035658515989780426, -0.017049500718712807, maxz - 0.009403428062796593),
2125 (minx + 0.006197184324264526, -0.017049500718712807, maxz - 0.006197153590619564),
2126 (minx + 0.00940346997231245, -0.017049500718712807, maxz - 0.003565829247236252),
2127 (minx + 0.013061493635177612, -0.017049500718712807, maxz - 0.0016105808317661285),
2128 (minx + 0.017030677758157253, -0.017049500718712807, maxz - 0.00040655024349689484),
2129 (minx + 0.021158456942334758, -0.017049498856067657, maxz - 0.00991731882095337),
2130 (maxx - 0.01896542147733271, -0.017049498856067657, maxz - 0.010133316740393639),
2131 (maxx - 0.016856661066412926, -0.017049498856067657, maxz - 0.010773001238703728),
2132 (maxx - 0.014913217630237341, -0.017049500718712807, maxz - 0.01181179191917181),
2133 (maxx - 0.013209773227572441, -0.017049500718712807, maxz - 0.013209772296249866),
2134 (maxx - 0.011811794713139534, -0.017049500718712807, maxz - 0.014913215301930904),
2135 (maxx - 0.010773001238703728, -0.017049500718712807, maxz - 0.01685666013509035),
2136 (maxx - 0.010133316740393639, -0.017049500718712807, maxz - 0.01896541938185692),
2137 (maxx - 0.009917320683598518, -0.017049500718712807, maxz - 0.02115845573538011),
2138 (maxx - 0.01013331487774849, -0.017049500718712807, minz + 0.018965424969792366),
2139 (maxx - 0.010773001238703728, -0.017049500718712807, minz + 0.01685666525736451),
2140 (maxx - 0.011811794713139534, -0.017049500718712807, minz + 0.01491321949288249),
2141 (maxx - 0.013209773227572441, -0.017049500718712807, minz + 0.01320977695286274),
2142 (maxx - 0.014913217630237341, -0.017049500718712807, minz + 0.011811795644462109),
2143 (maxx - 0.016856663394719362, -0.017049502581357956, minz + 0.010773002170026302),
2144 (maxx - 0.01896542403846979, -0.017049502581357956, minz + 0.010133319534361362),
2145 (minx + 0.021158453279507494, -0.017049502581357956, minz + 0.009917323477566242),
2146 (minx + 0.018965415423735976, -0.017049502581357956, minz + 0.010133319534361362),
2147 (minx + 0.016856654547154903, -0.017049502581357956, minz + 0.01077300775796175),
2148 (minx + 0.014913210645318031, -0.017049500718712807, minz + 0.011811801232397556),
2149 (minx + 0.013209767639636993, -0.017049500718712807, minz + 0.013209780678153038),
2150 (minx + 0.011811788193881512, -0.017049500718712807, minz + 0.014913226012140512),
2151 (minx + 0.01077299751341343, -0.017049500718712807, minz + 0.016856671776622534),
2152 (minx + 0.010133313946425915, -0.017049500718712807, minz + 0.018965433351695538),
2153 (minx + 0.009917320683598518, -0.017049500718712807, maxz - 0.02115844572963077),
2154 (minx + 0.010133318603038788, -0.017049500718712807, maxz - 0.01896540797315538),
2155 (minx + 0.0107730058953166, -0.017049500718712807, maxz - 0.01685664849355817),
2156 (minx + 0.011811800301074982, -0.017049500718712807, maxz - 0.014913204126060009),
2157 (minx + 0.013209782540798187, -0.017049500718712807, maxz - 0.013209762051701546),
2158 (minx + 0.014913228340446949, -0.017049500718712807, maxz - 0.011811783537268639),
2159 (minx + 0.016856675501912832, -0.017049498856067657, maxz - 0.010772991925477982),
2160 (minx + 0.01896543661132455, -0.017049498856067657, maxz - 0.010133312083780766),
2161 (maxx - 0.020345793396700174, -0.017049498856067657, maxz - 0.01707291603088379),
2162 (maxx - 0.018844185629859567, -0.017049498856067657, maxz - 0.017694902140647173),
2163 (maxx - 0.01821294822730124, -0.017049498856067657, maxz - 0.01821294496767223),
2164 (maxx - 0.017694905400276184, -0.017049498856067657, maxz - 0.018844182137399912),
2165 (maxx - 0.017309964634478092, -0.017049498856067657, maxz - 0.0195643559563905),
2166 (maxx - 0.01821294822730124, -0.017049498856067657, minz + 0.01821295404806733),
2167 (maxx - 0.019564359914511442, -0.017049498856067657, minz + 0.017309968825429678),
2168 (minx + 0.02034579199971631, -0.017049498856067657, minz + 0.017072923481464386),
2169 (minx + 0.018844183767214417, -0.017049498856067657, minz + 0.017694910988211632),
2170 (minx + 0.01769490260630846, -0.017049498856067657, minz + 0.01884419354610145),
2171 (minx + 0.017309962771832943, -0.017049498856067657, minz + 0.01956436806358397),
2172 (minx + 0.016992878634482622, -0.017049498856067657, maxz - 0.021158450354705316),
2173 (minx + 0.017309966031461954, -0.017049498856067657, maxz - 0.019564351649023592),
2174 (minx + 0.01821295195259154, -0.017049498856067657, maxz - 0.018212941009551287),
2175 (minx + 0.01884419028647244, -0.017049498856067657, maxz - 0.017694898648187518),
2176 (maxx - 0.021158457657990293, -0.017049498856067657, maxz - 0.016992874443531036),
2177 (maxx - 0.01956435921601951, -0.017049498856067657, maxz - 0.017309961607679725),
2178 (maxx - 0.017072918359190226, -0.017049498856067657, maxz - 0.020345790137071162),
2179 (maxx - 0.016992878168821335, -0.017049498856067657, maxz - 0.021158454062492393),
2180 (maxx - 0.017072918359190226, -0.017049498856067657, minz + 0.020345799159258604),
2181 (maxx - 0.017309964634478092, -0.017049498856067657, minz + 0.01956436550244689),
2182 (maxx - 0.017694905400276184, -0.017049498856067657, minz + 0.01884419098496437),
2183 (maxx - 0.018844186328351498, -0.017049498856067657, minz + 0.01769490959122777),
2184 (maxx - 0.020345794560853392, -0.017049498856067657, minz + 0.017072923481464386),
2185 (minx + 0.021158456452073482, -0.017049498856067657, minz + 0.01699288422241807),
2186 (minx + 0.019564357702620327, -0.017049498856067657, minz + 0.01730997092090547),
2187 (minx + 0.01821294636465609, -0.017049498856067657, minz + 0.018212955445051193),
2188 (minx + 0.01707291742786765, -0.017049498856067657, minz + 0.020345802302472293),
2189 (minx + 0.017072919756174088, -0.017049498856067657, maxz - 0.020345785829704255),
2190 (minx + 0.017694907495751977, -0.017049498856067657, maxz - 0.018844177946448326),
2191 (minx + 0.01956436550244689, -0.017049498856067657, maxz - 0.017309958348050714),
2192 (minx + 0.020345799799542874, -0.017049498856067657, maxz - 0.017072914633899927)]
2194 # Faces
2195 myfaces = [(0, 1, 3, 2), (2, 3, 5, 4), (4, 5, 7, 6), (6, 7, 9, 8), (8, 9, 11, 10),
2196 (10, 11, 13, 12), (12, 13, 15, 14), (14, 15, 17, 16), (16, 17, 19, 18), (18, 19, 21, 20),
2197 (20, 21, 23, 22), (22, 23, 25, 24), (24, 25, 27, 26), (26, 27, 29, 28), (28, 29, 31, 30),
2198 (30, 31, 33, 32), (32, 33, 35, 34), (34, 35, 37, 36), (36, 37, 39, 38), (38, 39, 41, 40),
2199 (40, 41, 43, 42), (42, 43, 45, 44), (44, 45, 47, 46), (46, 47, 49, 48), (48, 49, 51, 50),
2200 (50, 51, 53, 52), (52, 53, 55, 54), (54, 55, 57, 56), (56, 57, 59, 58), (58, 59, 61, 60),
2201 (60, 61, 63, 62), (62, 63, 1, 0), (45, 43, 85, 86), (23, 21, 74, 75), (51, 49, 88, 89),
2202 (7, 5, 66, 67), (29, 27, 77, 78), (57, 55, 91, 92), (35, 33, 80, 81), (13, 11, 69, 70),
2203 (63, 61, 94, 95), (41, 39, 83, 84), (19, 17, 72, 73), (47, 45, 86, 87), (3, 1, 64, 65),
2204 (25, 23, 75, 76), (53, 51, 89, 90), (9, 7, 67, 68), (31, 29, 78, 79), (59, 57, 92, 93),
2205 (37, 35, 81, 82), (15, 13, 70, 71), (1, 63, 95, 64), (43, 41, 84, 85), (21, 19, 73, 74),
2206 (49, 47, 87, 88), (5, 3, 65, 66), (27, 25, 76, 77), (55, 53, 90, 91), (11, 9, 68, 69),
2207 (33, 31, 79, 80), (61, 59, 93, 94), (39, 37, 82, 83), (17, 15, 71, 72), (89, 88, 120, 121),
2208 (67, 66, 98, 99), (78, 77, 109, 110), (87, 86, 118, 119), (65, 64, 96, 97), (76, 75, 107, 108),
2209 (64, 95, 127, 96), (85, 84, 116, 117), (74, 73, 105, 106), (94, 93, 125, 126), (83, 82, 114, 115),
2210 (72, 71, 103, 104), (92, 91, 123, 124), (81, 80, 112, 113), (70, 69, 101, 102), (90, 89, 121, 122),
2211 (68, 67, 99, 100), (79, 78, 110, 111), (88, 87, 119, 120), (66, 65, 97, 98), (77, 76, 108, 109),
2212 (86, 85, 117, 118), (75, 74, 106, 107), (95, 94, 126, 127), (84, 83, 115, 116), (73, 72, 104, 105),
2213 (93, 92, 124, 125), (82, 81, 113, 114), (71, 70, 102, 103), (91, 90, 122, 123), (69, 68, 100, 101),
2214 (80, 79, 111, 112), (123, 122, 154, 155), (101, 100, 132, 133), (112, 111, 143, 144),
2215 (121, 120, 152, 153),
2216 (99, 98, 130, 131), (110, 109, 141, 142), (119, 118, 150, 151), (97, 96, 128, 129), (108, 107, 139, 140),
2217 (96, 127, 159, 128), (117, 116, 148, 149), (106, 105, 137, 138), (126, 125, 157, 158),
2218 (115, 114, 146, 147),
2219 (104, 103, 135, 136), (124, 123, 155, 156), (113, 112, 144, 145), (102, 101, 133, 134),
2220 (122, 121, 153, 154),
2221 (100, 99, 131, 132), (111, 110, 142, 143), (120, 119, 151, 152), (98, 97, 129, 130),
2222 (109, 108, 140, 141),
2223 (118, 117, 149, 150), (107, 106, 138, 139), (127, 126, 158, 159), (116, 115, 147, 148),
2224 (105, 104, 136, 137),
2225 (125, 124, 156, 157), (114, 113, 145, 146), (103, 102, 134, 135), (157, 156, 173, 174),
2226 (133, 132, 162, 163),
2227 (134, 133, 163, 164), (132, 131, 161, 162), (150, 149, 169, 170), (146, 145, 167, 185),
2228 (135, 134, 164, 177),
2229 (155, 154, 172, 189), (144, 143, 183, 184), (153, 152, 171, 188), (131, 130, 176, 161),
2230 (142, 141, 182, 166),
2231 (151, 150, 170, 187), (129, 128, 175, 160), (140, 139, 181, 165), (128, 159, 191, 175),
2232 (149, 148, 186, 169),
2233 (138, 137, 179, 180), (158, 157, 174, 190), (147, 146, 185, 168), (136, 135, 177, 178),
2234 (156, 155, 189, 173),
2235 (145, 144, 184, 167), (154, 153, 188, 172), (143, 142, 166, 183), (152, 151, 187, 171),
2236 (130, 129, 160, 176),
2237 (141, 140, 165, 182), (139, 138, 180, 181), (159, 158, 190, 191), (148, 147, 168, 186),
2238 (137, 136, 178, 179),
2239 (175, 191, 190, 174, 173, 189, 172, 188, 171, 187, 170, 169, 186, 168, 185, 167, 184, 183, 166, 182, 165,
2240 181, 180, 179, 178, 177, 164, 163, 162, 161, 176, 160)]
2242 return myvertex, myfaces
2245 # ----------------------------------------------
2246 # Handle model 07
2247 # ----------------------------------------------
2248 def handle_model_07():
2249 # ------------------------------------
2250 # Mesh data
2251 # ------------------------------------
2252 minx = -0.10910986363887787
2253 maxx = 0.10910986363887787
2254 maxy = 0
2255 minz = -0.0039262366481125355
2256 maxz = 0.0039262366481125355
2258 # Vertex
2259 myvertex = [(maxx, -0.017620893195271492, maxz),
2260 (maxx, -0.01611838862299919, maxz - 0.00029886653646826744),
2261 (maxx, -0.014844624325633049, maxz - 0.0011499673128128052),
2262 (maxx, -0.013993524014949799, maxz - 0.002423731260932982),
2263 (maxx, -0.013694657012820244, minz + 0.003926236289926277),
2264 (maxx, -0.013993524014949799, minz + 0.002423729980364442),
2265 (maxx, -0.014844624325633049, minz + 0.001149968709796667),
2266 (maxx, -0.016118386760354042, minz + 0.0002988663036376238),
2267 (maxx, -0.017620891332626343, minz),
2268 (maxx, -0.019123397767543793, minz + 0.00029886653646826744),
2269 (maxx, -0.020397160202264786, minz + 0.0011499675456434488),
2270 (maxx, -0.021248264238238335, minz + 0.0024237307952716947),
2271 (maxx, -0.02154713124036789, maxz - 0.003926236195012284),
2272 (maxx, -0.021248262375593185, maxz - 0.0024237297475337982),
2273 (maxx, -0.020397160202264786, maxz - 0.0011499666143208742),
2274 (maxx, -0.019123397767543793, maxz - 0.0002988646738231182),
2275 (maxx - 0.02949388325214386, -0.01396019384264946, maxz - 0.0024807279696688056),
2276 (maxx - 0.030047059059143066, -0.01396019384264946, maxz - 0.0025907604722306132),
2277 (maxx - 0.030516013503074646, -0.01396019384264946, maxz - 0.002904107444919646),
2278 (maxx - 0.030829355120658875, -0.01396019384264946, maxz - 0.0033730645664036274),
2279 (maxx - 0.030939392745494843, -0.01396019198000431, minz + 0.003926236608184253),
2280 (maxx - 0.030829355120658875, -0.01396019384264946, minz + 0.0033730643335729837),
2281 (maxx - 0.030516013503074646, -0.01396019384264946, minz + 0.0029041077941656113),
2282 (maxx - 0.030047059059143066, -0.01396019384264946, minz + 0.002590760588645935),
2283 (maxx - 0.02949388325214386, -0.01396019384264946, minz + 0.0024807280860841274),
2284 (maxx - 0.02894071489572525, -0.01396019384264946, minz + 0.002590760588645935),
2285 (maxx - 0.028471753001213074, -0.01396019384264946, minz + 0.002904107444919646),
2286 (maxx - 0.028158411383628845, -0.01396019384264946, minz + 0.0033730644499883056),
2287 (maxx - 0.028048373758792877, -0.01396019384264946, maxz - 0.0039262363893523555),
2288 (maxx - 0.028158411383628845, -0.01396019384264946, maxz - 0.0033730638679116964),
2289 (maxx - 0.028471753001213074, -0.01396019384264946, maxz - 0.0029041070956736803),
2290 (maxx - 0.02894071489572525, -0.01396019384264946, maxz - 0.0025907597737386823),
2291 (maxx - 0.02949388325214386, -1.862645149230957e-09, maxz - 0.0024807279696688056),
2292 (maxx - 0.030047059059143066, -1.862645149230957e-09, maxz - 0.0025907604722306132),
2293 (maxx - 0.030516013503074646, -1.862645149230957e-09, maxz - 0.002904107444919646),
2294 (maxx - 0.030829355120658875, maxy, maxz - 0.0033730645664036274),
2295 (maxx - 0.030939392745494843, maxy, minz + 0.003926236608184253),
2296 (maxx - 0.030829355120658875, maxy, minz + 0.0033730643335729837),
2297 (maxx - 0.030516013503074646, -1.862645149230957e-09, minz + 0.0029041077941656113),
2298 (maxx - 0.030047059059143066, -1.862645149230957e-09, minz + 0.002590760588645935),
2299 (maxx - 0.02949388325214386, -1.862645149230957e-09, minz + 0.0024807280860841274),
2300 (maxx - 0.02894071489572525, -1.862645149230957e-09, minz + 0.002590760588645935),
2301 (maxx - 0.028471753001213074, -1.862645149230957e-09, minz + 0.002904107444919646),
2302 (maxx - 0.028158411383628845, -1.862645149230957e-09, minz + 0.0033730644499883056),
2303 (maxx - 0.028048373758792877, -1.862645149230957e-09, maxz - 0.0039262363893523555),
2304 (maxx - 0.028158411383628845, -1.862645149230957e-09, maxz - 0.0033730638679116964),
2305 (maxx - 0.028471753001213074, -1.862645149230957e-09, maxz - 0.0029041070956736803),
2306 (maxx - 0.02894071489572525, -1.862645149230957e-09, maxz - 0.0025907597737386823),
2307 (minx + 0.10910986037924886, -0.017620893195271492, maxz),
2308 (minx + 0.10910986037924886, -0.01611838862299919, maxz - 0.00029886653646826744),
2309 (minx + 0.10910986037924886, -0.014844624325633049, maxz - 0.0011499673128128052),
2310 (minx + 0.10910986037924886, -0.013993524014949799, maxz - 0.002423731260932982),
2311 (minx + 0.10910986037924886, -0.013694657012820244, minz + 0.003926236289926277),
2312 (minx + 0.10910986037924886, -0.013993524014949799, minz + 0.002423729980364442),
2313 (minx + 0.10910986037924886, -0.014844624325633049, minz + 0.001149968709796667),
2314 (minx + 0.10910986037924886, -0.016118386760354042, minz + 0.0002988663036376238),
2315 (minx + 0.10910986037924886, -0.017620891332626343, minz),
2316 (minx + 0.10910986037924886, -0.019123397767543793, minz + 0.00029886653646826744),
2317 (minx + 0.10910986037924886, -0.020397160202264786, minz + 0.0011499675456434488),
2318 (minx + 0.10910986037924886, -0.021248264238238335, minz + 0.0024237307952716947),
2319 (minx + 0.10910986037924886, -0.02154713124036789, maxz - 0.003926236195012284),
2320 (minx + 0.10910986037924886, -0.021248262375593185, maxz - 0.0024237297475337982),
2321 (minx + 0.10910986037924886, -0.020397160202264786, maxz - 0.0011499666143208742),
2322 (minx + 0.10910986037924886, -0.019123397767543793, maxz - 0.0002988646738231182),
2323 (minx, -0.017620893195271492, maxz),
2324 (minx, -0.01611838862299919, maxz - 0.00029886653646826744),
2325 (minx, -0.014844624325633049, maxz - 0.0011499673128128052),
2326 (minx, -0.013993524014949799, maxz - 0.002423731260932982),
2327 (minx, -0.013694657012820244, minz + 0.003926236289926277),
2328 (minx, -0.013993524014949799, minz + 0.002423729980364442),
2329 (minx, -0.014844624325633049, minz + 0.001149968709796667),
2330 (minx, -0.016118386760354042, minz + 0.0002988663036376238),
2331 (minx, -0.017620891332626343, minz),
2332 (minx, -0.019123397767543793, minz + 0.00029886653646826744),
2333 (minx, -0.020397160202264786, minz + 0.0011499675456434488),
2334 (minx, -0.021248264238238335, minz + 0.0024237307952716947),
2335 (minx, -0.02154713124036789, maxz - 0.003926236195012284),
2336 (minx, -0.021248262375593185, maxz - 0.0024237297475337982),
2337 (minx, -0.020397160202264786, maxz - 0.0011499666143208742),
2338 (minx, -0.019123397767543793, maxz - 0.0002988646738231182),
2339 (minx + 0.02949388325214386, -0.01396019384264946, maxz - 0.0024807279696688056),
2340 (minx + 0.030047059059143066, -0.01396019384264946, maxz - 0.0025907604722306132),
2341 (minx + 0.030516013503074646, -0.01396019384264946, maxz - 0.002904107444919646),
2342 (minx + 0.030829355120658875, -0.01396019384264946, maxz - 0.0033730645664036274),
2343 (minx + 0.030939392745494843, -0.01396019198000431, minz + 0.003926236608184253),
2344 (minx + 0.030829355120658875, -0.01396019384264946, minz + 0.0033730643335729837),
2345 (minx + 0.030516013503074646, -0.01396019384264946, minz + 0.0029041077941656113),
2346 (minx + 0.030047059059143066, -0.01396019384264946, minz + 0.002590760588645935),
2347 (minx + 0.02949388325214386, -0.01396019384264946, minz + 0.0024807280860841274),
2348 (minx + 0.02894071489572525, -0.01396019384264946, minz + 0.002590760588645935),
2349 (minx + 0.028471753001213074, -0.01396019384264946, minz + 0.002904107444919646),
2350 (minx + 0.028158411383628845, -0.01396019384264946, minz + 0.0033730644499883056),
2351 (minx + 0.028048373758792877, -0.01396019384264946, maxz - 0.0039262363893523555),
2352 (minx + 0.028158411383628845, -0.01396019384264946, maxz - 0.0033730638679116964),
2353 (minx + 0.028471753001213074, -0.01396019384264946, maxz - 0.0029041070956736803),
2354 (minx + 0.02894071489572525, -0.01396019384264946, maxz - 0.0025907597737386823),
2355 (minx + 0.02949388325214386, -1.862645149230957e-09, maxz - 0.0024807279696688056),
2356 (minx + 0.030047059059143066, -1.862645149230957e-09, maxz - 0.0025907604722306132),
2357 (minx + 0.030516013503074646, -1.862645149230957e-09, maxz - 0.002904107444919646),
2358 (minx + 0.030829355120658875, maxy, maxz - 0.0033730645664036274),
2359 (minx + 0.030939392745494843, maxy, minz + 0.003926236608184253),
2360 (minx + 0.030829355120658875, maxy, minz + 0.0033730643335729837),
2361 (minx + 0.030516013503074646, -1.862645149230957e-09, minz + 0.0029041077941656113),
2362 (minx + 0.030047059059143066, -1.862645149230957e-09, minz + 0.002590760588645935),
2363 (minx + 0.02949388325214386, -1.862645149230957e-09, minz + 0.0024807280860841274),
2364 (minx + 0.02894071489572525, -1.862645149230957e-09, minz + 0.002590760588645935),
2365 (minx + 0.028471753001213074, -1.862645149230957e-09, minz + 0.002904107444919646),
2366 (minx + 0.028158411383628845, -1.862645149230957e-09, minz + 0.0033730644499883056),
2367 (minx + 0.028048373758792877, -1.862645149230957e-09, maxz - 0.0039262363893523555),
2368 (minx + 0.028158411383628845, -1.862645149230957e-09, maxz - 0.0033730638679116964),
2369 (minx + 0.028471753001213074, -1.862645149230957e-09, maxz - 0.0029041070956736803),
2370 (minx + 0.02894071489572525, -1.862645149230957e-09, maxz - 0.0025907597737386823)]
2372 # Faces
2373 myfaces = [(49, 48, 0, 1), (60, 59, 11, 12), (58, 57, 9, 10), (56, 55, 7, 8), (54, 53, 5, 6),
2374 (52, 51, 3, 4), (48, 63, 15, 0), (50, 49, 1, 2), (61, 60, 12, 13), (59, 58, 10, 11),
2375 (57, 56, 8, 9), (55, 54, 6, 7), (53, 52, 4, 5), (63, 62, 14, 15), (51, 50, 2, 3),
2376 (62, 61, 13, 14), (17, 16, 32, 33), (32, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33),
2377 (28, 27, 43, 44), (26, 25, 41, 42),
2378 (24, 23, 39, 40), (22, 21, 37, 38), (20, 19, 35, 36), (16, 31, 47, 32), (18, 17, 33, 34),
2379 (29, 28, 44, 45), (27, 26, 42, 43), (25, 24, 40, 41), (23, 22, 38, 39), (21, 20, 36, 37),
2380 (31, 30, 46, 47), (19, 18, 34, 35), (30, 29, 45, 46), (49, 65, 64, 48), (60, 76, 75, 59),
2381 (58, 74, 73, 57), (56, 72, 71, 55), (54, 70, 69, 53), (52, 68, 67, 51), (48, 64, 79, 63),
2382 (50, 66, 65, 49), (61, 77, 76, 60), (59, 75, 74, 58), (57, 73, 72, 56), (55, 71, 70, 54),
2383 (53, 69, 68, 52), (63, 79, 78, 62), (51, 67, 66, 50), (62, 78, 77, 61), (81, 97, 96, 80),
2384 (96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111), (92, 108, 107, 91),
2385 (90, 106, 105, 89), (88, 104, 103, 87), (86, 102, 101, 85),
2386 (84, 100, 99, 83), (80, 96, 111, 95), (82, 98, 97, 81), (93, 109, 108, 92), (91, 107, 106, 90),
2387 (89, 105, 104, 88), (87, 103, 102, 86), (85, 101, 100, 84), (95, 111, 110, 94), (83, 99, 98, 82),
2388 (94, 110, 109, 93), (0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1),
2389 (64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79)]
2391 return myvertex, myfaces
2394 # ----------------------------------------------
2395 # Handle model 08
2396 # ----------------------------------------------
2397 def handle_model_08():
2398 # ------------------------------------
2399 # Mesh data
2400 # ------------------------------------
2401 minx = -0.05910986289381981
2402 maxx = 0.05910986289381981
2403 maxy = 0
2404 minz = -0.0039262366481125355
2405 maxz = 0.0039262366481125355
2407 # Vertex
2408 myvertex = [(maxx, -0.017620893195271492, maxz),
2409 (maxx, -0.01611838862299919, maxz - 0.00029886653646826744),
2410 (maxx, -0.014844624325633049, maxz - 0.0011499673128128052),
2411 (maxx, -0.013993524014949799, maxz - 0.002423731260932982),
2412 (maxx, -0.013694657012820244, minz + 0.003926236289926277),
2413 (maxx, -0.013993524014949799, minz + 0.002423729980364442),
2414 (maxx, -0.014844624325633049, minz + 0.001149968709796667),
2415 (maxx, -0.016118386760354042, minz + 0.0002988663036376238),
2416 (maxx, -0.017620891332626343, minz),
2417 (maxx, -0.019123397767543793, minz + 0.00029886653646826744),
2418 (maxx, -0.020397160202264786, minz + 0.0011499675456434488),
2419 (maxx, -0.021248264238238335, minz + 0.0024237307952716947),
2420 (maxx, -0.02154713124036789, maxz - 0.003926236195012284),
2421 (maxx, -0.021248262375593185, maxz - 0.0024237297475337982),
2422 (maxx, -0.020397160202264786, maxz - 0.0011499666143208742),
2423 (maxx, -0.019123397767543793, maxz - 0.0002988646738231182),
2424 (maxx - 0.010583892464637756, -0.01396019384264946, maxz - 0.0024807279696688056),
2425 (maxx - 0.011137068271636963, -0.01396019384264946, maxz - 0.0025907604722306132),
2426 (maxx - 0.011606022715568542, -0.01396019384264946, maxz - 0.002904107444919646),
2427 (maxx - 0.011919364333152771, -0.01396019384264946, maxz - 0.0033730645664036274),
2428 (maxx - 0.012029401957988739, -0.01396019198000431, minz + 0.003926236608184253),
2429 (maxx - 0.011919364333152771, -0.01396019384264946, minz + 0.0033730643335729837),
2430 (maxx - 0.011606022715568542, -0.01396019384264946, minz + 0.0029041077941656113),
2431 (maxx - 0.011137068271636963, -0.01396019384264946, minz + 0.002590760588645935),
2432 (maxx - 0.010583892464637756, -0.01396019384264946, minz + 0.0024807280860841274),
2433 (maxx - 0.010030724108219147, -0.01396019384264946, minz + 0.002590760588645935),
2434 (maxx - 0.00956176221370697, -0.01396019384264946, minz + 0.002904107444919646),
2435 (maxx - 0.009248420596122742, -0.01396019384264946, minz + 0.0033730644499883056),
2436 (maxx - 0.009138382971286774, -0.01396019384264946, maxz - 0.0039262363893523555),
2437 (maxx - 0.009248420596122742, -0.01396019384264946, maxz - 0.0033730638679116964),
2438 (maxx - 0.00956176221370697, -0.01396019384264946, maxz - 0.0029041070956736803),
2439 (maxx - 0.010030724108219147, -0.01396019384264946, maxz - 0.0025907597737386823),
2440 (maxx - 0.010583892464637756, -1.862645149230957e-09, maxz - 0.0024807279696688056),
2441 (maxx - 0.011137068271636963, -1.862645149230957e-09, maxz - 0.0025907604722306132),
2442 (maxx - 0.011606022715568542, -1.862645149230957e-09, maxz - 0.002904107444919646),
2443 (maxx - 0.011919364333152771, maxy, maxz - 0.0033730645664036274),
2444 (maxx - 0.012029401957988739, maxy, minz + 0.003926236608184253),
2445 (maxx - 0.011919364333152771, maxy, minz + 0.0033730643335729837),
2446 (maxx - 0.011606022715568542, -1.862645149230957e-09, minz + 0.0029041077941656113),
2447 (maxx - 0.011137068271636963, -1.862645149230957e-09, minz + 0.002590760588645935),
2448 (maxx - 0.010583892464637756, -1.862645149230957e-09, minz + 0.0024807280860841274),
2449 (maxx - 0.010030724108219147, -1.862645149230957e-09, minz + 0.002590760588645935),
2450 (maxx - 0.00956176221370697, -1.862645149230957e-09, minz + 0.002904107444919646),
2451 (maxx - 0.009248420596122742, -1.862645149230957e-09, minz + 0.0033730644499883056),
2452 (maxx - 0.009138382971286774, -1.862645149230957e-09, maxz - 0.0039262363893523555),
2453 (maxx - 0.009248420596122742, -1.862645149230957e-09, maxz - 0.0033730638679116964),
2454 (maxx - 0.00956176221370697, -1.862645149230957e-09, maxz - 0.0029041070956736803),
2455 (maxx - 0.010030724108219147, -1.862645149230957e-09, maxz - 0.0025907597737386823),
2456 (minx, -0.017620893195271492, maxz),
2457 (minx, -0.01611838862299919, maxz - 0.00029886653646826744),
2458 (minx, -0.014844624325633049, maxz - 0.0011499673128128052),
2459 (minx, -0.013993524014949799, maxz - 0.002423731260932982),
2460 (minx, -0.013694657012820244, minz + 0.003926236289926277),
2461 (minx, -0.013993524014949799, minz + 0.002423729980364442),
2462 (minx, -0.014844624325633049, minz + 0.001149968709796667),
2463 (minx, -0.016118386760354042, minz + 0.0002988663036376238),
2464 (minx, -0.017620891332626343, minz),
2465 (minx, -0.019123397767543793, minz + 0.00029886653646826744),
2466 (minx, -0.020397160202264786, minz + 0.0011499675456434488),
2467 (minx, -0.021248264238238335, minz + 0.0024237307952716947),
2468 (minx, -0.02154713124036789, maxz - 0.003926236195012284),
2469 (minx, -0.021248262375593185, maxz - 0.0024237297475337982),
2470 (minx, -0.020397160202264786, maxz - 0.0011499666143208742),
2471 (minx, -0.019123397767543793, maxz - 0.0002988646738231182),
2472 (minx + 0.010583892464637756, -0.01396019384264946, maxz - 0.0024807279696688056),
2473 (minx + 0.011137068271636963, -0.01396019384264946, maxz - 0.0025907604722306132),
2474 (minx + 0.011606022715568542, -0.01396019384264946, maxz - 0.002904107444919646),
2475 (minx + 0.011919364333152771, -0.01396019384264946, maxz - 0.0033730645664036274),
2476 (minx + 0.012029401957988739, -0.01396019198000431, minz + 0.003926236608184253),
2477 (minx + 0.011919364333152771, -0.01396019384264946, minz + 0.0033730643335729837),
2478 (minx + 0.011606022715568542, -0.01396019384264946, minz + 0.0029041077941656113),
2479 (minx + 0.011137068271636963, -0.01396019384264946, minz + 0.002590760588645935),
2480 (minx + 0.010583892464637756, -0.01396019384264946, minz + 0.0024807280860841274),
2481 (minx + 0.010030724108219147, -0.01396019384264946, minz + 0.002590760588645935),
2482 (minx + 0.00956176221370697, -0.01396019384264946, minz + 0.002904107444919646),
2483 (minx + 0.009248420596122742, -0.01396019384264946, minz + 0.0033730644499883056),
2484 (minx + 0.009138382971286774, -0.01396019384264946, maxz - 0.0039262363893523555),
2485 (minx + 0.009248420596122742, -0.01396019384264946, maxz - 0.0033730638679116964),
2486 (minx + 0.00956176221370697, -0.01396019384264946, maxz - 0.0029041070956736803),
2487 (minx + 0.010030724108219147, -0.01396019384264946, maxz - 0.0025907597737386823),
2488 (minx + 0.010583892464637756, -1.862645149230957e-09, maxz - 0.0024807279696688056),
2489 (minx + 0.011137068271636963, -1.862645149230957e-09, maxz - 0.0025907604722306132),
2490 (minx + 0.011606022715568542, -1.862645149230957e-09, maxz - 0.002904107444919646),
2491 (minx + 0.011919364333152771, maxy, maxz - 0.0033730645664036274),
2492 (minx + 0.012029401957988739, maxy, minz + 0.003926236608184253),
2493 (minx + 0.011919364333152771, maxy, minz + 0.0033730643335729837),
2494 (minx + 0.011606022715568542, -1.862645149230957e-09, minz + 0.0029041077941656113),
2495 (minx + 0.011137068271636963, -1.862645149230957e-09, minz + 0.002590760588645935),
2496 (minx + 0.010583892464637756, -1.862645149230957e-09, minz + 0.0024807280860841274),
2497 (minx + 0.010030724108219147, -1.862645149230957e-09, minz + 0.002590760588645935),
2498 (minx + 0.00956176221370697, -1.862645149230957e-09, minz + 0.002904107444919646),
2499 (minx + 0.009248420596122742, -1.862645149230957e-09, minz + 0.0033730644499883056),
2500 (minx + 0.009138382971286774, -1.862645149230957e-09, maxz - 0.0039262363893523555),
2501 (minx + 0.009248420596122742, -1.862645149230957e-09, maxz - 0.0033730638679116964),
2502 (minx + 0.00956176221370697, -1.862645149230957e-09, maxz - 0.0029041070956736803),
2503 (minx + 0.010030724108219147, -1.862645149230957e-09, maxz - 0.0025907597737386823),
2504 (maxx - 0.0591098596341908, -0.017620893195271492, maxz),
2505 (maxx - 0.0591098596341908, -0.01611838862299919, maxz - 0.00029886653646826744),
2506 (maxx - 0.0591098596341908, -0.014844624325633049, maxz - 0.0011499673128128052),
2507 (maxx - 0.0591098596341908, -0.013993524014949799, maxz - 0.002423731260932982),
2508 (maxx - 0.0591098596341908, -0.013694657012820244, minz + 0.003926236289926277),
2509 (maxx - 0.0591098596341908, -0.013993524014949799, minz + 0.002423729980364442),
2510 (maxx - 0.0591098596341908, -0.014844624325633049, minz + 0.001149968709796667),
2511 (maxx - 0.0591098596341908, -0.016118386760354042, minz + 0.0002988663036376238),
2512 (maxx - 0.0591098596341908, -0.017620891332626343, minz),
2513 (maxx - 0.0591098596341908, -0.019123397767543793, minz + 0.00029886653646826744),
2514 (maxx - 0.0591098596341908, -0.020397160202264786, minz + 0.0011499675456434488),
2515 (maxx - 0.0591098596341908, -0.021248264238238335, minz + 0.0024237307952716947),
2516 (maxx - 0.0591098596341908, -0.02154713124036789, maxz - 0.003926236195012284),
2517 (maxx - 0.0591098596341908, -0.021248262375593185, maxz - 0.0024237297475337982),
2518 (maxx - 0.0591098596341908, -0.020397160202264786, maxz - 0.0011499666143208742),
2519 (maxx - 0.0591098596341908, -0.019123397767543793, maxz - 0.0002988646738231182)]
2521 # Faces
2522 myfaces = [(97, 96, 0, 1), (108, 107, 11, 12), (106, 105, 9, 10), (104, 103, 7, 8), (102, 101, 5, 6),
2523 (100, 99, 3, 4), (96, 111, 15, 0), (98, 97, 1, 2), (109, 108, 12, 13), (107, 106, 10, 11),
2524 (105, 104, 8, 9), (103, 102, 6, 7), (101, 100, 4, 5), (111, 110, 14, 15), (99, 98, 2, 3),
2525 (110, 109, 13, 14), (17, 16, 32, 33), (32, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33),
2526 (28, 27, 43, 44), (26, 25, 41, 42),
2527 (24, 23, 39, 40), (22, 21, 37, 38), (20, 19, 35, 36), (16, 31, 47, 32), (18, 17, 33, 34),
2528 (29, 28, 44, 45), (27, 26, 42, 43), (25, 24, 40, 41), (23, 22, 38, 39), (21, 20, 36, 37),
2529 (31, 30, 46, 47), (19, 18, 34, 35), (30, 29, 45, 46),
2530 (0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1),
2531 (97, 49, 48, 96),
2532 (108, 60, 59, 107), (106, 58, 57, 105), (104, 56, 55, 103), (102, 54, 53, 101), (100, 52, 51, 99),
2533 (96, 48, 63, 111), (98, 50, 49, 97), (109, 61, 60, 108), (107, 59, 58, 106), (105, 57, 56, 104),
2534 (103, 55, 54, 102), (101, 53, 52, 100), (111, 63, 62, 110), (99, 51, 50, 98), (110, 62, 61, 109),
2535 (65, 81, 80, 64), (80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95), (76, 92, 91, 75),
2536 (74, 90, 89, 73), (72, 88, 87, 71),
2537 (70, 86, 85, 69), (68, 84, 83, 67), (64, 80, 95, 79), (66, 82, 81, 65), (77, 93, 92, 76),
2538 (75, 91, 90, 74), (73, 89, 88, 72), (71, 87, 86, 70), (69, 85, 84, 68), (79, 95, 94, 78),
2539 (67, 83, 82, 66), (78, 94, 93, 77), (48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63)]
2541 return myvertex, myfaces
2544 # ----------------------------------------------
2545 # Creaate SKU code for inventory
2546 # ----------------------------------------------
2547 def createunitsku(self, cabinet):
2548 # ------------------
2549 # Wall or Floor
2550 # ------------------
2551 if self.type_cabinet == "1":
2552 p1 = "F"
2553 else:
2554 p1 = "W"
2555 # ------------------
2556 # Front type
2557 # ------------------
2558 if cabinet.dType == "1" or cabinet.dType == "2" or cabinet.dType == "3" or cabinet.dType == "8":
2559 p2 = "D" # door
2560 elif cabinet.dType == "9" or cabinet.dType == "10":
2561 p2 = "L" # door
2562 elif cabinet.dType == "4" or cabinet.dType == "5" or cabinet.dType == "6" or cabinet.dType == "11":
2563 p2 = "G" # glass
2564 elif cabinet.dType == "7":
2565 p2 = "W" # drawers
2566 else:
2567 p2 = "N" # none
2568 # ------------------
2569 # Door number
2570 # ------------------
2571 if cabinet.dType == "1" or cabinet.dType == "2" or cabinet.dType == "3" or cabinet.dType == "4" \
2572 or cabinet.dType == "5" or cabinet.dType == "6" or cabinet.dType == "9" or cabinet.dType == "10":
2573 p3 = "01"
2574 elif cabinet.dType == "7":
2575 p3 = "%02d" % cabinet.dNum
2576 elif cabinet.dType == "8" or cabinet.dType == "11":
2577 p3 = "02"
2578 else:
2579 p3 = "00"
2580 # ------------------
2581 # Handles
2582 # ------------------
2583 if cabinet.hand is True:
2584 p4 = 1
2585 else:
2586 p4 = 0
2587 # ------------------
2588 # Shelves
2589 # ------------------
2590 # noinspection PyBroadException
2591 try:
2592 if cabinet.dType == "7":
2593 p5 = "00" # drawers is always 0
2594 else:
2595 p5 = "%02d" % cabinet.sNum
2596 except:
2597 p5 = "00"
2598 # ------------------
2599 # Size
2600 # ------------------
2601 x = cabinet.sX
2602 y = self.depth + cabinet.wY
2603 z = self.height + cabinet.wZ
2605 p6 = "%06.3fx%06.3fx%06.3f-%06.3f" % (x, y, z, self.thickness)
2607 # ------------------
2608 # Door Size
2609 # ------------------
2610 if cabinet.dType == "1" or cabinet.dType == "2" or cabinet.dType == "3" \
2611 or cabinet.dType == "4" or cabinet.dType == "5" or cabinet.dType == "6":
2612 p7 = "%06.3f" % cabinet.sX
2613 elif cabinet.dType == "8" or cabinet.dType == "11":
2614 p7 = "%06.3f" % (cabinet.sX / 2)
2615 elif cabinet.dType == "9" or cabinet.dType == "10": # corners
2616 dwidth = cabinet.sX - self.depth - self.thickness - 0.001
2617 p7 = "%06.3f" % dwidth
2618 else:
2619 p7 = "%06.3f" % 0
2621 sku = "%s%s%s%s%s-%s-%s" % (p1, p2, p3, p4, p5, p6, p7)
2623 return sku