Skip navigation
Currently Being Moderated

Defining Diagonal Bars in a Rectangle in Illustrator

Sep 3, 2012 1:35 PM

Hi everyone, In Illustrator how do you make a shape with points which go from point to pint within another shape?

 

For example, I am making flags, when a flag has a diagonal bar such as Scotland and Jamaica, the width of the bar is defined by it flat or laying horizontal and then it is set diagonally across the flag, with it's centre across the centre of the flag [rectangle] and it's ends centred on the corners.

 

How do you define a horizontal bar to be a certain width (when flat) and define it to be centred along the diagonal of a certain shape and with it's length defined by the corners of the rectangle?

 

Any help much appreciated

Gareth

 

PS. I have done an example of what I am trying to do here in an exact square. It can be done easily in an exact square because you just make the bar 45º, however by doing it this way the points at the centre of the white bar (which I have put there myself exactly in the middle) are still not at the corner points of the rectangle, thus the length of the diagonal bar is not defined.

 

 

 

FlagDiagonal.jpg

 
Replies 1 2 Previous Next
  • Currently Being Moderated
    Sep 3, 2012 3:07 PM   in reply to Gareth_Williams

    Gareth,

     

    You may (Smart Guides are your friends):

     

    1) Create a straight path, with a Stroke Weight equalling the width of the bar, close to being from corner to corner, then with the Direct Selection Tool drag the endpoints to coincide with the corner Anchor Points,

    2) Object>Path>Outline Stroke,

    3) Create a copy of the background rectangle (Ctrl/Cmd+F),

    4) Select 2) and 3) and Pathfinder>Intersect shape areas (or whatever it is called in your version to result in the overlap between the shapes, you may need to press Alt/Option to make a simple path).

     

    To create the crossing bar you may:

     

    5) Select 4) and Object>Transform>Reflect a copy (vertically or horizontally).

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 4, 2012 3:09 AM   in reply to Gareth_Williams

    You are welcome, Gareth.

     

    Just an afterthought: if you ever need to add a stroke to the flag, you may copy the background rectangle and change from fill to stroke, then move it to the top/bottom of the stacking order, depending on whether you wish to have the full stroke visible on top of the rest (covering the outermost part of the fills) or the outer half of the stroke visible (outside the fills).

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 4, 2012 11:43 AM   in reply to Gareth_Williams

    Gareth,

     

    In the Stroke Weight box, you may enter the unit, if you need 18 mm, just insert 18 mm.

     

    It will change to the corresponding value in points (51.024).

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 4, 2012 2:28 PM   in reply to Gareth_Williams

    Gareth,

     

    Here is an amended version which deals with the occasional issue of lacking coincidence/overlap in 2B) and a way to make sure the bar is centred over the corners in in 2A), the latter to be undone again:

     

    You may (Smart Guides are your friends):

     

    1) Create a straight path, with a Stroke Weight equalling the width of the bar, close to being from corner to corner, then with the Direct Selection Tool drag the endpoints to coincide with the corner Anchor Points,

     

    2) Object>Path>Outline Stroke,

     

    2A) If desired, to make sure the centring is right on the corners, Object>Path>Add Anchor Points to get Anchor Points at the centre of the end segments, then use Ctrl/Cmd+Z to Undo to get rid of unecessary Anchor Points,

     

    2B) In the Transform palette/panel, increase the value of W (or H, you may insert *1.01 (or *1.1) to the value to increase it by 1% (or 10%)) and use Ctrl/Cmd+Enter to increase the length past the corners of the background rectangle (it is important to have the Centre Reference Point ticked),

     

    3) Create a copy of the background rectangle (Ctrl/Cmd+F),

    4) Select 2) and 3) and Pathfinder>Intersect shape areas (or whatever it is called in your version to result in the overlap between the shapes, you may need to press Alt/Option to make a simple path).

     

    To create the crossing bar you may:

     

    5) Select 4) and Object>Transform>Reflect a copy (vertically or horizontally).

     

     

     

    I apologize for forgetting the coincidence/overlap issue. It only occurs when some inaccuracy sneaks in, but it is rather annoying when it does. I went through the steps before posting the original suggestion without encountering it.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 4, 2012 3:16 PM   in reply to Gareth_Williams

    You are welcome, Gareth. It is getting late indeed, for us over here.

     

    I forgot to mention that Smart Guides say anchor when you are within snapping distance of the corners.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 5, 2012 11:01 AM   in reply to Gareth_Williams

    Gareth,

     

    When the object is selected, you need to deselect it to move an individual Anchor Point (or the Direct Selection Tool will keep moving it as a whole); you can do it by clicking an empty spot.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 5, 2012 12:29 PM   in reply to Gareth_Williams

    Gareth,

     

    I believe it is better to return to a slightly simpler instruction (and I just realized that the order was a bit wrong so the width of the bar would become too large):

     

    1) Create a straight path, with a Stroke Weight equalling the width of the bar, close to being from corner to corner, then with the Direct Selection Tool drag the endpoints to coincide with the corner Anchor Points; the line will be coincide with the centreline of the bar when outlined;

     

    2) In the Transform palette/panel, increase the value of W (or H, you may insert *1.01 (or *1.1) to the value to increase it by 1% (or 10%)) and use Ctrl/Cmd+Enter to increase the length past the corners of the background rectangle (it is important to have the Centre Reference Point ticked); this will extend the line past the corners of the background rectangle, but the line will still go through the corners;

     

    3) Object>Path>Outline Stroke,

     

    4) Create a copy of the background rectangle (Ctrl/Cmd+F),

     

    5) Select 3) and 4) and Pathfinder>Intersect shape areas (or whatever it is called in your version to result in the overlap between the shapes, you may need to press Alt/Option to make a simple path).

     

    To create the crossing bar:

     

    6) Select 5) and Object>Transform>Reflect a copy (vertically or horizontally).

     

    I hope this works.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 5, 2012 2:40 PM   in reply to Gareth_Williams

    You are welcome, Gareth, and enjoy (is it a bottle a broon?).

     

    As I said, the issue with the Pathfinder only occurs when there is an inaccuracy; normally you should be fine without extending the line.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 6, 2012 4:56 AM   in reply to Gareth_Williams

    Gareth,

     

    Newcastle is in Northern England not Scotland

     

    Indeed, a bit north of Aidensfield.

     

    For a broon, you may try a gentle, steady pour down the side of the tilted glass to avoid the head and keep the hop oils in the ale.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2012 3:22 AM   in reply to Gareth_Williams

    Gareth,

     

    It seems that you have the original line lingering somehow. You may see that in the Layers palette/panel. If/when it happens, you will have to delete it.

     

    Edit: Away for an hour or so. Back long before sunset.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2012 5:31 AM   in reply to Gareth_Williams

    Result of applying pathfinder operation depends upon the stacking order of objects. So maybe you'd want to dive into the manual and read a little about how this all works.

    http://help.adobe.com/en_US/illustrator/cs/using/WS714a382cdf7d304e7e0 7d0100196cbc5f-6462a.html

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2012 5:50 AM   in reply to Gareth_Williams

    Gareth,

     

    Sorry, it proved to be an hour or two rather than so.

     

    Sometimes the inherent inaccuracy (of drawing in mm when the fundamental unit is points) disturbs the use of the Pathfinders, especially when the coincidence/overlap occurs between an Anchor Point (such as the corner of the background rectangle) and a segment (such as the end segment of the bar); is often seen in connexion with circles and radial lines, so the latter need to be extended.

     

    That is the reason for step 2) in post #15, which is only required in such cases.

     

    It may be that yours is one of them.

     

    What happens if you use the extension in step 2)?

     

    By the way I have noted that you use Crop instead of Intersect shape areas. What happens if you use Intersect (depending on version you may need to hold Alt/Option to get just the bar as a simple path)?

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2012 6:12 AM   in reply to Gareth_Williams

    Gareth,

     

    What about the inclusion of step 2), then?

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2012 8:06 AM   in reply to Gareth_Williams

    Gareth,

     

    One thing that might make a difference is if we made the diagonal bar a normal shape

     

    It should be.

     

    If you select the diagonal bar, right after Object>Path>Outline Stroke, what does the Layer palette/panel say?

     

    And if you open the Window>Document Info and select Objects in the flyout, what does it say (hopefully just Path: 1 (4 points))?

     

    Edit: Soon away for a while again, maybe until  sunset.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2012 12:02 PM   in reply to Gareth_Williams

    Gareth,

     

    Back from the field, sun below the hills.

     

    What I did was (actual clicks and keystrokes):

     

    0) Create the 150 by 90 mm nostroke background rectangle with a 100% C Fill, placed with X = 105 mm, Y = 117 mm as centre, lower left corner at X=30, Y=72, and upper right corner at X=180,Y=162;

     

    1A) Create a nofill straight path with a white 1pt Stroke and drag the endpoints to coincide with the lower left/upper right corners (Smart Guides say anchor), Anchor Points having the same X,Y values as the corners of 0);

    1B) Increase the Stroke Weight to 18mm, the path covers the corners of 0);

     

    2) Nothing/Skip the extension of length;

     

    3) Alt/Option+O+P+U (Object>Path>Outline>Stroke) to create the bar rectangle;

     

    4) Select the background rectangle 0) and Ctrl/Cmd+C+F to copy it above the original;

     

    5) ShiftClick the outlined white rectangle 3) to have both selected and Pathfinder>Intersect while holding Alt/Option, resulting in the first bar being a simple path;

     

    6) Alt/Option+O++E (Object>Transform>Reflect) a copy vertically, to make the full cross;

     

    7) Select the background rectangle 0) and Ctrl/Cmd+C+F+X+F to copy it above everything else and change it to nofill 0.25 pt 100%K Stroke.

     

    The outcome looks more or less like a rather whitened Bratach na h-Alba (Saltire).

     

    So it works here, with the same sizes and positions.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2012 2:48 PM   in reply to Gareth_Williams

    Gareth,

     

    Changing the background to 100%C and 44%M gets it rather close.

     

    And selecting both bars, then Pathfinder>Merge in step 6) would make it even neater with the whole cross as one simple path with 16 Anchor Points.

     

    I really hope you can make it work: I should hate to suggest cruder solutions.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2012 3:27 PM   in reply to Gareth_Williams

    You are welcome, Gareth; a great relief.

     

    why on earth are you doing it all white so you can't see what you're doing? Is there a reason that everything has to be white?

     

    I made the background rectangle 100% C(yan), then finally changed it to 100%C+44%M, following the recommendation of the Education, Culture and Sport Committee of the Scottish Parliament.

     

    I don't merge the two bars on right angle crosses, so I can still access the width of the bars, you loose that capability if you merge them together,

     

    That makes perfect sense, and obviously it is unnecessary to merge in any case.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2012 4:07 PM   in reply to Gareth_Williams

    Gareth,

     

    it may well have been that when I did the original stroke this time, I set it (on your instructions) no fill and only gave it a stoke colour. And when it was outline stroked it just turned straight into a normal shape.

     

    Ah, sorry, I overlooked the filled path trap, Illy assuming filled and stroked paths to start with: when you outline the stroke, the fill is kept as a separate filled nostroke path with no width, just waiting to cause trouble.

     

    Alt/Option+O+T+E is meant as Hold Alt/Option (depending on OS) while you press O, thenT, then E; you can see the keystroke guide unfold as underlining of the (next) letter in question when you hold Alt/Option.

     
    |
    Mark as:
1 2 Previous Next

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points