change perl function to use mesh initalized in perl

This commit is contained in:
Michael Kirsch 2019-05-27 21:51:05 +02:00 committed by Joseph Lenox
parent bcdcec1dc0
commit 48e0caa4ff
3 changed files with 6 additions and 6 deletions

View File

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

View File

@ -470,8 +470,6 @@ class ModelVolume
DynamicPrintConfig config;
///< Configuration parameters specific to an object model geometry or a modifier volume,
///< overriding the global Slic3r settings and the ModelObject settings.
TriangleMesh transformed_mesh; ///< The transformed mesh only to be used by the perl binding
/// Input file path needed for reloading the volume from disk
std::string input_file; ///< Input file path

View File

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