-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PShape.getVertexCount() always outputs 0 #896
Comments
@dtplsongithub , can you check if your shape is a group shape? I just tested this on the Processing example "LoadDisplayOBJ", which shows a rotating rocket. The vertex count was zero but I could use the below code to get the vertices for the object's children: rocket = loadShape("rocket.obj");
println(rocket.getVertexCount());
int count = 0;
for (PShape shape : rocket.getChildren()) {
count += shape.getVertexCount();
}
println(count); The output is: 0
1101 I would argue that a call to |
the code you provided me works, i guess i was using the method wrong... |
No, I think the code you originally wrote should work. Let's keep this open so we can use this as an opportunity to improve Processing. It would likely be an easy PR, so I'll add some tags so a first-time contributor can fix it. |
And @dtplsongithub , if you, or anyone else reading this would like some help working through the PR, I'm available to assist! |
Adding a warning message, that groups are ignored in the count would also be helpful. Maybe even a |
Most appropriate sub-area of Processing 4?
Core/Environment/Rendering
Processing version
4.3.1
Operating system
Windows 11 (24H2)
Steps to reproduce this
PShape.getVertexCount()
always seems to output 0. (tried 1 .svg file and 4 .obj files, even included the .mtl files)snippet
Additional context
No response
The text was updated successfully, but these errors were encountered: