How to draw a black and white cookie?

I am basically trying to draw something like this:

I can draw a half circle and a larger surrounding circle, but I am having trouble simulating the uneven-ness of one of the half circles and making the shape look bevelled.


void setup(){
size(500,500);
smooth(4);
}

void half_circles(float x, float y, float r, color c1, color c2){
  
  noStroke();
  fill(c1);
  // draw one half circle 
  arc(x,y, r, r, -HALF_PI, HALF_PI);
  
  // now do same thing for other half of circle
  pushMatrix();
  translate(x,y);
  rotate(PI);
  fill(c2);
  arc(0, 0, r, r, -HALF_PI,HALF_PI);
  popMatrix();
  }
  
void draw(){
  noLoop();
  // draw bigger circle
  fill(#DCC096);
  ellipse(width/2,height/2,220,220);
  // draw two half circles
  half_circles(width/2,height/2,200, 255,0);

  
}


You can use noise function for randomness. take a look at https://www.youtube.com/watch?v=8ZEMLCnn8v0

I know about the noise function but I am not even sure how to parametrize the shapes so that I can add noise. I am drawing two arcs – so the only opportunity for noise is with the width/height of each half-circle, but that wouldn’t be too helpful.

You won’t be able to do this with arcs – unless you could somehow post-process their pixel output with a PShader. That seems unlikely.

Another approach is to draw the edges with PShapes using curveVertex or bezierVertex and then add randomness / drift to them to create a stroke.

The example is very “hand drawn” – the variable pressure line thickness, the brush orientation.

Can you record stroke data (or pixel data) with your mouse and use that as an asset, or do you need this to be derived from simple geometry at run time?

Here is one very simple example of how to do mouse-controlled brush-based drawing in Processing – although I suspect you want your output to be vector based rather than pixel based.

You want a radial gradient for that.

Then you want to mask it, e.g. with your frosting outline.