processing / processing/p5.js

[2.0 beta 1] textToModel adds extra face?

Open
#7,474 4 comments 0 reactions 1 assignee View on GitHub

@perminder-17 is already working on this.

Since Jan 21, 2025.

Area:WebGL Bug p5.js 2.0+
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

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 beta 1

Web browser and version

Firefox

Operating system

MacOS

Steps to reproduce this

I was testing out textToModel here, combining it with a shader to displace vertices: https://openprocessing.org/sketch/2513601

I notice that when the vertices get displaced, sometimes the fills go outside of the strokes in a straight line:

Image

It looks like there's an extra face here, or a face that hasn't been subdivided, so that when the endpoints move, it draws a straight line between them, rather than following the warped curve.

This has something to do with p5.Font.textToModel here probably: https://github.com/processing/p5.js/blob/2ec3557dd7d6afeac87502d589ce8caa74baba77/src/type/p5.Font.js#L120

When drawing the front faces, I've called endContour(CLOSE), I wonder if the CLOSE is causing an extra face to be made?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.