14 Replies Latest reply on Aug 31, 2009 7:07 AM by Wade_Zimmerman

    Maximum distance across any axis?

    RSDD

      I'm looking for a way to constrain an object to a size across any axis. For example, a 3" x 4" rectangle is constrained to a height of 4", but along the diagonal, it is 5". If I wanted to circumscribe the rectangle, I would either need to reduce it proportionally so the diagonal was 4", or make the circle larger.

       

      But what about irregular shapes? Any good ideas for finding the longest edge-to-edge distance? I figure once I can do that, I can then scale by percentage to the size I'm looking to fit.

       

      Thanks!

        • 1. Re: Maximum distance across any axis?
          Wade_Zimmerman Level 6

          I am not certain I understand but if you select the object with a selection tool and look at the control panel at the top of your screen under the menus there is a h and w  fields for height and width.

           

          There is also info panel.

          • 2. Re: Maximum distance across any axis?
            RSDD Level 1

            That works for height and width. I suppose if I kept rotating the object I could keep changing the height until it fit. Maybe I can be clearer. A 3" x 4" rectangle has a maximum height (or width) of 4". But it will not fit inside a circle with a 4" diameter. If you rotate the rectangle 45°, it now has a width of 4.9498" and a height of 4.9497".

             

            Irregular shapes (the one I'm working with is the outline of a padlock) are much more difficult to check/adjust. I want to find a way to make sure any measurement across the object, regardless of rotation, is 4".

            • 3. Re: Maximum distance across any axis?
              Steve Fairbairn Level 5

              For a rectangle you can do it like this:

              Snap a ruler guide to one of the corners.

              With the rotate centre on that corner, rotate the rectangle so that its opposite corner snaps to the guide.

              Now you will see that the rectangle's bounding box has enlarged to the length of the diagonal.

              Read off the dimensions from the Info panel and you've got the size of a circumscribed circle.

              You can use this same priciple for other shapes too.

              • 4. Re: Maximum distance across any axis?
                RSDD Level 1

                That works pretty well for regular shapes. But what would you do with this one:

                 

                Lock.jpg

                • 5. Re: Maximum distance across any axis?
                  Steve Fairbairn Level 5

                  Pretty much the same.

                  Rotate the padlock so that the diagonal (bottom left to top right) becomes vertical and then read off the dimensions in Info.

                  In this case it depends a bit how accurate your measurements need to be.

                  • 6. Re: Maximum distance across any axis?
                    Jacob Bugge MVP & Adobe Community Professional

                    One way avoiding rotation would be to apply the Line Segment Tool and:

                     

                    1) Click the most obvious outermost part, in this case within the lower left hindmost corner part;

                    2) Drag and find the spot on the shackle where the line segment is longest and let go;

                    3) Use the Filter>Telegraphics>Path area or Path length to see the length.

                     

                    The filters can be downloaded here: http://www.telegraphics.com.au/sw/

                     

                    If you want a circle, you may Object>Path>Add Anchor Points and use that as centre, or in newer version (you can probably) just rotate the line.

                    • 7. Re: Maximum distance across any axis?
                      JETalmage Level 6

                      Draw a circle of any size.

                      Position it over the artwork.

                      Proportionally scale the circle and reposition it until it "circumscribes" the artwork the way you want. (The meaning of "circumscribe" is ambiguous, depnding on the artwork.)

                      Select both the circle and the artwork.

                      Make sure the Proportional link between the height and width fields is turned on.

                      Key the desired diameter into either the height or width field.

                      Press Enter.

                       

                      JET

                      • 8. Re: Maximum distance across any axis?
                        Wade_Zimmerman Level 6

                        Brilliant! The OP should mark this answered so we can all find it again.

                        1 person found this helpful
                        • 9. Re: Maximum distance across any axis?
                          RSDD Level 1

                          Okay, that answer borders on abuse of the forum. If the actual answer to any post on here is "draw a circle", we need a very stringent screening process for access.

                          • 10. Re: Maximum distance across any axis?
                            RSDD Level 1

                            Wade, you get a "helpful answer" just for being the first one to crack wise about that post.

                            • 11. Re: Maximum distance across any axis?
                              JETalmage Level 6

                              RSDD,

                               

                              I can't tell if you are trying to be cute, sarchastic, facetious, or some combination. But just in case you are actually serious in your derision of my post:

                               

                              You said your goal was to "circumscribe" an irregular shape. We know from geometry that any given three points (or a regular polygon, or a rectangle) have one circumcircle. But an "irregular shape" (an irregular polygon) will not. So you have to choose which points on the extrema of the polygon you want to circumscribe, because, while you can circumscribe up to three, in most cases, you can't circumscrbe all.

                               

                              Regardless, the technique suggested is a practical and useful one. It is one of several commonly-used practices to use a circle or other ellipse as a measuring tool in an environment (like Illustrator and other drawing programs) that is near-tyrannically oriented to mere horizontal and vertical axes.

                               

                               

                              JET

                              1 person found this helpful
                              • 12. Re: Maximum distance across any axis?
                                JETalmage Level 6

                                 

                                Said another way: The minimum bounding circle (the smallest circle which will enclose a given irregular polygon), which is what you really seem to be trying to achieve, is not a simple matter of knowing the greatest distance across the polygon. It may be that simple, but only if none of the other points on the polygon form an accute angle with the two points of your "greatest distance across." But even given that, from a graphics viewpoint, the minimum bounding circle is quite likely not what you want, because as often as not, the enclosed polygon will not be visually centered (as demonstrated in my second post).

                                 

                                JET

                                • 13. Re: Maximum distance across any axis?
                                  RSDD Level 1

                                  My apologies to JET and the members of the forum for my too quick response to JET's post early in this discussion. I jumped to conclusions and replied out of frustration. I appreciate JET's answers and, after reading through them, I realize that the problem is far more difficult than I initially thought and that, in true application of Occam's Razor, his method is actually the most practical. Thank you, JET, for your input and patience.

                                   

                                  RSDD

                                  • 14. Re: Maximum distance across any axis?
                                    Wade_Zimmerman Level 6

                                    All's well that ends well.

                                     

                                    BTW, I was not making a wise crack but did not want to fuel

                                    an uncomfortable exchange.

                                     

                                    It seems to have worked out really well. James has a website that 

                                    offers some interesting and very useful scripts.

                                    You might visit it now that you know how clever he is.