mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-30 16:42:43 +00:00
Visual preview for bed shape dialog
This commit is contained in:
@@ -25,7 +25,7 @@ use overload
|
||||
|
||||
package Slic3r::Pointf;
|
||||
use overload
|
||||
'@{}' => sub { [ $_[0]->x, $_[0]->y ] }, #,
|
||||
'@{}' => sub { $_[0]->arrayref },
|
||||
'fallback' => 1;
|
||||
|
||||
package Slic3r::Pointf3;
|
||||
|
||||
@@ -268,6 +268,15 @@ Pointf::translate(double x, double y)
|
||||
this->y += y;
|
||||
}
|
||||
|
||||
void
|
||||
Pointf::rotate(double angle, const Pointf ¢er)
|
||||
{
|
||||
double cur_x = this->x;
|
||||
double cur_y = this->y;
|
||||
this->x = center.x + cos(angle) * (cur_x - center.x) - sin(angle) * (cur_y - center.y);
|
||||
this->y = center.y + cos(angle) * (cur_y - center.y) + sin(angle) * (cur_x - center.x);
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
|
||||
REGISTER_CLASS(Pointf, "Pointf");
|
||||
|
||||
@@ -71,6 +71,7 @@ class Pointf
|
||||
explicit Pointf(coordf_t _x = 0, coordf_t _y = 0): x(_x), y(_y) {};
|
||||
void scale(double factor);
|
||||
void translate(double x, double y);
|
||||
void rotate(double angle, const Pointf ¢er);
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
bool from_SV(SV* point_sv);
|
||||
|
||||
@@ -56,6 +56,10 @@ new_from_points(CLASS, points)
|
||||
double x_max() %code{% RETVAL = THIS->max.x; %};
|
||||
double y_min() %code{% RETVAL = THIS->min.y; %};
|
||||
double y_max() %code{% RETVAL = THIS->max.y; %};
|
||||
void set_x_min(double val) %code{% THIS->min.x = val; %};
|
||||
void set_x_max(double val) %code{% THIS->max.x = val; %};
|
||||
void set_y_min(double val) %code{% THIS->min.y = val; %};
|
||||
void set_y_max(double val) %code{% THIS->max.y = val; %};
|
||||
|
||||
%{
|
||||
|
||||
|
||||
@@ -85,11 +85,18 @@ Point::coincides_with(point_sv)
|
||||
~Pointf();
|
||||
Clone<Pointf> clone()
|
||||
%code{% RETVAL = THIS; %};
|
||||
SV* arrayref()
|
||||
%code{% RETVAL = THIS->to_SV_pureperl(); %};
|
||||
SV* pp()
|
||||
%code{% RETVAL = THIS->to_SV_pureperl(); %};
|
||||
double x()
|
||||
%code{% RETVAL = THIS->x; %};
|
||||
double y()
|
||||
%code{% RETVAL = THIS->y; %};
|
||||
void translate(double x, double y);
|
||||
void scale(double factor);
|
||||
void rotate(double angle, Pointf* center)
|
||||
%code{% THIS->rotate(angle, *center); %};
|
||||
};
|
||||
|
||||
%name{Slic3r::Pointf3} class Pointf3 {
|
||||
|
||||
Reference in New Issue
Block a user