We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I don't understand why the arc is not located at the middle of the canvas. I must have missed sth here ...
PShape arc1, arc2, line1, line2;
void setup(){
size(200,200, P3D);
arc1 = createShape(ARC, 100,100, 100,100, 0,PI/2);
}
void draw(){
arc1.noFill();
shape(arc1);
}
Answers
What version of processing you are using? I have check it in 2.1.x on windows 7 machine and it is working fine. I think it may be either your OS problem, since you are using mac, or processing version problem.
On Mac OS 10.8.5, Processing 2.03, I get the shape in the correct position, but with an extra line drawn through it. I also get an error message that might be a clue:
noFill() can only be called between beginShape() and endShape()
thanks, blyk and bilmore!
I tried in the latest Processing 2.1 on windows7 and the problem is still there.
I assume the default ellipse mode used by createShape(ARC) is set as CORNER.
Is there a way to change it to CENTRE mode?
http://processing.org/reference/shapeMode_.html
I see, thanks a lot GoToLoop!
actually, what I wan to draw is like the first shape in the following image: part of a doughnut shape composed of 2 line segments and 2 arcs sharing the same center (i don't want to use bezier curve, too many control point to manipulate... )
Any advises on how to draw it? Thanks!
forum.processing.org/two/discussion/1797/how-to-use-bezier-curve-to-approximate-one-quarter-of-a-circle#Item_15
suggestions are greatly appreciated!