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

    [Plugin] Raytracer

    Scheduled Pinned Locked Moved Plugins
    60 Posts 18 Posters 60.9k Views 18 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.
    • olisheaO Offline
      olishea
      last edited by

      can you post an example of how this works please? just couple of images will do......pretty please ☀

      oli

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

        @olishea said:

        can you post an example of how this works please? just couple of images will do......pretty please ☀

        Done.

        I found a bug in my plugin - so you want to update it and TT_Lib2.

        I also found there is a nasty bug in SU8 that cause bogus results in the ray-tracing. I'm looking into this one - trying to work out way to work around it.

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

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

          Found a workaround. Please update TT_Lib2 to version 2.1.1.

          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
            Panga
            last edited by

            Thomthom,

            Thanks again for this plugin, but can I suggest you another function for this script. I need to make a raytrace from on point in every direction in order to see where rays intersect a terrain for example. I know that could generates a lot of rays and calculation, but It would be nice to have this function with maybe an option where we can choose the number of rays like : 1 to 10 rays / 10 o 100 rays / 100 to 1 000 rays. If it's possible, the rays should be drawn as guidelines, and a guide point could be automatically drawn on each intersection with the rest of the model.

            I don't know if you can do that...just and idea for my workflow that can be helpfull for others maybe.

            Thanks.

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

              @panga said:

              I need to make a raytrace from on point in every direction

              😲

              @unknownuser said:

              I know that could generates a lot of rays and calculation, but It would be nice to have this function with maybe an option where we can choose the number of rays like : 1 to 10 rays / 10 o 100 rays / 100 to 1 000 rays.

              I say, yes, it'd be a whole lot of rays. So, would it be like sub-dividing a sphere and shoot a ray for every segment?

              @panga said:

              If it's possible, the rays should be drawn as guidelines, and a guide point could be automatically drawn on each intersection with the rest of the model.

              YEs, can draw them a guidelines, yes. But how many points of origins are we talking about? There'd a huge amount of CLines. Would there be a limit to how far they reached? Would it be ok to draw only the rays that hit something?
              Do the rays need to ignore other geometry other than the target group/component?

              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
                Panga
                last edited by

                @unknownuser said:

                YEs, can draw them a guidelines, yes. But how many points of origins are we talking about?

                For my specific usage, there's two possibilities and the first one of them could be already fanstastic:

                1. From one point at time
                2. From one complex object (component or group)

                @unknownuser said:

                There'd a huge amount of CLines. Would there be a limit to how far they reached? Would it be ok to draw only the rays that hit something?
                Do the rays need to ignore other geometry other than the target group/component?

                Yes, Yes and Yes. In fact I only need to evaluate "covisibility". So I could select a point on my model (or a complex object) and the plugin draw a certain number of rays only where there's intersections with the model, or with a specific component/group if it's easier to implement/calculate.

                @unknownuser said:

                So, would it be like sub-dividing a sphere and shoot a ray for every segment?

                This could be a good solution with a sphere that surrounds the whole model.

                Thanks for your answer.

                Regards.

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

                  @panga said:

                  @unknownuser said:

                  So, would it be like sub-dividing a sphere and shoot a ray for every segment?

                  This could be a good solution with a sphere that surrounds the whole model.

                  I didn't mean to put an actual sphere in the model, just how one would determine which of the infinite possible directions the rays should be shot. What I meant by the sphere was they the ray's be evenly distributed based on how many rays one shoot.

                  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
                    Panga
                    last edited by

                    @unknownuser said:

                    I didn't mean to put an actual sphere in the model, just how one would determine which of the infinite possible directions the rays should be shot. What I meant by the sphere was they the ray's be evenly distributed based on how many rays one shoot.

                    Yes I understood you. And controlling the number of segments/faces of the "virtual sphere" could help to have more or less rays. Whatever you can do for that, thanks in advance.

                    EDIT : In fact, what could be really nice is a "sun" or a omnilight that I could place wherever I want in my SU model, and with shadows activated I could see the illuminated parts of my models and the dark ones...

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

                      I'm writing this down in the todo list. Will see what I can do.

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

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

                        hmm.... I'm not quite sure how to calculate the rays to shoot. Been all too long since I've done math like this...

                        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
                          Panga
                          last edited by

                          My knowledge in maths are very limited...so I'll not be able to help you on that. Anyway, thanks for giving it a try !! 😉

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

                            Found a solution! 😄

                            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
                              Panga
                              last edited by

                              I had no doubt about that !! 😉

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

                                When I say I I mean, someone smarter than me helped me out. 😉

                                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
                                  Panga
                                  last edited by

                                  Whatever if someone helped you or not, you were the one looking for the solution...so you found it ! 😛

                                  1 Reply Last reply Reply Quote 0
                                  • A Offline
                                    artupato
                                    last edited by

                                    sir Thomthom,
                                    thank you very much for this plugin.
                                    what a coincidence! This day I've been thinking of raytracing and what is its concept. I think I'll understand this once I use your plugin and of course read some notes about it. 😄

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

                                      grrrr.... SU8 has even more troublesome bug with the raytest method. I'm struggling to find a workaround.
                                      I got the Spray Ray working in SU7 - but SU8 is being a PITA.

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

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

                                        Version 1.1.0

                                        • Requires TT_Lib2 (v2.3.0)
                                        • Trace Spray Ray.
                                        • Bugfixes.

                                        Note: SU8 does not process rays properly and the results are not reliable!
                                        I've been unable to work out a successful workaround. 😞

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

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

                                          Kind-of like a cob-web... if the CLines was replaced with catenary curves...

                                          cobweb.png

                                          http://upload.wikimedia.org/wikipedia/en/thumb/f/fb/SpiderCatenary.jpg/180px-SpiderCatenary.jpg

                                          Wiki uses cob-webs as an example for catenary curves http://en.wikipedia.org/wiki/Catenary

                                          I have no idea what the usage would be, other than for Halloween... but... cool...

                                          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
                                            Panga
                                            last edited by

                                            Thanks Thomthom, I'll try it. Hope you can find a way to make it work under SU8 later.

                                            EDIT :

                                            Hi Thomthom,

                                            I made a Test under SU8, and it Works pretty well. Until now, I test it with a max of 10 000 rays, and it takes about 15 seconds to calculate, so It's pretty fast. The only thing is it seems that some directions are ignored by rays, see on the picture below :

                                            Test-raytracer.png

                                            Whatever, It's already a really good tool for me. I'm thinking of other options, but I'll do some tests before talking about...See u and thanks again.

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

                                            Advertisement