def translate(s): a = to_number_array(s) tx = a[0] ty = 0 if len(a) > 1: ty = a[1] return Transform.translated(tx, ty)
def translate(s): a = to_number_array(s) tx = a[0] ty = 0 if len(a) > 1: ty = a[1] return Transform.translated(tx, ty)
def pack(shapes, iterations, padding, seed): _seed(seed) packed_objects = [] for path in shapes: packed_objects.append(PackObject(path)) for i in xrange(1, iterations): _pack(packed_objects, damping=0.1/i, padding=padding) geo = Geometry() for po in packed_objects: print po.x, po.y p = Transform.translated(po.x, po.y).map(po.path) geo.add(p) return geo
def translate(shape, translate): """Move the shape.""" if shape is None: return None return Transform.translated(translate).map(shape)
def translate(shape, translate): """Move the shape.""" if shape is None: return None return Transform.translated(translate).map(shape)