Skip to content

p5.Geometry.prototype._getFaceNormal: face has colinear sides or a repeated vertex #4791

Open
@micuat

Description

@micuat

Most appropriate sub-area of p5.js?

  • Accessibility (Web Accessibility)
  • Color
  • Core/Environment/Rendering
  • Data
  • Dom
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Details about the bug:

  • p5.js version: 1.1.9
  • Web browser and version: any
  • Operating System: any
  • Steps to reproduce this:

sorry for a bit of a mess - first sayo found bunch of warnings from _getFaceNormal in her sketch

https://www.openprocessing.org/sketch/956215

and I found that it's due to "repeated vertex" as the warning suggests. When I add a condition not to add new vertices that are close to the existing set of vertices

https://www.openprocessing.org/sketch/956834

which is actually weird because the "threshold" I found was roughly around 0.05 (line 114 in the sketch above) which actually alters the appearance of the output. So I tried to reproduce it in a simpler sketch, which I failed to do

https://www.openprocessing.org/sketch/956871

I guess if I have a p5js dev environment the best way to debug this is to actually see the set of vertices causing error in the first and the second sketches, but I am a volunteer and can only write this issue here... sorry it's not that helpful

FYI

p5.Geometry.prototype._getFaceNormal = function(faceId) {

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Bugs with No Solution Yet

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions