mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 11:02:08 +00:00
Store width and height in ExtrusionEntity objects for debugging purposes
This commit is contained in:
@@ -112,7 +112,9 @@ sub new {
|
||||
return $class->_new(
|
||||
$args{polygon}, # required
|
||||
$args{role}, # required
|
||||
$args{mm3_per_mm} // -1,
|
||||
$args{mm3_per_mm} // die("Missing required mm3_per_mm in ExtrusionLoop constructor"),
|
||||
$args{width} // -1,
|
||||
$args{height} // -1,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,6 +125,8 @@ sub clone {
|
||||
$args{polygon} // $self->polygon,
|
||||
$args{role} // $self->role,
|
||||
$args{mm3_per_mm} // $self->mm3_per_mm,
|
||||
$args{width} // $self->width,
|
||||
$args{height} // $self->height,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -142,7 +146,9 @@ sub new {
|
||||
return $class->_new(
|
||||
$args{polyline}, # required
|
||||
$args{role}, # required
|
||||
$args{mm3_per_mm} // -1,
|
||||
$args{mm3_per_mm} // die("Missing required mm3_per_mm in ExtrusionPath constructor"),
|
||||
$args{width} // -1,
|
||||
$args{height} // -1,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -153,6 +159,8 @@ sub clone {
|
||||
$args{polyline} // $self->polyline,
|
||||
$args{role} // $self->role,
|
||||
$args{mm3_per_mm} // $self->mm3_per_mm,
|
||||
$args{width} // $self->width,
|
||||
$args{height} // $self->height,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -172,6 +172,8 @@ ExtrusionLoop::split_at_index(int index) const
|
||||
path->polyline = *poly;
|
||||
path->role = this->role;
|
||||
path->mm3_per_mm = this->mm3_per_mm;
|
||||
path->width = this->width;
|
||||
path->height = this->height;
|
||||
|
||||
delete poly;
|
||||
return path;
|
||||
|
||||
@@ -29,10 +29,13 @@ enum ExtrusionRole {
|
||||
class ExtrusionEntity
|
||||
{
|
||||
public:
|
||||
ExtrusionEntity() : mm3_per_mm(-1), width(-1), height(-1) {};
|
||||
virtual ExtrusionEntity* clone() const = 0;
|
||||
virtual ~ExtrusionEntity() {};
|
||||
ExtrusionRole role;
|
||||
double mm3_per_mm; // mm^3 of plastic per mm of linear head motion
|
||||
float width;
|
||||
float height;
|
||||
virtual void reverse() = 0;
|
||||
virtual Point first_point() const = 0;
|
||||
virtual Point last_point() const = 0;
|
||||
|
||||
@@ -25,16 +25,20 @@
|
||||
%{
|
||||
|
||||
ExtrusionLoop*
|
||||
_new(CLASS, polygon_sv, role, mm3_per_mm)
|
||||
_new(CLASS, polygon_sv, role, mm3_per_mm, width, height)
|
||||
char* CLASS;
|
||||
SV* polygon_sv;
|
||||
ExtrusionRole role;
|
||||
double mm3_per_mm;
|
||||
float width;
|
||||
float height;
|
||||
CODE:
|
||||
RETVAL = new ExtrusionLoop ();
|
||||
RETVAL->polygon.from_SV_check(polygon_sv);
|
||||
RETVAL->role = role;
|
||||
RETVAL->mm3_per_mm = mm3_per_mm;
|
||||
RETVAL->width = width;
|
||||
RETVAL->height = height;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
@@ -68,5 +72,25 @@ ExtrusionLoop::mm3_per_mm(...)
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
float
|
||||
ExtrusionLoop::width(...)
|
||||
CODE:
|
||||
if (items > 1) {
|
||||
THIS->width = (float)SvNV(ST(1));
|
||||
}
|
||||
RETVAL = THIS->width;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
float
|
||||
ExtrusionLoop::height(...)
|
||||
CODE:
|
||||
if (items > 1) {
|
||||
THIS->height = (float)SvNV(ST(1));
|
||||
}
|
||||
RETVAL = THIS->height;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
%}
|
||||
};
|
||||
|
||||
@@ -31,16 +31,20 @@
|
||||
%{
|
||||
|
||||
ExtrusionPath*
|
||||
_new(CLASS, polyline_sv, role, mm3_per_mm)
|
||||
_new(CLASS, polyline_sv, role, mm3_per_mm, width, height)
|
||||
char* CLASS;
|
||||
SV* polyline_sv;
|
||||
ExtrusionRole role;
|
||||
double mm3_per_mm;
|
||||
float width;
|
||||
float height;
|
||||
CODE:
|
||||
RETVAL = new ExtrusionPath ();
|
||||
RETVAL->polyline.from_SV_check(polyline_sv);
|
||||
RETVAL->role = role;
|
||||
RETVAL->mm3_per_mm = mm3_per_mm;
|
||||
RETVAL->width = width;
|
||||
RETVAL->height = height;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
@@ -74,6 +78,26 @@ ExtrusionPath::mm3_per_mm(...)
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
float
|
||||
ExtrusionPath::width(...)
|
||||
CODE:
|
||||
if (items > 1) {
|
||||
THIS->width = (float)SvNV(ST(1));
|
||||
}
|
||||
RETVAL = THIS->width;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
float
|
||||
ExtrusionPath::height(...)
|
||||
CODE:
|
||||
if (items > 1) {
|
||||
THIS->height = (float)SvNV(ST(1));
|
||||
}
|
||||
RETVAL = THIS->height;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
void
|
||||
ExtrusionPath::append(...)
|
||||
CODE:
|
||||
|
||||
Reference in New Issue
Block a user