delete perl workaround (output given as pointer)

This commit is contained in:
Michael Kirsch 2019-06-01 23:21:16 +02:00 committed by Joseph Lenox
parent 2aeacd3f59
commit cc8cb4092d
2 changed files with 3 additions and 6 deletions

View File

@ -1331,10 +1331,7 @@ sub load_object {
my $volume = $model_object->volumes->[$volume_idx]; my $volume = $model_object->volumes->[$volume_idx];
foreach my $instance_idx (@$instance_idxs) { foreach my $instance_idx (@$instance_idxs) {
my $instance = $model_object->instances->[$instance_idx]; my $instance = $model_object->instances->[$instance_idx];
my $mesh = Slic3r::TriangleMesh->new(); my $mesh = $volume->get_transformed_mesh($instance);
# $mesh is the output argument, given as pointer
$volume->transformed_mesh($instance, $mesh);
my $color_idx; my $color_idx;
if ($self->color_by eq 'volume') { if ($self->color_by eq 'volume') {

View File

@ -301,10 +301,10 @@ ModelMaterial::attributes()
Ref<TriangleMesh> mesh() Ref<TriangleMesh> mesh()
%code%{ RETVAL = &THIS->mesh; %}; %code%{ RETVAL = &THIS->mesh; %};
void transformed_mesh(ModelInstance * instance, TriangleMesh * mesh) Clone<TriangleMesh> get_transformed_mesh(ModelInstance * instance)
%code%{ %code%{
TransformationMatrix trafo = instance->get_trafo_matrix(false); TransformationMatrix trafo = instance->get_trafo_matrix(false);
*(mesh) = THIS->get_transformed_mesh(&trafo); RETVAL = THIS->get_transformed_mesh(&trafo);
%}; %};
bool modifier() bool modifier()