In https://jsfiddle.net/c6rted53/1/, adding slot Number using below function
function addLabel( text, obj, x, y, z )
{
var loader = new THREE.FontLoader();
var material_text = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
var size = 1;
loader.load( 'node_modules/three/examples/fonts/helvetiker_regular.typeface.json', function ( font ) {
var geometry = new THREE.TextGeometry( text, {
font: font,
size: size,
height: 2,
curveSegments: 10,
bevelEnabled: false
} );
var textMesh = new THREE.Mesh( geometry, material_text );
textMesh.position.set( x, y, z );
// textMesh.rotation.y = Math.PI/-2;
textMesh.name = text;
obj.add( textMesh );
} );
}
In drawRack, trying to add slot numbers to shape by calling the below function
var slotStart = slot;
var slotEnd = slot + slotSize
var labelPosition = yPosition-2.5;
for(z=slotEnd; z>slotStart; z--){
addLabel( z, shape, xPosition+4, labelPosition, 0 );
labelPosition = labelPosition -5;
}
But it is not working. Please inform using textGeometry whether two or more labels can be added on each face of boxGeometry.