Esempio n. 1
0
def bezier_curve_box(self, **options) -> str:
    line_width = self.style.get_line_width(face_element=False)
    pen = asy_create_pens(edge_color=self.edge_color, stroke_width=line_width)

    asy = ""
    for line in self.lines:
        for path in asy_bezier(
            (self.spline_degree, [xy.pos() for xy in line])):
            if path[:2] == "..":
                path = "(0.,0.)" + path
            asy += "draw(%s, %s);" % (path, pen)
    return asy
Esempio n. 2
0
 def components():
     for component in self.components:
         transformed = [(k, [xy.pos() for xy in p]) for k, p in component]
         yield "fill(%s--cycle, %s);" % ("".join(
             asy_bezier(*transformed)), pen)
Esempio n. 3
0
 def draw(points):
     for path in asy_bezier((self.spline_degree, points)):
         yield "draw(%s, %s);" % (path, pen)