noFill() not working in p5js

noFill() in p5js is not working for me. Is this a bug?

Please find below a sample of my issue.
With noFill() the p5js box shows as wireframe.
The custom trapezoid is still filled with orange.

var th = .345;
var v = [0,0,0, 35,0,0, 35,0,47, 13,0,35];

function setup() {
createCanvas(800, 600, WEBGL);
}
function draw() {
background(204);
rotateX(-0.345);
scale(4);

fill(‘orange’);

noFill();
rotateY(th);
box(50);

th = th + .02;

beginShape();
	for (var i = 0; i < v.length; i+=3) {
            // adjust for right hand system that I have data from
		vertex(v[i], -v[i+2], -v[i+1]);
	}
endShape(CLOSE);

}

I should mention that I am tis running under an index.html file with the p5.js source included along with my sample file… not in the editor. I read in an old noFill() discussion that this can make a difference.

More testing on noFill(0)… The following code is straight from the Vertex example in the P5js reference. I only added noFill(). It works in the editor but not when included in the index.html src. This is a bug. Macintos OS10.12 and OS10.14. Can someone please try this in Windows? Thanx.

function setup() {
createCanvas(800, 600, WEBGL);
}
function draw() {
background(240, 240, 240);
scale(3);
fill(237, 34, 93);

//noStroke();
noFill();
beginShape();
vertex(-10, 10);
vertex(0, 35);
vertex(10, 10);
vertex(35, 0);
vertex(10, -8);
vertex(0, -35);
vertex(-10, -8);
vertex(-35, 0);
endShape();
}

It seems to be an issue with version 1.0.0, it runs as expected in version 0.10.2. You can file an issue to report the bug here.

you’re telling it to fill and then tell it to not to???

Code
var th = 0.345;
var v = [0, 0, 0, 35, 0, 0, 35, 0, 47, 13, 0, 35];

function setup() {
  createCanvas(800, 600, WEBGL);
}

function draw() {
  background(204);
  scale(4);
  stroke("black");
  strokeWeight(3);
  fill("orange");
  box(50);

  th = th + 0.02;

  noFill();
  beginShape();
  for (let i = 0; i < v.length; i += 3) {
    // adjust for right hand system that I have data from
    vertex(v[i], -v[i + 2], -v[i + 1]);
  }
  endShape(CLOSE);
}

v0.10.2
image

v1.0.0
image

Thank you for verifying this. I will try to report this.

1 Like

I downloaded 0.10.2 and as mentioned noFill(); does indeed work there as promised. I signed up for Github and reported the issue. Thanx. CND aka buggles1.

1 Like

I have been informed and confirmed that v1.0.0 June 08 works properly with noFill(). My version v1.0.0 Feb 2020 that I am using does not. Hence the confusion. I got my version straight from the download option of the reference section. Where then do I get a current version? Thanx.

@stalgiag answered your question already on the issue you filed …

“You do have the latest officially released version which was made on Feb. 29th. The other file (June 8th) was built locally by me with the most recent Github main branch using the steps in the above linked contributor docs.”

The fix has already been resolved, you either need to wait for the next public release or grab the most recent version and build yourself following these steps steps 1-5 of the Development Process.