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