|
Author |
Topic: Bezier and curve parametric functions? (Read 448 times) |
|
WillisMorse
|
Bezier and curve parametric functions?
« on: May 20th, 2003, 6:25pm » |
|
Are there any plans to add some functions to Processing that will allow querying curves and beziers by parameteric value to find: - xyz point - normal - tangent - first and second derivatives And from an XYZ point: - hit detection (simple boolean) - distance to closest point on curve This would really set Processing apart from most 2D graphics API's. Neither Java2D, Cocoa/Quartz, Flash nor any other widely available API that I've come across provide this kind of support for curves. It's kind of important to support these in the API, because if you're using these to constrain motion, you want your derived points to exactly match the rasterized (drawn) version of the curves. I'd be willing to help out in implementing some of these, if needed. I tried to search for mention of these on the website, but didn't find anything. Sorry if I missed a previous discussion of this. Thanks, Willis Morse
|
|
|
|
fry
|
Re: Bezier and curve parametric functions?
« Reply #1 on: May 20th, 2003, 6:52pm » |
|
the evaluation of individual points is definitely important, and i've used it heavily in other projects, so i've got the code and just need to take the hour to hack it into p5. the more advanced stuff you describe (normal, tangent, derivatives) would make a great extension library that folks could include with their projects (we'll get the external lib thing sorted out soon) so hack away! (moving this thread to the suggestions section of the site)
|
|
|
|
WillisMorse
|
Re: Bezier and curve parametric functions?
« Reply #2 on: May 20th, 2003, 7:05pm » |
|
I'm off to hack Is there any mechanism in place now to handle linking in my external modules? Like #include? Thanks, Willis Morse
|
|
|
|
fry
|
Re: Bezier and curve parametric functions?
« Reply #3 on: May 20th, 2003, 7:42pm » |
|
not yet, but most certainly planned. this is one of the top-5 requested features/bug fixes so hopefully we'll get it in there soon.
|
|
|
|
WillisMorse
|
Re: Bezier and curve parametric functions?
« Reply #4 on: May 21st, 2003, 12:22am » |
|
Pardon the probably idiotic question, but I've only been doing Processing for a day Is there any way to get access to the JDK from within my processing code? Specifically, I'd like to get to the Java2D stuff. Or is this what you're talking about when you said you're adding support for external code? This seems to be related to the mythical "advanced" mode, which is not there yet, I take it? Thanks, Willis Morse
|
|
|
|
fry
|
Re: Bezier and curve parametric functions?
« Reply #5 on: Jun 24th, 2003, 9:21pm » |
|
most jdk stuff is just available, though the graphics engine we provide replaces what's in the java2d thing, so you'll have a rough time getting any of that to work in combination with what's there.
|
|
|
|
fry
|
Re: Bezier and curve parametric functions?
« Reply #6 on: Jul 31st, 2003, 2:21am » |
|
k, i've just finished parametric versions of bezier() and curve() for 57.
|
|
|
|
|