2013-09-06 16:36:38 +00:00
|
|
|
#include "Surface.hpp"
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
2013-09-13 12:48:40 +00:00
|
|
|
double
|
|
|
|
Surface::area() const
|
|
|
|
{
|
|
|
|
return this->expolygon.area();
|
|
|
|
}
|
|
|
|
|
2013-11-22 23:07:04 +00:00
|
|
|
bool
|
|
|
|
Surface::is_solid() const
|
|
|
|
{
|
|
|
|
return this->surface_type == stTop
|
|
|
|
|| this->surface_type == stBottom
|
|
|
|
|| this->surface_type == stInternalSolid;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
Surface::is_bridge() const
|
|
|
|
{
|
|
|
|
return this->surface_type == stBottom
|
|
|
|
|| this->surface_type == stInternalBridge;
|
|
|
|
}
|
|
|
|
|
2013-09-13 12:48:40 +00:00
|
|
|
#ifdef SLIC3RXS
|
2014-01-16 18:02:50 +00:00
|
|
|
void
|
|
|
|
Surface::from_SV_check(SV* surface_sv)
|
|
|
|
{
|
|
|
|
if (!sv_isa(surface_sv, "Slic3r::Surface") && !sv_isa(surface_sv, "Slic3r::Surface::Ref"))
|
|
|
|
CONFESS("Not a valid Slic3r::Surface object");
|
|
|
|
// a XS Surface was supplied
|
|
|
|
*this = *(Surface *)SvIV((SV*)SvRV( surface_sv ));
|
|
|
|
}
|
|
|
|
|
2013-09-06 16:36:38 +00:00
|
|
|
SV*
|
|
|
|
Surface::to_SV_ref() {
|
|
|
|
SV* sv = newSV(0);
|
|
|
|
sv_setref_pv( sv, "Slic3r::Surface::Ref", (void*)this );
|
|
|
|
return sv;
|
|
|
|
}
|
2013-11-23 17:15:59 +00:00
|
|
|
|
|
|
|
SV*
|
|
|
|
Surface::to_SV_clone_ref() const {
|
|
|
|
SV* sv = newSV(0);
|
|
|
|
sv_setref_pv( sv, "Slic3r::Surface", new Surface(*this) );
|
|
|
|
return sv;
|
|
|
|
}
|
2013-09-13 12:48:40 +00:00
|
|
|
#endif
|
2013-09-06 16:36:38 +00:00
|
|
|
|
|
|
|
}
|