sketchucation logo sketchucation
    • 登入
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🔌 Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download

    [Plugin] ShadowProjector

    已排程 已置頂 已鎖定 已移動 Plugins
    127 貼文 35 Posters 84.8k 瀏覽 35 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • T 離線
      the.pjt
      最後由 編輯

      I wish this features would be done by SU core ... not ruby .. 😞

      sorry for main developers .. if they had made a C++ API and compiled extensions .. or a open source program these tasks could be compute much faster ... 😞

      but .. thanks a lot dear TIG , ... this is incredible to simulate shadow system in ruby ... thanks for everything , I don't know what is your name and who you are .. man or woman ? , but thanks dear unknown TIG ... 😄

      1 條回覆 最後回覆 回覆 引用 0
      • T 離線
        tetsuyahishida
        最後由 編輯

        TIG!

        This plugin is wonderful. I'm now planning to make a plugin to export an hourly data of the shadow ratio.
        And now checking the code of yours.
        Since sketchup API doesn't have enough kind of shadow API,
        it would very helpful if you could explain the algorithm to get the shadow.

        Anyway thanks for your masterpiece.

        1 條回覆 最後回覆 回覆 引用 0
        • TIGT 離線
          TIG Moderator
          最後由 編輯

          @tetsuyahishida said:

          TIG!

          This plugin is wonderful. I'm now planning to make a plugin to export an hourly data of the shadow ratio.
          And now checking the code of yours.
          Since sketchup API doesn't have enough kind of shadow API,
          it would very helpful if you could explain the algorithm to get the shadow.

          Anyway thanks for your masterpiece.

          Read the .rb file's code to see how it works...
          The sun has a 'direction' [to get the direction of the rays of sunlight we reverse that vector].
          The selected faces are processed in turn - 'selected face'...
          It finds the edges of all faces in the model or groups/instances that might shine onto that 'selected face'.
          It extrudes these edges into a grouped 'tube' with a very long set of faces, which it then intersects with the 'selected face' and adds faces temporarily.
          The tube is erased.
          It then has a set of edges representing the outer limits of the 'selected face's' shadows; internal 'coplanar' edges are erased so it's as simple as possible.
          Each 'shadow' group is formated as the options set, text added etc...
          Obviously it's much more complicated than that [e.g. how to spot if there's a 'hole' in a face], but the principle is as stated...

          TIG

          1 條回覆 最後回覆 回覆 引用 0
          • T 離線
            tetsuyahishida
            最後由 編輯

            Wow now I got it.I guess that's the best way.

            Thanks so much.

            @tig said:

            @tetsuyahishida said:

            TIG!

            Read the .rb file's code to see how it works...
            The sun has a 'direction' [to get the direction of the rays of sunlight we reverse that vector].
            The selected faces are processed in turn - 'selected face'...
            It finds the edges of all faces in the model or groups/instances that might shine onto that 'selected face'.
            It extrudes these edges into a grouped 'tube' with a very long set of faces, which it then intersects with the 'selected face' and adds faces temporarily.
            The tube is erased.
            It then has a set of edges representing the outer limits of the 'selected face's' shadows; internal 'coplanar' edges are erased so it's as simple as possible.
            Each 'shadow' group is formated as the options set, text added etc...
            Obviously it's much more complicated than that [e.g. how to spot if there's a 'hole' in a face], but the principle is as stated...

            1 條回覆 最後回覆 回覆 引用 0
            • G 離線
              Gonvaz
              最後由 編輯

              I'm afraid I can't make it work. I select a face, then I click tools>ShadowProjector, select lines, or faces, etc. and nothing happens. I haven't been able to get any projection of any shadow.

              1 條回覆 最後回覆 回覆 引用 0
              • TIGT 離線
                TIG Moderator
                最後由 編輯

                @gonvaz said:

                I'm afraid I can't make it work. I select a face, then I click tools>ShadowProjector, select lines, or faces, etc. and nothing happens. I haven't been able to get any projection of any shadow.
                Any error messages if done with the Ruby Console open ? Can you post a simple example SKP etc...

                TIG

                1 條回覆 最後回覆 回覆 引用 0
                • G 離線
                  Gonvaz
                  最後由 編輯

                  I've been trying to make it work with the attached example.
                  Sometimes I get "You must preselect at least ONE suitably oriented face!".
                  When I get no message, I see no projections.


                  shp example

                  1 條回覆 最後回覆 回覆 引用 0
                  • TIGT 離線
                    TIG Moderator
                    最後由 編輯

                    @Gonvaz
                    I am baffled what you are trying to do 😕
                    This tool projects shadows from objects [essentially faces in the model/groups/components] onto preselected faces in the current context.
                    The SKP you attached seems to contain no faces whatsoever, so that is an immediate problem!
                    😲
                    Your 'pyramid' form is only edges, and whilst you can get edges to cast real-shadows, this tool only considers shadows from faces.
                    So, it should work given the right inputs - but I suggest you really need to reread and understand the tool's instructions... and then ask it to do what it's capable of, and you will get results.
                    😒

                    TIG

                    1 條回覆 最後回覆 回覆 引用 0
                    • G 離線
                      Gonvaz
                      最後由 編輯

                      I'm really sorry, TIG! I attached a wrong SKP. 😳
                      Now I have attached the one I was using to test the plugin.
                      And I have found why I couldn't make it work: some of the faces were reversed.
                      I just selected the faces, right-click the selection and click "Reverse Faces".
                      It works perfectly!
                      Thanks!


                      1s.skp

                      1 條回覆 最後回覆 回覆 引用 0
                      • plot-parisP 離線
                        plot-paris
                        最後由 編輯

                        Hey TIG, just to let you know. The plugin produces a bug-splat with SketchUp 2013

                        1 條回覆 最後回覆 回覆 引用 0
                        • TIGT 離線
                          TIG Moderator
                          最後由 編輯

                          @plot-paris said:

                          Hey TIG, just to let you know. The plugin produces a bug-splat with SketchUp 2013
                          It doesn't with me 😕
                          Works just fine...
                          Do you have an example of a failing SKP you can provide?
                          Does it work in v8 but not in v13 ?
                          Do you also have other plugins loading that might conflict ?
                          More info please... 😒

                          TIG

                          1 條回覆 最後回覆 回覆 引用 0
                          • plot-parisP 離線
                            plot-paris
                            最後由 編輯

                            Ok, I did a bit of testing:

                            • I got the plugin to work with SU 2013

                            • I found that the new default character in the scene - Derrick - is causing the Bug Splat

                            • I created a dynamic component with a hidden-toggle element myself. Everything worked fine...

                            • I also created a component with fixed size. Worked fine too...

                            So, no Idea what the problem is. But Derrick is the clue 😕

                            DerrickFucksItUp.skp

                            1 條回覆 最後回覆 回覆 引用 0
                            • TIGT 離線
                              TIG Moderator
                              最後由 編輯

                              Derrick makes a bugsplat in v8 AND v2013 when he's included in a shadow-projection !
                              Even when he's been exploded and hidden objects like the speech-bubble have been erased.

                              I think it's because sadly Derrick contains 26 edges that are <1mm long, and 3 of those are <=0.2mm, with the smallest being only 0.13mm long.
                              We all know [except apparently Trimble 😒 ] that 'tiny geometry' causes SketchUp several issues.
                              Shadows are 'projected' from the objects' face vertices, and if any two are almost coincident in 2d then SketchUp takes them to be coincident, and then the needed very small edge fails to be replicated in the shadow's outline set in the projection... and then it can't form a loop etc etc... Failure.

                              Also 2d face-me components might also cause problems with shadow-projections because their 'bounds' are shot to pieces by turning to face the camera etc...

                              I'll see if I can get Trimble to fix Derrick for the next maintenance release... 😒

                              Meanwhile, avoid 2d face-me components like Derrick, in your shadow-projections... until further notice... 😒

                              TIG

                              1 條回覆 最後回覆 回覆 引用 0
                              • plot-parisP 離線
                                plot-paris
                                最後由 編輯

                                ah, I see. Yes, usually I don't keep Derrick in my scenes. But unfortunately I did when trying your (very useful) plugin... 😒

                                1 條回覆 最後回覆 回覆 引用 0
                                • M 離線
                                  max8167
                                  最後由 編輯

                                  Hello,
                                  Is it possible to export result (text element : pourcentage, area...) in a .txt or .csv file?
                                  Thank you for advance

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • TIGT 離線
                                    TIG Moderator
                                    最後由 編輯

                                    @max8167 said:

                                    Hello,
                                    Is it possible to export result (text element : pourcentage, area...) in a .txt or .csv file?
                                    Thank you for advance
                                    Not at the moment.
                                    They are not saved with the group as attributes so they are not extractable later on.
                                    However, I'll look at adding that functionality to the tool...

                                    TIG

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • TIGT 離線
                                      TIG Moderator
                                      最後由 編輯

                                      An updated version, v1.3, is now in the PluginStore http://sketchucation.com/pluginstore?pln=TIG_shadowProjector
                                      The 'Shadow' groups now get 'ShadowProjector' attributes covering the areas of their face[s] and shadows, its % and the reported units.
                                      To view this select likely 'Shadow' group[s] - with no current selection the whole active context is considered.
                                      To see the data, type into the Ruby Console:
                                      TIG.shadowReport
                                      All of the Shadows groups' attribute data is printed out, formated for copying into another document...

                                      TIG

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • M 離線
                                        max8167
                                        最後由 編輯

                                        Hi,
                                        Your plugin it's very useful

                                        Do you think it is possible to change script in order to have result during a time period and not at a given time? Have you avenues of work and reflection?

                                        Thank you for advance

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • TIGT 離線
                                          TIG Moderator
                                          最後由 編輯

                                          @max8167 said:

                                          Hi,
                                          Your plugin it's very useful

                                          Do you think it is possible to change script in order to have result during a time period and not at a given time? Have you avenues of work and reflection?

                                          Thank you for advance
                                          Just do several shadows over a series of scenes with different times ?
                                          It cannot cope with reflections, if that's what you meant ??

                                          TIG

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • TIGT 離線
                                            TIG Moderator
                                            最後由 編輯

                                            Updated version v1.4 is now available.
                                            It has an additional option that can be typed into the Ruby Console:
                                            TIG.shadowReport **true**
                                            to choose a file and write the shadow report directly into it...
                                            http://sketchucation.com/pluginstore?pln=TIG_shadowProjector

                                            TIG

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 3 / 7
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement