sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Lock inference

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 3 Posters 475 Views 3 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.
    • A Offline
      avariant
      last edited by

      I'm trying to figure out how locking inference works with creating a tool. But I'm a little lost.
      As best as I can tell, lock_inference will fail if the point you pass ("view.lock_inference pt") is just a point, but it will succeed if you pass a point that is on an edge or face. Passing in two points, however, doesn't seem to do a single thing different than passing one point. It just uses the first. So is anyone able to explain what passing two points should do?

      The next question is that the line tool allows you to hit an arrow key and lock inferencing to an axis. Is this something that should be repeatable in a user-defined tool? Any help, especially with the axis issue, would be great! Thanks.

      1 Reply Last reply Reply Quote 0
      • Mike LuceyM Offline
        Mike Lucey
        last edited by

        Hi avariant,

        I sort of grasp what you are saying but not fully. Could you demonstrate with a screen video grab what your problem is. I am sure that you will get a response even if I can't supply an answer.

        Mike

        Support us so we can support you! Upgrade to Premium Membership!

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

          Sure.
          From the line tool, if you hit the up arrow, you get a constraint along the vertical axis, running through whatever point you were on at the time you hit the up arrow.

          http://img253.imageshack.us/img253/38/ss1rh6.jpg

          But this doesn't appear to be a standard behavior for the lock_inference command. The best I can do is lock to an edge, if I happen to pass it a point on an edge, or in the plane of a face, if the point I pass is on a face. I'd like to imitate the behavior of the line tool, where I constrain along an axis no matter what point I have.

          1 Reply Last reply Reply Quote 0
          • fredo6F Offline
            fredo6
            last edited by

            Avariant,

            Can you have a look at LineOnSurface and tell if this is the functionality you need. Note that you don't need a real surface to work with the tool.

            Fredo

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

              The behavior seen from the "Line on Surface" tool, when you hit an arrow key, is exactly what I'm looking for. I'm not trying to draw lines, it's actually a "positioning" tool of sorts, but that behavior is very much what I'm looking for. Can you make suggestions on how to do it? πŸ˜„

              [EDIT] glancing through the Surface Tools code, I can see that there is some very significant trigonometry / vector math going on to implement that axis constraint. I had high hopes that this was something built into SU's inference, but apparently not. πŸ˜‰

              1 Reply Last reply Reply Quote 0
              • fredo6F Offline
                fredo6
                last edited by

                @avariant said:

                [EDIT] glancing through the Surface Tools code, I can see that there is some very significant trigonometry / vector math going on to implement that axis constraint. I had high hopes that this was something built into SU's inference, but apparently not. πŸ˜‰

                Yes there is!! But LineOnSurface is particularly convoluted because it also supports drawing on surface with constraints on the initial and target faces.
                In the simple case of 2 points, you have mainly to take care of 2 situations:

                • The input point is located on an existing geometry (vertex, line, surface). It means that it is well located in 3D space. You can then use 3D calculations to manage inferences (essentially projections)
                • the input point is in the 'empty' space. Then, you'd better try to bring back everything in the 2D viewport, compute the right projections, and swith back to 3D to see if the line matches a particular direction like axes.

                In addition, you have to trap the SHIFT key, manage the arrows, etc... and also recreate some stickiness.

                At the end it is not so simple, and I agree that we would expect this to be available in some form in the Ruby API.

                Fredo

                PS: I have coded it once for all as a class, which I put in LibFredo6 (this is why I have this shared library by the way)

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

                  Thanks very much for your replies. I think, knowing that SU doesn't provide any inherent method for this kind of inference, that I can see how it might be done. I'll tinker around a bit; even if I never use it, it will be good to familiarize myself with this area of the Ruby API. Thanks again.

                  BTW, I mentioned earlier that passing two points to lock_inference does nothing different for me than one point. Any thoughts on that, as to what two points should do?

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

                  Advertisement