I'm working on a project where I'm having a question.
I need to fill a fixed sized space/canvas (let's say 750*300), with around 200 equal sized small squares (let's say 10*10). The small squares need to be randomly spread out in the canvas, and approximately evenly spaced out with each other. The small squares need to be moving around within its own certain boundaries that they won't overlap with each other.
Basically this looks similar with a randomly spread out tag/word cloud, but evenly spaced with each other. Anybody have any thoughts on how to implement this? It will be great if this doesn't involve any external libraries.
I'm looking at packing algorithms and word clouds, but not sure which could get me closer.
I'm recently playing with the carnivore library for processing. But I'm getting a unsatisfiedlinkerror for just running the example sketch. Here's all I got from the console.
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.
I'm using beginShape(QUAD_STRIP) to draw out something really big, and I just want a flat single colored shape, and I have some problems on the stroke or the gap.
If I use noStroke(), there will always be a gap between each quad if you look carefully. It seems the gap is where the stroke is supposed to be, since I'm setting noStroke(), then the skinny line just becomes transparent.
If I do use stroke with half of the alpha value, there still is a thick line, which I think consists of two overlapping stroke lines.
So my question is does anyone know if there is a way to get rid of the gap? I need just a big flat semi-transparent shape.