SLA base pool generation framework
This commit is contained in:
parent
5164bec8ce
commit
e8616b6a35
@ -179,6 +179,8 @@ add_library(libslic3r STATIC
|
|||||||
${LIBDIR}/libslic3r/SVG.hpp
|
${LIBDIR}/libslic3r/SVG.hpp
|
||||||
${LIBDIR}/libslic3r/TriangleMesh.cpp
|
${LIBDIR}/libslic3r/TriangleMesh.cpp
|
||||||
${LIBDIR}/libslic3r/TriangleMesh.hpp
|
${LIBDIR}/libslic3r/TriangleMesh.hpp
|
||||||
|
${LIBDIR}/libslic3r/SLASupportPool.hpp
|
||||||
|
${LIBDIR}/libslic3r/SLASupportPool.cpp
|
||||||
# ${LIBDIR}/libslic3r/utils.cpp
|
# ${LIBDIR}/libslic3r/utils.cpp
|
||||||
${LIBDIR}/libslic3r/Utils.hpp
|
${LIBDIR}/libslic3r/Utils.hpp
|
||||||
|
|
||||||
|
33
xs/src/libslic3r/SLASupportPool.cpp
Normal file
33
xs/src/libslic3r/SLASupportPool.cpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
#include "SLASupportPool.hpp"
|
||||||
|
#include "ExPolygon.hpp"
|
||||||
|
#include "TriangleMesh.hpp"
|
||||||
|
#include "boost/geometry.hpp"
|
||||||
|
|
||||||
|
namespace Slic3r { namespace sla {
|
||||||
|
|
||||||
|
void ground_layer(const Mesh3D &mesh, GroundLayer &output)
|
||||||
|
{
|
||||||
|
Mesh3D m = mesh;
|
||||||
|
TriangleMeshSlicer slicer(&m);
|
||||||
|
|
||||||
|
std::vector<GroundLayer> tmp;
|
||||||
|
|
||||||
|
slicer.slice({0.1f}, &tmp);
|
||||||
|
|
||||||
|
output = tmp.front();
|
||||||
|
}
|
||||||
|
|
||||||
|
void create_base_pool(const GroundLayer &ground_layer, Mesh3D& out)
|
||||||
|
{
|
||||||
|
// 1: Offset the ground layer
|
||||||
|
ExPolygon in;
|
||||||
|
ExPolygon chull;
|
||||||
|
boost::geometry::convex_hull(in, chull);
|
||||||
|
|
||||||
|
// 2: triangulate the ground layer
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
26
xs/src/libslic3r/SLASupportPool.hpp
Normal file
26
xs/src/libslic3r/SLASupportPool.hpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#ifndef SLASUPPORTPOOL_HPP
|
||||||
|
#define SLASUPPORTPOOL_HPP
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace Slic3r {
|
||||||
|
|
||||||
|
class ExPolygon;
|
||||||
|
class TriangleMesh;
|
||||||
|
|
||||||
|
namespace sla {
|
||||||
|
|
||||||
|
using Mesh3D = TriangleMesh;
|
||||||
|
using GroundLayer = std::vector<ExPolygon>;
|
||||||
|
|
||||||
|
/// Calculate the polygon representing the slice of the lowest layer of mesh
|
||||||
|
void ground_layer(const Mesh3D& mesh, GroundLayer& output);
|
||||||
|
|
||||||
|
/// Calculate the pool for the mesh for SLA printing
|
||||||
|
void create_base_pool(const GroundLayer& ground_layer, Mesh3D& output_mesh);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // SLASUPPORTPOOL_HPP
|
Loading…
Reference in New Issue
Block a user