Jump to content

Adding bevel, or TextGeometry


Recommended Posts

I experimented with a single 3D letter in Blender, then exported to the .babylon format. It was a 214KB file! I then removed the bevel, and that reduced it to 67KB. But the version with bevel is nicer. So, that got me wondering if the bevel is something I can add back in once the model has been loaded? Whether something text-specific, or a more generic algorithm that can smooth out the hard edges in a model?


But I suppose what I really want is the Babylon version of the Three.js TextGeometry module: http://threejs.org/docs/#Reference/Extras.Geometries/TextGeometry


Is there already something like this?


(Actually TextGeometry is just a thin layer around ExtrudeGeometry ( http://threejs.org/docs/#Reference/Extras.Geometries/ExtrudeGeometry ), which would be even more useful, if I could, say, take a png file or the contents of a 2D canvas, and turn it into a 3D bevelled object.)


Link to comment
Share on other sites

Thanks for the ideas. I don't see any mention of the binary format in the docs for the blender exporter ( http://doc.babylonjs.com/page.php?p=24821 ). There was mention in the release notes, but it goes to a dead link: http://www.babylonjs.com/binary


The Dialog/fonts, is quite mysterious, with no Readme or documentation, nor even inline comments. But it doesn't look like an extruder, more like data-as-code for one hard-coded font, perhaps?


I was thinking the CreateGroundFromHeightMap() is not so far from an extruder; can it be easily hacked into one?

Link to comment
Share on other sites

Hi qqdarren. You might want to take a look at this video by Jonathan Williamson, of cgcookie, about creating text in Blender:


Creating 3D Typography


The part that might interest you is at around 8-11.00 minutes in - his use of "limited dissolve" and "remove doubles".


I used this methodology to create this:




It contains 9 letter + a ".", the globe and of course the animation data - the total file size is 199kb. That is roughly 19kb per letter.


Now, I have not tried it with a bevel applied to the text.


cheers, gryff :)

Link to comment
Share on other sites

David, thanks, I just gave it (the binary converter) a go. Interesting results:


Plain text version: 214,356.

binary version: 1786, plus 148,244 meshdata.


But, a web server is likely to deliver the files gzipped:


Plain text, gzipped: 53,887 bytes

Binary, gzipped: 586 + 54,142 bytes (+ extra overhead of 2 requests)


Not all bad, though, as I imagine the binary version is parsed more quickly once the browser receives it?

Link to comment
Share on other sites

(Continuing from comment #4) I just found this topic, from February 2015:



Some mention of the Dialog extension, but still not quite enough to know how to use it, or what it is for. And some experiments using CreateGroundFromHeightMap (which are still a bit rough: the glyphs have no thickness, and then there is a plane getting left behind).

Link to comment
Share on other sites


Let's go back to the beginning.  I was making Letter meshes into individual Javascript classes, so that they could be strung together to make labels.  See fontgen.blend in extensions repository.  I needed it as inline javascript, since it must load real fast to build strings on the fly.  A .babylon needs to parse the whole file every import (There are 96 letters in either font2d.js or font3d.js), and a .babylon can only build originals, not clones if an original already exists.  I use the Tower of Babel exporter to generate source code.


The exported javascript files are very big, partly because TOB puts in a lot of spacing to make it human readable. Font3d.js uglifies down to 962.2kb (10 kb per letter). I just went into fontgen.blend and changed bevel depth to 0.01, and ran the built in script in the .blend to generate my meshes, then exported & uglified.  File is now 2.1 mb ( 22 kb per letter).


Before we go any farther, what was the letter you generating?  Are you using the default font for Blender? Blender "Text" objects are not meshes, you need a process or script to convert one to a mesh.  Is your process similar to fontgen.blend?  A 64kb letter seems kind of big.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...