~ubuntu-branches/ubuntu/utopic/slic3r/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/Slic3r/Format/AMF.pm

  • Committer: Package Import Robot
  • Author(s): Alessandro Ranellucci
  • Date: 2014-08-06 11:18:02 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20140806111802-8v6iez93cj6skz5l
Tags: 1.1.7+dfsg-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    for my $object_id (0 .. $#{ $model->objects }) {
52
52
        my $object = $model->objects->[$object_id];
53
53
        printf $fh qq{  <object id="%d">\n}, $object_id;
 
54
        
 
55
        my $config = $object->config;
 
56
        foreach my $opt_key (@{$config->get_keys}) {
 
57
             printf $fh qq{    <metadata type=\"slic3r.%s\">%s</metadata>\n}, $opt_key, $config->serialize($opt_key);
 
58
        }
 
59
        
54
60
        printf $fh qq{    <mesh>\n};
55
61
        printf $fh qq{      <vertices>\n};
56
62
        my @vertices_offset = ();
76
82
            my $vertices_offset = shift @vertices_offset;
77
83
            printf $fh qq{      <volume%s>\n},
78
84
                (!defined $volume->material_id) ? '' : (sprintf ' materialid="%s"', $volume->material_id);
 
85
            
 
86
            my $config = $volume->config;
 
87
            foreach my $opt_key (@{$config->get_keys}) {
 
88
                 printf $fh qq{        <metadata type=\"slic3r.%s\">%s</metadata>\n}, $opt_key, $config->serialize($opt_key);
 
89
            }
 
90
            if ($volume->modifier) {
 
91
                printf $fh qq{        <metadata type=\"slic3r.modifier\">1</metadata>\n};
 
92
            }
 
93
        
79
94
            foreach my $facet (@{$volume->mesh->facets}) {
80
95
                printf $fh qq{        <triangle>\n};
81
96
                printf $fh qq{          <v%d>%d</v%d>\n}, $_, $facet->[$_-1] + $vertices_offset, $_ for 1..3;