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

    [Plugin] Component Spray update

    Scheduled Pinned Locked Moved Plugins
    29 Posts 16 Posters 50.4k Views 16 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.
    • plot-parisP Offline
      plot-paris
      last edited by

      Thanks a lot for the update, Didier πŸ‘

      @jackson said:

      One thing I have always wished for in Component Spray would be the ability to scatter comps randomly within the spray area rather than weighting them towards the middle- or am I missing something really obvious? πŸ˜•

      good idea, Jackson. there should be either a check box to enable/disable the behaviour or a field to type in a percentage of distribution

      1 Reply Last reply Reply Quote 0
      • AdamBA Offline
        AdamB
        last edited by

        Cool plugin, Didier. I really believe these kind of 'smart' tools are the way forward.

        Jackson: The "bunching" in the middle is caused by the way the random positions are calculated.

        Just as an experiment I added some 'clash detection' to the plugin. The idea being before it adds the instance it checks there is space for it. It really reduces the overlap of Component instances (obviously) but also helps the "bunching" in the middle because it avoids adding too many near the middle.

        [I didn't want to make big changes to Didier's baby, so it only catches most clashes - with more work it could be made to never add overlapping Components]

        Adam

        PS Didier, I'll send you my changes. Ignore / use / abuse or whatever as you see fit.

        Developer of LightUp Click for website

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

          That's interesting. I thought it was some code in there that deliberately clustered the components, simulating the effect of a forest. There are times when I want that effect and there are times when I don't. Having an extra option for this would be really nice.

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

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

            @adamb said:

            Jackson: The "bunching" in the middle is caused by the way the random positions are calculated.

            So what factor affects the otherwise random positioning? It would seem to me the only factors which could cause this obviously non-random influence on random scattering must be either
            a) proximity to the centre point
            b) proximity from the boundary

            Another great addition to this script would be that rather than the density parameter being input as a percentage it could be input as a "x number of components per square metre/foot/etc. As a percentage is only representative of a fraction of a whole it can't really be used to describe density in this sense as there's no way for the script to know how big each component is, and therefore how much of the total area they will actually cover. It'd be great to be able to scatter trees randomly, but at an average of say 1 instance per 10mΒ². Just some ideas.

            Jackson

            1 Reply Last reply Reply Quote 0
            • Didier BurD Offline
              Didier Bur
              last edited by

              @unknownuser said:

              PS Didier, I'll send you my changes. Ignore / use / abuse or whatever as you see fit.

              Cool πŸ‘ Thanks Adam.
              But I have no time now to work on my freebies, or update the depot, etc; 😞

              DB

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

                @didier bur said:

                But I have no time now to work on my freebies, or update the depot, etc;

                Your generosity with this amazing script and the ruby depot is already greatly appreciated!

                Component Spray already has an excellent, intuitive UI and is among a small group of ruby scripts which really should be implemented as proper SU tools IMO. Great job!

                Jackson

                1 Reply Last reply Reply Quote 0
                • AdamBA Offline
                  AdamB
                  last edited by

                  @jackson said:

                  So what factor affects the otherwise random positioning? It would seem to me the only factors which could cause this obviously non-random influence on random scattering must be either
                  a) proximity to the centre point
                  b) proximity from the boundary

                  Its a bit involved but since you ask...

                  If you use a random number generator that is normally distributed and use it in an orthogonal linear space you're all set. So compo_spray along a Line works great with no bunching. But for the Spray mode, the script calculates a random radius and a random angle around the center. However, the circumference of a circle close to the center is smaller than at the outside edge of the spray so using a normally distributed random number for the radius effectively biases position generation to the center point of the spray.

                  Adding "clash-detection" means you can set a "N per unit area" threshold so although it tries to add more near the center of the spray, they get rejected hence you don't get that bunching.

                  Phew....Fascinating, huh? πŸ˜‰

                  Developer of LightUp Click for website

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

                    Adam,

                    Thanks for that detailed, but very clear explanation, it hadn't occurred to me that the random scattering was calculated along the circumferences of concentric circles. That actually is fascinating!

                    Sounds like your tweak is a useful addition. πŸ‘

                    Jackson

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

                      fascinating indeed. now everything makes sense. πŸ˜’

                      1 Reply Last reply Reply Quote 0
                      • Bob JamesB Offline
                        Bob James
                        last edited by

                        @jackson said:

                        It'd be great to be able to scatter trees randomly, but at an average of say 1 instance per 10mΒ². [/quote]

                        I'm looking for a way to randomly place people in a room: Jackson's suggestion would really do that job.

                        Didier: Looking forward to your having enough time to re-address this Ruby.

                        i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

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

                          I really appreciate the generosity with which you supply this community so many innovative tools. the dialogue that comes with your scripts is essential to improving SketchUp and how people interact with it.
                          Thank you.

                          IOviz.com
                          SU Pro 2024 PC

                          1 Reply Last reply Reply Quote 0
                          • S Offline
                            Sir
                            last edited by

                            this looks like an amazingly useful plugin. thanks!

                            1 Reply Last reply Reply Quote 0
                            • dereiD Offline
                              derei
                              last edited by

                              What means this update? If I want the latest version of the Component Spray, is it This One, or This one?
                              Thank you.

                              DESIGNER AND ARTIST [DEREI.UK](http://derei.uk/l)

                              1 Reply Last reply Reply Quote 0
                              • Didier BurD Offline
                                Didier Bur
                                last edited by

                                Latest version is here: http://rhin.crai.archi.fr/RubyLibraryDepot/plugin_details.php?id=76

                                DB

                                1 Reply Last reply Reply Quote 0
                                • dereiD Offline
                                  derei
                                  last edited by

                                  @didier bur said:

                                  Latest version is here: http://rhin.crai.archi.fr/RubyLibraryDepot/plugin_details.php?id=76

                                  thank you very much ! β˜€

                                  DESIGNER AND ARTIST [DEREI.UK](http://derei.uk/l)

                                  1 Reply Last reply Reply Quote 0
                                  • brookefoxB Offline
                                    brookefox
                                    last edited by

                                    Dear Farmer,

                                    Finally I have an occasion, and finally I straighten my install and finally I harvest a moment of your efforts.

                                    Thank you, Farmer. You help make living in this valley a pleasure.

                                    http://img638.imageshack.us/img638/7831/compospray1.jpg

                                    ~ Brooke

                                    1 Reply Last reply Reply Quote 0
                                    • brookefoxB Offline
                                      brookefox
                                      last edited by

                                      EDIT: This error may just be mine: perhaps having enabled 'hide everything else while editing group'.

                                      There may be a limit on how far the routine likes to be 'buried'? That is, when I run it on a simple group, no sweat, but when I try to run it in group within a component, it seems to fail. Please see image. Top success within the group copied out of the component. Lower failure on the same group residing in the component. Perhaps I missed some advice in the use instructions. (Not an issue of overshadowing entities.)

                                      I tried the same test in the naked group in the same location as the failing component and it worked fine, so it does appear to be that the routine wants to breathe a bit.


                                      component array-fail-1.JPG

                                      ~ Brooke

                                      1 Reply Last reply Reply Quote 0
                                      • brookefoxB Offline
                                        brookefox
                                        last edited by

                                        When spraying grass components onto a large area and I want to keep the numbers down the lowest available setting of 1% is still very much too high, so I make a request for percentages below 1.

                                        My work-round for this is to include within the component a large triangle so the spray density is thus limited and then edit this out of the component later. This works fine.

                                        ~ Brooke

                                        1 Reply Last reply Reply Quote 0
                                        • brookefoxB Offline
                                          brookefox
                                          last edited by

                                          Having a hard time now. Rarely is anything being sprayed, no matter the setting. No groups or components on the receiving end.

                                          FloatDomainError?


                                          component spray fail-1.JPG

                                          ~ Brooke

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

                                          Advertisement