Skip to content

endContour() throws error in WEBGL mode #5946

Closed
@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
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

p5.js version

1.5.0

Web browser and version

Firefox 108.0

Operating System

MacOS 12.5.1

Steps to reproduce this

Currently, if you add a createCanvas(100, 100, WEBGL) to the start of the beginContour example in the docs, we get an type error in endContour: d[0] is undefined.

We're able in theory to support this in beginShape(TESS) mode (the default on the main branch currently) by supplying multiple contours to libtess. I have an example of using that to extrude text in 3D in https://openprocessing.org/sketch/1721124 on extrudeText:52 and it triangulates the cutouts correctly, so implementing this would be a matter of mapping begin/endContour shapes to an array in the parameters of our _triangulate call.

Metadata

Metadata

Type

No type

Projects

Status

DONE! 🎉

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions