Skip to content

[p5.js 2.0 Bug Report]: Warnings about omitting strokes on high-detail 3D primitives don't use FES #8387

@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

All

Web browser and version

All

Operating system

All

Steps to reproduce this

Steps:

  1. Turn off FES
  2. Draw a cylinder with a high level of detail
  3. It still logs a warning

That's because these sorts of warnings are raw console.logs in the codebase:

console.log(
'Cannot draw stroke on cylinder objects with more' +
' than 24 detailX or 16 detailY'
);

Snippet:

p5.disableFriendlyErrors = true
function setup() {
  createCanvas(400, 400, WEBGL);
  cylinder(20, 100, 40, 40)
}

Additionally, this also triggers when you are drawing to a p5.Geometry, i.e.:

function setup() {
  createCanvas(400, 400, WEBGL);
  const myGeom = buildGeometry(() => cylinder(20, 100, 40, 40))
  noStroke()
  model(geom)
}

Arguably we should just silence this error if inside of buildGeometry since we don't know if it will eventually be drawn with strokes or not, to avoid misleading false positives.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions