Skip to content

New node: Arc #2470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 18, 2025
Merged

New node: Arc #2470

merged 9 commits into from
Apr 18, 2025

Conversation

optozorax
Copy link
Contributor

Closes #2434

@optozorax
Copy link
Contributor Author

Most of the code copied from

pub fn draw_arc(&mut self, center: DVec2, radius: f64, start_from: f64, end_at: f64) {

Tested it against circle with stroke +1px to see differences between them. Found none, seems pretty accurate.

Works for any angle from 0 to 360.

image

Copy link

📦 Build Complete for 65d3927
https://20e541a4.graphite.pages.dev

@mTvare6
Copy link
Contributor

mTvare6 commented Mar 20, 2025

Doesn't the ellipse part of #1715 also cover the use case of an arc. I believe implementing that would make an arc node redundant. So we shouldn't not have separate nodes.
Inkscape for reference.

pie
segment

@optozorax
Copy link
Contributor Author

optozorax commented Mar 29, 2025

I don't know what #1715 does, it's not obvious from the description. @Keavon was fine with this node. Maybe something changed?

Oh, it was inside todo: Ellipse should allow dragging a handle for the X extent and Y extent and ideally creating an arc/chord. Idk. I can only add Subpath::new_arc for #1715 to implement arc behavior later.

@Keavon
Copy link
Member

Keavon commented Mar 29, 2025

!build

Copy link

📦 Build Complete for 1720bd0
https://f7f1146f.graphite.pages.dev

@Keavon Keavon force-pushed the master branch 4 times, most recently from aa7ff13 to e11b57a Compare April 6, 2025 11:41
@Keavon
Copy link
Member

Keavon commented Apr 18, 2025

I made some improvements, now it can animate with values of any range without discontinuities:

capture_66_.mp4

@Keavon Keavon changed the title Add node that creates Arc shape New node: Arc Apr 18, 2025
@Keavon Keavon enabled auto-merge (squash) April 18, 2025 09:38
@Keavon Keavon merged commit adfcff7 into GraphiteEditor:master Apr 18, 2025
4 checks passed
@optozorax optozorax deleted the arc branch April 18, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add arc/unclosed shape options to circle node
3 participants