Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/p5.Renderer3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ export class Renderer3D extends Renderer {

model(model, count) {
count = count ?? this._instanceCount ?? 1;
if (model.vertices.length > 0) {
if (model.vertices.length > 0 || model.parts.some(part => part.vertices.length > 0)) {
if (this.geometryBuilder) {
this.geometryBuilder.addRetained(model);
} else {
Expand Down Expand Up @@ -605,14 +605,14 @@ export class Renderer3D extends Renderer {

if (
this.states.fillColor &&
geometry.vertices.length >= 3 &&
![constants.LINES, constants.POINTS].includes(mode)
) {
// draw every part. a geometry always has at least one part (the
// constructor makes it its own single part when nothing else does), so no
// fallback is needed. a part with no material state draws straight;
// multi-material parts apply their own material around the draw.
for (const part of geometry.parts) {
if (part.vertices.length < 3) continue;
const state = part.partState;
// fill/ambientColor/specularColor are arrays and texture is a p5.Image,
// so they're truthy when set; shininess is a number where 0 is valid.
Expand Down
2 changes: 1 addition & 1 deletion src/webgl/3d_primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,7 @@ function primitives3D(p5, fn) {
arcGeom.computeNormals();

if (detail <= 50) {
arcGeom._edgesToVertices(arcGeom);
arcGeom._edgesToVertices();
} else if (this.states.strokeColor) {
console.log(
`Cannot apply a stroke to an ${shape} with more than 50 detail`
Expand Down
Loading