ChristophSchranz / Tweaker-3

A performant auto-rotate software for objects in 3D Printing, whose parameter are trained by an evolutionary algorithm.
GNU General Public License v3.0
91 stars 25 forks source link

Questions about porting Tweaker-3; question about death star algorithm #19

Closed marciot closed 3 years ago

marciot commented 3 years ago

Hi,

I am the developer of a web-based slicing program called Symple Slicer:

https://github.com/SynDaverCO/symple-slicer

I think the auto-rotation feature would be very handy for our slicer. I have quite a bit of experience porting Python code to JavaScript, but before I launch into that, I was wondering if you were aware of anyone who may have already ported Tweaker-3 to JavaScript?

Secondly, I looked though your whitepaper and while most of it was beyond my understanding, I am curious about the death star algorithm. You say in your paper that "since the bottom area would be a circle without any resulting area, the area cumulation algorithm fails." In Symple Slicer, I needed to have an option for the user to lay a print flat on the print bed and complex shapes presented a challenge. I solved my problem by using an off-the-shelf algorithm to compute the convex hull of the STL file, as the convex hull provides a convenient representation of all faces that can sit against the bed.

Since the convex hull of the death star is precisely a sphere with a large flat circular face, I wonder if that could be used in Tweaker-3 to simplify the death star problem and maybe give you solution that is more deterministic. Computing the convex hull of geometry is not trivial, but there are well developed algorithms out there for doing it.

ChristophSchranz commented 3 years ago

Hi @marciot,

I'm glad my software is useful to your project!

Unfortunately, I don't know anyone who ported the Tweaker to JavaScript.

Wow this is a great idea! Thank you very much! Is your algorithm to calculate the convex hull located in the symple-slicer repo?

marciot commented 3 years ago

@ChristophSchranz: No, I am using the ConvexHull algorithm that is part of the THREE.js library (https://github.com/mrdoob/three.js/blob/master/examples/jsm/math/ConvexHull.js). This is in JavaScript, so probably not too useful for you.

Cura is written in Python and they use the ConvexHull operation from SciPy, which in turn is based on QHull http://www.qhull.org/. I know adding SciPy adds a pretty heavy dependency to your library, so that would be a downside of using that implementation in Tweaker,

Your death star algorithm does have the advantage of being fairly lightweight and self-contained, while unfortunately the same can't be said about ConvexHull operations.

marciot commented 3 years ago

It looks like the implementation in THREE.js is based on this: https://github.com/maurizzzio/quickhull3d/

ChristophSchranz commented 3 years ago

Awesome thanks! 👍