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

    Greeble Beta (Updated Feb-06-2009)

    Scheduled Pinned Locked Moved Developers' Forum
    69 Posts 15 Posters 7.2k Views 15 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.
    • thomthomT Offline
      thomthom
      last edited by

      @chris fullmer said:

      EDIT: If any Ruby coders are still following this thread, I am having problems that some greebles end up overlapping other faces and then delete faces that are queued to be greebled, then my script stops because it runs across a face that has been deleted. At least that is what I think is happening. So to solve that do I need to test each face to make sure it is not delete before I run the offset and push/pull?

      If you are trying to modify deleted objects then you should get an error in the console about that. If that's your problem then do a .valid? test on the entity you try to work with.

      I'm currently working on a script where I clean up the model, deleting lots of stuff and I've run into all sorts of problems as things shifts around when you delete entities. It seems the best is to loop over an array copy of entities which you've collected in before hand.

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

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        OK, so I'm getting some conflicting reports here (between my home and work computer). I've uploaded the most recent version. It works perfectly on my office XP, SU7 computer. I found a bug that caused SU6 to not work. It should now be working perfectly in 6. But it is not working on my home Vista SU7 machine. So if anyone has troubles with it now, let me know the SU version number and the platform. Thanks!

        Chris

        EDIT: If any Ruby coders are still following this thread, I am having problems that some greebles end up overlapping other faces and then delete faces that are queued to be greebled, then my script stops because it runs across a face that has been deleted. At least that is what I think is happening. So to solve that do I need to test each face to make sure it is not delete before I run the offset and push/pull?

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • Chris FullmerC Offline
          Chris Fullmer
          last edited by

          Thanks Thom, I think that is what the problem is. I am getting this error

          Error: #<TypeError: reference to deleted Face>

          and it happens when I am repeatedly apply greeble to very messy geometry - like faces that have been greebled many times already and are overlapping all over the place. Eventually it just breaks with that error. I'll add a validity check, and hopefully that will clear it up. I don't think I can keep rechecking the model entities though because the script creates so much geometry that I don't want touched. I only want it to work on the faces that exist before I begin the script. But the more intertwined those faces are, the more likely I am te have one of them overlap and delete a face that has not been greebled, thereby breaking the script. So, I'll try the a.valid and see if that does the trick. Thanks Thom!

          Chris

          Lately you've been tan, suspicious for the winter.
          All my Plugins I've written

          1 Reply Last reply Reply Quote 0
          • R Offline
            RickW
            last edited by

            Definitely test with face.valid?

            if face.valid?
              #do code here
            end
            

            As for SU6/7 issues, it could be an issue of the model.start_operation(name,true) breaking SU6, since SU6 only takes one argument. I use this:

            (Sketchup.version[0,1].to_i<7) ? (view.model.start_operation "name here") ; (view.model.start_operation "name here", true)
            
            

            obviously changing "name here" to something a bit more descriptive 😄

            RickW
            [www.smustard.com](http://www.smustard.com)

            1 Reply Last reply Reply Quote 0
            • Chris FullmerC Offline
              Chris Fullmer
              last edited by

              Heyhey! My code is similar, and that makes me happy. I'm using

              		a = Sketchup.version
              		b = a[0,1].to_i
              		if b > 6
              			model.start_operation("Greeble", true)
              		else
              			model.start_operation("Greeble")
              		end
              

              I like how your code consolidates it all down to just 2 lines though. I already can see all the extra fluff I have in there, so I'll clean it up.

              The reason it was not working before is because I accdidentally had written if b >= 6 and clearly I don't want the equal sign. So I've removed it and tested it on 6 on my XP machine and it works great.

              I'll implement the valid check after I'm done being busy with work 😞

              Chris

              Lately you've been tan, suspicious for the winter.
              All my Plugins I've written

              1 Reply Last reply Reply Quote 0
              • T Offline
                tomot
                last edited by

                chris:
                I just d/l'ed the latest greeble here is a pic, from Vista64 using SU6


                greeble.png

                [my plugins](http://thingsvirtual.blogspot.ca/)
                tomot

                1 Reply Last reply Reply Quote 0
                • Chris FullmerC Offline
                  Chris Fullmer
                  last edited by

                  I'm not on my Vistaq machine right now, but that is the same error I was getting on it running SU7. But SU6 and 7 both work on my XP machine here at work right now. So it looks like a Vista issue. I'll see if I can find anything in the code that looks a little shaky ( 🤣 well, it ALL looks a little shaky honestly). I haven't really heard of plugins that work on XP but not Vista.

                  Chris

                  Lately you've been tan, suspicious for the winter.
                  All my Plugins I've written

                  1 Reply Last reply Reply Quote 0
                  • Chris FullmerC Offline
                    Chris Fullmer
                    last edited by

                    Hi Pilou, could you specifiy if that is on XP, Vista, or Mac? Thanks!

                    Chris

                    Lately you've been tan, suspicious for the winter.
                    All my Plugins I've written

                    1 Reply Last reply Reply Quote 0
                    • R Offline
                      RickW
                      last edited by

                      @chris fullmer said:

                      I like how your code consolidates it all down to just 2 lines though. I already can see all the extra fluff I have in there, so I'll clean it up.

                      If the forum didn't wrap the line, you would see a single line of code. 😄 It's called a "ternary expression" since it has three parts (binary is 2 parts, ternary is 3 parts), and it is essentially just a very compact if:then:else statement.

                      The parts are:
                      (argument) ? (result_if_true) : (result_if_false)

                      It's best for short tests, but will work for longer ones, and you can nest them:

                      def guessme(x=10)
                        my_number = rand(x.to_i)+1
                        while (guess = ((UI.inputbox(["Guess a number between 1 and #{x} inclusive;"]))[0]).to_i)
                          (guess == my_number) ? (UI.messagebox("You're right!");return nil) ; (return nil if UI.messagebox("Too #{(guess>my_number) ? ("high") ; ("low")}. Try again?", MB_YESNO)==7)
                        end
                      end
                      
                      

                      RickW
                      [www.smustard.com](http://www.smustard.com)

                      1 Reply Last reply Reply Quote 0
                      • Chris FullmerC Offline
                        Chris Fullmer
                        last edited by

                        Yikes, I do not fluently read ternary expressions then. I can see sort of what its doing, but there's a lot in there I don't get. Maybe in time 😄 Also Rick, I am getting this error:

                        Error; #<ArgumentError; Cannot create unit vector from zero length vector>
                        C;/Program Files/Google/Google SketchUp 7/Plugins/offset.rb;49;in `parallel?'
                        C;/Program Files/Google/Google SketchUp 7/Plugins/offset.rb;49;in `offset'
                        C;/Program Files/Google/Google SketchUp 7/Plugins/offset.rb;39;in `upto'
                        C;/Program Files/Google/Google SketchUp 7/Plugins/offset.rb;39;in `offset'
                        C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;159;in `greeble'
                        C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;137;in `each'
                        C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;137;in `greeble'
                        C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;200
                        C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;200;in `call'
                        

                        I'm sure its because I'm passing bad geometry to your offset script. What do I need to check so as to not pass bad geometry to offset.rb? Thanks!

                        Chris

                        Lately you've been tan, suspicious for the winter.
                        All my Plugins I've written

                        1 Reply Last reply Reply Quote 0
                        • pilouP Offline
                          pilou
                          last edited by

                          Seems works fine 6 & 7 😉
                          Even for the "Tin" ☀
                          Bravo! 😎
                          XP on PC 😉


                          tin.jpg

                          Frenchy Pilou
                          Is beautiful that please without concept!
                          My Little site :)

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

                            @rickw said:

                            I use this:

                            (Sketchup.version[0,1].to_i<7) ? (view.model.start_operation "name here") ; (view.model.start_operation "name here", true)
                            > 
                            

                            What happens when SketchUp reaches version 10? 😆

                            Hi

                            1 Reply Last reply Reply Quote 0
                            • T Offline
                              todd burch
                              last edited by

                              @jim said:

                              @rickw said:

                              I use this:

                              (Sketchup.version[0,1].to_i<7) ? (view.model.start_operation "name here") ; (view.model.start_operation "name here", true)
                              > > 
                              

                              What happens when SketchUp reaches version 10? 😆

                              Rick will have to learn a new parsing technique! 🤣

                              1 Reply Last reply Reply Quote 0
                              • R Offline
                                RickW
                                last edited by

                                Haha! Good point. But Google's backwards-compatibility policy is for 3 versions. By that time, there will be no more need for the "true" flag so it will cease to exist after version 9, and then I'm safe until SketchUp 70.0. At that point, my crystal ball gets a bit fuzzy.

                                But just in case I'm wrong, this is better:

                                Sketchup.version.split(".")[0].to_i<7
                                

                                RickW
                                [www.smustard.com](http://www.smustard.com)

                                1 Reply Last reply Reply Quote 0
                                • R Offline
                                  RickW
                                  last edited by

                                  @chris fullmer said:

                                  Rick, I am getting this error:

                                  Error; #<ArgumentError; Cannot create unit vector from zero length vector>
                                  > C;/Program Files/Google/Google SketchUp 7/Plugins/offset.rb;49;in `parallel?'
                                  > C;/Program Files/Google/Google SketchUp 7/Plugins/offset.rb;49;in `offset'
                                  > C;/Program Files/Google/Google SketchUp 7/Plugins/offset.rb;39;in `upto'
                                  > C;/Program Files/Google/Google SketchUp 7/Plugins/offset.rb;39;in `offset'
                                  > C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;159;in `greeble'
                                  > C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;137;in `each'
                                  > C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;137;in `greeble'
                                  > C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;200
                                  > C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;200;in `call'
                                  

                                  I'm sure its because I'm passing bad geometry to your offset script. What do I need to check so as to not pass bad geometry to offset.rb? Thanks!

                                  Chris

                                  Can you email me a sample .skp file that's causing the error?

                                  RickW
                                  [www.smustard.com](http://www.smustard.com)

                                  1 Reply Last reply Reply Quote 0
                                  • T Offline
                                    tomot
                                    last edited by

                                    @rickw said:

                                    @chris fullmer said:

                                    Rick, I am getting this error:

                                    Error; #<ArgumentError; Cannot create unit vector from zero length vector>
                                    > > C;/Program Files/Google/Google SketchUp 7/Plugins/offset.rb;49;in `parallel?'
                                    > > C;/Program Files/Google/Google SketchUp 7/Plugins/offset.rb;49;in `offset'
                                    > > C;/Program Files/Google/Google SketchUp 7/Plugins/offset.rb;39;in `upto'
                                    > > C;/Program Files/Google/Google SketchUp 7/Plugins/offset.rb;39;in `offset'
                                    > > C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;159;in `greeble'
                                    > > C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;137;in `each'
                                    > > C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;137;in `greeble'
                                    > > C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;200
                                    > > C;/Program Files/Google/Google SketchUp 7/Plugins/clf_greeble.rb;200;in `call'
                                    

                                    I'm sure its because I'm passing bad geometry to your offset script. What do I need to check so as to not pass bad geometry to offset.rb? Thanks!

                                    I had the exact same error on one of my files. when I quit SU7. I was asked if I want to fix the error in that file. Which I did. Since then I don't get that error anymore.
                                    FYI: new SU7 install under Vista64, the only installed plugins are what the greeble script requires.

                                    [my plugins](http://thingsvirtual.blogspot.ca/)
                                    tomot

                                    1 Reply Last reply Reply Quote 0
                                    • R Offline
                                      RickW
                                      last edited by

                                      @tomot said:

                                      FYI: new SU7 install under Vista64, the only installed plugins are what the greeble script requires.

                                      Do you mean that offset.rb is installed with SU7?

                                      RickW
                                      [www.smustard.com](http://www.smustard.com)

                                      1 Reply Last reply Reply Quote 0
                                      • T Offline
                                        tomot
                                        last edited by

                                        @rickw said:

                                        Do you mean that offset.rb is installed with SU7?

                                        Yes, offset.rb is installed with SU7

                                        However my previous post and attached picture still confirms the same greeble problem when used with SU6 operating under Vista64. Mind you there are a significant number of Plugins that maybe contributing to the problem, BTW compospraytool.rb is not installed in that plugins dir.

                                        [my plugins](http://thingsvirtual.blogspot.ca/)
                                        tomot

                                        1 Reply Last reply Reply Quote 0
                                        • Chris FullmerC Offline
                                          Chris Fullmer
                                          last edited by

                                          Bummer, there must be another script that is interefering too then. I'm wondering, do you have makefaces installed on the version 6? If not, could you install it and try it? It also uses progressbar.rb. So it should be broken too.

                                          I might just have to releae a version that does not use progressbar I guess.

                                          Chris

                                          Lately you've been tan, suspicious for the winter.
                                          All my Plugins I've written

                                          1 Reply Last reply Reply Quote 0
                                          • pilouP Offline
                                            pilou
                                            last edited by

                                            Your version is always written 0.25
                                            you don't increase number between version?

                                            Frenchy Pilou
                                            Is beautiful that please without concept!
                                            My Little site :)

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 3 / 4
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement