Author Topic: rotate objects to minimize stock height (script)  (Read 2374 times)

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
rotate objects to minimize stock height (script)
« on: December 09, 2017, 03:17:45 am »
Following the http://www.cambam.co.uk/forum/index.php?topic=7012.0 feature request, did a little script just
for fun.

Select objects and run script. It will try to rotate objects in a way to minimize stock height.

The algorithm is dumb but effective - try a lot a rotations and choose the best )

By default script tries to minimize box height.  Box width, area or perimeter may be selected - just modify a
script header.

« Last Edit: December 09, 2017, 03:23:48 am by jk »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4463
    • View Profile
Re: rotate objects to minimize stock height (script)
« Reply #1 on: December 09, 2017, 12:39:19 pm »
I knew you couldn't resist  :D
Made in England

Offline kvom

  • CNC Jedi
  • *****
  • Posts: 1580
    • View Profile
Re: rotate objects to minimize stock height (script)
« Reply #2 on: December 09, 2017, 12:54:35 pm »
Tried it on my project.  Eyeball by me got 10.04", script 9.93".  It did end up rotated 180 from my starting point, but that's easy to re-rotate.

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: rotate objects to minimize stock height (script)
« Reply #3 on: December 10, 2017, 09:16:20 am »
I knew you couldn't resist  :D

I didn't even try to )

I made a few parts like this which should benefit from the script:
« Last Edit: December 10, 2017, 09:22:16 am by jk »

Offline kvom

  • CNC Jedi
  • *****
  • Posts: 1580
    • View Profile
Re: rotate objects to minimize stock height (script)
« Reply #4 on: December 10, 2017, 23:37:20 pm »
If you want the minimum X you just have to find minimum Y and rotate 90 degrees.  No need to modify the script.