PLYLoader class
Description: A THREE loader for PLY ASCII files (known as the Polygon File Format or the Stanford Triangle Format).
Limitations: ASCII decoding assumes file is UTF-8.
Usage: const loader = PLYLoader(); loader.load('./models/ply/ascii/dolphins.ply', function (geometry) {
scene.add( THREE.Mesh( geometry ) );
} );
If the PLY file uses non standard property names, they can be mapped while loading. For example, the following maps the properties “diffuse_(red|green|blue)” in the file to standard color names.
loader.setPropertyNameMapping( { diffuse_red: 'red', diffuse_green: 'green', diffuse_blue: 'blue' } );
Custom properties outside of the defaults for position, uv, normal and color attributes can be added using the setCustomPropertyNameMapping method. For example, the following maps the element properties “custom_property_a” and “custom_property_b” to an attribute “customAttribute” with an item size of 2. Attribute item sizes are set from the number of element properties in the property array.
loader.setCustomPropertyNameMapping( {
customAttribute: 'custom_property_a', 'custom_property_b'
,
} );
- Inheritance
-
- Object
- Loader
- PLYLoader
Constructors
- PLYLoader.new([LoadingManager? manager])
-
manager
— TheloadingManager
for the loader to use. Default isDefaultLoadingManager
.
Properties
- crossOrigin ↔ String
-
getter/setter pairinherited
-
customPropertyMapping
↔ Map<
String, dynamic> -
getter/setter pair
- flipY ↔ bool
-
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- manager ↔ LoadingManager
-
getter/setter pairinherited
- mimeType ↔ String
-
getter/setter pairinherited
- path ↔ String
-
getter/setter pairinherited
-
propertyNameMapping
↔ Map<
String, dynamic> -
getter/setter pair
-
requestHeader
↔ Map<
String, dynamic> -
getter/setter pairinherited
- resourcePath ↔ String?
-
getter/setter pairinherited
- responseType ↔ String
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- withCredentials ↔ bool
-
getter/setter pairinherited
Methods
-
dispose(
) → void -
override
-
fromAsset(
String asset, {String? package}) → Future< BufferGeometry?> -
asset
- path of the file to be loadedoverride -
fromBlob(
Blob blob) → Future< BufferGeometry> -
blob
- a blob of the file to be loadedoverride -
fromBytes(
Uint8List bytes) → Future< BufferGeometry> -
bytes
- the loaded bytes of the fileoverride -
fromFile(
File file) → Future< BufferGeometry> -
file
- the file to be loadedoverride -
fromNetwork(
Uri uri) → Future< BufferGeometry?> -
uri
- a uri containing the location of the file to be loadedoverride -
fromPath(
String filePath) → Future< BufferGeometry?> -
filePath
- path of the file to be loadedoverride -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setCrossOrigin(
String crossOrigin) → Loader -
crossOrigin
— The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.inherited -
setCustomPropertyNameMapping(
dynamic mapping) → void -
setPath(
String path) → Loader -
path
— Set the base path for the asset.inherited -
setPropertyNameMapping(
dynamic mapping) → void -
setRequestHeader(
Map< String, dynamic> requestHeader) → Loader -
requestHeader
- key: The name of the header whose value is to be set. value: The value to set as the body of the header.inherited -
setResourcePath(
String? resourcePath) → Loader -
resourcePath
— Set the base path for dependent resources like textures.inherited -
setWithCredentials(
bool value) → Loader -
Whether the XMLHttpRequest uses credentials such as cookies, authorization
headers or TLS client certificates. See
XMLHttpRequest.withCredentials.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unknown(
dynamic url) → Future -
url
- a dynmaic data that gets parsed by the systeminherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited