Skip to content

Commit b1e665d

Browse files
committed
Add filled_polygon primitive and fixtures
1 parent c77f368 commit b1e665d

13 files changed

Lines changed: 136 additions & 1 deletion

README.org

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,23 @@ nb.layer("Sketch").tool(pen=SAMPLE_TOOL, width=SAMPLE_LINE_WIDTH)
100100
nb.filled_rect(60, 320, 180, 110, spacing_factor=0.25, cross_hatch=True)
101101
#+END_SRC
102102

103+
Polygons can also be filled with the scanline approach:
104+
105+
#+BEGIN_SRC python
106+
nb.filled_polygon(
107+
[
108+
(80, 320),
109+
(200, 300),
110+
(240, 360),
111+
(200, 420),
112+
(80, 400),
113+
],
114+
spacing_factor=0.25,
115+
cross_hatch=True,
116+
edge_outline=True,
117+
)
118+
#+END_SRC
119+
103120
These helpers assemble a minimal, device-like block sequence (author IDs,
104121
migration and page info, scene tree, layer + stroke) using =rmscene= and write
105122
with a compatible version string. Coordinates are in pixels (typical page

fixtures/arc_fixture.rm

0 Bytes
Binary file not shown.

fixtures/ellipse_fixture.rm

0 Bytes
Binary file not shown.

fixtures/filled_ellipse_fixture.rm

0 Bytes
Binary file not shown.

fixtures/filled_polygon_fixture.rm

2.69 KB
Binary file not shown.

fixtures/filled_rect_fixture.rm

0 Bytes
Binary file not shown.

fixtures/path_fixture.rm

0 Bytes
Binary file not shown.

fixtures/polygon_fixture.rm

0 Bytes
Binary file not shown.

fixtures/rounded_rect_fixture.rm

0 Bytes
Binary file not shown.

fixtures/star_fixture.rm

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)