geometry_get_particles
Retrieves particle data from a Particles element in the format used by the generate_particles command, a map containing particles and type properties corresponding to the parameters of the same name for that command. Alternatively an optimized binary representation can be returned for use in V8 commands.
References:
arguments
- "binary" : Boolean (default: false)
If true a binary representation of the Particles object will be returned instead of the format used for the generate_particles command. This is primarily intended for consumption within server-side V8 JavaScript commands and is much faster to generate. Here is an example of the binary format returned. The binary elements are returned as raw binary data (bytes). You will need to decode them to the appropriate type before use. In V8 this will usually mean retrieving the ArrayBuffer object from the binary data and accessing this through buffer view objects like Float32Array, Uint32Array and so on. The types in brackets in the sample below indicates the expected type.
{ points: Binary (Float32Array), point_size: Uint32 (number of values per point) user: { "Name_string": { data: Binary (Float32Array), size: Uint32 (number of values of user data per point) }, motion: Binary (Float32Array), motion_size: Uint32 (number of motion vectors, each with three Float32 values, per point) type: String (currently only sphere is supported) }
The points property is mandatory but user and motion are optional and will only be returned if the underlying particles element contains the extra information. User data is given a name which is used when looking it up with MDL scene lookup functions. This name is arbitrary and the above Name_string is just an example. - "particles_name" : String
Name of the Particles element to retrieve