Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
Populate custom shape (vertex) with dots in p5

Trying to populate this red custom shape with dots like the ellipse. See image / code example below. Any help would be appreciated.

This Populating a circle with dots, using bias towards the edge of the cirlcle explains how to populate an ellipse but how to do the same technique in a custom shape?

Image with explanation of what I'm trying to do

function setup() {
  createCanvas(750, 750);
  background(0);
  noStroke();
  fill(255);
  noLoop();
}

function draw() {
  translate(width / 2, height / 2);
  for (let i = 0; i < 5000; i++) {
    let theta = random(0, TWO_PI);
    let h = randomGaussian(3.3); //experiment with different means
    let r = (exp(h) - 1) / (exp(h) + 1);
    let x = width / 2 * r * cos(theta);
    let y = height / 2 * r * sin(theta);
    ellipse(x,y,1,1); 


  }


// Trying to populate this custom shape with dots like the above ellipse
    beginShape();
      fill("#ff0000");
      vertex(179, 136);
      quadraticVertex(245, 30, 400, 140);
      bezierVertex(430, 360, 174, 306, 176, 211);
   endShape(CLOSE)


}
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.js"></script>

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda