[p5.js 2.0+ Bug Report]: Infinite loops detected when calling splineVertex
Open
Nobody has claimed this yet.
Area:Core
Area:WebGL
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
- WebGPU
- p5.strands
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
2.2.3
Web browser and version
150.0.7871.115 (Official Build) (arm64)
Operating system
MacOS
Steps to reproduce this
Steps:
- Run the following sketch in the p5.js editor
Doing this yields Error: Multiple infinite loops detected. Stopping execution.
Snippet:
const points1 = [];
const num = 7;
function setup() {
const s = 640;
createCanvas(s, s, WEBGL);
for (let i = 0; i < num; i++) {
const x = 0.5 * width - random(0, width);
const y = 0.5 * height - random(0, height);
const z = 0.5 * width - random(0, width);
points1.push({
x: 0.625 * x,
y: 0.625 * y,
z: 0.625 * z,
});
}
frameRate(24);
}
function draw() {
background(15);
noFill();
for (let k = 0; k < 32; k++) {
stroke(255);
push();
rotateY(frameCount * 0.01 - k * 0.04);
beginShape();
for (let i = 0; i < points1.length; i++) {
splineVertex(points1[i].x, points1[i].y, points1[i].z);
}
endShape(CLOSE);
pop();
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied sketch in the p5.js editor and trace the splineVertex entry point through the WebGL/core rendering path. Done means the reproduction no longer reports “Multiple infinite loops detected” while drawing the closed spline.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100