Thanks a lot for everything !
Yeah I think itâs because the params are too âsmallâ itâs messing up the geo.
Here is the final result btw : Under Construction | Evry_Paris-Saclay - iGEM 2022
(Original idea from Ilithya)
Its depend of size geometry. 1=Meters or 1=kilometers.
I guess the easiest solution would be to just keep the same settings as in the example from the Three.js manual I linked above, and then simply set the objectâs scale appropriately, e.g. (disregard my custom font JSON path):
const normalMaterial = new THREE.MeshNormalMaterial();
const loader = new FontLoader();
loader.load("http://localhost:8080/helvetiker_regular.typeface.json", function(font)
{
const textGeometry = new TextGeometry('Under Construction !' + '\nEstimated delivery :' + '\nSoonâ˘',
{
font: font,
size: 80,
height: 5,
curveSegments: 12,
bevelEnabled: true,
bevelThickness: 10,
bevelSize: 8,
bevelOffset: 0,
bevelSegments: 5
});
const textMesh = new THREE.Mesh(textGeometry, normalMaterial);
textGeometry.center();
textGeometry.computeBoundingBox();
scene.add(textMesh);
const stextMesh = new THREE.Mesh(textMesh.geometry.clone(), new THREE.MeshNormalMaterial());
stextMesh.geometry = BufferGeometryUtils.mergeVertices(stextMesh.geometry, 1);
stextMesh.geometry.computeVertexNormals();
stextMesh.position.set(10, 10, 10);
stextMesh.scale.setScalar(1 / 160);
scene.add(stextMesh);
});
That way, thereâs no need to guess what value is needed for the tolerance parameter (I tried in vain to figure that out, but itâs pointless in this case). I set the scale to 1 / 160 because of the ratio between font sizes, i.e. 80 / 0.5 = 160, but you can adjust it to suit your needs, considering that fonts donât size up on a per pixel basis. Same for positioning.
P.S. The stextMesh
name comes from âsmooth text meshâ, in case anyone is curious.
Thanks so much to you and everyone for all your help, you guys rock !!
thank youuuuu
For the record, if one looks closely, there are still some places where vertices are not properly joined / merged. If thatâs the case, just lower the tolerance parameter in the mergeVertices()
function from 1 to, say, 0.5 or similar, to âclose the gapsâ in the lettersâ geometries.
While a great idea and having a nice effect - credit to @Chaser_Code for it - I would personally still choose âsubdividingâ geometry by increasing the number of segments. Itâs heavier on the CPU but itâs âbuilt inâ and doesnât need further adjustments.