Skip to content

[p5.js 2.0 Beta Bug Report]: endShape(CLOSE) for splineVertex has backwards tangent #7494

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

2.0 beta 1

Web browser and version

Firefox

Operating system

MacOS

Steps to reproduce this

This snippet should create a rounded triangle

function setup() {
  createCanvas(100, 100);
}

function draw() {
  background(220);
  scale(2)
  beginShape();
  splineVertex(10, 10);
  splineVertex(15, 40);
  splineVertex(40, 35);
  endShape(CLOSE);
}

Live: https://editor.p5js.org/davepagurek/sketches/QGv88_YLf

Instead, it has a backwards loop where it loops back on itself:

Image

It should ideally look like this (rendered using 1.x by repeating the first 3 points):

function setup() {
  createCanvas(100, 100);
}

function draw() {
  background(220);
  scale(2)
  beginShape();
  curveVertex(10, 10);
  curveVertex(15, 40);
  curveVertex(40, 35);
  
  curveVertex(10, 10);
  curveVertex(15, 40);
  curveVertex(40, 35);
  endShape();
}

Live: https://editor.p5js.org/davepagurek/sketches/1JgK9Qvm-

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions