[Plugin] Scale2Face.rb

[Plugin] Scale2Face.rb

Postby su30 » Fri Jul 17, 2009 10:05 am

Hi all,

I have a collection of groups and components, they are in different dimensions and different shapes, and I want them to become taller or shorter in the way of scaling by z, so that all the grp/compo will have a certain height defined by the target face I gave. Actually I hope the target face is not only a flat face, but also some slope or curve face or a face collection, I think this script may have some relationship with the drop.rb, but I am not sure if it's easy to write.I wish someone can help me on this!
Many thanks for taking care no matter it's solved or not!
0
Last edited by su30 on Mon Jul 20, 2009 3:07 am, edited 1 time in total.
su30

su30 
 

Re: [REQ] Scale2Face

Postby daiku » Fri Jul 17, 2009 2:30 pm

Check out FredoScale. In particular, the "scale to target" and "stretch to target" modes.
0
User avatar
daiku 
PluginStore Author
PluginStore Author
 

[Plugin] Scale2Face v1.3

Postby TIG » Fri Jul 17, 2009 3:51 pm

Here's a Ruby that'll do it [please change the original post's title to [Plugin]...]

. scale2face.rb

Usage:
Select face(s) & group/component-instance(s) located below face(s).

Unacceptable selections produce error dialogs.

Pick 'Scale2Face' off the Plugins Menu
or type scale2face in the Ruby Console.

The selected items will be
scaled upwards [in the Z] until their CLs meet the face or faces.

Any intermediate faces etc are ignored; the scaling passes through them.

It has a one step un-do.

To Do: Alternative orientations to just the UP in Z.
E.G. down and in XY

Version: 1.0 20090717 First Release.
1.1 20090721 Tweaked to avoid height glitches.
1.2 20090811 Multi-face support added. Error msgs disabled.
1.3 20090819 Now works within groups/component edits.

scale2face.rb
0
Last edited by TIG on Wed Aug 19, 2009 1:28 pm, edited 6 times in total.
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Scale2Face

Postby free agent » Fri Jul 17, 2009 7:01 pm

wow TIG nice one, and good idea, that couldve saved me some time a couple projects ago :thumb:
0
User avatar
free agent 
 

Re: [Plugin] Scale2Face

Postby utiler » Sat Jul 18, 2009 1:01 am

Very cool indeed!!! Just wondering TIG; will this script work when you want to extend a wall top to a sloping roof for instance? :thumb:
0
purpose/expression/purpose/....
User avatar
utiler 
Top SketchUcator
 

Re: [Plugin] Scale2Face

Postby su30 » Mon Jul 20, 2009 3:25 am

TIG wrote:Here's a Ruby that'll do it [please change the original post's title to [Plugin]...]
. scale2face.rb
Usage: Select a face and some groups/component-instances that are
located below that face.
Pick 'Scale2Face' off the Plugins Menu or type scale2face in the Ruby
Console.
Unacceptable selections produce error dialogs.
The selected items will be
scaled upwards [in the Z] until their CLs meet the face.
If items CLs do not intersect with the face then they are not scaled
and there's a closing message...
Any intermediate faces etc are ignored and the scaling passes through
them.
It has a one step un-do.

To Do: Alternative orientations not just the UP in Z.

TIG,
I have to say you are great! It's not the first time that my request answered by you quickly,
your describe for the script is what exactly what I am searching for, and even more that I didn't image.
I changed the title of this thread and tested the script, but some unexpected results comes,
the items were not scaled correctly, I think there must be some difference happens between our system condition,
do you remember the 'lines2component.rb' last time you write? I found nearly the same thing happened this time.
0
su30

su30 
 

Re: [Plugin] Scale2Face.rb

Postby TIG » Mon Jul 20, 2009 12:08 pm

su30

What's the nature of the problem you are having ? I quickly churned out this first version... It might be buggy. Are you components originally drawn so that their eventual Z is the model Z etc ? Please try it using a simple box component (say 500x500x1000mm high and see if that [or several copies] scales up to a selected face ? Because the component instance is stretched up in the Z it must be consistent in its XY cross-section, otherwise it will distort... If you want to keep the base detail unchanged and simply want the top faces of the instances' to stretch up [with the base detail remaining unchanged] then the script would need to make each instance 'unique' and then change its definition - finding its top face and then using '.move!' on it to relocate it up at the face-intersect Z to suit...

Please feedback - I don't like flaky scripts out there with my name on...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Scale2Face.rb

Postby su30 » Tue Jul 21, 2009 9:08 am

TIG

I used the script and followed the steps, but this happened every time,
this is the feed back, please check the picture bellow:
0
su30

su30 
 

Re: [Plugin] Scale2Face.rb

Postby TIG » Tue Jul 21, 2009 2:28 pm

su30

I'm getting the exact same problems ! I didn't before - I am investigating...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Scale2Face.rb v1.1

Postby TIG » Tue Jul 21, 2009 4:50 pm

Version 1.1 is here...
viewtopic.php?p=173374#p173374
Fixed the glitch [I think]...
Code was all messed up somehow !!!
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Scale2Face.rb

Postby su30 » Wed Jul 22, 2009 3:35 am

TIG

Here is a simple feedback of the script,
scale items to a single slope.
It works pretty fine with the boxes in group and component,
but a little problem with 'Bryce', a face camera component.
picture followed...
0
su30

su30 
 

Re: [Plugin] Scale2Face.rb

Postby su30 » Wed Jul 22, 2009 4:07 am

This is another test for v1.1
groups, components, single slope
components are in different x,y,z position, and in different x,y,z scale,
it proves good with these items.
now the plugin works when only 1 face was selected, I don't know if it is possible to do it on multi faces or curve face,
maybe you have already worked on it, TIG.
Sorry that I can't reply on time because the time difference...
0
su30

su30 
 

Re: [Plugin] Scale2Face.rb

Postby TIG » Wed Jul 22, 2009 9:15 am

I have considered multiple faces and have a draft almost ready...

I don't know why 'Bryce' fails - I suspect it's because the face was originally draw flat on the Z plane and then tilts up to 'face-me' ? I'll look at it...

In passing: I've also got an early draft for a 'Stretch2Face' Ruby that takes works with groups and faces; the topmost vertices of any vertical faces in the group get moved up to snap onto the face(s) selected - that way you could easily stretch the top of a wall face up to the underside of a sloping or even curved roof ?

Thanks for the feedback, any other ideas or problems please let me know... :)
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Scale2Face.rb

Postby su30 » Wed Jul 22, 2009 10:06 am

yes I am looking forward for the multi_face version
this script will be very efficiency while editing a big amount of components, and I think it is promising.
thank you TIG for the excellent work!
0
su30

su30 
 

Re: [Plugin] Scale2Face.rb

Postby su30 » Fri Jul 31, 2009 10:52 am

TIG, I am wondering if you have some process script I can have a try?
still watching this ^_^
0
su30

su30 
 

Re: [Plugin] Scale2Face.rb

Postby TIG » Fri Jul 31, 2009 6:53 pm

Very busy - maybe next week ? :|
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Scale2Face.rb

Postby dtrarch » Mon Aug 03, 2009 4:54 pm

Hi All
Didier's [Project_faces_vector.rb] will put selected face on inclined plane.
Just draw a reference line vector in the direction wanted for projection path.

dtr
0

dtrarch 
Premium Member
Premium Member
 

Re: [Plugin] Scale2Face.rb

Postby su30 » Wed Aug 05, 2009 4:57 am

TIG wrote:Very busy - maybe next week ? :|

Sure TIG, in no hurry :)
0
su30

