diff options
author | tamasmeszaros <meszaros.q@gmail.com> | 2019-08-16 17:17:37 +0300 |
---|---|---|
committer | tamasmeszaros <meszaros.q@gmail.com> | 2019-08-16 17:17:37 +0300 |
commit | 7e0199746ef683c2bda80c5649b5c4150880a9c3 (patch) | |
tree | 68e994c183521fa7248a332f574995b7ac0e773b /sandboxes | |
parent | 7d25d8c677cc0edbba469e2a54658ed9468efa60 (diff) |
more clang warnings enabled, performance measuring
Succesfull build on mingw-w64
fix sandboxes
Mingw fixes and full parallel support tree gen.
Diffstat (limited to 'sandboxes')
-rw-r--r-- | sandboxes/CMakeLists.txt | 1 | ||||
-rw-r--r-- | sandboxes/slabasebed/slabasebed.cpp | 17 | ||||
-rw-r--r-- | sandboxes/slasupporttree/CMakeLists.txt | 2 | ||||
-rw-r--r-- | sandboxes/slasupporttree/slasupporttree.cpp | 42 |
4 files changed, 54 insertions, 8 deletions
diff --git a/sandboxes/CMakeLists.txt b/sandboxes/CMakeLists.txt index 0e1f52d6c..5905c438e 100644 --- a/sandboxes/CMakeLists.txt +++ b/sandboxes/CMakeLists.txt @@ -1 +1,2 @@ add_subdirectory(slabasebed) +add_subdirectory(slasupporttree) diff --git a/sandboxes/slabasebed/slabasebed.cpp b/sandboxes/slabasebed/slabasebed.cpp index 5393f61fd..b8b94d86f 100644 --- a/sandboxes/slabasebed/slabasebed.cpp +++ b/sandboxes/slabasebed/slabasebed.cpp @@ -5,6 +5,7 @@ #include <libslic3r/libslic3r.h> #include <libslic3r/TriangleMesh.hpp> #include <libslic3r/Tesselate.hpp> +#include <libslic3r/ClipperUtils.hpp> #include <libslic3r/SLA/SLABasePool.hpp> #include <libslic3r/SLA/SLABoilerPlate.hpp> #include <libnest2d/tools/benchmark.h> @@ -15,8 +16,8 @@ const std::string USAGE_STR = { namespace Slic3r { namespace sla { -Contour3D create_base_pool(const Polygons &ground_layer, - const Polygons &holes = {}, +Contour3D create_base_pool(const Polygons &ground_layer, + const ExPolygons &holes = {}, const PoolConfig& cfg = PoolConfig()); Contour3D walls(const Polygon& floor_plate, const Polygon& ceiling, @@ -43,22 +44,22 @@ int main(const int argc, const char *argv[]) { model.ReadSTLFile(argv[1]); model.align_to_origin(); - Polygons ground_slice; + ExPolygons ground_slice; sla::base_plate(model, ground_slice, 0.1f); if(ground_slice.empty()) return EXIT_FAILURE; - Polygon gndfirst; gndfirst = ground_slice.front(); - sla::offset_with_breakstick_holes(gndfirst, 0.5, 10, 0.3); + ground_slice = offset_ex(ground_slice, 0.5); + ExPolygon gndfirst; gndfirst = ground_slice.front(); + sla::breakstick_holes(gndfirst, 0.5, 10, 0.3); sla::Contour3D mesh; - bench.start(); sla::PoolConfig cfg; cfg.min_wall_height_mm = 0; cfg.edge_radius_mm = 0; - mesh = sla::create_base_pool(ground_slice, {}, cfg); + mesh = sla::create_base_pool(to_polygons(ground_slice), {}, cfg); bench.stop(); @@ -75,7 +76,7 @@ int main(const int argc, const char *argv[]) { if(std::abs(a) < 1e-6) std::cout << "degenerate triangle" << std::endl; } -// basepool.write_ascii("out.stl"); + // basepool.write_ascii("out.stl"); std::fstream outstream("out.obj", std::fstream::out); mesh.to_obj(outstream); diff --git a/sandboxes/slasupporttree/CMakeLists.txt b/sandboxes/slasupporttree/CMakeLists.txt new file mode 100644 index 000000000..79adb842b --- /dev/null +++ b/sandboxes/slasupporttree/CMakeLists.txt @@ -0,0 +1,2 @@ +add_executable(slasupporttree slasupporttree.cpp) +target_link_libraries(slasupporttree libslic3r ${Boost_LIBRARIES} ${TBB_LIBRARIES} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS}) diff --git a/sandboxes/slasupporttree/slasupporttree.cpp b/sandboxes/slasupporttree/slasupporttree.cpp new file mode 100644 index 000000000..dcaddf6d3 --- /dev/null +++ b/sandboxes/slasupporttree/slasupporttree.cpp @@ -0,0 +1,42 @@ +#include <iostream> +#include <fstream> +#include <string> + +#include <libslic3r/libslic3r.h> +#include <libslic3r/Model.hpp> +#include <libslic3r/Tesselate.hpp> +#include <libslic3r/ClipperUtils.hpp> +#include <libslic3r/SLA/SLAAutoSupports.hpp> +#include <libslic3r/SLA/SLASupportTree.hpp> +#include <libslic3r/SLAPrint.hpp> +#include <libslic3r/MTUtils.hpp> + +#include <tbb/parallel_for.h> +#include <tbb/mutex.h> +#include <future> + +const std::string USAGE_STR = { + "Usage: slasupporttree stlfilename.stl" +}; + +int main(const int argc, const char *argv[]) { + using namespace Slic3r; + using std::cout; using std::endl; + + if(argc < 2) { + cout << USAGE_STR << endl; + return EXIT_SUCCESS; + } + + DynamicPrintConfig config; + + Model model = Model::read_from_file(argv[1], &config); + + SLAPrint print; + + print.apply(model, config); + print.process(); + + + return EXIT_SUCCESS; +} |