mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-04 20:40:41 +08:00
remove or comment now invalid instance variables
This commit is contained in:
parent
51edd87d45
commit
bc491a09b4
@ -1533,12 +1533,8 @@ sub increase {
|
|||||||
for my $i (1..$copies) {
|
for my $i (1..$copies) {
|
||||||
$instance = $model_object->add_instance(
|
$instance = $model_object->add_instance(
|
||||||
offset => Slic3r::Pointf->new(map 10+$_, @{$instance->offset}),
|
offset => Slic3r::Pointf->new(map 10+$_, @{$instance->offset}),
|
||||||
z_translation => $instance->z_translation,
|
|
||||||
scaling_factor => $instance->scaling_factor,
|
scaling_factor => $instance->scaling_factor,
|
||||||
scaling_vector => $instance->scaling_vector,
|
|
||||||
rotation => $instance->rotation,
|
rotation => $instance->rotation,
|
||||||
x_rotation => $instance->x_rotation,
|
|
||||||
y_rotation => $instance->y_rotation,
|
|
||||||
);
|
);
|
||||||
$self->{print}->objects->[$obj_idx]->add_copy($instance->offset);
|
$self->{print}->objects->[$obj_idx]->add_copy($instance->offset);
|
||||||
}
|
}
|
||||||
@ -3387,10 +3383,10 @@ sub make_thumbnail {
|
|||||||
|
|
||||||
my $mesh = $model->objects->[$obj_idx]->raw_mesh;
|
my $mesh = $model->objects->[$obj_idx]->raw_mesh;
|
||||||
# Apply x, y rotations and scaling vector in case of reading a 3MF model object.
|
# Apply x, y rotations and scaling vector in case of reading a 3MF model object.
|
||||||
my $model_instance = $model->objects->[$obj_idx]->instances->[0];
|
#my $model_instance = $model->objects->[$obj_idx]->instances->[0];
|
||||||
$mesh->rotate_x($model_instance->x_rotation);
|
#$mesh->rotate_x($model_instance->x_rotation);
|
||||||
$mesh->rotate_y($model_instance->y_rotation);
|
#$mesh->rotate_y($model_instance->y_rotation);
|
||||||
$mesh->scale_xyz($model_instance->scaling_vector);
|
#$mesh->scale_xyz($model_instance->scaling_vector);
|
||||||
|
|
||||||
if ($mesh->facets_count <= 5000) {
|
if ($mesh->facets_count <= 5000) {
|
||||||
# remove polygons with area <= 1mm
|
# remove polygons with area <= 1mm
|
||||||
|
@ -128,18 +128,18 @@ sub add_instance {
|
|||||||
|
|
||||||
$new_instance->set_rotation($args{rotation})
|
$new_instance->set_rotation($args{rotation})
|
||||||
if defined $args{rotation};
|
if defined $args{rotation};
|
||||||
$new_instance->set_x_rotation($args{x_rotation})
|
# $new_instance->set_x_rotation($args{x_rotation})
|
||||||
if defined $args{x_rotation};
|
# if defined $args{x_rotation};
|
||||||
$new_instance->set_y_rotation($args{y_rotation})
|
# $new_instance->set_y_rotation($args{y_rotation})
|
||||||
if defined $args{y_rotation};
|
# if defined $args{y_rotation};
|
||||||
$new_instance->set_scaling_factor($args{scaling_factor})
|
$new_instance->set_scaling_factor($args{scaling_factor})
|
||||||
if defined $args{scaling_factor};
|
if defined $args{scaling_factor};
|
||||||
$new_instance->set_scaling_vector($args{scaling_vector})
|
# $new_instance->set_scaling_vector($args{scaling_vector})
|
||||||
if defined $args{scaling_vector};
|
# if defined $args{scaling_vector};
|
||||||
$new_instance->set_offset($args{offset})
|
$new_instance->set_offset($args{offset})
|
||||||
if defined $args{offset};
|
if defined $args{offset};
|
||||||
$new_instance->set_z_translation($args{z_translation})
|
# $new_instance->set_z_translation($args{z_translation})
|
||||||
if defined $args{z_translation};
|
# if defined $args{z_translation};
|
||||||
|
|
||||||
return $new_instance;
|
return $new_instance;
|
||||||
}
|
}
|
||||||
|
@ -845,17 +845,17 @@ void
|
|||||||
TMFParserContext::apply_transformation(ModelInstance *instance, std::vector<double> &transformations)
|
TMFParserContext::apply_transformation(ModelInstance *instance, std::vector<double> &transformations)
|
||||||
{
|
{
|
||||||
// Apply scale.
|
// Apply scale.
|
||||||
instance->scaling_vector = Pointf3(transformations[3], transformations[4], transformations[5]);;
|
// instance->scaling_vector = Pointf3(transformations[3], transformations[4], transformations[5]);;
|
||||||
|
|
||||||
// Apply x, y & z rotation.
|
// Apply x, y & z rotation.
|
||||||
instance->rotation = transformations[8];
|
instance->rotation = transformations[8];
|
||||||
instance->x_rotation = transformations[6];
|
// instance->x_rotation = transformations[6];
|
||||||
instance->y_rotation = transformations[7];
|
// instance->y_rotation = transformations[7];
|
||||||
|
|
||||||
// Apply translation.
|
// Apply translation.
|
||||||
instance->offset.x = transformations[0];
|
instance->offset.x = transformations[0];
|
||||||
instance->offset.y = transformations[1];
|
instance->offset.y = transformations[1];
|
||||||
instance->z_translation = transformations[2];
|
// instance->z_translation = transformations[2];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,33 +315,17 @@ ModelMaterial::attributes()
|
|||||||
|
|
||||||
double rotation()
|
double rotation()
|
||||||
%code%{ RETVAL = THIS->rotation; %};
|
%code%{ RETVAL = THIS->rotation; %};
|
||||||
double x_rotation()
|
|
||||||
%code%{ RETVAL = THIS->x_rotation; %};
|
|
||||||
double y_rotation()
|
|
||||||
%code%{ RETVAL = THIS->y_rotation; %};
|
|
||||||
double scaling_factor()
|
double scaling_factor()
|
||||||
%code%{ RETVAL = THIS->scaling_factor; %};
|
%code%{ RETVAL = THIS->scaling_factor; %};
|
||||||
Ref<Pointf3> scaling_vector()
|
|
||||||
%code%{ RETVAL = &THIS->scaling_vector; %};
|
|
||||||
Ref<Pointf> offset()
|
Ref<Pointf> offset()
|
||||||
%code%{ RETVAL = &THIS->offset; %};
|
%code%{ RETVAL = &THIS->offset; %};
|
||||||
double z_translation()
|
|
||||||
%code%{ RETVAL = THIS->z_translation; %};
|
|
||||||
|
|
||||||
void set_rotation(double val)
|
void set_rotation(double val)
|
||||||
%code%{ THIS->rotation = val; %};
|
%code%{ THIS->rotation = val; %};
|
||||||
void set_x_rotation(double val)
|
|
||||||
%code%{ THIS->x_rotation = val; %};
|
|
||||||
void set_y_rotation(double val)
|
|
||||||
%code%{ THIS->y_rotation = val; %};
|
|
||||||
void set_scaling_factor(double val)
|
void set_scaling_factor(double val)
|
||||||
%code%{ THIS->scaling_factor = val; %};
|
%code%{ THIS->scaling_factor = val; %};
|
||||||
void set_scaling_vector(Pointf3 *vec)
|
|
||||||
%code%{ THIS->scaling_vector = *vec; %};
|
|
||||||
void set_offset(Pointf *offset)
|
void set_offset(Pointf *offset)
|
||||||
%code%{ THIS->offset = *offset; %};
|
%code%{ THIS->offset = *offset; %};
|
||||||
void set_z_translation(double val)
|
|
||||||
%code%{ THIS->z_translation = val; %};
|
|
||||||
|
|
||||||
void transform_mesh(TriangleMesh* mesh, bool dont_translate = false) const;
|
void transform_mesh(TriangleMesh* mesh, bool dont_translate = false) const;
|
||||||
void transform_polygon(Polygon* polygon) const;
|
void transform_polygon(Polygon* polygon) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user