def robust_hole(self, context, tM):
hole = self.hole
m = bpy.data.meshes.new("hole")
o = bpy.data.objects.new("hole", m)
o['archipack_robusthole'] = True
context.scene.objects.link(o)
v = Vector((0, 0, 0))
offset = Vector((0, -0.001, 0))
size = Vector((self.x + 2 * self.frame_x, self.z + self.frame_x + 0.001, self.y))
verts = hole.vertices(16, offset, v, v, size, v, 0, 0, shape_z=None, path_type='RECTANGLE')
verts = [tM * Vector(v) for v in verts]
faces = hole.faces(16, path_type='RECTANGLE')
matids = hole.mat(16, 0, 1, path_type='RECTANGLE')
uvs = hole.uv(16, v, v, size, v, 0, 0, 0, 0, path_type='RECTANGLE')
bmed.buildmesh(context, o, verts, faces, matids=matids, uvs=uvs)
MaterialUtils.add_wall2_materials(o)
o.select = True
context.scene.objects.active = o
return o
评论列表
文章目录