Refactor the AMF parser so that it popolates a Model object directly. Also read constellations

This commit is contained in:
Alessandro Ranellucci 2012-08-29 18:23:34 +02:00
parent 23f6842bd4
commit f29d455319
4 changed files with 59 additions and 35 deletions

View file

@ -43,9 +43,10 @@ my %opt = ();
$f;
} @{ $model->objects->[0]->volumes->[0]->facets };
push @{$new_model->materials}, { Name => basename($ARGV[$m]) };
my $material_id = scalar keys %{$new_model->materials};
$new_model->materials->{$material_id} = { Name => basename($ARGV[$m]) };
$new_object->add_volume(
material_id => $#{$new_model->materials},
material_id => $material_id,
facets => [@new_facets],
);
}