mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-04 22:20:42 +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) {
|
||||
$instance = $model_object->add_instance(
|
||||
offset => Slic3r::Pointf->new(map 10+$_, @{$instance->offset}),
|
||||
z_translation => $instance->z_translation,
|
||||
scaling_factor => $instance->scaling_factor,
|
||||
scaling_vector => $instance->scaling_vector,
|
||||
rotation => $instance->rotation,
|
||||
x_rotation => $instance->x_rotation,
|
||||
y_rotation => $instance->y_rotation,
|
||||
);
|
||||
$self->{print}->objects->[$obj_idx]->add_copy($instance->offset);
|
||||
}
|
||||
@ -3387,10 +3383,10 @@ sub make_thumbnail {
|
||||
|
||||
my $mesh = $model->objects->[$obj_idx]->raw_mesh;
|
||||
# Apply x, y rotations and scaling vector in case of reading a 3MF model object.
|
||||
my $model_instance = $model->objects->[$obj_idx]->instances->[0];
|
||||
$mesh->rotate_x($model_instance->x_rotation);
|
||||
$mesh->rotate_y($model_instance->y_rotation);
|
||||
$mesh->scale_xyz($model_instance->scaling_vector);
|
||||
#my $model_instance = $model->objects->[$obj_idx]->instances->[0];
|
||||
#$mesh->rotate_x($model_instance->x_rotation);
|
||||
#$mesh->rotate_y($model_instance->y_rotation);
|
||||
#$mesh->scale_xyz($model_instance->scaling_vector);
|
||||
|
||||
if ($mesh->facets_count <= 5000) {
|
||||
# remove polygons with area <= 1mm
|
||||
|
@ -128,18 +128,18 @@ sub add_instance {
|
||||
|
||||
$new_instance->set_rotation($args{rotation})
|
||||
if defined $args{rotation};
|
||||
$new_instance->set_x_rotation($args{x_rotation})
|
||||
if defined $args{x_rotation};
|
||||
$new_instance->set_y_rotation($args{y_rotation})
|
||||
if defined $args{y_rotation};
|
||||
# $new_instance->set_x_rotation($args{x_rotation})
|
||||
# if defined $args{x_rotation};
|
||||
# $new_instance->set_y_rotation($args{y_rotation})
|
||||
# if defined $args{y_rotation};
|
||||
$new_instance->set_scaling_factor($args{scaling_factor})
|
||||
if defined $args{scaling_factor};
|
||||
$new_instance->set_scaling_vector($args{scaling_vector})
|
||||
if defined $args{scaling_vector};
|
||||
# $new_instance->set_scaling_vector($args{scaling_vector})
|
||||
# if defined $args{scaling_vector};
|
||||
$new_instance->set_offset($args{offset})
|
||||
if defined $args{offset};
|
||||
$new_instance->set_z_translation($args{z_translation})
|
||||
if defined $args{z_translation};
|
||||
# $new_instance->set_z_translation($args{z_translation})
|
||||
# if defined $args{z_translation};
|
||||
|
||||
return $new_instance;
|
||||
}
|
||||
|
@ -845,17 +845,17 @@ void
|
||||
TMFParserContext::apply_transformation(ModelInstance *instance, std::vector<double> &transformations)
|
||||
{
|
||||
// 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.
|
||||
instance->rotation = transformations[8];
|
||||
instance->x_rotation = transformations[6];
|
||||
instance->y_rotation = transformations[7];
|
||||
// instance->x_rotation = transformations[6];
|
||||
// instance->y_rotation = transformations[7];
|
||||
|
||||
// Apply translation.
|
||||
instance->offset.x = transformations[0];
|
||||
instance->offset.y = transformations[1];
|
||||
instance->z_translation = transformations[2];
|
||||
// instance->z_translation = transformations[2];
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -315,33 +315,17 @@ ModelMaterial::attributes()
|
||||
|
||||
double rotation()
|
||||
%code%{ RETVAL = THIS->rotation; %};
|
||||
double x_rotation()
|
||||
%code%{ RETVAL = THIS->x_rotation; %};
|
||||
double y_rotation()
|
||||
%code%{ RETVAL = THIS->y_rotation; %};
|
||||
double scaling_factor()
|
||||
%code%{ RETVAL = THIS->scaling_factor; %};
|
||||
Ref<Pointf3> scaling_vector()
|
||||
%code%{ RETVAL = &THIS->scaling_vector; %};
|
||||
Ref<Pointf> offset()
|
||||
%code%{ RETVAL = &THIS->offset; %};
|
||||
double z_translation()
|
||||
%code%{ RETVAL = THIS->z_translation; %};
|
||||
|
||||
void set_rotation(double 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)
|
||||
%code%{ THIS->scaling_factor = val; %};
|
||||
void set_scaling_vector(Pointf3 *vec)
|
||||
%code%{ THIS->scaling_vector = *vec; %};
|
||||
void set_offset(Pointf *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_polygon(Polygon* polygon) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user