Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
 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))
Esempio n. 4
0
 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))