**4.5.5 Implementation**

The system discussed here has been implemented in C++ using the Eigen template library for optimized matrix manipulation and Qt for visualization and user interface. For exploiting parallel computing on modern hardware multiple versions of the core software have been implemented. In particular we started from a C++ version that has been extended with OpenMP commands for portable parallelization on the CPU although the advantage was quite limited. The reason is that the most computational intensive element is the conjugate method that, being iterative, it is inherently sequential. A second version has been created implementing the same functionalities in OpenCL for portable parallelism among CPU and GPU. This solution improved CPU performance while GPU one was reduced due to the many data structures of the topology.

## **4.5.6 Dimensions and performance**

This system runs at a satisfactory rate with a configuration of 32 x 32 nodes in the FEM models obtaining around 200 frames per second on an Intel Core i750 3GHz with a tolerance of 0.05.

account these forces because it is a thin shell, but we can use them for the haptic computation. In particular when two proxies are both contacting the same region of the textile they can squeeze the material increasing the normal force on the contacting node, hence raising the effect of friction. The effect of the friction force on the nodes of the textile is integrated in the simulation with a stick slip model. A node subject to static friction is

The tactile rederer receives information from the contact response module, in particular the position of the contact points, relative velocities and pressures. This information is then used to control the tactile device, in which the 30 pins can be controlled using a single frequency of a sinusoid, whose intensity and phase can be changed for every pin. The rendering is performed by following the approach proposed in (D Allerkamp et al., 2007) and later integrated in (Fontana et al., 2007) although with a different device and with multiple degree of freedom in control. The idea is to start from a geometrical representation of the local feature of the textiles obtained from edge extraction of high resolution photos. Then the local height field is repeated over the textile surface and the position of the tactile actuators in real space is mapped to the surface of the textile. Taking into account the motion of the actuator over the surface the height local information is transformed into a profile of heights along the line of motion that can be transformed into a frequency signal. This signal is the one used for controlling the distinct pins. Differently from the cited work in which two frequencies where selected, this work uses

This model has to be extended for taking into account pressure over the textile and relative velocity. These two featured have indeed the effect of modifying the height of the surface and alter the frequencies of generated signal. Multiple contact points on the surface nearby the tactile actuator have the effect of cumulating the alteration on the surface due to

The system discussed here has been implemented in C++ using the Eigen template library for optimized matrix manipulation and Qt for visualization and user interface. For exploiting parallel computing on modern hardware multiple versions of the core software have been implemented. In particular we started from a C++ version that has been extended with OpenMP commands for portable parallelization on the CPU although the advantage was quite limited. The reason is that the most computational intensive element is the conjugate method that, being iterative, it is inherently sequential. A second version has been created implementing the same functionalities in OpenCL for portable parallelism among CPU and GPU. This solution improved CPU performance while GPU one was reduced due

This system runs at a satisfactory rate with a configuration of 32 x 32 nodes in the FEM models obtaining around 200 frames per second on an Intel Core i750 3GHz with a tolerance

sticked to the surface of the sphere by means of a full constraint.

a single sinusoidal frequency but different intensities and phases of the pins.

**4.5.4 Tactile integration** 

pressure and velocity.

**4.5.5 Implementation** 

of 0.05.

to the many data structures of the topology.

**4.5.6 Dimensions and performance** 

Fig. 11. Photo of the Haptic device and textile simulation

These parameters have been selected for balancing frame-rate with precision of the system. Fig. 11 shows a snapshot of the execution of the execution of the system: the two fingers are the big spheres. On the top line there are the constrained vertices. The small light circles near the fingers are the contacting points.
