[Plugin] RotaScale

[Plugin] RotaScale

Postby thomthom » Tue May 19, 2009 9:39 pm

By request: http://www.sketchucation.com/forums/scf ... 80&t=19130

This is just a rough version to get it out there. I got some other projects I need to attend to before I polish this one off.

Usage:
  • Select everything you want to rotate-scale
  • Tools->RotaScale
  • Pick point of origin
  • Pick a second reference point
  • Pick a third reference point that will determine the rotation and scaling

RotaScale.png


Currently I performs a 3D uniform scaling. I'll look into 2D and 1D scaling later. (If anyone cares to give me pointers to how to do this I'd be happy.)

Changelog
Code: Select all
# CHANGELOG
# 0.1.0b - 19.05.2009
#       * Rotate and Scale.
#
# 0.1.1b - 20.05.2009
#       * Fixed a bug that occured when there's no rotation.
#
# 0.2.0b - 20.05.2009
#       * Added CTRL modifier to disable scaling.
#
# 0.3.0b - 20.05.2009
#       * Added cursors.
#       * Minor bugfix.
#
# 0.3.1b - 21.05.2009
#       * Added some extra methods to the Float class which the script rely on.
#
# 0.3.2b - 11.06.2009
#       * Normalized the Scale transformation - VfSU has problems if this isn't done it appears.
#
# 0.3.3b - 11.06.2009
#       * Corrected a potential bug.


Todo:
  • 2D & 1D Scaling
  • Cleaner UI
  • Toolbar button
  • VCB input

Download

0
Last edited by thomthom on Thu Nov 28, 2013 11:55 pm, edited 8 times in total.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.1.0b)

Postby Chris Fullmer » Wed May 20, 2009 2:16 am

Great Thom! I'll check it out,

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] RotaScale (0.1.0b)

Postby AcesHigh » Wed May 20, 2009 4:11 am

is this something I cant do by using first the rotation tool and then the scale tool?
0

AcesHigh 
 

Re: [Plugin] RotaScale (0.1.0b)

Postby utiler » Wed May 20, 2009 5:21 am

Following with great interest!!!!!! :berserk:
0
purpose/expression/purpose/....
User avatar
utiler 
Top SketchUcator
 

Re: [Plugin] RotaScale (0.1.0b)

Postby thomthom » Wed May 20, 2009 7:22 am

AcesHigh wrote:is this something I cant do by using first the rotation tool and then the scale tool?

You can, but the request was a tool to do it in one operation.
1
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.1.0b)

Postby free agent » Wed May 20, 2009 9:02 am

wow thom thanks for working on this i really appreciate it!!

AcesHigh wrote:is this something I cant do by using first the rotation tool and then the scale tool?


its way more than that, the point is also to control the point a group will scale from, rather than just the centre or the corners, it makes lining/scaling reference material up to a model (or vise versa) really quick, so it squashes rotate scale and move into one.

thom just looked at the ruby, i works perfect, better than what i had asked for actually, i frikken love it :ecstatic: i cant tell you how long ive wanted this, thank you.

oops first problem :)... it seems you HAVE to rotate, if the first line is on an axis then it wont let u place the second point along the same axis
0
Last edited by free agent on Wed May 20, 2009 9:52 am, edited 1 time in total.
User avatar
free agent 
 

Re: [Plugin] RotaScale (0.1.0b)

Postby silver_shadow » Wed May 20, 2009 9:40 am

Great work!!!
Now we dont have to work out a scale factor if we want to re size an object or model.

it does work in some cases, don't know why
0

silver_shadow 
 

Re: [Plugin] RotaScale (0.1.1b)

Postby thomthom » Wed May 20, 2009 10:11 am

Free Agent wrote:oops first problem :)... it seems you HAVE to rotate, if the first line is on an axis then it wont let u place the second point along the same axis

Yea, I expected there to be issues. I didn't test it much. I uploaded a quick update. Think it should take care of that problem.

silver_shadow wrote:it does work in some cases, don't know why

Can you explain further to what you're doing? I can't reproduce any problems.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.1.1b)

Postby free agent » Wed May 20, 2009 10:16 am

beautiful, thank you, now it works great, i dont see a need for improvement :)
0
Last edited by free agent on Wed May 20, 2009 10:34 am, edited 1 time in total.
User avatar
free agent 
 

Re: [Plugin] RotaScale (0.1.1b)

Postby pilou » Wed May 20, 2009 10:30 am

Damned good! :fro: (works in V6 ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] RotaScale (0.1.1b)

Postby thomthom » Wed May 20, 2009 10:41 am

Pilou wrote:works in V6

Thanks for checking that. :) :thumb:
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.1.1b)

Postby pilou » Wed May 20, 2009 12:01 pm

Maybe a suggestion ;)
Scale is XYZ, maybe useful to have also choice X,Y only! :)
:oops: written in the todo list :oops:

:o Seems there are Splat bug when Undo v6 ! (but not repetitive)
0
Last edited by pilou on Wed May 20, 2009 12:16 pm, edited 4 times in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] RotaScale (0.1.1b)

Postby rv1974 » Wed May 20, 2009 12:09 pm

Hi Thom
When I point the 3rd point with (let's say) cntrl key pressed the script should't change original scale. Could you add this feature? It would be nice imo.
Thanks
0

rv1974 
 

Re: [Plugin] RotaScale (0.1.1b)

Postby thomthom » Wed May 20, 2009 12:21 pm

rv1974 wrote:Hi Thom
When I point the 3rd point with (let's say) cntrl key pressed the script should't change original scale. Could you add this feature? It would be nice imo.
Thanks

Yup. That can be done.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.1.1b)

Postby pilou » Wed May 20, 2009 3:46 pm

You can yet make this after the rotate scale with the same tool ;)
3 click more and have a resize as you want ;)
here half size wanted :mrgreen:
bug splat don't come back in the v6...curious :shock:
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] RotaScale (0.1.1b)

Postby thomthom » Wed May 20, 2009 4:12 pm

Pilou wrote:bug splat don't come back in the v6...curious :shock:

Let me know if it comes back.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.1.1b)

Postby thomthom » Wed May 20, 2009 5:44 pm

rv1974 wrote:Hi Thom
When I point the 3rd point with (let's say) cntrl key pressed the script should't change original scale. Could you add this feature? It would be nice imo.
Thanks

It is done. ;)
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.3.0b)

Postby kjc » Thu May 21, 2009 9:26 am

Hi, im sure this plugin will make things much easier, thanks!
I think it would be even more if pressing "ctrl" button would cause "RotaScaleCopy", the way it works in typical rotation and move tools.
0

kjc 
 

Re: [Plugin] RotaScale (0.3.0b)

Postby TIG » Thu May 21, 2009 11:12 am

Thanks for a great idea and an already very polished tool...
A minor problem - there are error messages in my Ruby console relating to the
Code: Select all
float.round_to()
method.
This is not built in to Ruby - the nearest is
Code: Select all
float.round
, I assume you have a round_to.rb auto-loading... perhaps you should include the method code inside your script, I'm sure others will be getting the error ? Here's the code I used to fix it on my PC...
Float-round_toEtc.rb
- it also includes some other methods like float.floor_to etc...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] RotaScale (0.3.0b)

Postby thomthom » Thu May 21, 2009 12:13 pm

I thought it was a ruby method. I googled ruby and rounding and I found some references to float_to which I just tried, and it worked. I guess it's a plugin I have installed which added that method.

Thanks for bringing that to my attention TIG.
Though, if I implement this method, might I not risk causing conflict with other script that also implements this method? I suppose if they act identical it might not be a problem..
...this is why I don't like extending base classes...
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.3.0b)

Postby TIG » Thu May 21, 2009 12:34 pm

I expect it'd be an identical function anyway - I'd change the base class in this case, as it's a pretty safe bet.

You could always call your own version float.round_to_TT [or another weird name] that no one else will use AND then find+replace .round_up with .round_to_TT ? OR you can invent a safe and simple internal def something like:
Code: Select all
def round_to(float,x)
  return((float*10**x).round.to_f/10**x)
end

typical usage would then be...
Code: Select all
view.draw_text(screen_xy, "Angle: #{round_to(angle.radians,1)° - Scale: #{round_to(scale,3)}")

...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] RotaScale (0.3.1b)

Postby thomthom » Thu May 21, 2009 12:48 pm

Updated the plugin in regard to TIG report. Thanks TIG.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.3.1b)

Postby pilou » Mon May 25, 2009 1:55 am

The no Scale on the Z axis will be released?
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] RotaScale (0.3.1b)

Postby thomthom » Mon May 25, 2009 7:19 am

Not sure. I don't fully understand the API on transformations. Need to figure out how first.
I'm currently working on a couple of other plugin projects, this was just a quick distraction. ;)
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.3.1b)

Postby Chris Fullmer » Mon May 25, 2009 7:56 am

t = Geom::Transformation.scaling point, xscale, yscale, zscale

just use 1.0 as the zscale value and it will be good to go!

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] RotaScale (0.3.1b)

Postby thomthom » Mon May 25, 2009 8:31 am

Chris Fullmer wrote:t = Geom::Transformation.scaling point, xscale, yscale, zscale

just use 1.0 as the zscale value and it will be good to go!

Chris


If I do that, it works for points that are picked planar to the model X and Y. But if I pick a point in the model Z axis, things are still being scaled only in the X and Y. Maybe that's what people expect?
IMO that not what I'd expect from this plugin. I expect that if I pick two reference lines in the Z axis, things will get scaled in that direction.

...I suppose that the scaling transformation would have to be transformed to be local to the reference lines?
That's what I'm not sure how to do. Getting the plane of the two reference lines (what happens when they are co-linear) and crossing it with the scaling transformation?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.3.2b) — 11 June 2009

Postby thomthom » Thu Jun 11, 2009 8:22 pm

Minor update to address a problem where V-Ray for Sketchup would not render RotaScaled groups/components correctly.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.3.3b) — 11 June 2009

Postby thomthom » Thu Jun 11, 2009 8:25 pm

Spotted a potential bug. Corrected.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] RotaScale (0.3.3b) — 11 June 2009

Postby free agent » Fri Jun 12, 2009 12:40 am

hi 5
0
User avatar
free agent 
 

Re: [Plugin] RotaScale (0.3.3b) — 11 June 2009

Postby thomthom » Fri Jun 12, 2009 7:16 am

5!
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: zul6041 and 22 guests

Visit our sponsors: