PrusaSlicer-NonPlainar/xs/src/libslic3r/Surface.hpp

44 lines
1.3 KiB
C++
Raw Normal View History

2013-07-14 13:05:55 +02:00
#ifndef slic3r_Surface_hpp_
#define slic3r_Surface_hpp_
#include "libslic3r.h"
2013-07-14 13:05:55 +02:00
#include "ExPolygon.hpp"
namespace Slic3r {
enum SurfaceType { stTop, stBottom, stBottomBridge, stInternal, stInternalSolid, stInternalBridge, stInternalVoid };
2013-07-14 13:05:55 +02:00
class Surface
{
public:
SurfaceType surface_type;
ExPolygon expolygon;
2013-07-14 13:05:55 +02:00
double thickness; // in mm
unsigned short thickness_layers; // in layers
double bridge_angle; // in radians, ccw, 0 = East, only 0+ (negative means undefined)
2013-07-14 13:05:55 +02:00
unsigned short extra_perimeters;
Surface(SurfaceType _surface_type, const ExPolygon &_expolygon)
: surface_type(_surface_type), expolygon(_expolygon),
thickness(-1), thickness_layers(1), bridge_angle(-1), extra_perimeters(0)
{};
2015-10-26 23:23:03 +01:00
operator Polygons() const;
double area() const;
bool is_solid() const;
bool is_external() const;
bool is_internal() const;
bool is_bottom() const;
bool is_bridge() const;
2013-07-14 13:05:55 +02:00
};
2013-07-18 19:09:07 +02:00
typedef std::vector<Surface> Surfaces;
2013-11-23 18:15:59 +01:00
typedef std::vector<Surface*> SurfacesPtr;
2013-07-18 19:09:07 +02:00
extern BoundingBox get_extents(const Surface &surface);
extern BoundingBox get_extents(const Surfaces &surfaces);
extern BoundingBox get_extents(const SurfacesPtr &surfaces);
2013-07-14 13:05:55 +02:00
}
#endif