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.

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).

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).

Hi, I do have a stroke around the whole flag like you suggested, it's a rectangle with no fill and a black stroke (0.25 pt) which is at the top in the stacking order, which looks quite good, It's definitely necessary to have a stroke because if any of the edge of the flag is white you wouldn't be able to see the edge!

Hi again Jacob, Whoa! … I have just tried doing what you said and found a problem with your solution “Create a straight path, with a Stroke Weight equalling the width of the bar” The stroke value is in points and my dimensions are in millimetres, am I required to change the stroke value back and forth while working on the design? that would be a bit annoying.

I have at the moment got as far as a straignt line from corner to corner which has no width value [width value should be 18 mm]

Hi thanks, I have made the width 18 mm Ok, and done [Object > Path > Outline Stroke] There are two things I would say. First, the bar (from the guidline in the middle) appears to be no longer centrerd propery on the corner points of the rectangle (but that may just be the way Illy presents it visually, as there are no longer points where the original line was on the centre line of the bar)

Second, when I select the bar and the rectangle behind it, it does not let me pathfinder it with Intersect for some reason [it just says, “Filter produced no results, please select two overlapping paths”], however, it does let me pathfinder it with exclude just leaving me with all the rubbish I didn't want! See below.

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.

Hi again, I have done [Object > Path > Add Anchors Points] and got the anchor points successfully. (it now displays a point at each end of the line in the centre of the shape) When I zoom in on it, I can quite clearly see that the end points of the centre line is not on the points of the corner of the rectangle, but there is not much I can do about it as it does not allow you to select the point and move it with the white arrow tool as usual.

With the white arrow tool you can only move the whole thing, I need to move the points of the line in the centre of the shape to put it back on the corners of the flag.

Thanks, I have moved the shape's centre points to the corners of the rectangle successfully, (the line it's self has not moved). I don't know what will happen when I remove the anchor points hopefully the line in the centre of the bar will adjust accordingly centring the shape on the corner points. I will let you know what happen's in a minute.

Removing the anchor points made the shape disappear! and, what it has done is not moved the whole bar to centre on that line it has just merely moved the centre points of the surrounding shape, so it is no longer a right angled shape nor is it actually centred on the diagonal between the two corners. (hope you can see the pic when it is scaled down)

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).

Hi, thanks for help again, that sounds like a much better order of doing it. If I make the stroke the right thickness (18 mm) and then place the points on the corners, it might stay in place when I Object >Path >Outline Stroke it. I don't yet see the point in extending the diagonal line past the rectangle (if it is to make illy recognise it has overlapping for the Pathfinder crop, I think I can get it to do that another way. I would just rather keep the points on the points). If I can get the bar to be 18mm think with the points still on the corner points of the rectangle I think I can do it.

I am going to try this on Friday morning when I have a day of work (it's Wednesday night here now) I will have a good go at your instructions and some other ways and get back to you. I am going to drink some beer and listen to some music (Children of Bodom) now, and then get some sleep!

It took me ages to get your question “is it a bottle a broon?” is it a bottle of Newcastle Brown Ale, (pronounced by northerners as “a bottle a broon”) in England that's very northern, I'm from the south, (Andover, Hampshire) but obviously it's a mockery of a northern accent, I got it in the end. Actually (for me) it's four cans of Carling. I know all the brands are different in the USA so you have probably never heard of Carling!

BTW if you don't know your UK geography, Newcastle is in Northern England not Scotland but both people from Northern England and Scotland would literally say “a bottle of broon” they do all sound impossible to understand!

Hi Jacob, Yep, that has worked, 100%. It looked right to the eye and to check it, I did [object » path » add anchor points] and clicked on the central point and it was right on the corner of the flag, so all is good. I am sure I will be able to crop it somehow with the pathfinder now it is properly aligned on the points.

Is there any way of making it a normal shape? i.e. without the line through it where the centre of the stroke was (when you select it with the black arrow tool). So it just becomes like any other rectangular shape? I might not apply this change, it depends what happens when I crop it, or try to crop it!

It still won't let me crop it. So I have made a rectangle corresponding to the edges of the flag and tried to crop it that way, but it still won't let me do it.

It allows me to combine the shapes (picture below) deduct the bar from the rectangle (post 2) though I don't know why there is an extra point in the punched out bit at the bottom. That shouldn't be there! and it allows me to exclude overlapping areas (post 3)

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)?

No, I don't use Crop, I have only used the top four buttons on the pathfinder pallet, unite, minus front, intersect and exclude. I can (I think but I haven't tried it yet) achieve what I want to by instead of cropping it with the pathfinder, drawing the shape I want to get over it with the pen tool with smart guides on so that it snaps the pints to the points where the shapes' lines overlap. I think that will work to achieve the exact same result.

Monika, I did it all in both orders, (with the bar above and below the rectangle). The three results I got where the only things it allowed. All other combinations produced the error message mentioned above.

It still doesn't work if you extend the shape beyond the corner points. One thing that might make a difference is if we made the diagonal bar a normal shape. What do I have to delete in the layers panel to make it normal and have the properties of any other rectangle made in the usual way?

In the Layer panel for diagonal bar it says, <group> and there is a black circle, for the rectangle it says <path> and there is a white circle

[window » document info » object] for the diagonal bar says - paths 2 (one open, one closed, six points … loads of other stuff I tried to paste it for you but I couldn't.

It might be quicker if you tried doing it yourself on an illustrator file. My rectangle is on A4 portrait, is 150 wide, 90 high and centred on 105 horizontally and 117 vertically, that makes the edge of it 30 mm (x) and the hight of it 72 mm (y). Have a go at a diagonal bar of any width and see if you can do it.

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);

It worked! your a slippery little genius Jacob. 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, however with the diagonal cross, it doesn't matter because I can't ever effect the width without doing it all again anyway.

I don't see why the colour scheme made a difference but it did, as soon as I outline stroked it, it went to a normal shape, not a funny one with a line through the middle. and I held down alt and option when I used the pathfinder this time which it didn't before. Anyway, it all works the bar stayed on the points and everything.

thanks for you help

Gareth

PS. I am going to click correct answer, again but this time I have actually done it!

My mistake, I thought you had done the rectangle and the bar white. Something about what we did differently made it work, 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.

PS. Alt/Option+O++E (Object>Transform>Reflect) didn't work, so I did it manually in the reflect pallet. what I tried to do (this might not have been what you meant) was selected teh bar and pressed [alt and option and O and E] all at the same time but nothing happened!

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.