• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Door Swing Both Ways

Scheduled Pinned Locked Moved SketchUp Components, Materials & Styles
sketchup
7 Posts 3 Posters 2.5k Views
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.
  • E Offline
    ericschimel
    last edited by 26 Jan 2011, 01:36

    Hey gang, I've run into an interesting problem...

    I am building a DC that has a door swing that happens when the user uses the "Interact" tool on the door. It works much like this one:

    Error 404 (Not Found)!!1

    favicon

    (sketchup.google.com)

    Here's my problem, I need the user to have a choice of the swing, whether it the door hinges from the left or right. Now I know you could just "flip" the component. In the case of the door I am using as an example, that would work fine. In the DC that I am building, this wouldn't work.

    Since DC's can't command sub components to flip themselves, or change their axes, I have to figure out how to accmplish this with math.

    So lets say when the user clicks on the door, ROTZ is animated to a positive angle of 120 Degrees. If I wanted that swing to be the opposite, I would have to use a value of -110. Then I would have to move the door back out, and then to the right.

    This is more of a math problem really then a DC problem. Does anyone have a DC that they have made like this, or perhaps could suggest how to approach the math end of this problem?

    -Eric
    http://plugin.sketchthis.net
    Sketchup Kitchen Design Plugin
    Custom Models

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 26 Jan 2011, 10:43

      Couldn't you simply make two door-leaves with appropriated flipped handle/butts, and the call one or the other to be visible when the door handing toggles as it flips ?
      When it's flipped you toggle the swing [RotZ] +/- ve ?
      There are only two versions as the other two possibilities are simply the DC facing the opposite way when placed ??

      TIG

      1 Reply Last reply Reply Quote 0
      • E Offline
        ericschimel
        last edited by 26 Jan 2011, 13:03

        I have done that exact method in other components. The problem here is in this particular component, the user will be able to specify how many doors they want to have, and then be able to go in and configure the swing of each door. Since I will never know how many doors someone will want, I need to set it up so they can choose the swing for each door.

        Plus, I am trying to make this component as light as possible, so the more things I can copy, and configure with math, rather then showing/hiding tings the better.

        -Eric
        http://plugin.sketchthis.net
        Sketchup Kitchen Design Plugin
        Custom Models

        1 Reply Last reply Reply Quote 0
        • H Offline
          Howard leslie
          last edited by 26 Jan 2011, 23:08

          Eric,
          This may give you some ideas:

          http://forums.sketchucation.com/viewtopic.php?f=289&t=21350
          ...........
          Howard L'

          1 Reply Last reply Reply Quote 0
          • E Offline
            ericschimel
            last edited by 26 Jan 2011, 23:22

            I've seen that door, its really awesome.

            The solution in that door for reversing the swing is not going to work for me. I need a door to swing the opposite direction upon user selection without flipping it around.

            Essentially, If the door was hinged left, or in other words, its axis rotation point was on the left, I need for it to appear to the user that its hinged on the right, without actually being hinged on the right.

            -Eric
            http://plugin.sketchthis.net
            Sketchup Kitchen Design Plugin
            Custom Models

            1 Reply Last reply Reply Quote 0
            • E Offline
              ericschimel
              last edited by 24 Feb 2011, 17:30

              Ok, I have attached a more updated file.

              If you click on Dynamic Component options you will see a choice for right and left. Try left and see what happens, then right. You can see that while I have the correct animation attributes animating, I don't have the correct formulas... (or really any formulas at all)

              I think this is in the world of Algebra and Calculus. My problem is I just don't know where to even begin with the formulas.

              When you are trying to get a door to appear to swing right, I need to animate its Y rotation angle to a negative. As that angle changes, the distance I need to move the door in a positive Z direction also changes. If I can figure out that distance I am set. I adjust the Z position, then just offset the size of the door in X and I am good to go.

              My research as lead me to this, and I am still trying to make heads or tails of it...

              Link Preview Image
              Exact trigonometric values - Wikipedia

              favicon

              (en.wikipedia.org)

              The answer I think lies with PIE, Angle, and LenX of the doors, I just don't know how to put it all in a formula.

              Any math geeks out there?


              Right Left Door.skp

              -Eric
              http://plugin.sketchthis.net
              Sketchup Kitchen Design Plugin
              Custom Models

              1 Reply Last reply Reply Quote 0
              • E Offline
                ericschimel
                last edited by 25 Feb 2011, 00:37

                HA! I got it, with the help of a local math genius.

                Check out the solution attached. Just open the Dynamic Components option and switch the hinging from left to right and use the interact tool on the door.

                SIN was the answer!

                (fist pump)


                Door Hinging Solved.skp

                -Eric
                http://plugin.sketchthis.net
                Sketchup Kitchen Design Plugin
                Custom Models

                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