egui icon indicating copy to clipboard operation
egui copied to clipboard

Add Arc and Pie Drawing and Plotting Features

Open varphone opened this issue 1 year ago • 2 comments

Summary

This PR introduces several new features related to drawing and plotting arcs and pies in the egui ecosystem.

Changes

  • epaint: Introduced ArcPieShape, a new shape that represents an arc or a pie slice with specified radius, angle, fill, and stroke properties.
  • egui: Added Painter::{arc, pie} methods, which simplify the process of drawing arcs and pies.
  • egui_plot: Introduced three new plot types: ArcLine, Pie, and PieChart. ArcLine renders a simple arc line, Pie renders a single pie slice, and PieChart renders a pie chart with data and labels.
  • egui_demo_lib: Added demonstrations for ArcPieShape, ArcLine, Pie, and PieChart. 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.

screencast-egui_demo_app-2024-04-27.webm

varphone avatar Apr 27 '24 13:04 varphone

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

enomado avatar May 11 '24 22:05 enomado

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!

murl-digital avatar May 11 '24 22:05 murl-digital

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 avatar Jul 15 '24 17:07 emilk

@emilk, I'd categorize this as an epaint feature request, or at least a part of it

murl-digital avatar Jul 15 '24 21:07 murl-digital