by CPhillips » Wed Feb 06, 2008 6:29 am
Unfortunately, I am out of time to work on this script. If anyone wants to pick it up contact me. The code is simple and (for me) well commented. It needs a UI and bug fixes. Funny thing, I don't really have a need for this script.  But I would love to see what others can do with it. If you make something cool with it post here. Chris 
Install by putting the script in your plugins directory. Instructions: (somewhat out of date. see updates for changes) -Create a group with all the geometry you wish to deform. This group should contain just faces and/or lines. -Right click the group and select one of the options in the FFD submenu. Either 2x2 or 3x3 or NxN FFD. Depending on the size of the model it could take a while (seconds I hope). At the end you should see a new group containing nothing but control points -Open the control point group and move the control points as you wish. The object should deform as you move the points. NOTE: it can take a long time for complex models. Look at the status bar in the lower left to see the status of the deformation. Bugs and limitations: -BUG. If you start a FFD and the control points don't match the object you need to explode and regroup the object. Then try the FFD again. -Only one FFD at a time. The script uses a few globals for speed. -Only works on geometry in a group and only one layer deep. -Sometimes hidden edges don't move right. Dont know why. Might be a bug in Sketchup. 
Update: Fixed a bug. Update Feb 12. New version: -Support for NxN deforms. -Mesh automatically when you move control points. -Added status text progress when it is weighing and deforming the mesh. Update Mar 21. -Moved all FFD right click menu items to a sub menu. -Fixed a bug that forced you to have a least 2 control point in each direction. You can now have do 2D grids. IE. 1x4x3. -Added an option to create a NxN 2d patch. A grid with a control point at each intersection. Updated May 9 2008 -Added ability to lock edges in the mesh so they don't move during FFD. Select edges then right click->FFD->Lock edges. -Added an option to subdivide the mesh when doing a NxN deformation. Updated Aug 24 2009 -Optimized the initial weighting to be about 3x faster. Idea by Stefan. Updated 20110810 by TIG -Code is now inside a module, all $ variables now @@ or @ types, the flaky observer code is fixed. Updated 20130203 by TIG - Recently reported NxN issues with NaN [0.0/0.0] & Infinity [1.0/0.0] fixed, which occurred when selected group was 2d & NxN height=1 and the NxN dialog now remembers the last used values that session for the NxN lattice [width, depth, height, subdivide]...
SketchyFFD.rb Older versions are listed below... BUT get the latest version from the PluginStore: Download
Last edited by TIG on Mon Apr 15, 2019 9:51 am, edited 21 times in total.
Reason: Updated Plugin Date
-
CPhillips
- PluginStore Author

-
- Posts: 1087
- Joined: Fri Nov 23, 2007 11:12 pm
by kwistenbiebel » Wed Feb 06, 2008 12:13 pm
Wow Chris, Thank you for sharing this ruby. That is a great contribution!
[EDIT]: the ruby doesn't seem to work on my PC. updating the FF seems broken. I must be doing something wrong....(I tried it on a sphere)
-
kwistenbiebel
-
- Posts: 2726
- Joined: Thu Nov 22, 2007 6:13 pm
by remus » Wed Feb 06, 2008 1:04 pm
cheers chris, just had a really quick go with it and it seems to work fine for me. Thanks for all the work youve already put into this.
-
remus
-
- Posts: 8044
- Joined: Fri Nov 30, 2007 8:48 am
- Location: UK
- Name: remus
-
by Daniel S » Wed Feb 06, 2008 2:47 pm
Fantastic script Chris!!! Hope that somebody pick it up and help with the UI. It works very fast!! To show interactively the deformation of the group in wireframe mode (like in Fredo6´s Shear) would be a good feature... perhaps will go more slow.. but will be a time saver because you don´t have to close the group, make a right click and select Update FFD and then wait to see if is the deformation you wanted and then make all the process again to fix it. This is other ruby that looks like a SU7 feature  . Thank You!!!!!! Daniel S
-
Daniel S
-
- Posts: 341
- Joined: Mon Nov 12, 2007 6:06 pm
- Location: Mar del Plata, Buenos Aires, Argentina
- Operating system: Windows
- SketchUp version: 2015
- License type: Pro
- SketchUp use: product design
- Level of SketchUp: Intermediate
-
by pilou » Wed Feb 06, 2008 3:38 pm
impressive task  Works fine except the control points stay on the screen after deformation 
-

pilou
- Top SketchUcator
-
- Posts: 21190
- Joined: Wed Jan 23, 2008 10:33 pm
- Name: Pilou
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by boofredlay » Wed Feb 06, 2008 4:29 pm
Pilou wrote:impressive task  Works fine except the control points stay on the screen after deformation 
That is the new group created by the FFD. You can simply delete or hide it when done with it. This is great! Thanks for this script.
-

boofredlay
- Global Moderator
-
- Posts: 9529
- Joined: Mon Oct 22, 2007 1:50 pm
- Location: Huntsville/Madison Alabama
- Name: Eric Lay
- Operating system: Windows
- SketchUp version: 2018
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by boofredlay » Wed Feb 06, 2008 4:44 pm
Here is a quickie test. I drew a circle with 24 segments and copy/push/pull. Then I ran the script and moved the points. This is one more step towards organics indeed. 
-

boofredlay
- Global Moderator
-
- Posts: 9529
- Joined: Mon Oct 22, 2007 1:50 pm
- Location: Huntsville/Madison Alabama
- Name: Eric Lay
- Operating system: Windows
- SketchUp version: 2018
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by pilou » Wed Feb 06, 2008 4:48 pm
That is the new group created by the FFD. You can simply delete or hide it when done with it.
THX: very simple indeed ! 
-

pilou
- Top SketchUcator
-
- Posts: 21190
- Joined: Wed Jan 23, 2008 10:33 pm
- Name: Pilou
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by krash88 » Thu Feb 07, 2008 2:11 pm
It looks great in it's current form, but I get this error in the console... Maybe I'm doing something wrong...
Error: #<NoMethodError: undefined method `definition' for #<Sketchup::Group:0xbec0960>> C:/Program Files/Google/Google SketchUp 6/Plugins/SketchyFFD.rb:224:in `analizeLattice' C:/Program Files/Google/Google SketchUp 6/Plugins/SketchyFFD.rb:60:in `updateFFD' C:/Program Files/Google/Google SketchUp 6/Plugins/SketchyFFD.rb:13 C:/Program Files/Google/Google SketchUp 6/Plugins/SketchyFFD.rb:13:in `call'
-
krash88
-
- Posts: 30
- Joined: Mon Feb 04, 2008 9:02 pm
by Mike Lucey » Thu Feb 07, 2008 5:55 pm
Thanks Chris, this could really be a useful Ruby for SketchUp. I hope someone picks it up (as you say) and copper fastens it. Even if they don't I imagine you will in your own good time finalise the Script Mike
-

Mike Lucey
- Mayor
-
- Posts: 7706
- Joined: Mon Oct 22, 2007 1:22 pm
- Location: Co. Clare, Ireland
- Name: Mike Lucey
- Operating system: Mac
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by CPhillips » Thu Feb 07, 2008 7:38 pm
krash88 wrote:It looks great in it's current form, but I get this error in the console... Maybe I'm doing something wrong...
Error: #<NoMethodError: undefined method `definition' for #<Sketchup::Group:0xbec0960>> C:/Program Files/Google/Google SketchUp 6/Plugins/SketchyFFD.rb:224:in `analizeLattice' C:/Program Files/Google/Google SketchUp 6/Plugins/SketchyFFD.rb:60:in `updateFFD' C:/Program Files/Google/Google SketchUp 6/Plugins/SketchyFFD.rb:13 C:/Program Files/Google/Google SketchUp 6/Plugins/SketchyFFD.rb:13:in `call'
Ooops! I fixed it and updated the script in the original post. Kwistenbiebel this is probably the same bug you were seeing. Chris
-
CPhillips
- PluginStore Author

