luca-heltai / ePICURE

Python Isogeometric CUrve REconstruction
GNU General Public License v2.0
10 stars 23 forks source link

Blender Interface #13

Open luca-heltai opened 9 years ago

luca-heltai commented 9 years ago

A Blender interface

- given two files, containing numpy nd-arrays (as created by
   `numpy.save`), representing the time evolution of the position
   and shape, this interface should create an animation capable of
   visualising the time evolution of the object. We will need
   interfaces for the following objects

    - Golestanian Axis Swimmer (`m=1, n=2`)
    - Golestanian Plane Swimmer (`m=2, n=3`)
    - Golestanian Space Swimmer (`m=6, n=4`)
    - Axis crawler (`m=1, n=as many as you wish`)
    - Plane worm (`m=2, n=as many as you wish`)
    - Space worm (`m=6, n=as many as you wish`)
    - etc.
lromor commented 9 years ago

I would like to do this part.

luca-heltai commented 9 years ago

Ok. Start by creating a python class, called CompositeObject, initialized with m, n, ntimeframes or directly with two filenames.

The class should have the following functions:

read_shapes("filename") read_positions("filename")

which read and store two numpy nd arrays from files (create two fake ones for the moment). Store the variables as object_shape and object_position. The ndarrays should have the following shape:

shape(swimmer_position) = (m, ntimeframes)
shape(swimmer_shape) = (n, ntimeframes)

the base class should have then a function (a virtual one)

pose_object(shape, position)

which, if called from within blender on a concrete class, would generate the object with the given shape and position. Start by considering a nurbs curve, with shape given by the control points.

I have some examples I can give you. More on thursday.