Within three.js's ExtrudeGeometry.UVGenerator.generateSideWallUV function, there is a specific condition being checked:
if ( Math.abs( a.y - b.y ) < 0.01 ) {
return [
new Vector2( a.x, 1 - a.z ),
new Vector2( b.x, 1 - b.z ),
new Vector2( c.x, 1 - c.z ),
new Vector2( d.x, 1 - d.z )
];
} else {
return [
new Vector2( a.y, 1 - a.z ),
new Vector2( b.y, 1 - b.z ),
new Vector2( c.y, 1 - c.z ),
new Vector2( d.y, 1 - d.z )
];
}
This conditional seems to cause strange discontinuities in the UVs, as illustrated by the uv coordinates displayed on this shape:
https://i.sstatic.net/JwJMJ.png
By removing this block and using only the else
section, the functionality works correctly. I am curious to know the rationale behind including this conditional in the first place.