-
- Posts: 1087
- Joined: Fri Nov 23, 2007 11:12 pm
by CPhillips » Fri Feb 08, 2008 12:20 am
Coen Naninck wrote:I can't get this script to work. Nothing happens. I create a sphere, group it, right-click and do 3x3 FFD, enter the new group with Construction Points, move some to another position, exit the group, right-click the sphere group and choose Update FFD. Nothing happens.
Can you open the ruby console and see if it is printing any errors? Chris
-
CPhillips
- PluginStore Author

-
- Posts: 1087
- Joined: Fri Nov 23, 2007 11:12 pm
by kwistenbiebel » Fri Feb 08, 2008 3:58 am
...exactly the same here. I see no errors in the ruby panel though.
-
kwistenbiebel
-
- Posts: 2726
- Joined: Thu Nov 22, 2007 6:13 pm
by CPhillips » Fri Feb 08, 2008 4:21 am
kwistenbiebel wrote:...exactly the same here. I see no errors in the ruby panel though.
Wow. I tried it on 2 different machines and it works. Maybe you are using a Mac? Altho I don't see why that would make any difference..
-
CPhillips
- PluginStore Author

-
- Posts: 1087
- Joined: Fri Nov 23, 2007 11:12 pm
by kwistenbiebel » Fri Feb 08, 2008 5:38 am
Does the plugin in any means uses web based 'action script' or 'javascript' as I had trouble before with corrupt Iexplorer settings? (I refer to web panel based plugins like Skindigo that failed in the past on my pc due to 'script blockers' )
-
kwistenbiebel
-
- Posts: 2726
- Joined: Thu Nov 22, 2007 6:13 pm
by boofredlay » Fri Feb 08, 2008 5:49 am
It is working fine on my home machine as well as my work machine. Both pc on xp. One new, the other 8 years old. 
-

boofredlay
- Global Moderator
-
- Posts: 9529
- Joined: Mon Oct 22, 2007 1:50 pm
- Location: Huntsville/Madison Alabama
- Name: Eric Lay
- Operating system: Windows
- SketchUp version: 2018
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by CPhillips » Fri Feb 08, 2008 5:51 am
kwistenbiebel wrote:Does the plugin in any means uses web based 'action script' or 'javascript' as I had trouble before with corrupt Iexplorer settings? (I refer to web panel based plugins like Skindigo that failed in the past on my pc due to 'script blockers' )
No other scripts at all. Just pure ruby. Hrmm. Very strange. Try doing a 2x2 FFD on a simple box. With the ruby console open in case of errors.
-
CPhillips
- PluginStore Author

