This commit is contained in:
2026-03-19 14:54:09 +03:00
parent 7145b66e0e
commit 37036f8f75
26 changed files with 5466 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
@startuml
title Эллипс/дуга: алгоритм растризации
start
:Read rx, ry, thickness,\narc_percent, closed, filled;
if (rx<=0 or ry<=0?) then (yes)
stop
endif
:Build local bbox corners with margin;
:Transform corners to buffer\nand compute pixel scan bounds;
:Create temporary transparent buffer;
if (do_fill?) then (yes)
:startFill() collect border pixels;
endif
while (for each pixel in bbox)
:Map pixel center Buffer -> World -> Local;
:nx = x/rx, ny = y/ry,\nd = nx^2 + ny^2;
if (d in stroke ring?) then (yes)
if (arc_percent < 100?) then (yes)
:Compute angular position\nvia atan2 and normalized diff;
if (inside arc sector?) then (yes)
:plot stroke pixel;
endif
else (full ellipse)
:plot stroke pixel;
endif
endif
endwhile
if (closed and arc_percent<100?) then (yes)
:Draw two radial segments\n(center->start and center->end);
endif
if (do_fill?) then (yes)
:stopFill(fill_color);
endif
:Composite temp buffer to target\nonce with object opacity;
stop
@enduml