mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-18 20:28:08 -06:00
Large refactoring to allow processing multimaterial files
This commit is contained in:
parent
04be94023b
commit
02356fd613
13 changed files with 982 additions and 891 deletions
|
@ -15,6 +15,7 @@ sub read_from_file {
|
|||
: $input_file =~ /\.amf(\.xml)?$/i ? Slic3r::Format::AMF->read_file($input_file)
|
||||
: die "Input file must have .stl, .obj or .amf(.xml) extension\n";
|
||||
|
||||
$_->input_file($input_file) for @{$model->objects};
|
||||
return $model;
|
||||
}
|
||||
|
||||
|
@ -26,6 +27,16 @@ sub add_object {
|
|||
return $object;
|
||||
}
|
||||
|
||||
sub set_material {
|
||||
my $self = shift;
|
||||
my ($material_id, $attributes) = @_;
|
||||
|
||||
return $self->materials->{$material_id} = Slic3r::Model::Material->new(
|
||||
model => $self,
|
||||
attributes => $attributes || {},
|
||||
);
|
||||
}
|
||||
|
||||
# flattens everything to a single mesh
|
||||
sub mesh {
|
||||
my $self = shift;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue