questions on drawing a ring shape with composite object
in
Processing with Other Languages
•
1 year ago
Hi all,
I'm having a question on how to draw out a sort-of-ring shape in processing.js. Basically I want something like this in the image, inner circle has some
offset relative to the outer circle, and It would also allow me to
change its outer and inner radius for more variations and scaling.
I'm wondering if there is a way I can composite the ring shape in processing like illustrator - pathfinder - minus front. I know there is a composite object example, but I didn't find a way to subtract an object from a big one.
Since I need to change the shape's outer and inner radius, I assume simply importing a svg file is probably a dead end.
I also tried to use beginShape(QUAD_STRIP) to get the ring shape, but if I set noStroke(), there will be a gap at where the stroke is supposed to be. The gap is tiny, but if it's scaled up and looked at carefully, which I do need, you will see it. I've also tried to set strokeWeight(1), and stroke alpha to be half of the actual shape, it gave me a very thick line. I assume that's probably because two strokes are overlapping each other. I tried to reduce stroke alpha to be 1/10 of the shape's, it looks fine, but still that's a fake, it didn't really get rid of the artifact.
A 3rd idea, is it actually possible to use some other javascript library to draw a adjustable ring, and use it in processing.js?
Thank you all in advance, any help of direction is welcome.
1