sketchucation logo sketchucation
    • Login
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    [Tutorial] PickHelper - Visual Guide

    Scheduled Pinned Locked Moved Developers' Forum
    34 Posts 11 Posters 2.5k Views 11 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.
    • jolranJ Offline
      jolran
      last edited by

      @unknownuser said:

      Expand on what "segments" and "points" are?

      The last part where it says "Segments and Points". πŸ˜„

      It all depends on what user-level you are targeting.
      Me, I felt I needed more information about points. (I've never used pic helper so I'm totally green on subject.) But then again I suppose this is meant to be a visual guide with as little text as possible, so that might work against the whole concept.

      @unknownuser said:

      I'll have to ponder on all this feedback.

      No need to "ponder" πŸ˜„ It is really good as it is.

      Got a 21 inch screen. At full screenmode and 66,7% zoom the text size was fine on my computer.
      Is target for print?

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

        @jolran said:

        It all depends on what user-level you are targeting.
        Me, I felt I needed more information about points. (I've never used pic helper so I'm totally green on subject.)

        Yea, the thing with the pickhelper is that it serves multiple purposes. It let you pick entities in the model, but it also let you test against simple Geom::Point3d object - which which isn't represented by a model entity at all. I kind of feel the class should have been broken up into two separate classes because it's currently doing two separate jobs. I have been playing with making a wrapper that might make more sense to use.

        @jolran said:

        Is target for print?

        No, screen was the target. Saving them poor trees.

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

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

          @thomthom said:

          Revision 3

          I've finally got around to work on a revision for this. Would you please have a look at this draft and give me your thoughts? Is it more understandable?
          This version is more verbose and instead of trying to explain the entire class in one diagram I broke it down into categories.

          Thanks TT, looks clear and helpful. Now for your next assignment, compare/contrast pickHelper and InputPoint!

          Steve

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

            @slbaumgartner said:

            Now for your next assignment, compare/contrast pickHelper and InputPoint!

            Not sure if infographics is needed for that. ❓
            PickHelper let you find out what you clicked on - like if you where making a Select tool. InputPoint uses inference, used by drawing tools such as Line, Rectangle, Circle etc.

            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

              Revision 3.1 posted here: http://www.thomthom.net/thoughts/2013/01/pickhelper-a-visual-guide/

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

              1 Reply Last reply Reply Quote 0
              • H Offline
                honkinberry
                last edited by

                I have a Tool currently that uses the pick method, in order to place a Component that needs to be scaled.
                The problem is, that seems to keep picking the component itself, so it keeps floating towards the camera.
                I'm thinking PickHelper would, well, help with this? Am I understanding this right?
                So conceivably, I would be replacing my @ip.pick with an @ph.do_pick, and then I could rifle through the objects to expressly avoid the component instance in question. Am I on the right track?

                --J

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

                  I think you'd still get problems. You might have to avoid the PickHelper all together and use model.raytest - if you ray hits your component, you then re-shoot the ray from the point where it hit until it hits some other geometry or returns nil.

                  http://www.sketchup.com/intl/en/developer/docs/ourdoc/model#raytest

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

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    honkinberry
                    last edited by

                    That was the route I was going, and then it hit me... what if I just toggle the Visible status of my object?!
                    Works perfectly, so it's a very simple Pick call and done.
                    Thanks as always!

                    --J

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

                      That doesn't produce visual flickering?

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

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

                        Hi ThomThom,

                        I'm currrently stumbling around the API trying to get comfortable with interacting with the geometry, and I found your .pdf incredibly informative. It would have taken me days of reading doc's and experimenting to gain the same understanding that I could see there in just a few minutes.
                        My only complaint is that you have thrown the shortcomings of the official documents into sharp relief and it pains me now to return to the API pages! - and that goes for the rest of your blog too, you really have some talent as a technical author.

                        The only suggestion that I would make is that it might be nice to see an example of how the picker works with "virtual entities" such as curves and polygons - it is not clear whether these would behave like groups/compnents as 'branches' with their individual segments as 'leaves'.
                        But your explanation makes the principles very clear, so it is now easy for me to go and test that for myself - and maybe it's not a bad thing to leave some details for folks to discover for themselves.

                        1 Reply Last reply Reply Quote 0
                        • H Offline
                          honkinberry
                          last edited by

                          @unknownuser said:

                          That doesn't produce visual flickering?

                          Nope, at least none that I notice on my Macbook Pro.
                          Even if there was a little, it would be acceptable for the rock solid performance.

                          --J

                          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