sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] SketchyFFD (Classic)

    Scheduled Pinned Locked Moved Plugins
    412 Posts 153 Posters 419.2k Views 153 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • BurkhardB Offline
      Burkhard
      last edited by

      First page!

      [http://www.ia-plus.de(http://www.ia-plus.de)]

      1 Reply Last reply Reply Quote 0
      • plot-parisP Offline
        plot-paris
        last edited by

        since switching to SketchUp 7 I can only use the default 3x3 lattice. any user defined deformation matrix doesn't work (the lattice is created, but moving the points doesn't have any effect)... 😕

        1 Reply Last reply Reply Quote 0
        • G Offline
          gbabcock
          last edited by

          Chris,

          Thanks for the great plug-in, it really makes SU into a useful tool!

          I think I found the cause of the problems some are having since with the 22 Aug update. The symptom is that once you use SketchyFFD, you can't change the size of the FFD. For example, if you create a 2x2 FFD you can only use a 2x2 for that session. Closing SU and reopening (or reloading the plug-in) clears it. Also NxN only works when all three dimensions are the same. At least that's what I have observed, and it seems consistent with the posts.

          Starting on line 440 is the following:

          [mod=:2y04bwod]THIS IS VERY OLD CODE, AND NO LONGER REGARDED AS GOOD-PRACTICE [$var ETC].
          THE NEWEST VERSION OF FFD FROM THE PLUGINSTORE IS THE BEST AVAILABLE...[/mod:2y04bwod]

          #Calculate the Bernstein polynomial.
          #Uses a table for speed. 
          #thanks to steven-arts for the idea.
          $binomialTable=[]
          def calcBernstein (i, n, u) #Bernstein Polynomial
              begin
                  binomial=$binomialTable[i][n]
              rescue
                  $binomialTable[i]=[] if($binomialTable[i]==nil)
                  $binomialTable[i][n]=ffdfactorial(n).to_f / (ffdfactorial(n - i).to_f * ffdfactorial(i).to_f)
                  binomial=$binomialTable[i][n]
              end
              #binomial = factorial(n).to_f / (factorial(n - i).to_f * factorial(i).to_f)
              bernstein = binomial * (u**i) * ((1-u)**(n-i))
              return(bernstein)
          end
          

          The 4th line of this section, "$binomialTable=[]", declares the array and initializes it empty. But it is BEFORE the function declaration, so it gets executed only on the initial program load. Once you dimension the array with "binomial=$binomialTable[i][n]" you can't change the dimensions without reinitializing it. I simply moved this line inside the function so it will reinitialize on each call and it works fine.

          I've tested this in SU 7.1.860 with 2x2, 3x3, and random NxN FFD's in the same session with no problems. Hope this helps!

          Glenn

          Glenn

          1 Reply Last reply Reply Quote 0
          • plot-parisP Offline
            plot-paris
            last edited by

            well, that did the trick for me. thanks, Glenn.
            however, there are still some issues sometimes. like that a transformation isn't applied to certain parts of the geometry.

            and I have got two questions/suggestions for improvements for a future version:

            • when you undo an action, the deformation, that has been applied to the geometry will be undone. the changed position of the control vertexes however is not set back. thus, when you undo an unwanted deformation and then move some control vertexes again, the old (undone) transformation is simply added to the new transformation)
              so my question is: is there a way to undo the repositioning of control vertexes alongside the undo-process of the geometry?

            • when you deform a group, then delete the lattice and then create a new ffd lattice, the array of control vertexes is shaped around the old position of the group. in order to correct this you have to explode and regroup the geometry.
              I guess there is now easy way to overcome this problem. but if there was a possibility the plugin could reevaluate a groups position/scale, before creating the lattice, that would be cool.

            1 Reply Last reply Reply Quote 0
            • mariochaM Offline
              mariocha
              last edited by

              Yeah !, that modification came just in time. I needed it for work. Modeling a boat.
              Great work.

              As for the undo, for now I undo twice, one for the geom and one for the vertices. Seems to work fine.

              %(#008000)[Mario C.
              Every rule has exceptions, but some.]

              1 Reply Last reply Reply Quote 0
              • J Offline
                Jim
                last edited by

                Is Chris no longer maintaining this?

                Hi

                1 Reply Last reply Reply Quote 0
                • plot-parisP Offline
                  plot-paris
                  last edited by

                  hey Glenn,

                  marvellous! now it works like a charm. a new matrix is always reliably adjusted to the group's dimensions and - for me even more important - undoing an operation effects geometry and control vertexes at the same time! 😍

                  thank you very much for improving the script, Glenn 👍

                  1 Reply Last reply Reply Quote 0
                  • plot-parisP Offline
                    plot-paris
                    last edited by

                    I do have a question about the workings of this plugin.

                    is the deformation a gradual process? (each change I make with the matrix adds another deformation to the geometry, therefore the order is important)

                    or is it only dependent on the matrix's final state? (no matter if i do 10 changes or a hundred, the final position of control vertexes is important)

                    because if the latter is the case (which I hope), you could - in theory at least - write a mighty modifier plugin not too much unlike 3Ds Max's deformers, where you can assign various preset-deformations to an object.
                    these modifiers are attached to the group, can be switched on/off or their attributes can be adjusted.
                    also you can add several modifiers (like a 'twist', a 'bend', and a 'squeeze' modifier). then the order is important (whether you twist or bend first), which of course can be changed later too...

                    I don't want to know how difficult/impossible it is to write such a script. but just imagine the capabilities! you would add a whole new level of non-destructive controls to SketchUp 😲

                    1 Reply Last reply Reply Quote 0
                    • thomthomT Offline
                      thomthom
                      last edited by

                      @gbabcock said:

                      OK, here's the latest update. This one should fix the problems with control points and subdividing being misaligned with the deformation group.

                      I'd appreciate any feedback to let me know if it's working well.

                      Glenn

                      Maybe better to create a new thread - so the download is at the start of the thread - not buried somewhere randomly in between. If you do that I'll tab this one obsolete and add a link to the new version.

                      Thomas Thomassen — SketchUp Monkey & Coding addict
                      List of my plugins and link to the CookieWare fund

                      1 Reply Last reply Reply Quote 0
                      • P Offline
                        Plasticbricks
                        last edited by

                        Hi guys,

                        I've installed the SketchyFFD plugin by dropping it into my plugins folder but cannot locate it in SU. How do I access it/ turn it on?

                        Thanks.

                        1 Reply Last reply Reply Quote 0
                        • massimoM Offline
                          massimo Moderator
                          last edited by

                          Hi and welcome 😄 . You will find FFD in the context menu (right click). Oh, and remember that this plugin works on grouped geometry.

                          1 Reply Last reply Reply Quote 0
                          • M Offline
                            markbowen
                            last edited by

                            Hiya,

                            Sorry for effectively bumping this post for everyone again but I'm having a real problem getting this plugin to work so was wondering if someone could possibly help?

                            I tried by creating a simple cube, grouping everything and then running the FFD 2x2 on it. I see the point grid appear but then I'm not too sure what to do. I can't select points easily and when I do all that happens is that the points move but the object doesn't change in any way at all, just the points move 😞

                            Has anyone ever seen that before and knows what might be causing this?

                            Many thanks for any help on this.

                            Best wishes,

                            Mark

                            1 Reply Last reply Reply Quote 0
                            • soloS Offline
                              solo
                              last edited by

                              mark

                              Once you have made the cube a group, right click and select the FFD you want, then click on one of the small black crosses to edit the form. Now you can move, scale, rotate one or multiple crosses to deform the shape.
                              When completed close group and delete FFD transformer group.

                              http://www.solos-art.com

                              If you see a toilet in your dreams do not use it.

                              1 Reply Last reply Reply Quote 0
                              • soloS Offline
                                solo
                                last edited by

                                Here is a video of what I mean.

                                Link Preview Image
                                Dropbox - 404

                                favicon

                                (dl.dropbox.com)

                                http://www.solos-art.com

                                If you see a toilet in your dreams do not use it.

                                1 Reply Last reply Reply Quote 0
                                • M Offline
                                  markbowen
                                  last edited by

                                  Thanks. I've finally got the mesh working although sometimes it doesn't always do anything. Probably me being silly or something though.

                                  Off to give some of that a try now.

                                  Many thanks for the help on this.

                                  Best wishes,

                                  Mark

                                  1 Reply Last reply Reply Quote 0
                                  • K Offline
                                    Kman
                                    last edited by

                                    Great! A little confusing, but great!

                                    When life gives you lemons, take them. Because hey... free lemons.

                                    1 Reply Last reply Reply Quote 0
                                    • D Offline
                                      daedaluz
                                      last edited by

                                      Cool! It is very useful and amazing tool. Thanks!

                                      1 Reply Last reply Reply Quote 0
                                      • C Offline
                                        chouaibcl65
                                        last edited by

                                        thank you

                                        1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          jeabdc
                                          last edited by

                                          ThankYou for your Plugins.
                                          ขอบคุณมากครับ(Thailand is Smile Land)

                                          1 Reply Last reply Reply Quote 0
                                          • C Offline
                                            chobs
                                            last edited by

                                            Hi to all. Having a problem when I make an FFD Patch.

                                            Here's the message:

                                            Error: #<ArgumentError: wrong number of arguments(2 for 3)>
                                            C:/Program Files/Google/Google SketchUp 7/Plugins/SketchyFFD.rb:106:in startFFD' C:/Program Files/Google/Google SketchUp 7/Plugins/SketchyFFD.rb:106:in init'
                                            C:/Program Files/Google/Google SketchUp 7/Plugins/SketchyFFD.rb:83:in `call'

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 17
                                            • 18
                                            • 19
                                            • 20
                                            • 21
                                            • 20 / 21
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement