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
|
2014-03-25 00:11:28 +00:00
|
|
|
|| this->surface_type == stBottomBridge
|
2013-11-22 23:07:04 +00:00
|
|
|
|| this->surface_type == stInternalSolid;
|
|
|
|
}
|
|
|
|
|
2014-02-10 12:19:44 +00:00
|
|
|
bool
|
|
|
|
Surface::is_external() const
|
|
|
|
{
|
|
|
|
return this->surface_type == stTop
|
2014-03-25 00:11:28 +00:00
|
|
|
|| this->surface_type == stBottom
|
|
|
|
|| this->surface_type == stBottomBridge;
|
2014-02-10 12:19:44 +00:00
|
|
|
}
|
|
|
|
|
2013-11-22 23:07:04 +00:00
|
|
|
bool
|
2014-03-25 00:11:28 +00:00
|
|
|
Surface::is_bottom() const
|
2013-11-22 23:07:04 +00:00
|
|
|
{
|
|
|
|
return this->surface_type == stBottom
|
2014-03-25 00:11:28 +00:00
|
|
|
|| this->surface_type == stBottomBridge;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
Surface::is_bridge() const
|
|
|
|
{
|
|
|
|
return this->surface_type == stBottomBridge
|
2013-11-22 23:07:04 +00:00
|
|
|
|| this->surface_type == stInternalBridge;
|
|
|
|
}
|
|
|
|
|
2013-09-13 12:48:40 +00:00
|
|
|
#ifdef SLIC3RXS
|
2014-04-27 17:18:53 +00:00
|
|
|
|
|
|
|
REGISTER_CLASS(Surface, "Surface");
|
|
|
|
|
2014-01-16 18:02:50 +00:00
|
|
|
void
|
|
|
|
Surface::from_SV_check(SV* surface_sv)
|
|
|
|
{
|
2014-04-27 17:18:53 +00:00
|
|
|
if (!sv_isa(surface_sv, perl_class_name(this)) && !sv_isa(surface_sv, perl_class_name_ref(this)))
|
|
|
|
CONFESS("Not a valid %s object", perl_class_name(this));
|
2014-01-16 18:02:50 +00:00
|
|
|
// a XS Surface was supplied
|
|
|
|
*this = *(Surface *)SvIV((SV*)SvRV( surface_sv ));
|
|
|
|
}
|
2013-09-13 12:48:40 +00:00
|
|
|
#endif
|
2013-09-06 16:36:38 +00:00
|
|
|
|
|
|
|
}
|