# particle system with particles that conform to surface

I would like to create a particle system or hair in which the particles conform to the surface.

For instance, a particle system of a special object such as a long cylinder, which can be conformed to the surface of a sphere in random arrangements with paths that are randomized. I would like to arrive at something similar to this image:

Is this possible?

I thought about doing it via a particle system of bezier curves on a sphere and then applying a modifier to the curves, but I believe this would require doing it with a script and I haven't yet figured out how to do all of the scripting. Is there a simpler manner to do this?

I have tried creating a hair emitter with a empty force field sphere object (negative value for force at -1) and a collision sphere object, but the hair does not coalesce around the sphere. Instead I just get this:

It appears that the hair does not have segments which are allowed to bend.

Furthermore, I would like to have an object which will follow these paths created by the hair or emitter such as this:

Such that I can get a close up image of the interface such as this:

This code shows some of my difficulty in getting the particle system entities to be flexible and conform to a surface:

import bpy
import math

def reset():
# Set to Object mode initially
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

# Delete all objects in project at current
for i in bpy.data.objects:
bpy.data.objects[i.name].select = True
bpy.ops.object.delete()

# Delete all materials in curent project
for i in bpy.data.materials[:]:
bpy.data.materials.remove(bpy.data.materials[i.name])

# Set background to white
world = bpy.context.scene.world
world.horizon_color = (1,1,1)

obj_camera = bpy.data.objects["Camera"]
obj_camera.location = (10,-10, 8)
obj_camera.rotation_euler = (math.pi/3, 0, math.pi/4)

reset()

size = 1, \
view_align = False, \
enter_editmode = False, \
location = (0, 0, 0))
ob = bpy.context.active_object
ob.name = 'Collision Sphere'
ob.show_name = True
col_sph = bpy.data.objects['Collision Sphere']

size = 1, \
view_align = False, \
enter_editmode = False, \
location = (0, 0, 0))
ob = bpy.context.active_object
ob.name = 'Emitter'
ob.show_name = True
em_sph = bpy.data.objects['Emitter']

ob = bpy.context.active_object
ob.name = 'Force'
ob.show_name = True
force_sph = bpy.data.objects['Force']
bpy.ops.object.forcefield_toggle()
force_sph.field.strength = -1

bpy.context.scene.objects.active = em_sph
psys1 = em_sph.particle_systems[-1]
psys1.name = 'Tubes'
psys1.use_hair_dynamics = True
pset1 = psys1.settings
pset1.name = 'TubeSettings'
pset1.type = 'HAIR'
pset1.use_hair_bspline = True
pset1.effector_weights.group = bpy.data.groups["Group"]
pset1.effector_weights.gravity = 0
pset1.effector_weights.apply_to_hair_growing = True


This gives just a spiky ball, without any bending of the hair. Any suggestions?

• Are these shapes similar to snake / sperm with a head? Round bumps are part of tube or separate? Spheres or Hexagon? Are the shapes laying on the surface of the hexagon, or penetrating ? Will you need an even closer detail shot? Animated or static? Inter hexagon attachments are part of the requirement? – atomicbezierslinger Apr 30 '16 at 19:35
• It would be ideal to be able to make these from any object. I have a long cylinder with randomly placed small spheres all over them, which I would like to use as the 'hair'. The hexagonal pattern of the large spheres isn't important to me, but it may be useful to others, it was just the image I found. I will be getting a closer image from this, at the interface of the sphere and air. – chase May 1 '16 at 7:01
• If you have more directly related questions .... It may be useful for you to edit your question and show the progress you have made so far. Showing what the aspects that are successful for you and unsuccessful for you. – atomicbezierslinger May 1 '16 at 17:17
• I added a script which is similar to what I have tried so far. It is an attempt which is based on the answer given below but shows that the objects do not bend under the force. I am still working on the flexibility issue as well as how to get objects to conform to the paths given by these particle systems. – chase May 3 '16 at 21:56
• How is the progress? Please consider replacing your hair image if you have now produced a better one, closer to your goal. – atomicbezierslinger May 5 '16 at 23:37

The obvious answer would be to use the hair simulation.

Create a hair emitter object an empty forcefield object and a sphere collision object. On the hair emitter decrease gravity to 0, enable hair dynamics with a large step size (like 20+).

Place the empty with the forcefield and your sphere with collision enabled within the emitter object.

On the hair emitter hit "bake" in the hair dynamics tab. Like 20 frames should do for the particles to settle around the collision object.

You should get something like this:

Now just tweak the hair length and strand thickness and select a shader. Done

• Awesome! Thanks! What if you want the hairs to have little spheres dispersed on them? – chase Apr 29 '16 at 15:25
• Also, when I try this my hair does not bend. It simply reduces in length but still points directly outward. How do you get the hair to have a lot of flexible segments such that they will fold like that? – chase May 1 '16 at 7:06
• Do you have B-spline steps? Also in the hair dynamics, you need to reduce "stiffness" and "mass" to make them bend. – AdamTM May 2 '16 at 9:43
• PS: about little spheres. id make the duplicates (hair) real and then use a separate particle system to add the speheres using the hair object. BTW you can nest particle systems. i.e. you can have a particle system that uses an object that has another particle system, etc. Its just usually very CPU/RAM intensive. – AdamTM May 2 '16 at 11:12
• I tried adding the B-spline steps and reducing stiffness and mass, but I'm still not getting the hair to change. I will post my steps in the question in order to make the process and what I may be doing wrong with it more clear. – chase May 2 '16 at 19:33