Skip to content

Commit 4ff4171

Browse files
committed
Fix text extrusion with proper vertex deduplication, edge detection, and normal calculation with recomended chnages
1 parent 014e2cb commit 4ff4171

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/type/p5.Font.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,8 @@ export class Font {
631631
const edgeVector = new Vector(vB.x - vA.x, vB.y - vA.y, vB.z - vA.z);
632632
const extrudeVector = new Vector(0, 0, extrude);
633633
const crossProduct = Vector.cross(edgeVector, extrudeVector);
634-
if (crossProduct.mag() < 0.0001) continue;
635-
if (dist < 0.0001) continue;
634+
const dist = edgeVector.mag();
635+
if (crossProduct.mag() < 0.0001 || dist < 0.0001) continue;
636636
// Front face vertices
637637
const frontA = extruded.vertices.length;
638638
extruded.vertices.push(new Vector(vA.x, vA.y, vA.z + half));

0 commit comments

Comments
 (0)