mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 11:17:51 -06:00
Moved C++ code into new libslic3r directory
This commit is contained in:
parent
b8676241e0
commit
6adc3477c9
84 changed files with 122 additions and 111 deletions
56
xs/src/libslic3r/Surface.cpp
Normal file
56
xs/src/libslic3r/Surface.cpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
#include "Surface.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
double
|
||||
Surface::area() const
|
||||
{
|
||||
return this->expolygon.area();
|
||||
}
|
||||
|
||||
bool
|
||||
Surface::is_solid() const
|
||||
{
|
||||
return this->surface_type == stTop
|
||||
|| this->surface_type == stBottom
|
||||
|| this->surface_type == stBottomBridge
|
||||
|| this->surface_type == stInternalSolid;
|
||||
}
|
||||
|
||||
bool
|
||||
Surface::is_external() const
|
||||
{
|
||||
return this->surface_type == stTop
|
||||
|| this->surface_type == stBottom
|
||||
|| this->surface_type == stBottomBridge;
|
||||
}
|
||||
|
||||
bool
|
||||
Surface::is_bottom() const
|
||||
{
|
||||
return this->surface_type == stBottom
|
||||
|| this->surface_type == stBottomBridge;
|
||||
}
|
||||
|
||||
bool
|
||||
Surface::is_bridge() const
|
||||
{
|
||||
return this->surface_type == stBottomBridge
|
||||
|| this->surface_type == stInternalBridge;
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
|
||||
REGISTER_CLASS(Surface, "Surface");
|
||||
|
||||
void
|
||||
Surface::from_SV_check(SV* surface_sv)
|
||||
{
|
||||
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));
|
||||
// a XS Surface was supplied
|
||||
*this = *(Surface *)SvIV((SV*)SvRV( surface_sv ));
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue