Line caps on exported SVG lines and arcs are now configured to be round

(stroke-linecap="round"), matching the on-screen Lyon tessellation.

Summary of Changes
turtle-lib/src/export_svg.rs:
Added .set("stroke-linecap", "round") to SVG <line> elements.
Added .set("stroke-linecap", "round") to partial arc <path> elements.
Extracted SvgExporter::to_svg_document(&TurtleWorld) -> Document to
allow in-memory SVG inspection and testing.
Added unit tests verifying that both lines and arcs export with
stroke-linecap="round".

turtle-lib/src/state.rs:
Added #[allow(clippy::unused_self)] to SvgLog::clear for clean clippy
passes when compiling without the svg feature.
This commit is contained in:
2026-09-20 10:33:38 +02:00
parent c4831967be
commit 368497f97a
3 changed files with 70 additions and 7 deletions
+4 -4
View File
@@ -9,11 +9,11 @@ fn draw(turtle: &mut TurtlePlan) {
turtle.set_pen_width(0.5);
// Draw a 5-pointed star pattern repeatedly
for _i in 0..50000 {
for _i in 0..500 {
turtle.forward(200.0);
turtle.circle_left(10.0, 72.0, 1000);
turtle.circle_right(5.0, 360.0, 1000);
turtle.circle_left(10.0, 72.0, 1000);
turtle.circle_left(10.0, 72.0, 100);
turtle.circle_right(5.0, 360.0, 100);
turtle.circle_left(10.0, 72.0, 100);
}
// Set animation speed