mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 20:56:16 +08:00
change perl function to use mesh initalized in perl
This commit is contained in:
parent
bcdcec1dc0
commit
48e0caa4ff
@ -1331,7 +1331,10 @@ 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 = $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;
|
my $color_idx;
|
||||||
if ($self->color_by eq 'volume') {
|
if ($self->color_by eq 'volume') {
|
||||||
|
@ -470,8 +470,6 @@ class ModelVolume
|
|||||||
DynamicPrintConfig config;
|
DynamicPrintConfig config;
|
||||||
///< Configuration parameters specific to an object model geometry or a modifier volume,
|
///< Configuration parameters specific to an object model geometry or a modifier volume,
|
||||||
///< overriding the global Slic3r settings and the ModelObject settings.
|
///< 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
|
/// Input file path needed for reloading the volume from disk
|
||||||
std::string input_file; ///< Input file path
|
std::string input_file; ///< Input file path
|
||||||
|
@ -301,11 +301,10 @@ ModelMaterial::attributes()
|
|||||||
Ref<TriangleMesh> mesh()
|
Ref<TriangleMesh> mesh()
|
||||||
%code%{ RETVAL = &THIS->mesh; %};
|
%code%{ RETVAL = &THIS->mesh; %};
|
||||||
|
|
||||||
Ref<TriangleMesh> transformed_mesh(ModelInstance * instance)
|
void transformed_mesh(ModelInstance * instance, TriangleMesh * mesh)
|
||||||
%code%{
|
%code%{
|
||||||
TransformationMatrix trafo = instance->get_trafo_matrix(false);
|
TransformationMatrix trafo = instance->get_trafo_matrix(false);
|
||||||
THIS->transformed_mesh = THIS->get_transformed_mesh(&trafo);
|
*(mesh) = THIS->get_transformed_mesh(&trafo);
|
||||||
RETVAL = &THIS->transformed_mesh;
|
|
||||||
%};
|
%};
|
||||||
|
|
||||||
bool modifier()
|
bool modifier()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user