three.js icon indicating copy to clipboard operation
three.js copied to clipboard

TextGeometry changes and support in editor

Open zz85 opened this issue 3 months ago • 14 comments

Related issue: maybe

Description

Add text geometry support to three.js editor

image

** details **

  • add support for TextGeometry in editor. currently this is linked only to a single font, but all of TextGeometry functionality is wired to the editor's sidebar UI, which I think is more than sufficient now
  • depreciating height parameter in TextGeometry options for depth for consistency with ExtrudeGeometry, which refers to the thickness the Text will be extruded. using height is still supported but will emit a warning in the console
  • also added a scale parameter in TextGeometry and editor. The numbers that work well for font sizes is unusally large in three.js objects (esp in VR), so passing 0.01 makes it more the conversion more pleasant to work with
  • Serialization and deserialization works. toJSON() and fromJSON() is added to TextGeometry. I have to add this to Geometries.js for scene loading to work automatically in editor, but the dependency of an addon (TextGeometry is addon, ExtrudeGeometry is core) seems a little strange. Either there's a better way to extend the supported Geometries deserialization list or perhaps move TextGeometry out of the examples

This contribution is funded by blurspline

zz85 avatar Mar 16 '24 16:03 zz85