-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
mixing vertex() and curveVertex() #906
Comments
Yes, I think you are right. My memory tells me there's a way of mixing in Processing, but perhaps that's part of This may be a edge case that rarely comes up, and I agree it looks like it's a documentation issue. |
You can mix regular and curve vertices in Processing: size(200, 200);
fill(255);
noFill();
beginShape();
curveVertex(84, 91);
curveVertex(84, 91);
curveVertex(68, 19);
curveVertex(21, 17);
curveVertex(32, 100);
curveVertex(32, 100);
vertex(50, 120);
vertex(80, 140);
endShape(); the problem is that you need at least four consecutive curveVertex() calls to draw a valid curve segment |
Thanks, @codeanticode. I am not sure what p5.js should do, just noting the difference. I suppose mixing would be nice if it's reasonable to implement in canvas. See results in both below. function setup() {
createCanvas(200, 200);
}
function draw() {
fill(255);
noFill();
beginShape();
curveVertex(84, 91);
curveVertex(84, 91);
curveVertex(68, 19);
curveVertex(21, 17);
curveVertex(32, 100);
curveVertex(32, 100);
vertex(50, 120);
vertex(80, 140);
vertex(100, 140);
vertex(120, 180);
vertex(160, 200);
endShape();
} |
I think the complexity of adding this and the lack of activity on this thread suggests we table this for now and focus on frying bigger fish until this comes into higher demand. |
I have the same problem. |
I have also run into a similar issue, I assumed that I could put a My solution has been to approach the curve shape with straight lines between multiple I would recommend this solution for any problem where you try to mix I attempted the |
This is now resolved in 2.0 after #7373! |
First, let me say that I don't really know what I'm talking about here. But I noticed today that if you use a call to
curveVertex()
withinbeginShape()
andendShape()
, all the vertices turn into "curved" ones, rather than just an individual vertex, i.e.I know there are other aspects at play here in terms of how
curveVertex()
works, but I'm not sure if the above result is correct?The text was updated successfully, but these errors were encountered: