FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Bugs
   Bug Fixes, Implemented Suggestions
(Moderator: fry)
   bezier incorrectly drawn
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: bezier incorrectly drawn  (Read 772 times)
benelek

35160983516098 WWW Email
bezier incorrectly drawn
« on: Sep 11th, 2003, 2:38am »

this is slightly strange:
 
Code:
size(300,200);
bezier(0,100,width/3,100,2*width/3,100,3*width/3,100);

 
the curve should be drawn as a straight line, but has a slight upwards bend on it towards the right hand side of the curve.
 
arielm

WWW
Re: bezier incorrectly drawn
« Reply #1 on: Sep 11th, 2003, 10:48am »

to summarize, a 300 pixels width perfect horizontal line is expected, but instead, a 1 pixel height shift is occuring about the last third of the line...
 
seems like a "rounding" issue, due to the inner use of floats, no?
 
any expert judgment before i categorize this one in the bug db?
 

Ariel Malka | www.chronotext.org
arielm

WWW
Re: bezier incorrectly drawn
« Reply #2 on: Sep 11th, 2003, 11:14am »

hey, after trying to reproduce this curve in illustrator...
 
it seems that the "bug" is somewhere else:
 
the result of this curve should be a ~227 pixels wide straight horizontal line.
 
instead, the curve is 300 pixels wide, and a 1 pixel shift updwards is showing at the place the curve should end!
 

Ariel Malka | www.chronotext.org
benelek

35160983516098 WWW Email
Re: bezier incorrectly drawn
« Reply #3 on: Sep 11th, 2003, 11:40am »

erm... why should the curve be 227px long?
 
benelek

35160983516098 WWW Email
Re: bezier incorrectly drawn
« Reply #4 on: Sep 11th, 2003, 11:43am »

after a little experimenting, it seems the same bug is scaled to any width; lengths of 100, 200 or 227 all produce the same deflection.
 
arielm

WWW
Re: bezier incorrectly drawn
« Reply #5 on: Sep 11th, 2003, 8:52pm »

on Sep 11th, 2003, 11:40am, benelek wrote:
erm... why should the curve be 227px long

 
i started with your Code:
size(300,200);  
bezier(0,100,width/3,100,2*width/3,100,3*width/3,100);

then, i went to illustrator, switched to grid mode, and drew a curve based on the proportions you gave:
 
vertex 1: 0,0
control point 1: 100,0
 
vertex 2: 200,0
control point 2: 300, 0
 
 
the result is a straight horizontal line of ~227 pixels (which is something different from what is drawn within Processing)
 
(of course, there might be something i "missed" in all this...)
 

Ariel Malka | www.chronotext.org
benelek

35160983516098 WWW Email
Re: bezier incorrectly drawn
« Reply #6 on: Sep 12th, 2003, 4:11am »

i don't use illustrator, so i'm probably wrong in this, but aren't the endpoints supposed to be the vertices? ie,
 
vertex 1: 0,0  
control point 1: 100,0  
 
control point 2: 200,0  
vertex 2: 300, 0  
 
(possibly an irrelevant question, but perhaps illustrator calls different things vertices...)
 
arielm

WWW
Re: bezier incorrectly drawn
« Reply #7 on: Sep 12th, 2003, 9:18pm »

yeah... it's not illustrator actually, but rather me that did wrong (inverting the last two components), but i think, this time, that i finally understood the syntax
 
(me and bezier curves: a short, but funny story..)
 
so i guess we're back to the beginning of this thread (the "floating point rounding" issue...)
 

Ariel Malka | www.chronotext.org
fry


WWW
Re: bezier incorrectly drawn
« Reply #8 on: Sep 17th, 2003, 1:13am »

interesting bug.. i think there might be a rounding error in the code that we have to calculate the curve positions.  
 
you can get around it by using bezierMode(19) or bezierMode(21), (just not 20 since that's the default), though that uncovers another bug, that the first point isn't drawn
 
sooo... both bugs will be repaired for the next release.
 
fry


WWW
Re: bezier incorrectly drawn
« Reply #9 on: Sep 18th, 2003, 12:07am »

i've just finished fixing all this, so it'll be in rev 60.
 
Pages: 1 

« Previous topic | Next topic »