su30 
 

Re: [Plugin] Scale2Face.rb

Postby j_forrester » Mon Aug 10, 2009 3:04 pm

Great Plugin btw,
Just wondered if there are any developments of a version that takes into account a sloped surface instead of a flat plane?

Many thanks
0

j_forrester 
 

Re: [Plugin] Scale2Face.rb

Postby utiler » Mon Aug 10, 2009 11:09 pm

j_forrester wrote:Great Plugin btw,
Just wondered if there are any developments of a version that takes into account a sloped surface instead of a flat plane?

Many thanks


Ditto.
I think this would be neat!!!
0
purpose/expression/purpose/....
User avatar
utiler 
Top SketchUcator
 

Re: [Plugin] Scale2Face.rb v1.2

Postby TIG » Tue Aug 11, 2009 9:24 am

At long last :berserk: version v1.2 is now available.
Link: viewtopic.php?p=173374#p173374

It Scales any Selected Component-instances/Groups up in Z to Selected Faces above them. It works for curved Surfaces, but remember that it Scales to all Selected Faces... so if you select a horizontal cylinder its whole curved Face gets Selected (which is actually Face facets) and therefore it Scales to the lower [nearer] Faces and then the upper Faces - if you want to Scale to just the lower [nearer] Faces you must first switch on Hidden Geometry and them Select just the lower Face facets required and it then Scales things just to those...

Feedback please
0
Last edited by TIG on Tue Aug 11, 2009 12:37 pm, edited 1 time in total.
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Scale2Face.rb

Postby j_forrester » Tue Aug 11, 2009 12:28 pm

TIG,

Tried and tested.

Works absolutely perfect! Many thanks this will be a great help.
0

j_forrester 
 

Re: [Plugin] Scale2Face.rb

Postby olishea » Tue Aug 18, 2009 5:14 pm

nice plugin, thank you
0
oli
User avatar
olishea 
Premium Member
Premium Member
 

Re: [Plugin] Scale2Face.rb

Postby rv1974 » Wed Aug 19, 2009 12:41 pm

Tig it doesn't work within groups :cry:
And maybe clicking 3 points instead of face would be better solution?
Thank you (I mean it!)
0

rv1974 
 

Re: [Plugin] Scale2Face.rb v1.3

Postby TIG » Wed Aug 19, 2009 1:30 pm

rv1974 wrote:Tig it doesn't work within groups :cry:
And maybe clicking 3 points instead of face would be better solution?
Thank you (I mean it!)


It does work inside groups etc now !

See here for v1.3 viewtopic.php?p=173374#p173374

Easy fix ray[1].last gives face if in group/component edit mode... :D :geek: :ugeek:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Scale2Face.rb

Postby xrok1 » Sun Apr 11, 2010 4:48 pm

don't know how i missed this one :oops:
Thankyou! :D
0
“There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

http://www.Twilightrender.com try it!

xrok1 
 

Re: [Plugin] Scale2Face.rb

Postby xrok1 » Sun Apr 11, 2010 4:53 pm

j_forrester wrote:Great Plugin btw,
Just wondered if there are any developments of a version that takes into account a sloped surface instead of a flat plane?

Many thanks

it would be awsome if the scaled face matched the shape/angle of the scaled to face. any plans?
0
“There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

http://www.Twilightrender.com try it!

xrok1 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: Debora Macedo, Google Bot, ljus, ngoctung0211, userid7 and 12 guests

Visit our sponsors: