Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2014-08-03 21:42:29 +0400
committerAlessandro Ranellucci <aar@cpan.org>2014-08-03 21:42:29 +0400
commit6adc3477c9d08d2cfa0e6902b3d241a9193e50d4 (patch)
tree98e1a403cec185a06501056d1811b4d39d731bf5 /xs/src/libslic3r/Surface.cpp
parentb8676241e0c9f91eb9db5b6757e73edfe7f85598 (diff)
Moved C++ code into new libslic3r directory
Diffstat (limited to 'xs/src/libslic3r/Surface.cpp')
-rw-r--r--xs/src/libslic3r/Surface.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/xs/src/libslic3r/Surface.cpp b/xs/src/libslic3r/Surface.cpp
new file mode 100644
index 000000000..a53cb2513
--- /dev/null
+++ b/xs/src/libslic3r/Surface.cpp
@@ -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
+
+}