Skip to content

[p5.js 2.0 Bug Report]: noFill() + buildGeometry() sets fill to black #8183

@davepagurek

Description

@davepagurek

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.0.5 (2.0+)

Web browser and version

Any

Operating system

Any

Steps to reproduce this

Steps:

  1. Call noFill()
  2. Create a stroke-only model with buildGeometry()
  3. Draw the stroke-only model with model()

Instead of just drawing a stroke-only model, it draws with a black fill, and logs an internal parameter validation error about an invalid color.

Snippet:

function setup() {
  createCanvas(400, 400, WEBGL);
  background(255)
  stroke('red')
  noFill()
  const geom = buildGeometry(() => {
    beginShape()
    vertex(-50, 50)
    vertex(50, 50)
    vertex(0, -50)
    endShape(CLOSE)
  })

  model(geom)
}

Live: https://editor.p5js.org/davepagurek/sketches/cGiG6zJ-S

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions