2013-11-22 21:38:30 +00:00
|
|
|
%module{Slic3r::XS};
|
|
|
|
|
|
|
|
%{
|
2015-12-07 23:39:54 +00:00
|
|
|
#include <xsinit.h>
|
2014-08-03 17:42:29 +00:00
|
|
|
#include "libslic3r/Geometry.hpp"
|
New BuildVolume class was created, which detects build volume type (rectangular,
circular, convex, concave) and performs efficient collision detection agains these build
volumes. As of now, collision detection is performed against a convex
hull of a concave build volume for efficency.
GCodeProcessor::Result renamed out of GCodeProcessor to GCodeProcessorResult,
so it could be forward declared.
Plater newly exports BuildVolume, not Bed3D. Bed3D is a rendering class,
while BuildVolume is a purely geometric class.
Reduced usage of global wxGetApp, the Bed3D is passed as a parameter
to View3D/Preview/GLCanvas.
Convex hull code was extracted from Geometry.cpp/hpp to Geometry/ConvexHulll.cpp,hpp.
New test inside_convex_polygon().
New efficent point inside polygon test: Decompose convex hull
to bottom / top parts and use the decomposition to detect point inside
a convex polygon in O(log n). decompose_convex_polygon_top_bottom(),
inside_convex_polygon().
New Circle constructing functions: circle_ransac() and circle_taubin_newton().
New polygon_is_convex() test with unit tests.
2021-11-16 09:15:51 +00:00
|
|
|
#include "libslic3r/Geometry/ConvexHull.hpp"
|
2019-09-26 15:30:03 +00:00
|
|
|
#include "libslic3r/ShortestPath.hpp"
|
2013-11-22 21:38:30 +00:00
|
|
|
%}
|
|
|
|
|
2013-11-23 20:54:56 +00:00
|
|
|
|
2013-11-22 21:38:30 +00:00
|
|
|
%package{Slic3r::Geometry};
|
|
|
|
|
|
|
|
%{
|
|
|
|
|
2015-01-19 17:53:04 +00:00
|
|
|
Clone<Polygon>
|
2013-11-22 21:38:30 +00:00
|
|
|
convex_hull(points)
|
|
|
|
Points points
|
|
|
|
CODE:
|
2015-01-19 17:53:04 +00:00
|
|
|
RETVAL = Slic3r::Geometry::convex_hull(points);
|
2013-11-22 21:38:30 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2013-11-23 20:39:05 +00:00
|
|
|
std::vector<Points::size_type>
|
|
|
|
chained_path_from(points, start_from)
|
|
|
|
Points points
|
|
|
|
Point* start_from
|
|
|
|
CODE:
|
2019-09-26 15:30:03 +00:00
|
|
|
RETVAL = chain_points(points, start_from);
|
2013-11-23 20:39:05 +00:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2014-11-15 21:41:22 +00:00
|
|
|
double
|
|
|
|
rad2deg(angle)
|
|
|
|
double angle
|
|
|
|
CODE:
|
|
|
|
RETVAL = Slic3r::Geometry::rad2deg(angle);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
double
|
|
|
|
deg2rad(angle)
|
|
|
|
double angle
|
|
|
|
CODE:
|
|
|
|
RETVAL = Slic3r::Geometry::deg2rad(angle);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
2015-04-16 19:22:04 +00:00
|
|
|
IV
|
|
|
|
_constant()
|
|
|
|
ALIAS:
|
|
|
|
X = X
|
|
|
|
Y = Y
|
|
|
|
Z = Z
|
|
|
|
PROTOTYPE:
|
|
|
|
CODE:
|
|
|
|
RETVAL = ix;
|
|
|
|
OUTPUT: RETVAL
|
|
|
|
|
2013-11-22 21:38:30 +00:00
|
|
|
%}
|
2015-04-16 19:22:04 +00:00
|
|
|
|