### Creation of a Scene (3/9)

Description

One of the quickest way to model a deformable body is to embed it inside a regular grid. We will simulate only the points of the grid's cells. The description of this grid is made inside a Topology which describes how the particles are connected.

Key points

We will add a SpareGridTopology: it only keeps the full cells of this embedded grid.

Add the component SparseGridTopology to the Object node.

Now that we have a topology in the scene, the MechanicalObject will rely on it, in order to initialize itself.
To use this component, you have to:

- Specify the 3d model
- Specify the resolution of the grid

Open the SparseGridTopology parameters. Find the fileTopology section, and click the ... button, found across from Filename of the mesh. Use the file browser to select /Sofa/share/mesh/dragon.

Switch to the Property 4/6 tab. Find the section labeled n. Change the grid resolution from (2 2 2) to (7 6 5).

Results

Run in SOFA

Now, several particules are created, representing your deformable object: it embeds the visual model we put.

Press Animate.

The particles fall against the Plane we defined previously. As no internal force other than a plane is defined, the original shape is not kept.

Related

Change the 3d mesh for the SparseGridTopology, and the resolution of the grid.

Edit the MechanicalObject to see the number of particles simulated.

### Previous ____________ Next