Public Member Functions | |
def | __init__ |
def | __repr__ |
def | Path |
def | SVG |
Public Attributes | |
attr | |
f | |
high | |
loop | |
low | |
y2 | |
Static Public Attributes | |
dictionary | defaults = {} |
Draws a rectangle. Rect(x1, y1, x2, y2, attribute=value) x1, y1 required the starting point x2, y2 required the ending point attribute=value pairs keyword list SVG attributes
def svgfig::Rect::__init__ | ( | self, | |
x1, | |||
y1, | |||
x2, | |||
y2, | |||
attr | |||
) |
Reimplemented from svgfig::Curve.
def svgfig::Rect::__repr__ | ( | self | ) |
Reimplemented from svgfig::Curve.
def svgfig::Rect::Path | ( | self, | |
trans = None , |
|||
local = False |
|||
) |
Apply the transformation "trans" and return a Path object in global coordinates. If local=True, return a Path in local coordinates (which must be transformed again).
Reimplemented from svgfig::Curve.
Definition at line 2204 of file svgfig.py.
02205 : 02206 """Apply the transformation "trans" and return a Path object in 02207 global coordinates. If local=True, return a Path in local coordinates 02208 (which must be transformed again).""" 02209 if trans == None: 02210 return Path([("M", self.x1, self.y1, not local), ("L", self.x2, self.y1, not local), ("L", self.x2, self.y2, not local), ("L", self.x1, self.y2, not local), ("Z",)], **self.attr) 02211 02212 else: 02213 self.low = 0. 02214 self.high = 1. 02215 self.loop = False 02216 02217 self.f = lambda t: (self.x1 + t*(self.x2 - self.x1), self.y1) 02218 d1 = Curve.Path(self, trans, local).d 02219 02220 self.f = lambda t: (self.x2, self.y1 + t*(self.y2 - self.y1)) 02221 d2 = Curve.Path(self, trans, local).d 02222 del d2[0] 02223 02224 self.f = lambda t: (self.x2 + t*(self.x1 - self.x2), self.y2) 02225 d3 = Curve.Path(self, trans, local).d 02226 del d3[0] 02227 02228 self.f = lambda t: (self.x1, self.y2 + t*(self.y1 - self.y2)) 02229 d4 = Curve.Path(self, trans, local).d 02230 del d4[0] 02231 02232 return Path(d=(d1 + d2 + d3 + d4 + [("Z",)]), **self.attr)
def svgfig::Rect::SVG | ( | self, | |
trans = None |
|||
) |
Apply the transformation "trans" and return an SVG object.
Reimplemented from svgfig::Curve.
Reimplemented from svgfig::Curve.
dictionary svgfig::Rect::defaults = {} [static] |
Reimplemented from svgfig::Curve.
Reimplemented from svgfig::Curve.
Reimplemented from svgfig::Curve.
Reimplemented from svgfig::Curve.
Reimplemented from svgfig::Curve.