-
-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add arc/unclosed shape options to circle node #2434
Comments
Good idea! I'll need to think slightly about the design, and in particular how to distinguish between an empty and full circle which would both be represented by equal starting and ending angles (relevant if being animated). This should also probably have a choice between being an open path or a closed pie slice. |
I would love to take this on. Please assign it to me |
@Forchapeatl Go for it! Feel free to suggest ideas for the solution to the problem I mentioned in my previous comment for telling the difference between an empty and full circle, but you could begin working on it while we experiment with ideas. Regarding @superlou's previous post, I think we can skip the "chord" option because that is redundant compared to just applying a "Close Path" node, which we don't have yet but you could also add. We don't do issue assignments until a PR is ready to land, but feel free to comment here with your PR number once you have it opened to communicate to others that you have a work in progress PR for the task. Looking forward to your PR! |
I think this solution will work for the angle question: instead of "start angle" and "stop angle", it can be "start angle" and "angular distance" which can be a positive or negative value that tells it how far from the start angle to go. A full circle would be a full 360°. |
Hi @Keavon , can we make modifications to these modifications fn circle(_: impl Ctx, _primary: (), #[default(50.)] radius: f64, #[default(0.)] start_angle: f64, #[default(360.)] angular_distance: f64) -> VectorDataTable {
let arc_path = Subpath::new_arc(DVec2::splat(-radius), DVec2::splat(radius), start_angle, start_angle + angular_distance);
VectorDataTable::new(VectorData::from_subpath(arc_path))
} to Graphite/node-graph/gcore/src/vector/generator_nodes.rs Lines 37 to 39 in 7e7e88f
? so that graphite Creates an arc based on the start angle and angular distance. The documentation talks about the |
Revelant info from the discord: You can't create any shape which is not bezier curves. This is why circle is an approximated using bezier curves with link to some very large article. Also, even if I want to hack this, it's still impossible, since you can't create segment without a bezier handles. So in order to do this task one need to implement it using bezier curves Algorithm for a bezier arc is here: https://github.com/GraphiteEditor/Graphite/blob/master/editor/src/messages/portfolio/document/overlays/utility_types.rs#L275 |
@Forchapeatl did you read and follow all the instructions in the contributor guide that you linked? It should cover all your questions about setting up the project. If you need more help, please first attempt to research your troubles and if that doesn't solve it, reach out on our Discord for further assistance (issues aren't a good format for troubleshooting). |
I'm trying to use Graphite to generate sprite sheets for a circular progress indicator. Inkscape has the ability to specify a start and end angle for the stroke, creating an unclosed cirlce:
Having node editor properties to set these in Graphite would allow using nodes to generate the different images, with the arc filling up to close the circle as the progress indicator gets to 100%.
The text was updated successfully, but these errors were encountered: