Class: SimplifyModifierPlugin
Plugins.SimplifyModifierPlugin
Boilerplate for implementing a plugin for simplifying geometries. This is a base class and cannot be used directly. See MeshOptSimplifyModifierPlugin the simplify-modifier-plugin example for a sample implementation.
Hierarchy
AViewerPlugin
<""
>↳
SimplifyModifierPlugin
Properties
PluginType
▪ Static
Readonly
PluginType: string
= 'SimplifyModifierPlugin'
enabled
• enabled: boolean
= true
Overrides
toJSON
• toJSON: any
= undefined
Overrides
simplifyFactor
• simplifyFactor: number
= 0.5
Factor of vertices to remove. eg 0.5 will remove half of the vertices. Default is 0.5 This is used when no factor or count is provided in the options to simplifyGeometry or simplifyGeometries.
_dirty
• Protected
_dirty: boolean
= false
Inherited from
_viewer
• Protected
Optional
_viewer: ViewerApp
Inherited from
Accessors
dirty
• get
dirty(): boolean
Returns
boolean
Inherited from
AViewerPlugin.dirty
• set
dirty(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
AViewerPlugin.dirty
viewer
• get
viewer(): undefined
| ViewerApp
Returns
undefined
| ViewerApp
Inherited from
AViewerPlugin.viewer
initialized
• get
initialized(): boolean
Returns
boolean
Methods
onDispose
▸ onDispose(viewer
): Promise
<void
>
Parameters
Name | Type |
---|---|
viewer | ViewerApp |
Returns
Promise
<void
>
Inherited from
onRemove
▸ onRemove(viewer
): Promise
<void
>
Parameters
Name | Type |
---|---|
viewer | ViewerApp |
Returns
Promise
<void
>
Inherited from
fromJSON
▸ fromJSON(data
, meta?
): null
| SimplifyModifierPlugin
| Promise
<null
| SimplifyModifierPlugin
>
Parameters
Name | Type |
---|---|
data | any |
meta? | any |
Returns
null
| SimplifyModifierPlugin
| Promise
<null
| SimplifyModifierPlugin
>
Inherited from
exportState
▸ exportState(): any
Returns
any
Inherited from
importState
▸ importState(state
): Promise
<void
>
Parameters
Name | Type |
---|---|
state | any |
Returns
Promise
<void
>
Inherited from
storeState
▸ storeState(prefix?
, storage?
, data?
): void
Parameters
Name | Type |
---|---|
prefix? | string |
storage? | Storage |
data? | any |
Returns
void
Inherited from
loadState
▸ loadState(prefix?
, storage?
): Promise
<void
>
Parameters
Name | Type |
---|---|
prefix? | string |
storage? | Storage |
Returns
Promise
<void
>
Inherited from
initialize
▸ initialize(): Promise
<void
>
Returns
Promise
<void
>
onAdded
▸ onAdded(viewer
): Promise
<void
>
Parameters
Name | Type |
---|---|
viewer | ViewerApp |
Returns
Promise
<void
>
Overrides
simplifyGeometries
▸ simplifyGeometries(geometry?
, options?
): undefined
| any
[]
Parameters
Name | Type |
---|---|
geometry? | any |
options? | SimplifyOptions |
Returns
undefined
| any
[]
simplifyGeometry
▸ simplifyGeometry(geometry?
, __namedParameters?
): any
Parameters
Name | Type |
---|---|
geometry? | any |
__namedParameters | SimplifyOptions |
Returns
any
simplifyAll
▸ simplifyAll(root?
, options?
): Promise
<undefined
| any
[]>
Parameters
Name | Type |
---|---|
root? | IModel <any , IObject3DEventMap > |
options? | SimplifyOptions |
Returns
Promise
<undefined
| any
[]>
simplifySelected
▸ simplifySelected(): Promise
<void
>
Returns
Promise
<void
>
_storeKey
▸ Protected
_storeKey(prefix?
): string
Parameters
Name | Type |
---|---|
prefix? | string |
Returns
string
Inherited from
_simplify
▸ Protected
Abstract
_simplify(geometry
, count
): any
Sample for three.js addons SimplifyModifier:
import {SimplifyModifier} from 'three/examples/jsm/modifiers/SimplifyModifier'
protected _simplify(geometry: IGeometry, count: number): IGeometry {
const modifier = new SimplifyModifier()
return modifier.modify(geometry, count) as IGeometry
}
Parameters
Name | Type |
---|---|
geometry | any |
count | number |
Returns
any
Constructors
constructor
• new SimplifyModifierPlugin()