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

AttributeError: 'Tweak' object has no attribute 'ANGLE_SCALE' #13

Closed EvgeniGenchev closed 3 years ago

EvgeniGenchev commented 3 years ago

When trying to run python Tweaker.py -i <my_obj.STL> -vb -x -fs "[[0,-1,2.5],3]" I get this exception:

Calculating the optimal orientation:
  spool_axle.STL
You favour the side [ 0.         -0.39872611  0.91707006] with a factor of 1.0
Traceback (most recent call last):
  File "/home/gena/workspace/work/Iambol_e_grada/Tweaker-3/Tweaker.py", line 154, in <module>
    x = Tweak(mesh, args.extended_mode, args.verbose, args.show_progress, args.favside, args.volume)
  File "/home/gena/workspace/work/Iambol_e_grada/Tweaker-3/MeshTweaker.py", line 107, in __init__
    self.favour_side(favside)
  File "/home/gena/workspace/work/Iambol_e_grada/Tweaker-3/MeshTweaker.py", line 281, in favour_side
    align = np.sum(diff * diff, axis=1) < self.ANGLE_SCALE  # 0.7654, ANGLE_SCALE ist around 0.1
AttributeError: 'Tweak' object has no attribute 'ANGLE_SCALE'
ChristophSchranz commented 3 years ago

Hi @EvgeniGenchev, Thanks for reporting this! I fixed this in a4a16a96879cf59aa78eaa3bf89a551cc8cda8a3 and 12fd95bb049974128e4e9d143a5ff3aae8eb8d35.

Let me know if it works for you!

Another thing that makes me wonder: Does the parameter -fs "[[0,-1,2.5],3]" really lead to the factor of 1.0, or have you copied a different command?

You favour the side [ 0.         -0.39872611  0.91707006] with a factor of >>1.0<<