generate_particles_on_mesh
Creates a particles object by generating a set of points on an underlying Polygon_mesh or Triangle_mesh and placing spherical particles at these locations. The radius of these particles will randomly vary between the provided minimum and maximum. Optionally a particle color user data attribute vector can be added with random brightness variations. It is also possible to offset the particles from the source mesh (also with random variation if desired) in the direction of the surface normal. An optional scalar user data attribute vector can also be created which will vary between particle_scalar_min and particle_scalar_max. This scalar has no fixed meaning but can be looked up by MDL scene functions.
arguments
- "mesh_name" : String
Name of the Polygon_mesh or Triangle_mesh on which to generate the set of points used to place the particles.
- "particle_color" : Color (default: null)
If provided then a user data attribute vector will be created containing this color with the name specified by the particle_color_name parameter.
- "particle_color_name" : String (default: "Particle_color")
The name of the user data attribute vector to be created holding particle colors. Has no effect unless particle_color is also provided. This name can be then used to look up the scene data with the appropriate MDL functions.
- "particle_color_variation" : Float32 (default: 0)
Extent to which the particle colors brightness should be varied per particle. Has no effect unless particle_color is also provided. Useful range is between 0.0 and 1.0. When 0.0 or not provided there will be no variation in colors between particles. Higher values give more variation. Values greater than 1.0 can be used however the shift in hue will generally be greater in this case.
- "particle_count" : Uint32 (default: 10000)
The number of particles to be generated.
- "particle_offset_max" : Float32 (default: 0)
The maximum offset of each generated particle from the mesh in the normal direction.
- "particle_offset_min" : Float32 (default: 0)
The minimum offset of each generated particle from the mesh in the normal direction.
- "particle_radius_max" : Float32 (default: 1)
The maximum radius of each generated particle.
- "particle_radius_min" : Float32 (default: 1)
The minimum radius of each generated particle.
- "particle_scalar" : Boolean (default: false)
If true a user data attribute vector will be created containing a single scalar floating point number for each particle. This will vary between particle_scalar_min and particle_scalar_max. The particle_scalar_name parameter determines the name used to look up the scene data with the appropriate MDL functions.
- "particle_scalar_max" : Float32 (default: 1)
The maximum scalar userdata value of each generated particle.
- "particle_scalar_min" : Float32 (default: 0)
The minimum scalar userdata value of each generated particle.
- "particle_scalar_name" : String (default: "Particle_scalar")
The name of the user data attribute vector to be created holding particle scalars. Has no effect unless particle_scalar is also true. This name can be then used to look up the scene data with the appropriate MDL functions.
- "particles_name" : String
Name of the Particles element that will be created by this command.
return value
VoidVoid.