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

    Pairing face problem

    Scheduled Pinned Locked Moved Developers' Forum
    9 Posts 2 Posters 752 Views 2 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.
    • hsmyersH Offline
      hsmyers
      last edited by

      When I say face in this instance I'm speaking of the side of a bounding box and not a SU face. My problem stems from a naive assumption on my part, that the closest pair of faces of two objects would be what I think of as 'opposing', i.e. right with left, top with bottom and so on. Only a second or two of visualization would show that this is not so. Right may easily pair with front, rear with left and similar. Needless to say this does not lead to good result.

      So the obvious solution is to rotate the object into 'paired' alignment. My problem is that I'm having trouble thinking of such a solution. Clearly the un-aligned would have to be rotated to match the target but what does that imply? I mean it is obvious that right would have to rotate to become rear in order to match up with front...and I suppose that means a rotation around the z-axis assuming normal orientation. Seems like it would always be a single 90Β° right or left(around the given axis).

      So the sledgehammer approach is to map out each possible rotation and apply it. Which leads me to ask is the a better solution?

      1 Reply Last reply Reply Quote 0
      • sdmitchS Offline
        sdmitch
        last edited by

        So you would like to specify the "face" on the "moved" object which is to be "paired" with a specified face on the "fixed" object?

        Nothing is worthless, it can always be used as a bad example.

        http://sdmitch.blogspot.com/

        1 Reply Last reply Reply Quote 0
        • hsmyersH Offline
          hsmyers
          last edited by

          @sdmitch said:

          So you would like to specify the "face" on the "moved" object which is to be "paired" with a specified face on the "fixed" object?

          Pretty much. As part of the existing code I already know the orientation of the two object BB faces. And have written code for opposite? so I know when things are amiss. The rotate90 code is also written. I'm now pondering the code between. And wondering if rotation will always be positive.

          1 Reply Last reply Reply Quote 0
          • sdmitchS Offline
            sdmitch
            last edited by

            @hsmyers said:

            @sdmitch said:

            So you would like to specify the "face" on the "moved" object which is to be "paired" with a specified face on the "fixed" object?

            Pretty much. As part of the existing code I already know the orientation of the two object BB faces. And have written code for opposite? so I know when things are amiss. The rotate90 code is also written. I'm now pondering the code between. And wondering if rotation will always be positive.

            No, it can be negative. The sign of 'z' of the product of the two vectors you are using to determine the angle_between should be the sign of the angle of rotation.

            Nothing is worthless, it can always be used as a bad example.

            http://sdmitch.blogspot.com/

            1 Reply Last reply Reply Quote 0
            • hsmyersH Offline
              hsmyers
              last edited by

              @sdmitch said:

              No, it can be negative. The sign of 'z' of the product of the two vectors you are using to determine the angle_between should be the sign of the angle of rotation.

              Very good to know. I just built a 3d grid of nine boxes to see how many bad pairs I can find. Anything on a diagonal path is bad so far. That arrangement seems like it should be all of the possible pairings but I'm not yet confident enough to bet the farm on it. πŸ˜•

              1 Reply Last reply Reply Quote 0
              • sdmitchS Offline
                sdmitch
                last edited by

                @hsmyers said:

                @sdmitch said:

                No, it can be negative. The sign of 'z' of the product of the two vectors you are using to determine the angle_between should be the sign of the angle of rotation.

                Very good to know. I just built a 3d grid of nine boxes to see how many bad pairs I can find. Anything on a diagonal path is bad so far. That arrangement seems like it should be all of the possible pairings but I'm not yet confident enough to bet the farm on it. πŸ˜•

                As always, posting a model or pictures will help us better understand what it is you are trying to accomplish.

                As for bounding boxes, their orientation never changes regardless of what you do to the component or group. corner(0) will always be xmin,ymin,zmin and corner(7) will always be xmax,ymax,zmax of the entity in its present orientation.

                Nothing is worthless, it can always be used as a bad example.

                http://sdmitch.blogspot.com/

                1 Reply Last reply Reply Quote 0
                • hsmyersH Offline
                  hsmyers
                  last edited by

                  Current test file for pairs problemYou know, I've yet to solve the problem of adding an image to a post? Never-mind...it pays to actually look at the screen staring you in the face...doh!! These are all individual groups. Here is a correctly paired and moved (face center to face center) pair followed by an incorrect pairing...Good pairingCapture.2.PNGIgnore the purple dot and odd selection coloring, they are not germane.

                  Thus far I've found 13 pairings that fail for obvious reasons:

                  • Bottom, Left"
                  • Bottom, Right"
                  • Front, Bottom"
                  • Front, Left"
                  • Front, Right"
                  • Front, Top"
                  • Rear, Bottom"
                  • Rear, Left"
                  • Rear, Right"
                  • Rear, Top"
                  • Top, Left"
                  • Top, Right"

                  I will continue to test at least until I figure a way to code, detect and fix.

                  1 Reply Last reply Reply Quote 0
                  • sdmitchS Offline
                    sdmitch
                    last edited by

                    What defines a good or bad pairing?

                    Nothing is worthless, it can always be used as a bad example.

                    http://sdmitch.blogspot.com/

                    1 Reply Last reply Reply Quote 0
                    • hsmyersH Offline
                      hsmyers
                      last edited by

                      @sdmitch said:

                      What defines a good or bad pairing?

                      No overlap when moved center to center. Where 'center' is center of paired face.

                      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