+ memset (model, 0, sizeof *model);
+ model->objects = g_new (Object, num_objects);
+ model->num_objects = num_objects;
+ model->springs = g_new (Spring, num_springs);
+ model->num_springs = num_springs;
+ model->spacers = g_new (Spacer, num_spacers);
+ model->num_spacers = num_spacers;
+ model->anchors = g_new (Anchor, 1);
+ model->num_anchors = 1;
+ model->k = 0.1;
+
+ model->polygons = g_new (Polygon, 1);
+ model->num_polygons = 1;
+ polygon_init_enclosing_rectangle (&model->polygons[0], 10, 10, 700, 500);
+
+ model->anchors[0].x = 300;
+ model->anchors[0].y = 300;
+ model->anchors[0].object = &model->objects[0];
+
+ object = model->objects;
+ spring = model->springs;
+ spacer = model->spacers;
+ for (i = 0; i < num_objects; i++, object++) {
+ x = 200 + i * distance / 3;
+ y = 40;
+ object_init (object, x, y, 1);
+ if (i == 0)
+ continue;
+ spring_init (spring++,
+ &model->objects[0],
+ &model->objects[i],
+ distance);
+ for (j = 1; j < num_objects - i; j++) {
+ spacer_init (spacer++, object, object + j, distance);