Add Arc and Pie Drawing and Plotting Features
Summary
This PR introduces several new features related to drawing and plotting arcs and pies in the egui ecosystem.
Changes
epaint: IntroducedArcPieShape, a new shape that represents an arc or a pie slice with specified radius, angle, fill, and stroke properties.egui: AddedPainter::{arc, pie}methods, which simplify the process of drawing arcs and pies.egui_plot: Introduced three new plot types:ArcLine,Pie, andPieChart.ArcLinerenders a simple arc line,Pierenders a single pie slice, andPieChartrenders a pie chart with data and labels.egui_demo_lib: Added demonstrations forArcPieShape,ArcLine,Pie, andPieChart. These demos showcase how to use these new features in a variety of contexts.
Impact
These changes enhance the capabilities of the egui ecosystem by providing users with more options for drawing and plotting.
The new demos also serve as valuable examples for users to learn from.
Take a look to a bezier curve arc approximation methods, it could be faster(may be)
https://docs.rs/bezier-nd/latest/bezier_nd/struct.Bezier.html#method.arc https://michael-f-bryan.github.io/arcs/kurbo/struct.Arc.html
Example: https://github.com/enomado/smitters/blob/main/src/egui.rs#L6
Take a look to a bezier curve arc approximation methods, it could be faster(may be)
It could also be more accurate, if you'd like an example, I have a duplicate PR: https://github.com/emilk/egui/pull/4426
Side note: I probably should have caught this in my review. Sorry!
egui_plot has recently been moved to its own repository, at https://github.com/emilk/egui_plot
This will hopefully speed up its development by having more reviewers and maintainers.
Please re-open this PR at https://github.com/emilk/egui_plot/pulls
See also:
- https://github.com/emilk/egui/issues/4705
- https://github.com/emilk/egui/pull/4828
@emilk, I'd categorize this as an epaint feature request, or at least a part of it