Update for changes in Blender's API
[blender-addons.git] / archimesh / achm_venetian_maker.py
blob57adf0ef64bc27694810f8ba47cb6818f25c4eed
1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
19 # <pep8 compliant>
21 # ----------------------------------------------------------
22 # Author: Antonio Vazquez (antonioya)
24 # ----------------------------------------------------------
25 # noinspection PyUnresolvedReferences
26 import bpy
27 from math import atan, sin, cos, radians
28 # noinspection PyUnresolvedReferences
29 from bpy.types import Operator, PropertyGroup, Object, Panel
30 from bpy.props import FloatProperty, BoolProperty, IntProperty, FloatVectorProperty, CollectionProperty
31 from .achm_tools import *
34 # ------------------------------------------------------------------
35 # Define operator class to create object
36 # ------------------------------------------------------------------
37 class AchmVenetian(Operator):
38 bl_idname = "mesh.archimesh_venetian"
39 bl_label = "Venetian blind"
40 bl_description = "Venetian"
41 bl_category = 'Archimesh'
42 bl_options = {'REGISTER', 'UNDO'}
44 # -----------------------------------------------------
45 # Draw (create UI interface)
46 # -----------------------------------------------------
47 # noinspection PyUnusedLocal
48 def draw(self, context):
49 layout = self.layout
50 row = layout.row()
51 row.label("Use Properties panel (N) to define parms", icon='INFO')
53 # -----------------------------------------------------
54 # Execute
55 # -----------------------------------------------------
56 def execute(self, context):
57 if bpy.context.mode == "OBJECT":
58 create_object(self, context)
59 return {'FINISHED'}
60 else:
61 self.report({'WARNING'}, "Archimesh: Option only valid in Object mode")
62 return {'CANCELLED'}
65 # ------------------------------------------------------------------------------
67 # Create main object. The other objects will be children of this.
69 # ------------------------------------------------------------------------------
70 # noinspection PyUnusedLocal
71 def create_object(self, context):
72 # deselect all objects
73 for o in bpy.data.objects:
74 o.select = False
76 # we create main object and mesh
77 mainmesh = bpy.data.meshes.new("VenetianFrane")
78 mainobject = bpy.data.objects.new("VenetianFrame", mainmesh)
79 mainobject.location = bpy.context.scene.cursor_location
80 bpy.context.scene.objects.link(mainobject)
81 mainobject.VenetianObjectGenerator.add()
83 # we shape the main object and create other objects as children
84 shape_mesh_and_create_children(mainobject, mainmesh)
86 # we select, and activate, main object
87 mainobject.select = True
88 bpy.context.scene.objects.active = mainobject
91 # ------------------------------------------------------------------------------
93 # Update main mesh and children objects
95 # ------------------------------------------------------------------------------
96 # noinspection PyUnusedLocal
97 def update_object(self, context):
98 # When we update, the active object is the main object
99 o = bpy.context.active_object
100 oldmesh = o.data
101 oldname = o.data.name
102 # Now we deselect that object to not delete it.
103 o.select = False
104 # and we create a new mesh
105 tmp_mesh = bpy.data.meshes.new("temp")
106 # deselect all objects
107 for obj in bpy.data.objects:
108 obj.select = False
110 # -----------------------
111 # remove all children
112 # -----------------------
113 # first granchild
114 for child in o.children:
115 remove_children(child)
116 # now children of main object
117 remove_children(o)
119 # Finally we create all that again (except main object),
120 shape_mesh_and_create_children(o, tmp_mesh, True)
121 o.data = tmp_mesh
122 # Remove data (mesh of active object),
123 bpy.data.meshes.remove(oldmesh)
124 tmp_mesh.name = oldname
125 # and select, and activate, the main object
126 o.select = True
127 bpy.context.scene.objects.active = o
130 # ------------------------------------------------------------------------------
131 # Generate all objects
132 # For main, it only shapes mesh and creates modifiers (the modifier, only the first time).
133 # And, for the others, it creates object and mesh.
134 # ------------------------------------------------------------------------------
135 # noinspection PyUnusedLocal
136 def shape_mesh_and_create_children(mainobject, tmp_mesh, update=False):
137 mp = mainobject.VenetianObjectGenerator[0]
138 mat = None
139 plastic = None
141 if mp.crt_mat and bpy.context.scene.render.engine == 'CYCLES':
142 rgb = mp.objcol
143 plastic = create_diffuse_material("Plastic_venetian_material", True, rgb[0], rgb[1], rgb[2], rgb[0], rgb[1],
144 rgb[2], 0.2)
146 # ------------------
147 # Top
148 # ------------------
149 create_venetian_top(tmp_mesh, mp.width + 0.002, mp.depth + 0.002, -0.06)
151 # materials
152 if mp.crt_mat and bpy.context.scene.render.engine == 'CYCLES':
153 set_material(mainobject, plastic)
154 # --------------------------------------------------------------------------------
155 # segments
156 # --------------------------------------------------------------------------------
157 margin = mp.depth
158 mydata = create_slat_mesh("Venetian_slats", mp.width, mp.depth, mp.height - 0.06, mp.angle, mp.ratio)
159 myslats = mydata[0]
160 myslats.parent = mainobject
161 myslats.location.x = 0
162 myslats.location.y = 0
163 myslats.location.z = -margin - 0.04
165 mypoints = mydata[1]
166 angleused = mydata[2]
167 # refine
168 remove_doubles(myslats)
169 set_normals(myslats)
170 set_smooth(myslats)
172 if mp.crt_mat and bpy.context.scene.render.engine == 'CYCLES':
173 set_material(myslats, plastic)
174 # ------------------------
175 # Strings (Middle)
176 # ------------------------
177 myp = [((0, 0, mypoints[0] + margin), (0, 0, 0), (0, 0, 0)),
178 ((0, 0, mypoints[len(mypoints) - 1]), (0, 0, 0), (0, 0, 0))]
180 mycurvel = create_bezier("String.L", myp, (0, 0, 0))
181 mycurvel.parent = myslats
182 mycurvec = create_bezier("String.C", myp, (0, 0, 0))
183 mycurvec.parent = myslats
184 mycurver = create_bezier("String.R", myp, (0, 0, 0))
185 mycurver.parent = myslats
187 if mp.width < 0.60:
188 sep = 0.058
189 else:
190 sep = 0.148
192 mycurvel.location.x = (mp.width / 2) - sep
193 mycurvel.location.y = 0
194 mycurvel.location.z = 0
196 mycurvec.location.x = 0
197 mycurvec.location.y = 0
198 mycurvec.location.z = 0
200 mycurver.location.x = -(mp.width / 2) + sep
201 mycurver.location.y = 0
202 mycurver.location.z = 0
204 if mp.crt_mat and bpy.context.scene.render.engine == 'CYCLES':
205 mat = create_diffuse_material("String_material", False, 0.674, 0.617, 0.496, 0.1, 0.1, 0.1, 0.01)
206 set_material(mycurvel, mat)
207 set_material(mycurvec, mat)
208 set_material(mycurver, mat)
209 # ------------------------
210 # Strings (Front)
211 # ------------------------
212 myp = [((0, 0, margin), (0, 0, 0), (0, 0, 0)),
213 ((0, 0, mypoints[len(mypoints) - 1] - 0.003 - sin(radians(angleused)) * mp.depth / 2), (0, 0, 0),
214 (0, 0, 0))]
216 mycurvelf = create_bezier("String.f.L", myp, (0, 0, 0), 0.001, 'FRONT')
217 mycurvelf.parent = myslats
218 mycurvecf = create_bezier("String.f.C", myp, (0, 0, 0), 0.001, 'FRONT')
219 mycurvecf.parent = myslats
220 mycurverf = create_bezier("String.f.R", myp, (0, 0, 0), 0.001, 'FRONT')
221 mycurverf.parent = myslats
223 if mp.width < 0.60:
224 sep = 0.058
225 else:
226 sep = 0.148
228 mycurvelf.location.x = (mp.width / 2) - sep
229 mycurvelf.location.y = ((-mp.depth / 2) * cos(radians(mp.angle))) - 0.001
230 mycurvelf.location.z = 0
232 mycurvecf.location.x = 0
233 mycurvecf.location.y = ((-mp.depth / 2) * cos(radians(mp.angle))) - 0.001
234 mycurvecf.location.z = 0
236 mycurverf.location.x = -(mp.width / 2) + sep
237 mycurverf.location.y = ((-mp.depth / 2) * cos(radians(mp.angle))) - 0.001
238 mycurverf.location.z = 0
240 if mp.crt_mat and bpy.context.scene.render.engine == 'CYCLES':
241 set_material(mycurvelf, mat)
242 set_material(mycurvecf, mat)
243 set_material(mycurverf, mat)
245 # ------------------------
246 # Strings (Back)
247 # ------------------------
248 myp = [((0, 0, margin), (0, 0, 0), (0, 0, 0)),
249 ((0, 0, mypoints[len(mypoints) - 1] - 0.003 + sin(radians(angleused)) * mp.depth / 2),
250 (0, 0, 0),
251 (0, 0, 0))]
253 mycurvelb = create_bezier("String.b.L", myp, (0, 0, 0), 0.001, 'BACK')
254 mycurvelb.parent = myslats
255 mycurvecb = create_bezier("String.b.C", myp, (0, 0, 0), 0.001, 'BACK')
256 mycurvecb.parent = myslats
257 mycurverb = create_bezier("String.b.R", myp, (0, 0, 0), 0.001, 'BACK')
258 mycurverb.parent = myslats
260 if mp.width < 0.60:
261 sep = 0.058
262 else:
263 sep = 0.148
265 mycurvelb.location.x = (mp.width / 2) - sep
266 mycurvelb.location.y = ((mp.depth / 2) * cos(radians(mp.angle))) + 0.001
267 mycurvelb.location.z = 0
269 mycurvecb.location.x = 0
270 mycurvecb.location.y = ((mp.depth / 2) * cos(radians(mp.angle))) + 0.001
271 mycurvecb.location.z = 0
273 mycurverb.location.x = -(mp.width / 2) + sep
274 mycurverb.location.y = ((mp.depth / 2) * cos(radians(mp.angle))) + 0.001
275 mycurverb.location.z = 0
277 if mp.crt_mat and bpy.context.scene.render.engine == 'CYCLES':
278 set_material(mycurvelb, mat)
279 set_material(mycurvecb, mat)
280 set_material(mycurverb, mat)
282 # ------------------
283 # Bottom
284 # ------------------
285 mybase = create_venetian_base("Venetian_base", mp.width + 0.002, mp.depth + 0.002, -0.006)
286 mybase.parent = myslats
287 mybase.location.x = 0
288 mybase.location.y = 0
289 mybase.location.z = mypoints[len(mypoints) - 1]
290 mybase.rotation_euler = (radians(angleused), 0, 0)
292 # materials
293 if mp.crt_mat and bpy.context.scene.render.engine == 'CYCLES':
294 set_material(mybase, plastic)
295 # ------------------
296 # Stick
297 # ------------------
298 mystick = get_venetian_stick("Venetian_stick", mp.height * 0.6)
299 mystick.parent = mainobject
300 mystick.location.x = -mp.width / 2 + 0.03
301 mystick.location.y = -mp.depth / 2 - 0.003
302 mystick.location.z = -0.03
303 # materials
304 if mp.crt_mat and bpy.context.scene.render.engine == 'CYCLES':
305 matstick = create_diffuse_material("Stick_material", False, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.04)
306 set_material(mybase, matstick)
308 # ------------------
309 # Strings up/down
310 # ------------------
311 mystring = get_venetian_strings("Venetian_updown", mp.height * 0.75)
312 mystring.parent = mainobject
313 mystring.location.x = mp.width / 2 - 0.03
314 mystring.location.y = -mp.depth / 2 - 0.003
315 mystring.location.z = -0.03
317 if mp.crt_mat and bpy.context.scene.render.engine == 'CYCLES':
318 set_material(mystring, mat)
319 # deactivate others
320 for o in bpy.data.objects:
321 if o.select is True and o.name != mainobject.name:
322 o.select = False
324 return
327 # ------------------------------------------------------------------
328 # Define property group class to create or modify
329 # ------------------------------------------------------------------
330 class ObjectProperties(PropertyGroup):
331 width = FloatProperty(
332 name='Width',
333 min=0.30, max=4, default=1, precision=3,
334 description='Total width', update=update_object,
336 height = FloatProperty(
337 name='Height',
338 min=0.20, max=10, default=1.7, precision=3,
339 description='Total height',
340 update=update_object,
342 depth = FloatProperty(
343 name='Slat depth', min=0.02, max=0.30, default=0.04,
344 precision=3,
345 description='Slat depth', update=update_object,
347 angle = FloatProperty(
348 name='Angle', min=0, max=85, default=0, precision=1,
349 description='Angle of the slats', update=update_object,
351 ratio = IntProperty(
352 name='Extend', min=0, max=100, default=100,
353 description='% of extension (100 full extend)', update=update_object,
356 # Materials
357 crt_mat = BoolProperty(
358 name="Create default Cycles materials",
359 description="Create default materials for Cycles render",
360 default=True, update=update_object,
362 objcol = FloatVectorProperty(
363 name="Color",
364 description="Color for material",
365 default=(0.616, 0.435, 1.0, 1.0),
366 min=0.1, max=1,
367 subtype='COLOR',
368 size=4, update=update_object,
371 # Register
372 bpy.utils.register_class(ObjectProperties)
373 Object.VenetianObjectGenerator = CollectionProperty(type=ObjectProperties)
376 # ------------------------------------------------------------------
377 # Define panel class to modify object
378 # ------------------------------------------------------------------
379 class AchmVenetianObjectgeneratorpanel(Panel):
380 bl_idname = "OBJECT_PT_venetian_generator"
381 bl_label = "Venetian"
382 bl_space_type = 'VIEW_3D'
383 bl_region_type = 'UI'
384 bl_category = 'Archimesh'
386 # -----------------------------------------------------
387 # Verify if visible
388 # -----------------------------------------------------
389 @classmethod
390 def poll(cls, context):
391 o = context.object
392 if o is None:
393 return False
394 if 'VenetianObjectGenerator' not in o:
395 return False
396 else:
397 return True
399 # -----------------------------------------------------
400 # Draw (create UI interface)
401 # -----------------------------------------------------
402 def draw(self, context):
403 o = context.object
404 # noinspection PyBroadException
405 try:
406 if 'VenetianObjectGenerator' not in o:
407 return
408 except:
409 return
411 layout = self.layout
412 if bpy.context.mode == 'EDIT_MESH':
413 layout.label('Warning: Operator does not work in edit mode.', icon='ERROR')
414 else:
415 myobjdat = o.VenetianObjectGenerator[0]
416 space = bpy.context.space_data
417 if not space.local_view:
418 # Imperial units warning
419 if bpy.context.scene.unit_settings.system == "IMPERIAL":
420 row = layout.row()
421 row.label("Warning: Imperial units not supported", icon='COLOR_RED')
423 box = layout.box()
424 row = box.row()
425 row.prop(myobjdat, 'width')
426 row.prop(myobjdat, 'height')
427 row.prop(myobjdat, 'depth')
428 row = box.row()
429 row.prop(myobjdat, 'angle', slider=True)
430 row.prop(myobjdat, 'ratio', slider=True)
432 box = layout.box()
433 if not context.scene.render.engine == 'CYCLES':
434 box.enabled = False
435 box.prop(myobjdat, 'crt_mat')
436 if myobjdat.crt_mat:
437 row = box.row()
438 row.prop(myobjdat, 'objcol')
439 else:
440 row = layout.row()
441 row.label("Warning: Operator does not work in local view mode", icon='ERROR')
444 # ------------------------------------------------------------------------------
445 # Create rectangular base
447 # x: size x axis
448 # y: size y axis
449 # z: size z axis
450 # ------------------------------------------------------------------------------
451 def create_venetian_top(mymesh, x, y, z):
452 myvertex = [(-x / 2, -y / 2, 0.0),
453 (-x / 2, y / 2, 0.0),
454 (x / 2, y / 2, 0.0),
455 (x / 2, -y / 2, 0.0),
456 (-x / 2, -y / 2, z),
457 (-x / 2, y / 2, z),
458 (x / 2, y / 2, z),
459 (x / 2, -y / 2, z)]
461 myfaces = [(0, 1, 2, 3), (0, 1, 5, 4), (1, 2, 6, 5), (2, 6, 7, 3), (5, 6, 7, 4), (0, 4, 7, 3)]
463 mymesh.from_pydata(myvertex, [], myfaces)
464 mymesh.update(calc_edges=True)
466 return
469 # ------------------------------------------------------------
470 # Create venetian slats
472 # width: total width of the slat
473 # depth: depth of the slat
474 # height: Total height (extended)
475 # ratio: factor of extension 0-collapsed 100-extended
476 # angle: angle
477 # ------------------------------------------------------------
478 def create_slat_mesh(objname, width, depth, height, angle, ratio):
479 # Vertex
480 v = 0
481 gap = 0.001
482 angleused = 0
483 myvertex = []
484 myfaces = []
485 mypoints = []
486 # Calculate total slats
487 separation = (depth * 0.75) # posZ is % of depth
488 numslats = int(height / separation)
489 collapsedslats = numslats - int((height * ((100 - ratio) / 100)) / separation)
490 # --------------------------------
491 # Generate slats
492 # --------------------------------
493 posz = 0
494 for x in range(numslats):
495 if x < collapsedslats:
496 angleused = angle
497 elif x == collapsedslats:
498 angleused = angle / 2
499 else:
500 angleused = 0
501 # if the slat is collapsed, the angle is 0
503 mydata = get_slat_data(v, angleused, width, depth, posz)
504 mypoints.extend([posz]) # saves all Z points
505 myvertex.extend(mydata[0])
506 myfaces.extend(mydata[1])
507 v = mydata[2]
508 if x < collapsedslats:
509 posz -= separation
510 else:
511 posz -= gap
512 # Transition to horizontal
513 if angleused == angle / 2:
514 sinheight = sin(radians(angle / 2)) * depth / 2
515 posz -= sinheight
517 mesh = bpy.data.meshes.new(objname)
518 myobject = bpy.data.objects.new(objname, mesh)
520 myobject.location = bpy.context.scene.cursor_location
521 bpy.context.scene.objects.link(myobject)
523 mesh.from_pydata(myvertex, [], myfaces)
524 mesh.update(calc_edges=True)
526 return myobject, mypoints, angleused
529 # ------------------------------------------------------------
530 # Generate slat data for venetian slat mesh
532 # v: last vertex index
533 # angle: angle
534 # width: total width of the slat
535 # depth: depth of the slat
536 # posZ: position in Z axis
537 # ------------------------------------------------------------
538 def get_slat_data(v, angle, width, depth, posz):
539 # ------------------------------------
540 # Mesh data
541 # ------------------------------------
542 maxx = width / 2
543 miny = -depth / 2
544 maxy = depth / 2
545 maxz = 0.0028
546 gap = 0.0025
547 radio = 0.00195
548 sinv = sin(atan(maxz / (maxy - gap)))
549 cos_value = cos(radians(angle))
550 sin_value = sin(radians(angle))
552 if width < 0.60:
553 sep = 0.06
554 else:
555 sep = 0.15
557 sep2 = sep - 0.005
559 # Vertex
560 myvertex = []
562 myvertex.extend(
563 [(maxx - 0.0017, (miny + 0.00195) * cos_value, posz + (-maxz + (radio * sinv)) + ((miny + 0.00195) * sin_value)),
564 (maxx - 0.0017, (maxy - 0.00195) * cos_value, posz + (-maxz + (radio * sinv)) + ((maxy - 0.00195) * sin_value)),
565 (maxx - 0.0045, miny * cos_value, posz + -maxz + (miny * sin_value)),
566 (maxx - 0.0045, maxy * cos_value, posz + -maxz + (maxy * sin_value)),
567 (maxx, -gap * cos_value, posz + (-gap * sin_value)),
568 (maxx, gap * cos_value, posz + (gap * sin_value)),
569 (maxx - 0.0045, -gap * cos_value, posz + (-gap * sin_value)),
570 (maxx - 0.0045, gap * cos_value, posz + (gap * sin_value)),
571 (0.001172, miny * cos_value, posz + -maxz + (miny * sin_value)),
572 (0.001172, maxy * cos_value, posz + -maxz + (maxy * sin_value)),
573 (0.001172, -gap * cos_value, posz + (-gap * sin_value)),
574 (0.001172, gap * cos_value, posz + (gap * sin_value)),
575 (maxx - sep, miny * cos_value, posz + -maxz + (miny * sin_value)),
576 (maxx - sep, maxy * cos_value, posz + -maxz + (maxy * sin_value)),
577 (maxx - sep, -gap * cos_value, posz + (-gap * sin_value)),
578 (maxx - sep, gap * cos_value, posz + (gap * sin_value)),
579 (maxx - sep2, miny * cos_value, posz + -maxz + (miny * sin_value)),
580 (maxx - sep2, maxy * cos_value, posz + -maxz + (maxy * sin_value)),
581 (maxx - sep2, -gap * cos_value, posz + (-gap * sin_value)),
582 (maxx - sep2, gap * cos_value, posz + (gap * sin_value))])
584 myvertex.extend(
585 [(-maxx + 0.0017, (miny + 0.00195) * cos_value, posz + (-maxz + (radio * sinv)) + ((miny + 0.00195) * sin_value)),
586 (-maxx + 0.0017, (maxy - 0.00195) * cos_value, posz + (-maxz + (radio * sinv)) + ((maxy - 0.00195) * sin_value)),
587 (-maxx + 0.0045, miny * cos_value, posz + -maxz + (miny * sin_value)),
588 (-maxx + 0.0045, maxy * cos_value, posz + -maxz + (maxy * sin_value)),
589 (-maxx, -gap * cos_value, posz + (-gap * sin_value)),
590 (-maxx, gap * cos_value, posz + (gap * sin_value)),
591 (-maxx + 0.0045, -gap * cos_value, posz + (-gap * sin_value)),
592 (-maxx + 0.0045, gap * cos_value, posz + (gap * sin_value)),
593 (-0.001172, miny * cos_value, posz + -maxz + (miny * sin_value)),
594 (-0.001172, maxy * cos_value, posz + -maxz + (maxy * sin_value)),
595 (-0.001172, -gap * cos_value, posz + (-gap * sin_value)),
596 (-0.001172, gap * cos_value, posz + (gap * sin_value)),
597 (-maxx + sep, miny * cos_value, posz + -maxz + (miny * sin_value)),
598 (-maxx + sep, maxy * cos_value, posz + -maxz + (maxy * sin_value)),
599 (-maxx + sep, -gap * cos_value, posz + (-gap * sin_value)),
600 (-maxx + sep, gap * cos_value, posz + (gap * sin_value)),
601 (-maxx + sep2, miny * cos_value, posz + -maxz + (miny * sin_value)),
602 (-maxx + sep2, maxy * cos_value, posz + -maxz + (maxy * sin_value)),
603 (-maxx + sep2, -gap * cos_value, posz + (-gap * sin_value)),
604 (-maxx + sep2, gap * cos_value, posz + (gap * sin_value))])
606 # Faces
607 myfaces = [(v + 7, v + 5, v + 1, v + 3), (v + 19, v + 7, v + 3, v + 17), (v + 2, v + 0, v + 4, v + 6),
608 (v + 6, v + 4, v + 5, v + 7), (v + 16, v + 2, v + 6, v + 18),
609 (v + 18, v + 6, v + 7, v + 19), (v + 11, v + 15, v + 13, v + 9), (v + 8, v + 12, v + 14, v + 10),
610 (v + 10, v + 14, v + 15, v + 11), (v + 15, v + 19, v + 17, v + 13),
611 (v + 12, v + 16, v + 18, v + 14), (v + 39, v + 35, v + 33, v + 37), (v + 34, v + 38, v + 36, v + 32),
612 (v + 27, v + 25, v + 21, v + 23), (v + 27, v + 26, v + 24, v + 25),
613 (v + 24, v + 26, v + 22, v + 20), (v + 39, v + 37, v + 23, v + 27), (v + 39, v + 27, v + 26, v + 38),
614 (v + 38, v + 26, v + 22, v + 36), (v + 30, v + 34, v + 32, v + 28),
615 (v + 34, v + 30, v + 31, v + 35), (v + 35, v + 31, v + 29, v + 33), (v + 11, v + 9, v + 29, v + 31),
616 (v + 8, v + 10, v + 30, v + 28)]
618 v += len(myvertex)
620 return myvertex, myfaces, v
623 # ------------------------------------------------------------------------------
624 # Create rectangular base
626 # objName: Object name
627 # x: size x axis
628 # y: size y axis
629 # z: size z axis
630 # ------------------------------------------------------------------------------
631 def create_venetian_base(objname, x, y, z):
632 myvertex = [(-x / 2, -y / 2, 0.0),
633 (-x / 2, y / 2, 0.0),
634 (x / 2, y / 2, 0.0),
635 (x / 2, -y / 2, 0.0),
636 (-x / 2, -y / 2, z),
637 (-x / 2, y / 2, z),
638 (x / 2, y / 2, z),
639 (x / 2, -y / 2, z)]
641 myfaces = [(0, 1, 2, 3), (0, 1, 5, 4), (1, 2, 6, 5), (2, 6, 7, 3), (5, 6, 7, 4), (0, 4, 7, 3)]
643 mesh = bpy.data.meshes.new(objname)
644 myobject = bpy.data.objects.new(objname, mesh)
646 myobject.location = bpy.context.scene.cursor_location
647 bpy.context.scene.objects.link(myobject)
649 mesh.from_pydata(myvertex, [], myfaces)
650 mesh.update(calc_edges=True)
652 return myobject
655 # ------------------------------------------------------------
656 # Generate stick for venetian
658 # objName: Object name
659 # height: height
660 # ------------------------------------------------------------
661 def get_venetian_stick(objname, height):
662 # ------------------------------------
663 # Mesh data
664 # ------------------------------------
665 minx = -0.005686083808541298
666 maxx = 0.005686083808541298
667 # minZ = -0.2236524224281311
668 minz = -height
669 maxz = 0
671 # Vertex
672 myvertex = [(minx + 0.0031912513077259064, -0.012805024161934853, maxz - 0.02722930908203125),
673 (minx + 0.0030460257548838854, -0.007894348353147507, maxz - 0.008386015892028809),
674 (minx + 0.003936204360798001, -0.014603500254452229, maxz - 0.02722930908203125),
675 (minx + 0.003812092007137835, -0.006685533560812473, maxz - 0.009785711765289307),
676 (maxx - 0.005637487949570641, -0.01534845307469368, maxz - 0.02722930908203125),
677 (minx + 0.005661540681103361, -0.006184821017086506, maxz - 0.010365545749664307),
678 (maxx - 0.0038390127010643482, -0.014603500254452229, maxz - 0.02722930908203125),
679 (maxx - 0.0038611787604168057, -0.006685533560812473, maxz - 0.009785711765289307),
680 (maxx - 0.0030940594151616096, -0.012805024161934853, maxz - 0.02722930908203125),
681 (maxx - 0.0030951115768402815, -0.007894348353147507, maxz - 0.008386015892028809),
682 (maxx - 0.0038390120025724173, -0.011006549000740051, maxz - 0.02722930908203125),
683 (maxx - 0.0038611781783401966, -0.009103144519031048, maxz - 0.0069863200187683105),
684 (maxx - 0.005637487425701693, -0.010261595249176025, maxz - 0.02722930908203125),
685 (minx + 0.005661541004883475, -0.00960385799407959, maxz - 0.0064064860343933105),
686 (minx + 0.003936204593628645, -0.011006549000740051, maxz - 0.02722930908203125),
687 (minx + 0.003812092822045088, -0.009103145450353622, maxz - 0.0069863200187683105),
688 (minx + 0.004708557506091893, -0.0009992714039981365, maxz - 0.002431390807032585),
689 (minx + 0.004987679829355329, -0.0009992715204134583, maxz - 0.0031052385456860065),
690 (minx + 0.005661541195877362, -0.0009992715204134583, maxz - 0.0033843691926449537),
691 (maxx - 0.00503676530206576, -0.0009992715204134583, maxz - 0.0031052385456860065),
692 (maxx - 0.004757642629556358, -0.0009992716368287802, maxz - 0.002431390807032585),
693 (maxx - 0.005036764952819794, -0.0009992715204134583, maxz - 0.0017575474921613932),
694 (minx + 0.005661541457811836, -0.0009992715204134583, maxz - 0.0014784171944484115),
695 (minx + 0.004987680295016617, -0.0009992715204134583, maxz - 0.0017575474921613932),
696 (minx + 0.0038341645849868655, -0.010904508642852306, maxz - 0.015928268432617188),
697 (maxx - 0.005637487367494032, -0.01011728961020708, maxz - 0.015928268432617188),
698 (maxx - 0.003736971877515316, -0.010904508642852306, maxz - 0.015928268432617188),
699 (maxx - 0.002949752612039447, -0.012805024161934853, maxz - 0.015928268432617188),
700 (maxx - 0.0037369721103459597, -0.014705540612339973, maxz - 0.015928268432617188),
701 (maxx - 0.00563748789136298, -0.015492759644985199, maxz - 0.015928268432617188),
702 (minx + 0.0038341644685715437, -0.014705540612339973, maxz - 0.015928268432617188),
703 (minx + 0.003046944970265031, -0.012805024161934853, maxz - 0.015928268432617188),
704 (minx + 0.0043586865067481995, -0.012638782151043415, maxz - 0.013130486011505127),
705 (minx + 0.004740283475257456, -0.0120366420596838, maxz - 0.013827741146087646),
706 (minx + 0.0056615397916175425, -0.011787224560976028, maxz - 0.014116525650024414),
707 (maxx - 0.004789371509104967, -0.0120366420596838, maxz - 0.013827741146087646),
708 (maxx - 0.0044077744241803885, -0.012638782151043415, maxz - 0.013130486011505127),
709 (maxx - 0.0047893712762743235, -0.013240913860499859, maxz - 0.012433230876922607),
710 (minx + 0.005661539897118928, -0.01349033135920763, maxz - 0.01214444637298584),
711 (minx + 0.004740283824503422, -0.013240914791822433, maxz - 0.012433230876922607),
712 (minx + 0.005661537383275572, -0.012638770043849945, maxz - 0.017504926770925522),
713 (maxx - 0.0039202586049214005, -0.010174507275223732, maxz - 0.015622403472661972),
714 (maxx - 0.0028137227054685354, -0.013580016791820526, maxz - 0.015622403472661972),
715 (minx + 0.005661537154082907, -0.015684761106967926, maxz - 0.015622403472661972),
716 (minx + 0.0027646280359476805, -0.013580016791820526, maxz - 0.015622403472661972),
717 (minx + 0.003871166962198913, -0.010174507275223732, maxz - 0.015622403472661972),
718 (maxx - 0.0028137224726378918, -0.011697524227201939, maxz - 0.01257637981325388),
719 (maxx - 0.003920258954167366, -0.015103034675121307, maxz - 0.01257637981325388),
720 (minx + 0.0038711666129529476, -0.015103034675121307, maxz - 0.01257637981325388),
721 (minx + 0.002764628268778324, -0.011697524227201939, maxz - 0.01257637981325388),
722 (minx + 0.0056615376142872265, -0.00959277804940939, maxz - 0.01257637981325388),
723 (minx + 0.005661537383275572, -0.012638770043849945, maxz - 0.010693902149796486),
724 (maxx - 0.004007883137091994, -0.013192017562687397, maxz - 0.016996320337057114),
725 (maxx - 0.004658283665776253, -0.011190323159098625, maxz - 0.016996320337057114),
726 (maxx - 0.002955520059913397, -0.011743564158678055, maxz - 0.015889829024672508),
727 (minx + 0.00566153760337329, -0.009741866029798985, maxz - 0.015889829024672508),
728 (minx + 0.0046091912081465125, -0.011190323159098625, maxz - 0.016996320337057114),
729 (minx + 0.005661537248670356, -0.014429156668484211, maxz - 0.016996320337057114),
730 (maxx - 0.004007878364063799, -0.014982416294515133, maxz - 0.015889829024672508),
731 (minx + 0.003958789980970323, -0.013192017562687397, maxz - 0.016996320337057114),
732 (minx + 0.00395878404378891, -0.014982416294515133, maxz - 0.015889829024672508),
733 (minx + 0.002906427951529622, -0.011743564158678055, maxz - 0.015889829024672508),
734 (maxx - 0.004658278776332736, -0.009399918839335442, maxz - 0.014099414460361004),
735 (minx + 0.004609186435118318, -0.009399918839335442, maxz - 0.014099414460361004),
736 (maxx - 0.0023051041644066572, -0.012638770043849945, maxz - 0.014099414460361004),
737 (maxx - 0.0029555035289376974, -0.010637051425874233, maxz - 0.014099414460361004),
738 (maxx - 0.004658279241994023, -0.015877623111009598, maxz - 0.014099414460361004),
739 (maxx - 0.0029555039945989847, -0.014640489593148232, maxz - 0.014099414460361004),
740 (minx + 0.0029064100235700607, -0.014640489593148232, maxz - 0.014099414460361004),
741 (minx + 0.00460918596945703, -0.015877623111009598, maxz - 0.014099414460361004),
742 (minx + 0.002906410489231348, -0.010637051425874233, maxz - 0.014099414460361004),
743 (minx + 0.0022560113575309515, -0.012638770043849945, maxz - 0.014099414460361004),
744 (maxx - 0.004007878014817834, -0.010295123793184757, maxz - 0.012308954261243343),
745 (maxx - 0.002955520059913397, -0.013533977791666985, maxz - 0.012308954261243343),
746 (minx + 0.005661537164996844, -0.015535674057900906, maxz - 0.012308954261243343),
747 (minx + 0.0029064277186989784, -0.013533977791666985, maxz - 0.012308954261243343),
748 (minx + 0.003958784393034875, -0.010295123793184757, maxz - 0.012308954261243343),
749 (maxx - 0.004007883137091994, -0.012085524387657642, maxz - 0.011202462017536163),
750 (minx + 0.0056615375196997775, -0.01084838341921568, maxz - 0.011202462017536163),
751 (maxx - 0.004658283898606896, -0.01408721785992384, maxz - 0.011202462017536163),
752 (minx + 0.004609190975315869, -0.01408721785992384, maxz - 0.011202462017536163),
753 (minx + 0.003958789980970323, -0.012085524387657642, maxz - 0.011202462017536163),
754 (minx + 0.003936204593628645, -0.011006549000740051, minz),
755 (maxx - 0.005637487425701693, -0.010261595249176025, minz),
756 (maxx - 0.0038390120025724173, -0.011006549000740051, minz),
757 (maxx - 0.0030940594151616096, -0.012805024161934853, minz),
758 (maxx - 0.0038390127010643482, -0.014603500254452229, minz),
759 (maxx - 0.005637487949570641, -0.01534845307469368, minz),
760 (minx + 0.003936204360798001, -0.014603500254452229, minz),
761 (minx + 0.0031912513077259064, -0.012805024161934853, minz),
762 (minx, -0.001379312016069889, maxz - 0.005334946792572737),
763 (minx, -4.6566128730773926e-09, maxz - 0.005334946792572737),
764 (maxx, -4.6566128730773926e-09, maxz - 0.005334946792572737),
765 (maxx, -0.001379312016069889, maxz - 0.005334946792572737),
766 (minx, -0.001379312016069889, maxz - 1.5133991837501526e-08),
767 (minx, -4.6566128730773926e-09, maxz - 1.5133991837501526e-08),
768 (maxx, -4.6566128730773926e-09, maxz - 1.5133991837501526e-08),
769 (maxx, -0.001379312016069889, maxz - 1.5133991837501526e-08),
770 (minx + 0.0009754756465554237, -0.001379312016069889, maxz - 0.00447732862085104),
771 (minx + 0.0009754756465554237, -0.001379312016069889, maxz - 0.0008576327236369252),
772 (maxx - 0.0009754756465554237, -0.001379312016069889, maxz - 0.0008576327236369252),
773 (maxx - 0.0009754756465554237, -0.001379312016069889, maxz - 0.00447732862085104),
774 (minx + 0.0009754756465554237, -0.0007799165323376656, maxz - 0.00447732862085104),
775 (minx + 0.0009754756465554237, -0.0007799165323376656, maxz - 0.0008576327236369252),
776 (maxx - 0.0009754756465554237, -0.0007799165323376656, maxz - 0.0008576327236369252),
777 (maxx - 0.0009754756465554237, -0.0007799165323376656, maxz - 0.00447732862085104)]
779 # Faces
780 myfaces = [(1, 15, 23, 16), (17, 16, 23, 22, 21, 20, 19, 18),
781 (15, 13, 22, 23), (13, 11, 21, 22), (11, 9, 20, 21),
782 (9, 7, 19, 20), (7, 5, 18, 19), (5, 3, 17, 18), (3, 1, 16, 17), (0, 31, 24, 14),
783 (14, 24, 25, 12), (12, 25, 26, 10), (10, 26, 27, 8), (8, 27, 28, 6), (6, 28, 29, 4),
784 (2, 30, 31, 0), (4, 29, 30, 2), (15, 1, 32, 39), (13, 15, 39, 38), (11, 13, 38, 37),
785 (9, 11, 37, 36), (7, 9, 36, 35), (5, 7, 35, 34), (3, 5, 34, 33), (1, 3, 33, 32),
786 (40, 53, 52), (41, 53, 55), (40, 52, 57), (40, 57, 59), (40, 59, 56),
787 (41, 55, 62), (42, 54, 64), (43, 58, 66), (44, 60, 68), (45, 61, 70),
788 (41, 62, 65), (42, 64, 67), (43, 66, 69), (44, 68, 71), (45, 70, 63),
789 (46, 72, 77), (47, 73, 79), (48, 74, 80), (49, 75, 81), (50, 76, 78),
790 (52, 54, 42), (52, 53, 54), (53, 41, 54), (55, 56, 45), (55, 53, 56),
791 (53, 40, 56), (57, 58, 43), (57, 52, 58), (52, 42, 58), (59, 60, 44),
792 (59, 57, 60), (57, 43, 60), (56, 61, 45), (56, 59, 61), (59, 44, 61),
793 (62, 63, 50), (62, 55, 63), (55, 45, 63), (64, 65, 46), (64, 54, 65),
794 (54, 41, 65), (66, 67, 47), (66, 58, 67), (58, 42, 67), (68, 69, 48),
795 (68, 60, 69), (60, 43, 69), (70, 71, 49), (70, 61, 71), (61, 44, 71),
796 (65, 72, 46), (65, 62, 72), (62, 50, 72), (67, 73, 47), (67, 64, 73),
797 (64, 46, 73), (69, 74, 48), (69, 66, 74), (66, 47, 74), (71, 75, 49),
798 (71, 68, 75), (68, 48, 75), (63, 76, 50), (63, 70, 76), (70, 49, 76),
799 (77, 78, 51), (77, 72, 78), (72, 50, 78), (79, 77, 51), (79, 73, 77),
800 (73, 46, 77), (80, 79, 51), (80, 74, 79), (74, 47, 79), (81, 80, 51),
801 (81, 75, 80), (75, 48, 80), (78, 81, 51), (78, 76, 81), (76, 49, 81),
802 (87, 4, 2, 88), (88, 2, 0, 89), (86, 6, 4, 87), (85, 8, 6, 86), (84, 10, 8, 85),
803 (83, 12, 10, 84), (82, 14, 12, 83), (89, 0, 14, 82), (94, 95, 91, 90), (95, 96, 92, 91),
804 (96, 97, 93, 92), (98, 101, 105, 102), (90, 91, 92, 93), (97, 96, 95, 94), (98, 99, 94, 90),
805 (100, 101, 93, 97), (99, 100, 97, 94), (101, 98, 90, 93), (104, 103, 102, 105), (100, 99, 103, 104),
806 (101, 100, 104, 105), (99, 98, 102, 103)]
808 mesh = bpy.data.meshes.new(objname)
809 myobject = bpy.data.objects.new(objname, mesh)
811 myobject.location = bpy.context.scene.cursor_location
812 bpy.context.scene.objects.link(myobject)
814 mesh.from_pydata(myvertex, [], myfaces)
815 mesh.update(calc_edges=True)
817 return myobject
820 # ------------------------------------------------------------
821 # Generate strings for venetian
823 # objName: Object name
824 # height: height
825 # ------------------------------------------------------------
826 def get_venetian_strings(objname, height):
827 # ------------------------------------
828 # Mesh data
829 # ------------------------------------
830 minx = -0.006897219456732273
831 maxx = 0.006897197104990482
832 maxy = 1.57160684466362e-08
833 minz = -height
834 maxz = 0
836 # Vertex
837 myvertex = [(maxx - 0.004941887455061078, -0.005041633266955614, minz + 3.1925737857818604e-05),
838 (maxx - 0.005070153623819351, -0.004731120076030493, minz + 4.9524009227752686e-05),
839 (maxx - 0.005380495102144778, -0.004602177534252405, minz + 5.389750003814697e-05),
840 (maxx - 0.005691118887625635, -0.00473033869639039, minz + 4.2498111724853516e-05),
841 (maxx - 0.005820065038278699, -0.005040528252720833, minz + 2.1979212760925293e-05),
842 (maxx - 0.005691798985935748, -0.005351040977984667, minz + 4.380941390991211e-06),
843 (maxx - 0.005381457391194999, -0.0054799835197627544, minz),
844 (maxx - 0.005070833722129464, -0.005351822357624769, minz + 1.1406838893890381e-05),
845 (maxx - 0.005004765349440277, -0.005394590552896261, minz + 0.029493853449821472),
846 (maxx - 0.005133012658916414, -0.005083992145955563, minz + 0.02950144186615944),
847 (maxx - 0.005443348782137036, -0.004955026786774397, minz + 0.029502809047698975),
848 (maxx - 0.005753983394242823, -0.005083239171653986, minz + 0.02949715033173561),
849 (maxx - 0.0058829509653151035, -0.005393524654209614, minz + 0.02948778122663498),
850 (maxx - 0.005754703655838966, -0.005704122595489025, minz + 0.029480192810297012),
851 (maxx - 0.005444367183372378, -0.005833088420331478, minz + 0.029478825628757477),
852 (maxx - 0.005133732687681913, -0.005704876501113176, minz + 0.02948448434472084),
853 (maxx - 0.005029367166571319, -0.005440863780677319, maxz - 0.029401594772934914),
854 (maxx - 0.005157589330337942, -0.005130413919687271, maxz - 0.029417745769023895),
855 (maxx - 0.005467916373163462, -0.005001509562134743, maxz - 0.029425399377942085),
856 (maxx - 0.005778562976047397, -0.0051296609453856945, maxz - 0.029420070350170135),
857 (maxx - 0.005907556158490479, -0.00543979974463582, maxz - 0.029404880478978157),
858 (maxx - 0.005779333529062569, -0.005750249605625868, maxz - 0.029388729482889175),
859 (maxx - 0.005469006602652371, -0.005879154894500971, maxz - 0.029381075873970985),
860 (maxx - 0.005158359999768436, -0.0057510025799274445, maxz - 0.029386404901742935),
861 (maxx - 0.00503770902287215, -0.005161902867257595, maxz - 0.015295670367777348),
862 (maxx - 0.00516585458535701, -0.004854197148233652, maxz - 0.015373632311820984),
863 (maxx - 0.005476148682646453, -0.00472648162394762, maxz - 0.01540757529437542),
864 (maxx - 0.0057868254370987415, -0.004853568039834499, maxz - 0.015377615578472614),
865 (maxx - 0.005915894289501011, -0.005161012522876263, maxz - 0.015301303938031197),
866 (maxx - 0.0057877483777701855, -0.005468717776238918, maxz - 0.015223342925310135),
867 (maxx - 0.005477453931234777, -0.005596434231847525, maxz - 0.01518939808011055),
868 (maxx - 0.005166777293197811, -0.005469346884638071, maxz - 0.01521935872733593),
869 (maxx - 0.0050518905045464635, -0.004537198692560196, maxz - 0.007016266230493784),
870 (maxx - 0.0051788275595754385, -0.004260011948645115, maxz - 0.007274628151208162),
871 (maxx - 0.005488568218424916, -0.004146246705204248, maxz - 0.007390326354652643),
872 (maxx - 0.005799670936539769, -0.004262544680386782, maxz - 0.007295588497072458),
873 (maxx - 0.005929895443841815, -0.004540780559182167, maxz - 0.007045908365398645),
874 (maxx - 0.0058029580395668745, -0.004817967768758535, maxz - 0.006787544582039118),
875 (maxx - 0.005493217264302075, -0.004931733012199402, maxz - 0.006671848241239786),
876 (maxx - 0.005182114546187222, -0.004815434105694294, maxz - 0.006766586098819971),
877 (maxx - 0.005094519350677729, -0.0035386907402426004, maxz - 0.003334574867039919),
878 (maxx - 0.005213141208514571, -0.0034136706963181496, maxz - 0.0038649537600576878),
879 (maxx - 0.005518985213711858, -0.003371135564520955, maxz - 0.004107045475393534),
880 (maxx - 0.0058328923769295216, -0.0034360019490122795, maxz - 0.003919033799320459),
881 (maxx - 0.005970980157144368, -0.003570271423086524, maxz - 0.003411055076867342),
882 (maxx - 0.005852358415722847, -0.003695291467010975, maxz - 0.002880676183849573),
883 (maxx - 0.005546514177694917, -0.0037378265988081694, maxz - 0.002638584468513727),
884 (maxx - 0.005232607247307897, -0.003672960214316845, maxz - 0.0028265961445868015),
885 (maxx - 0.005944175529293716, -0.0036394987255334854, maxz - 0.003126396331936121),
886 (maxx - 0.005875613423995674, -0.00560829509049654, maxz - 0.02939625270664692),
887 (maxx - 0.005034194211475551, -0.005343204364180565, maxz - 0.021542727947235107),
888 (maxx - 0.005612890352495015, -0.00580073706805706, minz + 0.029478538781404495),
889 (maxx - 0.0052128632087260485, -0.005448057781904936, minz + 3.8817524909973145e-06),
890 (maxx - 0.005320212687365711, -0.004174317233264446, maxz - 0.007358333561569452),
891 (maxx - 0.005857669049873948, -0.005254213232547045, minz + 0.01586836576461792),
892 (maxx - 0.005270682042464614, -0.002958775730803609, maxz - 0.0018540903693065047),
893 (maxx - 0.004973854636773467, -0.004873105324804783, minz + 4.190206527709961e-05),
894 (maxx - 0.005896858056075871, -0.0043898820877075195, maxz - 0.007182727102190256),
895 (maxx - 0.005644757067784667, -0.004758160561323166, maxz - 0.015400669537484646),
896 (maxx - 0.0050204748986288905, -0.0054572150111198425, maxz - 0.03902619704604149),
897 (maxx - 0.005107744364067912, -0.004944739863276482, minz + 0.01588994264602661),
898 (maxx - 0.005821454804390669, -0.004324669484049082, maxz - 0.004334418568760157),
899 (maxx - 0.0058509946102276444, -0.00556210009381175, minz + 0.029483404010534286),
900 (maxx - 0.004974223440513015, -0.005210080184042454, minz + 2.121180295944214e-05),
901 (maxx - 0.005512951058335602, -0.004414208233356476, maxz - 0.004156060982495546),
902 (maxx - 0.005657264497131109, -0.004175691865384579, maxz - 0.007369710598140955),
903 (maxx - 0.005083143012598157, -0.004386562388390303, maxz - 0.007155258674174547),
904 (maxx - 0.005898642586544156, -0.004691417329013348, maxz - 0.006906915921717882),
905 (maxx - 0.005482866894453764, -0.005316956900060177, maxz - 0.010308705270290375),
906 (maxx - 0.005200946354307234, -0.004315671045333147, maxz - 0.004297847393900156),
907 (maxx - 0.005883492063730955, -0.004994065500795841, maxz - 0.015342974103987217),
908 (maxx - 0.0055490892846137285, -0.004634103272110224, minz + 5.002319812774658e-05),
909 (maxx - 0.005586991785094142, -0.002982017118483782, maxz - 0.0016202632104977965),
910 (maxx - 0.005500998347997665, -0.0037720794789493084, maxz - 0.005249096546322107),
911 (maxx - 0.0056365174241364, -0.005033436696976423, maxz - 0.029424406588077545),
912 (maxx - 0.0051623902982100844, -0.0050335354171693325, maxz - 0.021582692861557007),
913 (maxx - 0.005850603571161628, -0.005225026980042458, minz + 0.029492609202861786),
914 (maxx - 0.005787728703580797, -0.0048720804043114185, minz + 3.269314765930176e-05),
915 (maxx - 0.005192494718357921, -0.003861617762595415, maxz - 0.005070738960057497),
916 (maxx - 0.005163213470950723, -0.005652572028338909, maxz - 0.021503763273358345),
917 (maxx - 0.005460095009766519, -0.005895696114748716, maxz - 0.039026711136102676),
918 (maxx - 0.005661572678945959, -0.004903662484139204, maxz - 0.006703841034322977),
919 (maxx - 0.005856060888618231, -0.002980045508593321, maxz - 0.003230756614357233),
920 (maxx - 0.005036721588112414, -0.005226014647632837, minz + 0.029498230665922165),
921 (maxx - 0.005933607462793589, -0.0034987321123480797, maxz - 0.0036901147104799747),
922 (maxx - 0.005068209487944841, -0.0040867808274924755, maxz - 0.004676718730479479),
923 (maxx - 0.005645966622978449, -0.005564413033425808, maxz - 0.015198467299342155),
924 (maxx - 0.005149454576894641, -0.005767486989498138, maxz - 0.03902563825249672),
925 (maxx - 0.0050617282977327704, -0.005609281826764345, maxz - 0.029393207281827927),
926 (maxx - 0.005539751029573381, -0.0029568036552518606, maxz - 0.0034645837731659412),
927 (maxx - 0.005688222707249224, -0.003390622790902853, maxz - 0.00406796345487237),
928 (maxx - 0.005419071996584535, -0.005693721119314432, minz + 0.0158514603972435),
929 (maxx - 0.005788097972981632, -0.005209055729210377, minz + 1.1995434761047363e-05),
930 (maxx - 0.005069609847851098, -0.004994889721274376, maxz - 0.015337754040956497),
931 (maxx - 0.005299395183101296, -0.0050338455475866795, maxz - 0.029423145577311516),
932 (maxx - 0.005729411728680134, -0.005564768332988024, minz + 0.015854761004447937),
933 (maxx - 0.005889465333893895, -0.002997873816639185, maxz - 0.0019266236340627074),
934 (maxx - 0.00523727759718895, -0.002940947189927101, maxz - 0.0031582233496010303),
935 (maxx - 0.005883992882445455, -0.0053280252031981945, maxz - 0.015259221196174622),
936 (maxx - 0.005637527909129858, -0.0058468179777264595, maxz - 0.029383329674601555),
937 (maxx - 0.0060009173466823995, -0.002997057046741247, maxz - 0.0025937133468687534),
938 (maxx - 0.00581300281919539, -0.0038706157356500626, maxz - 0.005107311997562647),
939 (maxx - 0.005784186767414212, -0.005651846993714571, maxz - 0.02150617726147175),
940 (maxx - 0.005061309668235481, -0.005272367969155312, maxz - 0.02941022254526615),
941 (maxx - 0.00535176380071789, -0.0033784990664571524, maxz - 0.004038602579385042),
942 (maxx - 0.005131891928613186, -0.0036102300509810448, maxz - 0.0030555170960724354),
943 (maxx - 0.0059457405004650354, -0.004099506419152021, maxz - 0.004728438798338175),
944 (maxx - 0.005791432806290686, -0.004595593549311161, maxz - 0.010660232976078987),
945 (maxx - 0.005473870667628944, -0.005780417006462812, maxz - 0.021488623693585396),
946 (maxx - 0.005108443321660161, -0.005565532948821783, minz + 0.01586039364337921),
947 (maxx - 0.005042683565989137, -0.00489416578784585, maxz - 0.01050524227321148),
948 (maxx - 0.0053004054352641106, -0.005847226828336716, maxz - 0.029382066801190376),
949 (maxx - 0.005324521102011204, -0.004902287386357784, maxz - 0.006692463997751474),
950 (maxx - 0.0053076359909027815, -0.00475850235670805, maxz - 0.015398506075143814),
951 (maxx - 0.005770427291281521, -0.005766738206148148, maxz - 0.03902877867221832),
952 (maxx - 0.005377276800572872, -0.0037183398380875587, maxz - 0.0026776683516800404),
953 (maxx - 0.005898662726394832, -0.005456155631691217, maxz - 0.03903063386678696),
954 (maxx - 0.005084927543066442, -0.004688097629696131, maxz - 0.006879445631057024),
955 (maxx - 0.005037112743593752, -0.0055630882270634174, minz + 0.029489029198884964),
956 (maxx - 0.0050701110158115625, -0.0053288498893380165, maxz - 0.015254000201821327),
957 (maxx - 0.005418083746917546, -0.004815786611288786, minz + 0.01589323580265045),
958 (maxx - 0.005308845662511885, -0.0055647543631494045, maxz - 0.015196305699646473),
959 (maxx - 0.0054806380067020655, -0.0044716945849359035, maxz - 0.010715048760175705),
960 (maxx - 0.005459042498841882, -0.005017674993723631, maxz - 0.03903011977672577),
961 (maxx - 0.00571373593993485, -0.0037304633297026157, maxz - 0.0027070273645222187),
962 (maxx - 0.005125825526192784, -0.0029417641926556826, maxz - 0.002491133753210306),
963 (maxx - 0.005783363711088896, -0.005032809916883707, maxz - 0.02158510498702526),
964 (maxx - 0.005121324211359024, -0.003469463437795639, maxz - 0.00361923361197114),
965 (maxx - 0.005170495598576963, -0.0045953672379255295, maxz - 0.010650848969817162),
966 (maxx - 0.005611946457065642, -0.004986968822777271, minz + 0.02950076386332512),
967 (maxx - 0.005769683048129082, -0.005145883187651634, maxz - 0.03903118893504143),
968 (maxx - 0.004979487042874098, -0.005255294498056173, minz + 0.01587633788585663),
969 (maxx - 0.005172071512788534, -0.005193057470023632, maxz - 0.010363521054387093),
970 (maxx - 0.005793009069748223, -0.005193284247070551, maxz - 0.010372905060648918),
971 (maxx - 0.005875195027329028, -0.005271381698548794, maxz - 0.029413267970085144),
972 (maxx - 0.005472706281580031, -0.004904965870082378, maxz - 0.02160024456679821),
973 (maxx - 0.0052757697412744164, -0.0058011459186673164, minz + 0.029480870813131332),
974 (maxx - 0.0057287130039185286, -0.004943975247442722, minz + 0.01588430255651474),
975 (maxx - 0.0051487102173268795, -0.0051466329023242, maxz - 0.03902805224061012),
976 (maxx - 0.005920821567997336, -0.004894486162811518, maxz - 0.0105185117572546),
977 (maxx - 0.005912382970564067, -0.005342178046703339, maxz - 0.021546142175793648),
978 (maxx - 0.005211971350945532, -0.004634527489542961, minz + 5.383789539337158e-05),
979 (maxx - 0.005274825729429722, -0.004987378139048815, minz + 0.029503092169761658),
980 (maxx - 0.005549981025978923, -0.0054476335644721985, minz + 6.705522537231445e-08),
981 (maxx - 0.005011449102312326, -0.005086742807179689, minz + 0.01588405668735504),
982 (maxx - 0.005249560461379588, -0.004848137032240629, minz + 0.01589324325323105),
983 (maxx - 0.005586679908446968, -0.004847722128033638, minz + 0.015890181064605713),
984 (maxx - 0.005825327709317207, -0.005085740704089403, minz + 0.01587667316198349),
985 (maxx - 0.005825707106851041, -0.005422765389084816, minz + 0.015860632061958313),
986 (maxx - 0.005587595398537815, -0.005661370232701302, minz + 0.0158514603972435),
987 (maxx - 0.005250476184301078, -0.005661786068230867, minz + 0.015854522585868835),
988 (maxx - 0.005011828150600195, -0.005423767026513815, minz + 0.01586802303791046),
989 (maxx - 0.0050524246180430055, -0.00528864748775959, maxz - 0.03902701288461685),
990 (maxx - 0.005290519911795855, -0.005050024017691612, maxz - 0.03902914375066757),
991 (maxx - 0.005627641920000315, -0.005049617029726505, maxz - 0.03903084620833397),
992 (maxx - 0.005866308696568012, -0.005287665408104658, maxz - 0.03903112933039665),
993 (maxx - 0.005866712890565395, -0.005624723620712757, maxz - 0.039029818028211594),
994 (maxx - 0.005628617363981903, -0.005863346625119448, maxz - 0.03902768716216087),
995 (maxx - 0.0052914953557774425, -0.005863754078745842, maxz - 0.03902598097920418),
996 (maxx - 0.005052828579209745, -0.005625705700367689, maxz - 0.03902570158243179),
997 (maxx - 0.005066122743301094, -0.005175130441784859, maxz - 0.02156427875161171),
998 (maxx - 0.005304188118316233, -0.004937214311212301, maxz - 0.021595504134893417),
999 (maxx - 0.0056413100101053715, -0.004936820361763239, maxz - 0.021596813574433327),
1000 (maxx - 0.005880007753148675, -0.005174180027097464, maxz - 0.021567441523075104),
1001 (maxx - 0.005880454205907881, -0.005510250572115183, maxz - 0.021524591371417046),
1002 (maxx - 0.0056423889473080635, -0.005748167168349028, maxz - 0.021493365988135338),
1003 (maxx - 0.005305267055518925, -0.005748561583459377, maxz - 0.02149205468595028),
1004 (maxx - 0.005066569661721587, -0.005511201918125153, maxz - 0.02152142859995365),
1005 (maxx - 0.005074405577033758, -0.004731936380267143, maxz - 0.010583722963929176),
1006 (maxx - 0.005312168272212148, -0.004502579569816589, maxz - 0.01069762371480465),
1007 (maxx - 0.005649270839057863, -0.004502702970057726, maxz - 0.010702718049287796),
1008 (maxx - 0.0058882435550913215, -0.004732233472168446, maxz - 0.010596020147204399),
1009 (maxx - 0.005889098974876106, -0.0050567155703902245, maxz - 0.010440031066536903),
1010 (maxx - 0.005651336396113038, -0.005286071915179491, maxz - 0.010326128453016281),
1011 (maxx - 0.005314233829267323, -0.005285948980599642, maxz - 0.010321034118533134),
1012 (maxx - 0.0050752609968185425, -0.005056418012827635, maxz - 0.01042773388326168),
1013 (maxx - 0.005098042776808143, -0.003963995724916458, maxz - 0.004888410214334726),
1014 (maxx - 0.005333001143299043, -0.0037931459955871105, maxz - 0.005199151579290628),
1015 (maxx - 0.005669870879501104, -0.003798031248152256, maxz - 0.0052190073765814304),
1016 (maxx - 0.005911318236030638, -0.003975789062678814, maxz - 0.004936345387250185),
1017 (maxx - 0.005915906862355769, -0.004222291521728039, maxz - 0.004516747314482927),
1018 (maxx - 0.0056809482630342245, -0.004393140785396099, maxz - 0.004206005949527025),
1019 (maxx - 0.0053440784104168415, -0.004388255998492241, maxz - 0.0041861520148813725),
1020 (maxx - 0.005102631403133273, -0.004210498183965683, maxz - 0.004468812141567469),
1021 (maxx - 0.005148796364665031, -0.0029389490373432636, maxz - 0.002848892007023096),
1022 (maxx - 0.005373513558879495, -0.0029471139423549175, maxz - 0.0033773710019886494),
1023 (maxx - 0.005709447083063424, -0.0029683399479836226, maxz - 0.003416749183088541),
1024 (maxx - 0.005959811387583613, -0.002990193199366331, maxz - 0.002943959552794695),
1025 (maxx - 0.0059779464500024915, -0.002999872202053666, maxz - 0.0022359550930559635),
1026 (maxx - 0.005753229022957385, -0.0029917070642113686, maxz - 0.0017074759816750884),
1027 (maxx - 0.005417295498773456, -0.0029704810585826635, maxz - 0.0016680978005751967),
1028 (maxx - 0.0051669314270839095, -0.002948627807199955, maxz - 0.0021408875472843647),
1029 (minx + 0.006793352426029742, -0.005108049139380455, minz + 0.00023909658193588257),
1030 (minx + 0.0066346460953354836, -0.004723844584077597, minz + 0.00025669485330581665),
1031 (minx + 0.006250653299503028, -0.004564301110804081, minz + 0.00026106834411621094),
1032 (minx + 0.00586631172336638, -0.0047228774055838585, minz + 0.0002496689558029175),
1033 (minx + 0.005706763477064669, -0.005106681492179632, minz + 0.00022915005683898926),
1034 (minx + 0.005865469924174249, -0.005490886978805065, minz + 0.00021155178546905518),
1035 (minx + 0.006249462720006704, -0.005650430452078581, minz + 0.00020717084407806396),
1036 (minx + 0.006633804412558675, -0.005491853225976229, minz + 0.00021857768297195435),
1037 (minx + 0.006715552299283445, -0.005544771905988455, minz + 0.029701028019189835),
1038 (minx + 0.00655686913523823, -0.005160461645573378, minz + 0.0297086164355278),
1039 (minx + 0.006172882916871458, -0.005000889301300049, minz + 0.029709983617067337),
1040 (minx + 0.005788527661934495, -0.0051595289260149, minz + 0.029704324901103973),
1041 (minx + 0.005628953338600695, -0.005543452687561512, minz + 0.02969495579600334),
1042 (minx + 0.005787636619061232, -0.005927762482315302, minz + 0.029687367379665375),
1043 (minx + 0.0061716228374280035, -0.006087335292249918, minz + 0.02968600019812584),
1044 (minx + 0.006555978092364967, -0.005928694736212492, minz + 0.029691658914089203),
1045 (minx + 0.006685112020932138, -0.005602027289569378, maxz - 0.0291944220662117),
1046 (minx + 0.006526459823362529, -0.005217899568378925, maxz - 0.029210573062300682),
1047 (minx + 0.0061424848972819746, -0.005058403126895428, maxz - 0.029218226671218872),
1048 (minx + 0.005758114974014461, -0.00521696824580431, maxz - 0.029212897643446922),
1049 (minx + 0.005598508752882481, -0.005600709468126297, maxz - 0.029197707772254944),
1050 (minx + 0.005757161183282733, -0.005984836723655462, maxz - 0.029181556776165962),
1051 (minx + 0.006141135876532644, -0.0061443340964615345, maxz - 0.029173903167247772),
1052 (minx + 0.006525505916215479, -0.005985768511891365, maxz - 0.029179232195019722),
1053 (minx + 0.00667479052208364, -0.005256861448287964, maxz - 0.015088497661054134),
1054 (minx + 0.006516232970170677, -0.0048761311918497086, maxz - 0.01516645960509777),
1055 (minx + 0.006132298905868083, -0.0047181048430502415, maxz - 0.015200402587652206),
1056 (minx + 0.005747891729697585, -0.004875352140516043, maxz - 0.015170442871749401),
1057 (minx + 0.005588191794231534, -0.005255760159343481, maxz - 0.015094131231307983),
1058 (minx + 0.005746749578975141, -0.005636490881443024, maxz - 0.015016170218586922),
1059 (minx + 0.006130683759693056, -0.005794517230242491, maxz - 0.014982225373387337),
1060 (minx + 0.006515091052278876, -0.005637269467115402, maxz - 0.015012186020612717),
1061 (minx + 0.006657243531662971, -0.004483901429921389, maxz - 0.0068090930581092834),
1062 (minx + 0.0065001812763512135, -0.004140931181609631, maxz - 0.007067454978823662),
1063 (minx + 0.006116931792348623, -0.004000166896730661, maxz - 0.007183153182268143),
1064 (minx + 0.005731997545808554, -0.004144065547734499, maxz - 0.007088415324687958),
1065 (minx + 0.005570868030190468, -0.004488333128392696, maxz - 0.006838735193014145),
1066 (minx + 0.005727930460125208, -0.004831302911043167, maxz - 0.006580371409654617),
1067 (minx + 0.006111179769504815, -0.004972067661583424, maxz - 0.006464675068855286),
1068 (minx + 0.006496114016044885, -0.004828169010579586, maxz - 0.006559412926435471),
1069 (minx + 0.006604497611988336, -0.0032484245020896196, maxz - 0.0031274016946554184),
1070 (minx + 0.006457724317442626, -0.003093734150752425, maxz - 0.0036577805876731873),
1071 (minx + 0.006079296523239464, -0.003041104646399617, maxz - 0.003899872303009033),
1072 (minx + 0.005690891877748072, -0.003121365327388048, maxz - 0.003711860626935959),
1073 (minx + 0.0055200329516083, -0.003287500236183405, maxz - 0.0032038819044828415),
1074 (minx + 0.005666806362569332, -0.003442190121859312, maxz - 0.0026735030114650726),
1075 (minx + 0.006045234156772494, -0.0034948198590427637, maxz - 0.0024314112961292267),
1076 (minx + 0.006433638744056225, -0.0034145594108849764, maxz - 0.002619422972202301),
1077 (minx + 0.005553199094720185, -0.003373156301677227, maxz - 0.0029192231595516205),
1078 (minx + 0.005638031987473369, -0.005809193942695856, maxz - 0.029189079999923706),
1079 (minx + 0.006679139332845807, -0.005481190048158169, maxz - 0.021335555240511894),
1080 (minx + 0.005963105417322367, -0.0060473051853477955, minz + 0.029685713350772858),
1081 (minx + 0.0064580682083033025, -0.005610927473753691, minz + 0.00021105259656906128),
1082 (minx + 0.006325242109596729, -0.004034899175167084, maxz - 0.007151160389184952),
1083 (minx + 0.005660235299728811, -0.0053710793145000935, minz + 0.016075536608695984),
1084 (minx + 0.00638652773341164, -0.002530882600694895, maxz - 0.001646917313337326),
1085 (minx + 0.006753799156285822, -0.004899526014924049, minz + 0.0002490729093551636),
1086 (minx + 0.005611745989881456, -0.004301622975617647, maxz - 0.006975553929805756),
1087 (minx + 0.005923676071688533, -0.004757302813231945, maxz - 0.015193496830761433),
1088 (minx + 0.006696114782243967, -0.00562225840985775, maxz - 0.038819022476673126),
1089 (minx + 0.006588134099729359, -0.004988160915672779, minz + 0.016097113490104675),
1090 (minx + 0.0057050439063459635, -0.004220933653414249, maxz - 0.004127245396375656),
1091 (minx + 0.005668493686243892, -0.005752034951001406, minz + 0.02969057857990265),
1092 (minx + 0.006753342226147652, -0.005316472612321377, minz + 0.0002283826470375061),
1093 (minx + 0.00608676258707419, -0.0043317219242453575, maxz - 0.003948887810111046),
1094 (minx + 0.005908200400881469, -0.004036600701510906, maxz - 0.0071625374257564545),
1095 (minx + 0.006618573679588735, -0.004297514911741018, maxz - 0.006948085501790047),
1096 (minx + 0.005609537824057043, -0.004674719180911779, maxz - 0.006699742749333382),
1097 (minx + 0.0061239866190589964, -0.005448713432997465, maxz - 0.010101532563567162),
1098 (minx + 0.006472813023719937, -0.004209799692034721, maxz - 0.0040906742215156555),
1099 (minx + 0.00562828395050019, -0.005049192346632481, maxz - 0.015135801397264004),
1100 (minx + 0.006042047869414091, -0.004603803623467684, minz + 0.00025719404220581055),
1101 (minx + 0.005995150306262076, -0.002559639746323228, maxz - 0.0014130901545286179),
1102 (minx + 0.006101552047766745, -0.0035372015554457903, maxz - 0.005041923373937607),
1103 (minx + 0.005933871027082205, -0.005097907967865467, maxz - 0.029217233881354332),
1104 (minx + 0.006520519149489701, -0.005098029971122742, maxz - 0.021375520154833794),
1105 (minx + 0.005668977275490761, -0.005334966816008091, minz + 0.02969978377223015),
1106 (minx + 0.005746773676946759, -0.004898258484899998, minz + 0.00023986399173736572),
1107 (minx + 0.006483270728494972, -0.0036479895934462547, maxz - 0.0048635657876729965),
1108 (minx + 0.006519501097500324, -0.005863978061825037, maxz - 0.021296590566635132),
1109 (minx + 0.00615216267760843, -0.006164800841361284, maxz - 0.038819536566734314),
1110 (minx + 0.00590286951046437, -0.004937335848808289, maxz - 0.0064966678619384766),
1111 (minx + 0.005662225186824799, -0.0025571994483470917, maxz - 0.0030235834419727325),
1112 (minx + 0.00667601206805557, -0.0053361887112259865, minz + 0.029705405235290527),
1113 (minx + 0.005566274747252464, -0.0031989826820790768, maxz - 0.0034829415380954742),
1114 (minx + 0.006637051934376359, -0.0039265891537070274, maxz - 0.004469545558094978),
1115 (minx + 0.005922179203480482, -0.005754896439611912, maxz - 0.014991294592618942),
1116 (minx + 0.006536525208503008, -0.006006165407598019, maxz - 0.03881846368312836),
1117 (minx + 0.006645070854574442, -0.005810413975268602, maxz - 0.029186034575104713),
1118 (minx + 0.006053602788597345, -0.0025284423027187586, maxz - 0.0032574106007814407),
1119 (minx + 0.005869895336218178, -0.0030652163550257683, maxz - 0.0038607902824878693),
1120 (minx + 0.0062029213877394795, -0.005914892535656691, minz + 0.016058631241321564),
1121 (minx + 0.005746316979639232, -0.005315205082297325, minz + 0.00021916627883911133),
1122 (minx + 0.006635318568442017, -0.005050212610512972, maxz - 0.015130581334233284),
1123 (minx + 0.006350999989081174, -0.005098414141684771, maxz - 0.029215972870588303),
1124 (minx + 0.005818931153044105, -0.00575533602386713, minz + 0.016061931848526),
1125 (minx + 0.005620893090963364, -0.002579259453341365, maxz - 0.0017194505780935287),
1126 (minx + 0.0064278600621037185, -0.0025088228285312653, maxz - 0.00295105017721653),
1127 (minx + 0.005627664038911462, -0.00546240946277976, maxz - 0.015052048489451408),
1128 (minx + 0.005932620842941105, -0.006104323081672192, maxz - 0.02917615696787834),
1129 (minx + 0.0054829909931868315, -0.0025782485026866198, maxz - 0.002386540174484253),
1130 (minx + 0.005715501611120999, -0.003659122856333852, maxz - 0.004900138825178146),
1131 (minx + 0.005751156946644187, -0.005863080266863108, maxz - 0.021299004554748535),
1132 (minx + 0.006645588902756572, -0.005393543280661106, maxz - 0.029203049838542938),
1133 (minx + 0.006286203453782946, -0.0030502157751470804, maxz - 0.0038314294070005417),
1134 (minx + 0.00655825569992885, -0.0033369415905326605, maxz - 0.002848343923687935),
1135 (minx + 0.005551262525841594, -0.003942334558814764, maxz - 0.004521265625953674),
1136 (minx + 0.0057421906385570765, -0.004556154832243919, maxz - 0.010453060269355774),
1137 (minx + 0.00613511772826314, -0.006022163201123476, maxz - 0.021281450986862183),
1138 (minx + 0.0065872694831341505, -0.005756282713264227, minz + 0.016067564487457275),
1139 (minx + 0.006668635527603328, -0.0049255844205617905, maxz - 0.010298069566488266),
1140 (minx + 0.006349750037770718, -0.006104828789830208, maxz - 0.029174894094467163),
1141 (minx + 0.006319911277387291, -0.0049356333911418915, maxz - 0.006485290825366974),
1142 (minx + 0.0063408034620806575, -0.004757725168019533, maxz - 0.015191333368420601),
1143 (minx + 0.00576818163972348, -0.006005238275974989, maxz - 0.03882160410284996),
1144 (minx + 0.0062546354020014405, -0.0034707081504166126, maxz - 0.00247049517929554),
1145 (minx + 0.00560951279476285, -0.005620947107672691, maxz - 0.038823459297418594),
1146 (minx + 0.006616365630179644, -0.004670611582696438, maxz - 0.0066722724586725235),
1147 (minx + 0.0066755281295627356, -0.005753257777541876, minz + 0.029696203768253326),
1148 (minx + 0.006634698482230306, -0.005463429726660252, maxz - 0.015046827495098114),
1149 (minx + 0.006204143981449306, -0.004828604869544506, minz + 0.016100406646728516),
1150 (minx + 0.006339306535664946, -0.005755319260060787, maxz - 0.01498913299292326),
1151 (minx + 0.006126744614448398, -0.004402851220220327, maxz - 0.010507876053452492),
1152 (minx + 0.006153465015813708, -0.005078405141830444, maxz - 0.03882294520735741),
1153 (minx + 0.005838327226229012, -0.003485708963125944, maxz - 0.002499854192137718),
1154 (minx + 0.00656576210167259, -0.0025098335463553667, maxz - 0.0022839605808258057),
1155 (minx + 0.005752174882218242, -0.005097132176160812, maxz - 0.021377932280302048),
1156 (minx + 0.006571331556187943, -0.003162768203765154, maxz - 0.0034120604395866394),
1157 (minx + 0.006510490493383259, -0.00455587450414896, maxz - 0.010443676263093948),
1158 (minx + 0.005964273179415613, -0.005040412303060293, minz + 0.02970793843269348),
1159 (minx + 0.005769102484919131, -0.005237040109932423, maxz - 0.038824014365673065),
1160 (minx + 0.006746829953044653, -0.005372417625039816, minz + 0.016083508729934692),
1161 (minx + 0.0065085404785349965, -0.0052954102866351604, maxz - 0.01015634834766388),
1162 (minx + 0.005740240449085832, -0.005295691080391407, maxz - 0.010165732353925705),
1163 (minx + 0.0056385500356554985, -0.005392322316765785, maxz - 0.02920609526336193),
1164 (minx + 0.006136558135040104, -0.004938947968184948, maxz - 0.021393071860074997),
1165 (minx + 0.006380232633091509, -0.006047811824828386, minz + 0.029688045382499695),
1166 (minx + 0.005819795769639313, -0.0049872142262756824, minz + 0.016091473400592804),
1167 (minx + 0.006537446053698659, -0.00523796770721674, maxz - 0.03882087767124176),
1168 (minx + 0.005582095473073423, -0.004925980698317289, maxz - 0.010311339050531387),
1169 (minx + 0.005592536414042115, -0.005479920189827681, maxz - 0.021338969469070435),
1170 (minx + 0.0064591713598929346, -0.00460432842373848, minz + 0.00026100873947143555),
1171 (minx + 0.006381400395184755, -0.005040918942540884, minz + 0.02971026673913002),
1172 (minx + 0.006040944659616798, -0.005610402673482895, minz + 0.00020723789930343628),
1173 (minx + 0.006707282620482147, -0.005163864698261023, minz + 0.016091227531433105),
1174 (minx + 0.006412662158254534, -0.004868632182478905, minz + 0.016100414097309113),
1175 (minx + 0.005995536455884576, -0.004868118558079004, minz + 0.016097351908683777),
1176 (minx + 0.0057002517860382795, -0.005162625107914209, minz + 0.016083844006061554),
1177 (minx + 0.005699782632291317, -0.005579632706940174, minz + 0.016067802906036377),
1178 (minx + 0.0059944032109342515, -0.005874865222722292, minz + 0.016058631241321564),
1179 (minx + 0.00641152891330421, -0.005875378847122192, minz + 0.0160616934299469),
1180 (minx + 0.0067068132339045405, -0.005580872762948275, minz + 0.016075193881988525),
1181 (minx + 0.006656582350842655, -0.00541368592530489, maxz - 0.03881983831524849),
1182 (minx + 0.00636198150459677, -0.005118431523442268, maxz - 0.03882196918129921),
1183 (minx + 0.005944853066466749, -0.005117928143590689, maxz - 0.03882367163896561),
1184 (minx + 0.005649544997140765, -0.005412471015006304, maxz - 0.03882395476102829),
1185 (minx + 0.005649045226164162, -0.005829520057886839, maxz - 0.03882264345884323),
1186 (minx + 0.005943646072410047, -0.006124773994088173, maxz - 0.03882051259279251),
1187 (minx + 0.00636077462695539, -0.00612527783960104, maxz - 0.038818806409835815),
1188 (minx + 0.00665608246345073, -0.005830735433846712, maxz - 0.03881852701306343),
1189 (minx + 0.006639633560553193, -0.005273229442536831, maxz - 0.021357106044888496),
1190 (minx + 0.006345069617964327, -0.004978850018233061, maxz - 0.021388331428170204),
1191 (minx + 0.00592794077238068, -0.00497836247086525, maxz - 0.021389640867710114),
1192 (minx + 0.005632595275528729, -0.005272052250802517, maxz - 0.02136026881635189),
1193 (minx + 0.005632042535580695, -0.0056878807954490185, maxz - 0.021317418664693832),
1194 (minx + 0.005926606128923595, -0.005982260685414076, maxz - 0.021286193281412125),
1195 (minx + 0.0063437349162995815, -0.005982748232781887, maxz - 0.021284881979227066),
1196 (minx + 0.006639080471359193, -0.0056890579871833324, maxz - 0.021314255893230438),
1197 (minx + 0.006629384937696159, -0.004724854603409767, maxz - 0.010376550257205963),
1198 (minx + 0.006335195794235915, -0.004441066179424524, maxz - 0.010490451008081436),
1199 (minx + 0.0059180911630392075, -0.004441218450665474, maxz - 0.010495545342564583),
1200 (minx + 0.005622404860332608, -0.004725221544504166, maxz - 0.010388847440481186),
1201 (minx + 0.005621346062980592, -0.005126711446791887, maxz - 0.01023285835981369),
1202 (minx + 0.0059155350318178535, -0.005410499405115843, maxz - 0.010118955746293068),
1203 (minx + 0.0063326399540528655, -0.005410346668213606, maxz - 0.010113861411809921),
1204 (minx + 0.006628326023928821, -0.005126343574374914, maxz - 0.010220561176538467),
1205 (minx + 0.006600138149224222, -0.0037746636662632227, maxz - 0.004681237041950226),
1206 (minx + 0.006309418939054012, -0.0035632678773254156, maxz - 0.004991978406906128),
1207 (minx + 0.005892602261155844, -0.0035693119280040264, maxz - 0.00501183420419693),
1208 (minx + 0.005593853886239231, -0.0037892560940235853, maxz - 0.0047291722148656845),
1209 (minx + 0.005588176427409053, -0.004094259347766638, maxz - 0.004309574142098427),
1210 (minx + 0.005878895753994584, -0.004305655136704445, maxz - 0.003998832777142525),
1211 (minx + 0.006295712431892753, -0.00429961085319519, maxz - 0.003978978842496872),
1212 (minx + 0.006594460690394044, -0.004079666920006275, maxz - 0.004261638969182968),
1213 (minx + 0.006537339504575357, -0.002506350167095661, maxz - 0.0026417188346385956),
1214 (minx + 0.006259291782043874, -0.0025164526887238026, maxz - 0.003170197829604149),
1215 (minx + 0.005843633785843849, -0.0025427164509892464, maxz - 0.0032095760107040405),
1216 (minx + 0.005533852614462376, -0.0025697555392980576, maxz - 0.0027367863804101944),
1217 (minx + 0.005511413444764912, -0.0025817318819463253, maxz - 0.002028781920671463),
1218 (minx + 0.005789461429230869, -0.0025716288946568966, maxz - 0.0015003029257059097),
1219 (minx + 0.006205119309015572, -0.0025453658308833838, maxz - 0.001460924744606018),
1220 (minx + 0.0065149005386047065, -0.0025183262769132853, maxz - 0.0019337143748998642),
1221 (minx, -0.0013792915269732475, maxz - 0.005334946792572737),
1222 (minx + 4.656612873077393e-10, maxy, maxz - 0.005334946792572737),
1223 (maxx, maxy - 4.423782229423523e-09, maxz - 0.005334946792572737),
1224 (maxx, -0.0013792961835861206, maxz - 0.005334946792572737),
1225 (minx, -0.0013792915269732475, maxz - 1.5133991837501526e-08),
1226 (minx + 4.656612873077393e-10, maxy, maxz - 1.5133991837501526e-08),
1227 (maxx, maxy - 4.423782229423523e-09, maxz - 1.5133991837501526e-08),
1228 (maxx, -0.0013792961835861206, maxz - 1.5133991837501526e-08),
1229 (minx + 0.0011832499876618385, -0.0013792921090498567, maxz - 0.00447732862085104),
1230 (minx + 0.0011832499876618385, -0.0013792921090498567, maxz - 0.0008576327236369252),
1231 (maxx - 0.0011832499876618385, -0.0013792957179248333, maxz - 0.0008576327236369252),
1232 (maxx - 0.0011832499876618385, -0.0013792957179248333, maxz - 0.00447732862085104),
1233 (minx + 0.0011832504533231258, -0.0007798965089023113, maxz - 0.00447732862085104),
1234 (minx + 0.0011832504533231258, -0.0007798965089023113, maxz - 0.0008576327236369252),
1235 (maxx - 0.0011832495220005512, -0.0007799001759849489, maxz - 0.0008576327236369252),
1236 (maxx - 0.0011832495220005512, -0.0007799001759849489, maxz - 0.00447732862085104),
1237 (minx + 0.004529597237706184, -0.0007973873289301991, maxz - 0.0044512152671813965),
1238 (minx + 0.004529597237706184, -0.0007973873289301991, maxz - 0.0008894965285435319),
1239 (minx + 0.004144799197092652, -0.001563245547004044, maxz - 0.0044512152671813965),
1240 (minx + 0.004144799197092652, -0.001563245547004044, maxz - 0.0008894965285435319),
1241 (minx + 0.0032158144749701023, -0.0018804739229381084, maxz - 0.0044512152671813965),
1242 (minx + 0.0032158144749701023, -0.0018804739229381084, maxz - 0.0008894965285435319),
1243 (minx + 0.0022868295200169086, -0.0015632447320967913, maxz - 0.0044512152671813965),
1244 (minx + 0.0022868295200169086, -0.0015632447320967913, maxz - 0.0008894965285435319),
1245 (minx + 0.0019020326435565948, -0.0007973865140229464, maxz - 0.0044512152671813965),
1246 (minx + 0.0019020326435565948, -0.0007973865140229464, maxz - 0.0008894965285435319),
1247 (maxx - 0.001917288638651371, -0.0007973890169523656, maxz - 0.0044512152671813965),
1248 (maxx - 0.001917288638651371, -0.0007973890169523656, maxz - 0.0008894965285435319),
1249 (maxx - 0.0023020864464342594, -0.0015632474096491933, maxz - 0.0044512152671813965),
1250 (maxx - 0.0023020864464342594, -0.0015632474096491933, maxz - 0.0008894965285435319),
1251 (maxx - 0.0032310718670487404, -0.0018804756691679358, maxz - 0.0044512152671813965),
1252 (maxx - 0.0032310718670487404, -0.0018804756691679358, maxz - 0.0008894965285435319),
1253 (maxx - 0.00416005658917129, -0.0015632465947419405, maxz - 0.0044512152671813965),
1254 (maxx - 0.00416005658917129, -0.0015632465947419405, maxz - 0.0008894965285435319),
1255 (maxx - 0.0045448546297848225, -0.0007973880274221301, maxz - 0.0044512152671813965),
1256 (maxx - 0.0045448546297848225, -0.0007973880274221301, maxz - 0.0008894965285435319)]
1258 # Faces
1259 myfaces = [(0, 56, 144, 131), (0, 131, 151, 63), (1, 141, 145, 60), (1, 60, 144, 56), (2, 71, 146, 120),
1260 (2, 120, 145, 141), (3, 77, 147, 137), (3, 137, 146, 71), (4, 92, 148, 54), (4, 54, 147, 77),
1261 (5, 143, 149, 95), (5, 95, 148, 92), (6, 52, 150, 91), (6, 91, 149, 143), (7, 63, 151, 109),
1262 (7, 109, 150, 52), (8, 131, 144, 83), (8, 83, 152, 59), (8, 59, 159, 118), (8, 118, 151, 131),
1263 (9, 60, 145, 142), (9, 142, 153, 138), (9, 138, 152, 83), (9, 83, 144, 60), (10, 120, 146, 129),
1264 (10, 129, 154, 123), (10, 123, 153, 142), (10, 142, 145, 120), (11, 137, 147, 76), (11, 76, 155, 130),
1265 (11, 130, 154, 129), (11, 129, 146, 137), (12, 54, 148, 62), (12, 62, 156, 116), (12, 116, 155, 76),
1266 (12, 76, 147, 54), (13, 95, 149, 51), (13, 51, 157, 114), (13, 114, 156, 62), (13, 62, 148, 95),
1267 (14, 91, 150, 136), (14, 136, 158, 80), (14, 80, 157, 51), (14, 51, 149, 91), (15, 109, 151, 118),
1268 (15, 118, 159, 87), (15, 87, 158, 136), (15, 136, 150, 109), (16, 59, 152, 103), (16, 103, 160, 50),
1269 (16, 50, 167, 88), (16, 88, 159, 59), (17, 138, 153, 94), (17, 94, 161, 75), (17, 75, 160, 103),
1270 (17, 103, 152, 138), (18, 123, 154, 74), (18, 74, 162, 135), (18, 135, 161, 94), (18, 94, 153, 123),
1271 (19, 130, 155, 134), (19, 134, 163, 126), (19, 126, 162, 74), (19, 74, 154, 130), (20, 116, 156, 49),
1272 (20, 49, 164, 140), (20, 140, 163, 134), (20, 134, 155, 116), (21, 114, 157, 99), (21, 99, 165, 102),
1273 (21, 102, 164, 49), (21, 49, 156, 114), (22, 80, 158, 111), (22, 111, 166, 108), (22, 108, 165, 99),
1274 (22, 99, 157, 80), (23, 87, 159, 88), (23, 88, 167, 79), (23, 79, 166, 111), (23, 111, 158, 87),
1275 (24, 50, 160, 93), (24, 93, 168, 110), (24, 110, 175, 119), (24, 119, 167, 50), (25, 75, 161, 113),
1276 (25, 113, 169, 128), (25, 128, 168, 93), (25, 93, 160, 75), (26, 135, 162, 58), (26, 58, 170, 122),
1277 (26, 122, 169, 113), (26, 113, 161, 135), (27, 126, 163, 70), (27, 70, 171, 107), (27, 107, 170, 58),
1278 (27, 58, 162, 126), (28, 140, 164, 98), (28, 98, 172, 139), (28, 139, 171, 70), (28, 70, 163, 140),
1279 (29, 102, 165, 86), (29, 86, 173, 133), (29, 133, 172, 98), (29, 98, 164, 102), (30, 108, 166, 121),
1280 (30, 121, 174, 68), (30, 68, 173, 86), (30, 86, 165, 108), (31, 79, 167, 119), (31, 119, 175, 132),
1281 (31, 132, 174, 121), (31, 121, 166, 79), (32, 110, 168, 66), (32, 66, 176, 85), (32, 85, 183, 117),
1282 (32, 117, 175, 110), (33, 128, 169, 53), (33, 53, 177, 78), (33, 78, 176, 66), (33, 66, 168, 128),
1283 (34, 122, 170, 65), (34, 65, 178, 73), (34, 73, 177, 53), (34, 53, 169, 122), (35, 107, 171, 57),
1284 (35, 57, 179, 101), (35, 101, 178, 65), (35, 65, 170, 107), (36, 139, 172, 67), (36, 67, 180, 106),
1285 (36, 106, 179, 57), (36, 57, 171, 139), (37, 133, 173, 81), (37, 81, 181, 61), (37, 61, 180, 67),
1286 (37, 67, 172, 133), (38, 68, 174, 112), (38, 112, 182, 64), (38, 64, 181, 81), (38, 81, 173, 68),
1287 (39, 132, 175, 117), (39, 117, 183, 69), (39, 69, 182, 112), (39, 112, 174, 132), (40, 85, 176, 127),
1288 (40, 127, 184, 125), (40, 125, 191, 105), (40, 105, 183, 85), (41, 78, 177, 104), (41, 104, 185, 97),
1289 (41, 97, 184, 127), (41, 127, 176, 78), (42, 73, 178, 90), (42, 90, 186, 89), (42, 89, 185, 104),
1290 (42, 104, 177, 73), (43, 101, 179, 84), (43, 84, 187, 82), (43, 82, 186, 90), (43, 90, 178, 101),
1291 (44, 106, 180, 48), (44, 48, 188, 100), (44, 100, 187, 84), (44, 84, 179, 106), (45, 61, 181, 124),
1292 (45, 124, 189, 96), (45, 96, 188, 48), (45, 48, 180, 61), (46, 64, 182, 115), (46, 115, 190, 72),
1293 (46, 72, 189, 124), (46, 124, 181, 64), (47, 69, 183, 105), (47, 105, 191, 55), (47, 55, 190, 115),
1294 (47, 115, 182, 69), (192, 248, 336, 323), (192, 323, 343, 255),
1295 (193, 333, 337, 252), (193, 252, 336, 248),
1296 (194, 263, 338, 312), (194, 312, 337, 333), (195, 269, 339, 329),
1297 (195, 329, 338, 263), (196, 284, 340, 246),
1298 (196, 246, 339, 269), (197, 335, 341, 287), (197, 287, 340, 284),
1299 (198, 244, 342, 283), (198, 283, 341, 335),
1300 (199, 255, 343, 301), (199, 301, 342, 244), (200, 323, 336, 275),
1301 (200, 275, 344, 251), (200, 251, 351, 310),
1302 (200, 310, 343, 323), (201, 252, 337, 334), (201, 334, 345, 330),
1303 (201, 330, 344, 275), (201, 275, 336, 252),
1304 (202, 312, 338, 321), (202, 321, 346, 315), (202, 315, 345, 334),
1305 (202, 334, 337, 312), (203, 329, 339, 268),
1306 (203, 268, 347, 322), (203, 322, 346, 321), (203, 321, 338, 329),
1307 (204, 246, 340, 254), (204, 254, 348, 308),
1308 (204, 308, 347, 268), (204, 268, 339, 246), (205, 287, 341, 243),
1309 (205, 243, 349, 306), (205, 306, 348, 254),
1310 (205, 254, 340, 287), (206, 283, 342, 328), (206, 328, 350, 272),
1311 (206, 272, 349, 243), (206, 243, 341, 283),
1312 (207, 301, 343, 310), (207, 310, 351, 279), (207, 279, 350, 328),
1313 (207, 328, 342, 301), (208, 251, 344, 295),
1314 (208, 295, 352, 242), (208, 242, 359, 280), (208, 280, 351, 251),
1315 (209, 330, 345, 286), (209, 286, 353, 267),
1316 (209, 267, 352, 295), (209, 295, 344, 330), (210, 315, 346, 266),
1317 (210, 266, 354, 327), (210, 327, 353, 286),
1318 (210, 286, 345, 315), (211, 322, 347, 326), (211, 326, 355, 318),
1319 (211, 318, 354, 266), (211, 266, 346, 322),
1320 (212, 308, 348, 241), (212, 241, 356, 332), (212, 332, 355, 326),
1321 (212, 326, 347, 308), (213, 306, 349, 291),
1322 (213, 291, 357, 294), (213, 294, 356, 241), (213, 241, 348, 306),
1323 (214, 272, 350, 303), (214, 303, 358, 300),
1324 (214, 300, 357, 291), (214, 291, 349, 272), (215, 279, 351, 280),
1325 (215, 280, 359, 271), (215, 271, 358, 303),
1326 (215, 303, 350, 279), (216, 242, 352, 285), (216, 285, 360, 302),
1327 (216, 302, 367, 311), (216, 311, 359, 242),
1328 (217, 267, 353, 305), (217, 305, 361, 320), (217, 320, 360, 285),
1329 (217, 285, 352, 267), (218, 327, 354, 250),
1330 (218, 250, 362, 314), (218, 314, 361, 305), (218, 305, 353, 327),
1331 (219, 318, 355, 262), (219, 262, 363, 299),
1332 (219, 299, 362, 250), (219, 250, 354, 318), (220, 332, 356, 290),
1333 (220, 290, 364, 331), (220, 331, 363, 262),
1334 (220, 262, 355, 332), (221, 294, 357, 278), (221, 278, 365, 325),
1335 (221, 325, 364, 290), (221, 290, 356, 294),
1336 (222, 300, 358, 313), (222, 313, 366, 260), (222, 260, 365, 278),
1337 (222, 278, 357, 300), (223, 271, 359, 311),
1338 (223, 311, 367, 324), (223, 324, 366, 313), (223, 313, 358, 271),
1339 (224, 302, 360, 258), (224, 258, 368, 277),
1340 (224, 277, 375, 309), (224, 309, 367, 302), (225, 320, 361, 245),
1341 (225, 245, 369, 270), (225, 270, 368, 258),
1342 (225, 258, 360, 320), (226, 314, 362, 257), (226, 257, 370, 265),
1343 (226, 265, 369, 245), (226, 245, 361, 314),
1344 (227, 299, 363, 249), (227, 249, 371, 293), (227, 293, 370, 257),
1345 (227, 257, 362, 299), (228, 331, 364, 259),
1346 (228, 259, 372, 298), (228, 298, 371, 249), (228, 249, 363, 331),
1347 (229, 325, 365, 273), (229, 273, 373, 253),
1348 (229, 253, 372, 259), (229, 259, 364, 325), (230, 260, 366, 304),
1349 (230, 304, 374, 256), (230, 256, 373, 273),
1350 (230, 273, 365, 260), (231, 324, 367, 309), (231, 309, 375, 261),
1351 (231, 261, 374, 304), (231, 304, 366, 324),
1352 (232, 277, 368, 319), (232, 319, 376, 317), (232, 317, 383, 297),
1353 (232, 297, 375, 277), (233, 270, 369, 296),
1354 (233, 296, 377, 289), (233, 289, 376, 319), (233, 319, 368, 270),
1355 (234, 265, 370, 282), (234, 282, 378, 281),
1356 (234, 281, 377, 296), (234, 296, 369, 265), (235, 293, 371, 276),
1357 (235, 276, 379, 274), (235, 274, 378, 282),
1358 (235, 282, 370, 293), (236, 298, 372, 240), (236, 240, 380, 292),
1359 (236, 292, 379, 276), (236, 276, 371, 298),
1360 (237, 253, 373, 316), (237, 316, 381, 288), (237, 288, 380, 240),
1361 (237, 240, 372, 253), (238, 256, 374, 307),
1362 (238, 307, 382, 264), (238, 264, 381, 316), (238, 316, 373, 256),
1363 (239, 261, 375, 297), (239, 297, 383, 247),
1364 (239, 247, 382, 307), (239, 307, 374, 261), (388, 389, 385, 384),
1365 (389, 390, 386, 385), (390, 391, 387, 386),
1366 (392, 395, 399, 396), (384, 385, 386, 387), (391, 390, 389, 388),
1367 (392, 393, 388, 384), (394, 395, 387, 391),
1368 (393, 394, 391, 388), (395, 392, 384, 387), (398, 397, 396, 399),
1369 (394, 393, 397, 398), (395, 394, 398, 399),
1370 (393, 392, 396, 397), (400, 401, 403, 402), (402, 403, 405, 404),
1371 (404, 405, 407, 406), (406, 407, 409, 408),
1372 (410, 411, 413, 412), (412, 413, 415, 414), (414, 415, 417, 416), (416, 417, 419, 418)]
1374 mesh = bpy.data.meshes.new(objname)
1375 myobject = bpy.data.objects.new(objname, mesh)
1377 myobject.location = bpy.context.scene.cursor_location
1378 bpy.context.scene.objects.link(myobject)
1380 mesh.from_pydata(myvertex, [], myfaces)
1381 mesh.update(calc_edges=True)
1383 return myobject
1386 # ------------------------------------------------------------------------------
1387 # Create bezier curve
1388 # ------------------------------------------------------------------------------
1389 def create_bezier(objname, points, origin, depth=0.001, fill='FULL'):
1390 curvedata = bpy.data.curves.new(name=objname, type='CURVE')
1391 curvedata.dimensions = '3D'
1392 curvedata.fill_mode = fill
1393 curvedata.bevel_resolution = 5
1394 curvedata.bevel_depth = depth
1396 myobject = bpy.data.objects.new(objname, curvedata)
1397 myobject.location = origin
1399 bpy.context.scene.objects.link(myobject)
1401 polyline = curvedata.splines.new('BEZIER')
1402 polyline.bezier_points.add(len(points) - 1)
1404 for idx, (knot, h1, h2) in enumerate(points):
1405 point = polyline.bezier_points[idx]
1406 point.co = knot
1407 point.handle_left = h1
1408 point.handle_right = h2
1409 point.handle_left_type = 'FREE'
1410 point.handle_right_type = 'FREE'
1412 return myobject