def cleanup(ps): pw = py2geom.paths_to_pw(ps) centre, area = py2geom.centroid(pw) if (area > 1): return py2geom.sanitize(ps) * py2geom.Translate(-centre) else: return py2geom.sanitize(ps)
def cleanup(ps): pw = py2geom.paths_to_pw(ps) centre, area = py2geom.centroid(pw) if(area > 1): return py2geom.sanitize(ps) * py2geom.Translate(-centre) else: return py2geom.sanitize(ps)
def __init__(self): toyframework.Toy.__init__(self) self.handles.append(toyframework.PointHandle(200, 200)) self.path_b_name = "star.svgd" self.pv = py2geom.read_svgd(self.path_b_name) centr = py2geom.Point() for p in self.pv: c, area = py2geom.centroid(p.toPwSb()) centr += c self.pv = self.pv * py2geom.Matrix(py2geom.Translate(-centr))
def __init__(self): toyframework.Toy.__init__(self) self.handles.append(toyframework.PointHandle(200, 200)) self.path_b_name="star.svgd" self.pv = py2geom.read_svgd(self.path_b_name); centr = py2geom.Point() for p in self.pv: c,area = py2geom.centroid(p.toPwSb()) centr += c self.pv = self.pv*py2geom.Matrix(py2geom.Translate(-centr))