libslic3r
Library for generating gcode from 3d models
Classes | Functions | Variables
Slic3r::Geometry Namespace Reference

Classes

class  ArrangeItem
 
class  ArrangeItemIndex
 
class  MedialAxis
 

Functions

static bool sort_points (Point a, Point b)
 
Polygon convex_hull (Points points)
 
Polygon convex_hull (const Polygons &polygons)
 
void chained_path (const Points &points, std::vector< Points::size_type > &retval, Point start_near)
 
void chained_path (const Points &points, std::vector< Points::size_type > &retval)
 
template<class T >
void chained_path_items (Points &points, T &items, T &retval)
 
template void chained_path_items (Points &points, ClipperLib::PolyNodes &items, ClipperLib::PolyNodes &retval)
 
bool directions_parallel (double angle1, double angle2, double max_diff)
 
template<class T >
bool contains (const std::vector< T > &vector, const Point &point)
 
template bool contains (const Polygons &vector, const Point &point)
 
template bool contains (const ExPolygons &vector, const Point &point)
 
template<class T >
double area (const std::vector< T > &vector)
 
template double area (const Polygons &vector)
 
double rad2deg (double angle)
 
double rad2deg_dir (double angle)
 
double deg2rad (double angle)
 
double linint (double value, double oldmin, double oldmax, double newmin, double newmax)
 
Point circle_taubin_newton (const Points &input, size_t cycles=20)
 Find the center of the circle corresponding to the vector of Points as an arc. More...
 
Point circle_taubin_newton (const Points::const_iterator &input_begin, const Points::const_iterator &input_end, size_t cycles)
 
Pointf circle_taubin_newton (const Pointfs &input, size_t cycles=20)
 Find the center of the circle corresponding to the vector of Pointfs as an arc. More...
 
Pointf circle_taubin_newton (const Pointfs::const_iterator &input_begin, const Pointfs::const_iterator &input_end, size_t cycles)
 
bool arrange (size_t total_parts, const Pointf &part_size, coordf_t dist, const BoundingBoxf *bb, Pointfs &positions)
 

Variables

constexpr double epsilon { 1e-4 }
 Epsilon value. More...
 
constexpr coord_t scaled_epsilon { static_cast<coord_t>(epsilon / SCALING_FACTOR) }
 

Function Documentation

◆ area() [1/2]

template<class T >
double Slic3r::Geometry::area ( const std::vector< T > &  vector)

◆ area() [2/2]

template double Slic3r::Geometry::area ( const Polygons vector)

◆ arrange()

bool Slic3r::Geometry::arrange ( size_t  total_parts,
const Pointf part_size,
coordf_t  dist,
const BoundingBoxf bb,
Pointfs positions 
)

◆ chained_path() [1/2]

void Slic3r::Geometry::chained_path ( const Points points,
std::vector< Points::size_type > &  retval,
Point  start_near 
)

◆ chained_path() [2/2]

void Slic3r::Geometry::chained_path ( const Points points,
std::vector< Points::size_type > &  retval 
)

◆ chained_path_items() [1/2]

template<class T >
void Slic3r::Geometry::chained_path_items ( Points points,
T &  items,
T &  retval 
)

◆ chained_path_items() [2/2]

template void Slic3r::Geometry::chained_path_items ( Points points,
ClipperLib::PolyNodes &  items,
ClipperLib::PolyNodes &  retval 
)

◆ circle_taubin_newton() [1/4]

Point Slic3r::Geometry::circle_taubin_newton ( const Points input,
size_t  cycles 
)

Find the center of the circle corresponding to the vector of Points as an arc.

◆ circle_taubin_newton() [2/4]

Point Slic3r::Geometry::circle_taubin_newton ( const Points::const_iterator &  input_begin,
const Points::const_iterator &  input_end,
size_t  cycles 
)

◆ circle_taubin_newton() [3/4]

Pointf Slic3r::Geometry::circle_taubin_newton ( const Pointfs input,
size_t  cycles 
)

Find the center of the circle corresponding to the vector of Pointfs as an arc.

◆ circle_taubin_newton() [4/4]

Pointf Slic3r::Geometry::circle_taubin_newton ( const Pointfs::const_iterator &  input_begin,
const Pointfs::const_iterator &  input_end,
size_t  cycles 
)

Adapted from work in "Circular and Linear Regression: Fitting circles and lines by least squares", pg 126 Returns a point corresponding to the center of a circle for which all of the points from input_begin to input_end lie on.

◆ contains() [1/3]

template<class T >
bool Slic3r::Geometry::contains ( const std::vector< T > &  vector,
const Point point 
)

◆ contains() [2/3]

template bool Slic3r::Geometry::contains ( const Polygons vector,
const Point point 
)

◆ contains() [3/3]

template bool Slic3r::Geometry::contains ( const ExPolygons vector,
const Point point 
)

◆ convex_hull() [1/2]

Polygon Slic3r::Geometry::convex_hull ( Points  points)

◆ convex_hull() [2/2]

Polygon Slic3r::Geometry::convex_hull ( const Polygons polygons)

◆ deg2rad()

double Slic3r::Geometry::deg2rad ( double  angle)

◆ directions_parallel()

bool Slic3r::Geometry::directions_parallel ( double  angle1,
double  angle2,
double  max_diff 
)

◆ linint()

double Slic3r::Geometry::linint ( double  value,
double  oldmin,
double  oldmax,
double  newmin,
double  newmax 
)

◆ rad2deg()

double Slic3r::Geometry::rad2deg ( double  angle)

◆ rad2deg_dir()

double Slic3r::Geometry::rad2deg_dir ( double  angle)

◆ sort_points()

static bool Slic3r::Geometry::sort_points ( Point  a,
Point  b 
)
static

Variable Documentation

◆ epsilon

constexpr double Slic3r::Geometry::epsilon { 1e-4 }

Epsilon value.

◆ scaled_epsilon

constexpr coord_t Slic3r::Geometry::scaled_epsilon { static_cast<coord_t>(epsilon / SCALING_FACTOR) }