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 first_time(self, argv): path_b_name="star.svgd" if len(argv) > 1: path_b_name = argv[1] self.paths_b = py2geom.read_svgd(path_b_name) bounds = py2geom.bounds_exact(self.paths_b) self.offset_handle.pos = bounds.midpoint() - bounds.corner(0) self.bs = cleanup(self.paths_b)
def first_time(self, argv): path_b_name = "star.svgd" if len(argv) > 1: path_b_name = argv[1] self.paths_b = py2geom.read_svgd(path_b_name) bounds = py2geom.bounds_exact(self.paths_b) self.offset_handle.pos = bounds.midpoint() - bounds.corner(0) self.bs = cleanup(self.paths_b)
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.tmat = numpy.zeros([3, 4]) # plane origin self.origin_handle = toyframework.PointHandle(180, 65) self.handles.append(self.origin_handle) self.vanishing_points_handles = toyframework.PointSetHandle() path_a_name = "ptitle.svgd" import sys if len(sys.argv) > 1: path_a_name = sys.argv[1] self.paths_a = py2geom.read_svgd(path_a_name) # Finite images of the three vanishing points and the origin self.handles.append(self.vanishing_points_handles) self.vanishing_points_handles.append(550, 350) self.vanishing_points_handles.append(150, 300) self.vanishing_points_handles.append(380, 40) self.vanishing_points_handles.append(340, 450)
def __init__(self): toyframework.Toy.__init__(self) self.tmat = numpy.zeros([3,4]) # plane origin self.origin_handle = toyframework.PointHandle(180,65) self.handles.append(self.origin_handle) self.vanishing_points_handles = toyframework.PointSetHandle() path_a_name="ptitle.svgd" import sys if len(sys.argv) > 1: path_a_name = sys.argv[1] self.paths_a = py2geom.read_svgd(path_a_name) # Finite images of the three vanishing points and the origin self.handles.append(self.vanishing_points_handles) self.vanishing_points_handles.append(550,350) self.vanishing_points_handles.append(150,300) self.vanishing_points_handles.append(380,40) self.vanishing_points_handles.append(340,450)