threepipe
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

SimplifyModifierPlugin.md 1.1KB

před 1 rokem
12345678910111213141516171819202122232425262728293031323334
  1. ---
  2. prev:
  3. text: 'GLTFMeshOptDecodePlugin'
  4. link: './GLTFMeshOptDecodePlugin'
  5. next:
  6. text: 'MeshOptSimplifyModifierPlugin'
  7. link: './MeshOptSimplifyModifierPlugin'
  8. ---
  9. # SimplifyModifierPlugin
  10. [Example](https://threepipe.org/examples/#simplify-modifier-plugin/) —
  11. [Source Code](https://github.com/repalash/threepipe/blob/master/src/plugins/extras/SimplifyModifierPlugin.ts) —
  12. [API Reference](https://threepipe.org/docs/classes/SimplifyModifierPlugin.html)
  13. Boilerplate for implementing a plugin for simplifying geometries.
  14. This is a base class and cannot be used directly.
  15. A sample to use it:
  16. ```typescript
  17. class SimplifyModifierPluginImpl extends SimplifyModifierPlugin {
  18. protected _simplify(geometry: IGeometry, count: number) {
  19. return new SimplifyModifier().modify(geometry, count) as IGeometry
  20. }
  21. }
  22. const plugin = viewer.addPluginSync(new SimplifyModifierPluginImpl())
  23. const root = await viewer.load('file.glb')
  24. plugin.simplifyAll(root, {factor: 0.75})
  25. ```
  26. Check the [example](https://threepipe.org/examples/#simplify-modifier-plugin/) for full implementation.