예제 #1
0
파일: graphic.py 프로젝트: xnoob/Inkcut
 def get_bounding_box(self, adjusted=False):
     """
     Returns the bounding box, or corner points of the graphic as a list in
     the format [minx,maxx,miny,maxy]. If adjusted is true, the bounding box
     is adjusted to not include the weedline padding.
     """
     had_weedline = self.get_weedline_status()
     if adjusted:
         self.set_weedline(False)  # removes weedline if it is enabled
     path = cubicsuperpath.parsePath(simplepath.formatPath(self._data))
     self.set_weedline(had_weedline)  # adds weedline back if it was enabled
     return list(simpletransform.roughBBox(path))
예제 #2
0
 def get_bounding_box(self,adjusted=False):
     """
     Returns the bounding box, or corner points of the graphic as a list in
     the format [minx,maxx,miny,maxy]. If adjusted is true, the bounding box
     is adjusted to not include the weedline padding.
     """
     had_weedline = self.get_weedline_status()
     if adjusted:
         self.set_weedline(False) # removes weedline if it is enabled
     path = cubicsuperpath.parsePath(simplepath.formatPath(self._data))
     self.set_weedline(had_weedline) # adds weedline back if it was enabled
     return list(simpletransform.roughBBox(path))
예제 #3
0
파일: graphic.py 프로젝트: xnoob/Inkcut
 def curveto(p0, curve, flat=smoothness):
     poly = []
     d = simplepath.formatPath([['M', p0], curve])
     p = cubicsuperpath.parsePath(d)
     cspsubdiv.cspsubdiv(p, flat)
     for sp in p:
         first = True
         for csp in sp:
             if first:
                 first = False
             else:
                 for subpath in csp:
                     poly.append(['L', list(subpath)])
     return poly
예제 #4
0
 def curveto(p0,curve,flat=smoothness):
     poly = []
     d = simplepath.formatPath([['M',p0],curve])
     p = cubicsuperpath.parsePath(d)
     cspsubdiv.cspsubdiv(p, flat)
     for sp in p:
         first = True
         for csp in sp:
             if first:
                 first = False
             else:
                 for subpath in csp:
                     poly.append(['L',list(subpath)])
     return poly
예제 #5
0
 def _update_bounding_box(self):
     path = cubicsuperpath.parsePath(simplepath.formatPath(self._data))
     bbox = list(simpletransform.roughBBox(path))
     self._properties['bounding_box'] = bbox
예제 #6
0
파일: graphic.py 프로젝트: xnoob/Inkcut
 def _update_bounding_box(self):
     path = cubicsuperpath.parsePath(simplepath.formatPath(self._data))
     bbox = list(simpletransform.roughBBox(path))
     self._properties['bounding_box'] = bbox