-
- Posts: 1087
- Joined: Fri Nov 23, 2007 11:12 pm
by Dave R » Fri Feb 08, 2008 2:35 pm
Very cool script. Thank you. I do seem to being doing something wrong with it though. (Leave it to me to break it.  ) See the attached screen grab. I drew a sphere centered on the blue axis and above the ground plane. After moving a single point marked at the top and updating, the egg moved off to where it is now. What did I do wrong? FFD1.JPG
Etaoin Shrdlu
%
(THERE'S NO PLACE LIKE)
G28 X0.0 Y0.0 Z0.0
M30
%
-

Dave R
- Global Moderator
-
- Posts: 18189
- Joined: Tue Nov 13, 2007 11:52 pm
- Location: SE Minnesota
- Name: Dave R
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Advanced
by krash88 » Fri Feb 08, 2008 2:39 pm
CPhillips wrote:krash88 wrote:It looks great in it's current form, but I get this error in the console... Maybe I'm doing something wrong...
Error: #<NoMethodError: undefined method `definition' for #<Sketchup::Group:0xbec0960>> C:/Program Files/Google/Google SketchUp 6/Plugins/SketchyFFD.rb:224:in `analizeLattice' C:/Program Files/Google/Google SketchUp 6/Plugins/SketchyFFD.rb:60:in `updateFFD' C:/Program Files/Google/Google SketchUp 6/Plugins/SketchyFFD.rb:13 C:/Program Files/Google/Google SketchUp 6/Plugins/SketchyFFD.rb:13:in `call'
Ooops! I fixed it and updated the script in the original post. Kwistenbiebel this is probably the same bug you were seeing. Chris
It works great now! thanks for the fix!
-
krash88
-
- Posts: 30
- Joined: Mon Feb 04, 2008 9:02 pm
by CPhillips » Fri Feb 08, 2008 7:14 pm
Dave R wrote:Very cool script. Thank you. I do seem to being doing something wrong with it though. (Leave it to me to break it.  ) See the attached screen grab. I drew a sphere centered on the blue axis and above the ground plane. After moving a single point marked at the top and updating, the egg moved off to where it is now. What did I do wrong? FFD1.JPG
It looks like you did a "Update FFD" without first closing the control point group. Chris
-
CPhillips
- PluginStore Author

-
- Posts: 1087
- Joined: Fri Nov 23, 2007 11:12 pm
by Dave R » Fri Feb 08, 2008 9:48 pm
Yup. That's what I did alright. Thanks for the help. Dave
Etaoin Shrdlu
%
(THERE'S NO PLACE LIKE)
G28 X0.0 Y0.0 Z0.0
M30
%
-

Dave R
- Global Moderator
-
- Posts: 18189
- Joined: Tue Nov 13, 2007 11:52 pm
- Location: SE Minnesota
- Name: Dave R
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Advanced
by Dave R » Mon Feb 11, 2008 12:07 am
Coen's post makes me ask, is there anyway to make this work on a component instead of or in addition to a group?
Etaoin Shrdlu
%
(THERE'S NO PLACE LIKE)
G28 X0.0 Y0.0 Z0.0
M30
%
-

Dave R
- Global Moderator
-
- Posts: 18189
- Joined: Tue Nov 13, 2007 11:52 pm
- Location: SE Minnesota
- Name: Dave R
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Advanced
by Dave R » Mon Feb 11, 2008 12:22 pm
Where's the "dope slap" smilie? I was doing it in reverse, trying to make a group of a components. Thanks Coen. I gotta think inside the box. 
Etaoin Shrdlu
%
(THERE'S NO PLACE LIKE)
G28 X0.0 Y0.0 Z0.0
M30
%
-

Dave R
- Global Moderator
-
- Posts: 18189
- Joined: Tue Nov 13, 2007 11:52 pm
- Location: SE Minnesota
- Name: Dave R
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Advanced
by CPhillips » Mon Feb 11, 2008 10:18 pm
Coen Naninck wrote:You're welcome Dave!
What's a dope slap though?
Also, I have been experimenting more with this script. I had an idea to position the cloned Construction Points along a series of curved Edges that you usually see used on Soap Skin Bubble examples, but I haven't been successful. I am trying to see (and would like Chris to shed some light on this) if the Construction Points have coordinates assigned to them. What I mean is that if I clone the Construction Points from the top and use them in the bottom will this distort the FFD? Should I therefor use the top ones? Well I tested this and it does seem so that there are coordinates assigned to them because by running two tests, one with using the Construction Points from above and the other test by using the bottom ones, and the result were different. The second test is what you see below, which brings me to another point - it is interesting to see what kind of curvy geometry you can create with this script, cloning Construction Points and positioning them. I hope I can find a way to understand how to exactly control them so it becomes easy to make any kind of curved geometry I had hoped to create in the first place.
As it is currently written it creates the construction points at fixed points and then weights the model based on that initial position. I am actually surprised that coping the construction points works at all.  I think what you are asking for is: Take this mesh and start FFD with this group of arbitrary positioned control points. That should be possible and probably not to difficult. But you would have to be careful. When you start a FFD it creates a table of weights for each construction point with 3 floats per vertex in the group to deform. So if you have a mesh with 1000 verts and a 3x3 set of control points: 3x3x3=27 control points 27*1000*3=81,000 floats When you update it loops through each vertex and calculates how much to move it based on the weighted changes in the control point. So the more control points you have the slower it is. In your picture it looks like you have 9x9x3 control points. That comes to 729,000 floats. It would be really really slow to deform. Chris
-
CPhillips
- PluginStore Author

-
- Posts: 1087
- Joined: Fri Nov 23, 2007 11:12 pm
by juju » Mon Feb 11, 2008 11:08 pm
I'd take "really really slow" over "no such function at all" any day.
Save the Earth, it's the only planet with chocolate.
-

juju
- Premium Member

-
- Posts: 2748
- Joined: Mon Oct 22, 2007 1:45 pm
- Location: Durbanville, Cape Town, South Africa.
- Name: Juju
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Intermediate
by Pixero » Mon Feb 11, 2008 11:21 pm
I think its pretty clear what he means. He much rather have a slow tool that does what he wants then not having that tool at all.
-

Pixero
-
- Posts: 2654
- Joined: Thu May 24, 2018 12:49 pm
- Location: Halmstad, Sweden
- Name: Pixero
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by CPhillips » Mon Feb 11, 2008 11:45 pm
Coen Naninck wrote:The example in the pic takes a few seconds to deform.
So do the points placed actually have different coordinates assigned to them? That's what I was asking in my previous post. I find it kinda hard to explain, I hope you know what I mean.
Yes they do. Each construction point has its original position stored in an attribute. Thats how I know how far the point moved. But that is only 1/2 the equation. You also need the pre-calculated weight. That is what is missing when you copy a control point. Its that quick because it doesn't have all the calculated weights to process. If you want to try it with more control points do this: -Select the group you want to deform. -Open the ruby console and enter the following line: startFFD(Sketchup.active_model.selection[0],7.0) That will create a 8x8 control grid (8-1=7.0). Delete the points you don't intend to move to make it a bit faster.
-
CPhillips
- PluginStore Author

-
- Posts: 1087
- Joined: Fri Nov 23, 2007 11:12 pm
by CPhillips » Tue Feb 12, 2008 8:22 am
I made a new version that has a NxN FFD. That means you can select how many control points there are in each direction. It isn't as slow as I expected. Here is a 12x12x2. I am playing back my undo buffer so it looks faster than it is. 
Ill post it once I fix a bug or two. Just when I thought I was out they pull me back in. Chris
-
CPhillips
- PluginStore Author

-
- Posts: 1087
- Joined: Fri Nov 23, 2007 11:12 pm
by juju » Tue Feb 12, 2008 11:17 am
Coen Naninck wrote:Juju wrote:I'd take "really really slow" over "no such function at all" any day.
Juju, I find your replies are often cryptic. What's the bottom line?
Pixero wrote:I think its pretty clear what he means. He much rather have a slow tool that does what he wants then not having that tool at all.
Exactly! Thanks for clearing that up for me.
Save the Earth, it's the only planet with chocolate.
-

juju
- Premium Member

-
- Posts: 2748
- Joined: Mon Oct 22, 2007 1:45 pm
- Location: Durbanville, Cape Town, South Africa.
- Name: Juju
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Intermediate
by Fletch » Wed Feb 13, 2008 7:29 am
Can't wait to play with this, Chris, thank you from the bottom of my heart... been wishing for this for a loooong time.
-
Fletch
- Twilight Render
-
- Posts: 732
- Joined: Wed Nov 14, 2007 1:02 am
- Location: Milwaukee, WI USA / Rovinj, Croatia
- Name: Fletch
- Operating system: Windows
- SketchUp version: 2017
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by Ad Machine » 5 minutes ago
-
Ad Machine
- Robot
-
- Posts: 2012
-
Return to Plugins
|