@threepipe/plugin-geometry-generator
TIP
All geometry generators except text have moved to core threepipe as GeometryGeneratorPlugin. This package now provides TextGeometryGenerator, FontLibrary, and GeometryGeneratorExtrasPlugin.
Exports the text geometry generator and GeometryGeneratorExtrasPlugin to extend the core GeometryGeneratorPlugin with 3D text support.
Example — Source Code — API Reference
bash
npm install @threepipe/plugin-geometry-generatorThe generated geometries/meshes include the parameters in the userData and can be re-generated by changing the parameters from the UI or the plugin API.
This package provides:
- text: TextGeometryGenerator — 3D text geometry (depends on
three/examples/jsm) - FontLibrary — font loading for text geometry
- GeometryGeneratorExtrasPlugin — registers the text generator with the core plugin
For all other generators (plane, box, sphere, circle, torus, cylinder, tube, shape, tubeShape, line), see the core GeometryGeneratorPlugin.
Sample Usage:
typescript
import {ThreeViewer, GeometryGeneratorPlugin} from 'threepipe'
import {FontLibrary, GeometryGeneratorExtrasPlugin} from '@threepipe/plugin-geometry-generator'
const viewer = new ThreeViewer({...})
const generator = viewer.addPluginSync(GeometryGeneratorPlugin)
viewer.addPluginSync(GeometryGeneratorExtrasPlugin) // adds text generator
await FontLibrary.Init // required for text geometry
const text = generator.generateObject('text', {
text: 'Hello', size: 1, depth: 0.2, bevelEnabled: true,
})
viewer.scene.addObject(text)