Vector
# Editable paths, gradient paint, colored spans and fused instances.page = canvas(name="LayMesh vectors", size=(180 mm, 120 mm), background="#ffffff") heading = text(spans=[span("Lay", color="#087f8c"), span("Mesh", color="#1d2640"), span(" vectors", color="#5b6680")], font_family="DejaVu Sans", font_size=20 pt)page.add(heading, target=page.top_left, offset=(10 mm, 7 mm)) warm = linear_gradient(start=(0, 0), end=(1, 1), stops=[(0, "#fff0ce"), (0.55, "#ff8a60"), (1, "#ad3462")])cool = radial_gradient(center=(0.35, 0.3), radius=0.8, stops=[(0, "#cbfff5"), (1, "#087f8c")]) wave = path(commands=[move_to(0 mm, 23 mm), cubic_to(14 mm, -5 mm, 31 mm, -5 mm, 45 mm, 23 mm), cubic_to(31 mm, 40 mm, 14 mm, 40 mm, 0 mm, 23 mm), close()],# Editable paths, gradient paint, colored spans and fused instances.page = canvas(name="LayMesh vectors", size=(180 mm, 120 mm), background="#ffffff") heading = text(spans=[span("Lay", color="#087f8c"), span("Mesh", color="#1d2640"), span(" vectors", color="#5b6680")], font_family="DejaVu Sans", font_size=20 pt)page.add(heading, target=page.top_left, offset=(10 mm, 7 mm)) warm = linear_gradient(start=(0, 0), end=(1, 1), stops=[(0, "#fff0ce"), (0.55, "#ff8a60"), (1, "#ad3462")])cool = radial_gradient(center=(0.35, 0.3), radius=0.8, stops=[(0, "#cbfff5"), (1, "#087f8c")]) wave = path(commands=[move_to(0 mm, 23 mm), cubic_to(14 mm, -5 mm, 31 mm, -5 mm, 45 mm, 23 mm), cubic_to(31 mm, 40 mm, 14 mm, 40 mm, 0 mm, 23 mm), close()], fill=warm, border_color="#743152", border_width=0.5 mm)page.add(wave, target=page.top_left, offset=(10 mm, 31 mm)) donut = ring(outer_radius=17 mm, inner_radius=8 mm, fill=cool, border_color="#087f8c", border_width=0.4 mm)page.add(donut, target=page.top_left, offset=(72 mm, 37 mm)) burst = star(points=9, outer_radius=17 mm, inner_radius=11 mm, fill="#f2b544", border_color="#a45e23", border_width=0.4 mm)page.add(burst, target=page.top_left, offset=(125 mm, 37 mm)) divider = polyline(points=[(0 mm, 0 mm), (52 mm, 0 mm), (55 mm, -3 mm), (58 mm, 0 mm), (160 mm, 0 mm)], line_color="#8c99ae", line_width=0.5 mm, line_dash=[2 mm, 1 mm], line_cap=round, line_join=round)page.add(divider, target=page.top_left, offset=(10 mm, 84 mm)) box = rect(size=(18 mm, 12 mm), fill="#087f8c")left = page.add(box, target=page.top_left, offset=(10 mm, 96 mm))page.add(box, target=page.top_left, offset=(142 mm, 96 mm))stem = page.add(line(dx=30 mm, dy=0 mm, line_width=3 mm), target=page.top_left, offset=(42 mm, 102 mm))joined = page.fuse(left, stem, points=(left.middle_right, stem.start), bridge_width=3 mm, junction=round, radius=1.5 mm, fill="#087f8c", border_color="none")tip = page.add(line(end_head=head(), dx=22 mm, dy=0 mm, line_color="#a45e23", line_width=1.5 mm), target=joined.middle_right, offset=(5 mm, 0 mm))page.add(sector(radius=6 mm, start=-45 deg, end=45 deg, fill="#f2b544"), target=tip.end, offset=(3 mm, -6 mm))预览
背景
依赖文件
examples/vector.lay
复现
laymesh validate examples/vector.laylaymesh render examples/vector.lay -o figure.svglaymesh render examples/vector.lay -o figure.pdflaymesh render examples/vector.lay -o figure.png --dpi 300