Skip to content
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

Circular arc command as part of low level api? #29

Open
tnrich opened this issue Nov 2, 2015 · 3 comments
Open

Circular arc command as part of low level api? #29

tnrich opened this issue Nov 2, 2015 · 3 comments

Comments

@tnrich
Copy link

tnrich commented Nov 2, 2015

Hey @andreaferretti, I think it would be really nice if users could define a circular arc with a slightly simplified api:

.arcCircular(xCenter, yCenter, r, sAngle, eAngle, counterclockwise)

This api mirrors the canvas arc api and I think it is a lot more straightforward for this particular use case.
http://www.w3schools.com/tags/canvas_arc.asp

What do you think?

I'd be happy to try to implement it myself, but am a little confused as to whether I should be modifying the path.coffee file or the one under the node dir?

Thanks for the great library!

@andreaferretti
Copy link
Owner

I think the right place to put such an API - which is certainly welcome! - would be the Mid Level API. The Low Level one intentionally mimcs the SVG spec literally, and I'd rather not deviate. One could have instead a Shape called CircleArc or something like that, with your parameters, that draws a circular arc.

If you want to submit a PR, you could create a file like circle-arc.coffee under /src/main/paths, together with some tests in /src/tests. The node files are created by grunt. For an example, you can look at another shape, such as polygon.coffee.

To check that everything is fine and run the tests, you first need to install grunt (npm install -g grunt-cli), then

npm install
grunt

Hope that helps!

@tnrich
Copy link
Author

tnrich commented Nov 2, 2015

Great thanks for the info. I'll do it if I have time!

On Mon, Nov 2, 2015, 12:59 AM Andrea Ferretti notifications@github.com
wrote:

I think the right place to put such an API - which is certainly welcome! -
would be the Mid Level API. The Low Level one intentionally mimcs the SVG
spec literally, and I'd rather not deviate. One could have instead a Shape
called CircleArc or something like that, with your parameters, that draws a
circular arc.

If you want to submit a PR, you could create a file like circle-arc.coffee
under /src/main/paths, together with some tests in /src/tests. The node
files are created by grunt http://gruntjs.com/. For an example, you can
look at another shape, such as polygon.coffee.

To check that everything is fine and run the tests, you first need to
install grunt (npm install -g grunt-cli), then

npm install
grunt

Hope that helps!


Reply to this email directly or view it on GitHub
#29 (comment)
.

@andreaferretti
Copy link
Owner

Just in case, now there is no need for grunt anymore. Just npm install, npm run build, npm run test

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

No branches or pull requests

2 participants