Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortamasmeszaros <meszaros.q@gmail.com>2019-11-11 13:41:14 +0300
committertamasmeszaros <meszaros.q@gmail.com>2019-11-11 14:55:22 +0300
commitc22423a21928ec3e2d160ed148d30d50df04ceb6 (patch)
treebfe35e36e326da460c11fa2575e7df0c18d1d910 /src/libslic3r/SLA/Rotfinder.hpp
parentb4795e12920ea8f20b796a1f9b3d068b53a03c6f (diff)
parentac8eab5fa8e6c38faf788349bcb4f0f707d6bbbe (diff)
Merge branch 'tm_openvdb_integration' into lm_tm_hollowing
* Refactor file names in SLA dir
Diffstat (limited to 'src/libslic3r/SLA/Rotfinder.hpp')
-rw-r--r--src/libslic3r/SLA/Rotfinder.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/libslic3r/SLA/Rotfinder.hpp b/src/libslic3r/SLA/Rotfinder.hpp
new file mode 100644
index 000000000..4469f9731
--- /dev/null
+++ b/src/libslic3r/SLA/Rotfinder.hpp
@@ -0,0 +1,38 @@
+#ifndef SLA_ROTFINDER_HPP
+#define SLA_ROTFINDER_HPP
+
+#include <functional>
+#include <array>
+
+namespace Slic3r {
+
+class ModelObject;
+
+namespace sla {
+
+/**
+ * The function should find the best rotation for SLA upside down printing.
+ *
+ * @param modelobj The model object representing the 3d mesh.
+ * @param accuracy The optimization accuracy from 0.0f to 1.0f. Currently,
+ * the nlopt genetic optimizer is used and the number of iterations is
+ * accuracy * 100000. This can change in the future.
+ * @param statuscb A status indicator callback called with the unsigned
+ * argument spanning from 0 to 100. May not reach 100 if the optimization finds
+ * an optimum before max iterations are reached.
+ * @param stopcond A function that if returns true, the search process will be
+ * terminated and the best solution found will be returned.
+ *
+ * @return Returns the rotations around each axis (x, y, z)
+ */
+std::array<double, 3> find_best_rotation(
+ const ModelObject& modelobj,
+ float accuracy = 1.0f,
+ std::function<void(unsigned)> statuscb = [] (unsigned) {},
+ std::function<bool()> stopcond = [] () { return false; }
+ );
+
+}
+}
+
+#endif // SLAROTFINDER_HPP