Viscoelastic springs for sph particle fluids, original patch by Stephen Whitehorn (chickencoop)

* Viscoelastic springs between the fluid particles can simulate all kinds
  of viscous and elastic substances, such as jelly and honey. This is
  achieved by creating springs dynamically between neighboring particles
  and adjusting their rest length based on stretching/compression.
* This nearly completes the currently intended functionality for particle
  fluids. The last missing thing is a surfacing extraction algorithm,
  which is needed for a proper representation of a sph fluid.
* I also cleaned up and renamed some of the fluid parameters to make the
  ui a bit easier to understand.
* One addition to the patch is an option to use "initial rest length" for
  the springs, which uses the lengths between the particles at the time of
  spring creation as the spring rest lengths instead of interaction radius/2.
  This makes the fluid keep it's original shape better (good for very
  viscoelastic materials), but can create large density differences inside
  the fluid (not really physically correct for a fluid).
* Viscoelastic springs are stored in point cache as extra data.
This commit is contained in:
2011-01-09 19:09:41 +00:00
parent 84a464ab62
commit 9231ff4160
10 changed files with 340 additions and 63 deletions

View File

@@ -445,24 +445,32 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, bpy.types.Panel):
split = layout.split()
sub = split.column()
sub.label(text="Fluid Interaction:")
sub.prop(fluid, "fluid_radius", slider=True)
sub.prop(fluid, "stiffness")
sub.prop(fluid, "stiffness_near")
sub.prop(fluid, "rest_density")
sub.prop(fluid, "fluid_radius")
sub.prop(fluid, "repulsion_force")
subsub = sub.column(align=True)
subsub.prop(fluid, "rest_density")
subsub.prop(fluid, "density_force", text="Force")
sub.label(text="Viscosity:")
sub.prop(fluid, "viscosity_omega", text="Linear")
sub.prop(fluid, "viscosity_beta", text="Square")
subsub = sub.column(align=True)
subsub.prop(fluid, "linear_viscosity", text="Linear")
subsub.prop(fluid, "square_viscosity", text="Square")
sub = split.column()
sub.label(text="Springs:")
sub.prop(fluid, "spring_force", text="Force", slider=True)
sub.prop(fluid, "rest_length", slider=True)
layout.label(text="Multiple fluids interactions:")
sub.prop(fluid, "spring_force", text="Force")
#Hidden to make ui a bit lighter, can be unhidden for a bit more control
#sub.prop(fluid, "rest_length", slider=True)
sub.prop(fluid, "use_viscoelastic_springs")
subsub = sub.column(align=True)
subsub.active = fluid.use_viscoelastic_springs
subsub.prop(fluid, "yield_ratio", slider=True)
subsub.prop(fluid, "plasticity", slider=True)
subsub.prop(fluid, "use_initial_rest_length")
sub.label(text="Buoyancy:")
sub.prop(fluid, "buoyancy", slider=True)
sub.prop(fluid, "buoyancy", text="Strength", slider=True)
elif part.physics_type == 'KEYED':
split = layout.split()
@@ -526,6 +534,8 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, bpy.types.Panel):
if part.physics_type == 'KEYED' or part.physics_type == 'BOIDS' or part.physics_type == 'FLUID':
if part.physics_type == 'BOIDS':
layout.label(text="Relations:")
elif part.physics_type == 'FLUID':
layout.label(text="Fluid interaction:")
row = layout.row()
row.template_list(psys, "targets", psys, "active_particle_target_index")
@@ -886,6 +896,9 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, bpy.types.Panel):
col.prop(part, "show_number")
if part.physics_type == 'BOIDS':
col.prop(part, "show_health")
col = row.column()
col.prop(part, "show_material_color", text="Use material color")