Overlap two objects to share the same stroke in Illustrator

I have two rectangles with stroke width of 2px.
How do I go about putting them side by side such that they share the same adjacent stroke border of 2px?

I tried dragging the rectangles to fit them into the stroke but there is no snapping. Is there a better way to do this?

Stroke border of 2 x 2px
enter image description here

Rectangles share the same stroke.
enter image description here

Answer

Draw one rectangle and then draw a 2px line and center it in the rectangle.

enter image description here

Unless there’s some reason you must have two separate rectangles.


(Assumption that all strokes are set to the default stroke alignment, which is centered on their respective paths)

Realistically, if two rectangles are actually butted against each other, there is no variation in the appearance of a stroke….

enter image description here

Yellow boxes are all the same width…. as are the strokes. However this is two separate rectangles.

enter image description here

enter image description here

The key may be to use Outline Mode (View > Outline) to ensure your rectangles actually do butt against each other. Outline mode can be an invaluable feature if you are trying to be precise in positioning. There is simply no way to be as accurate working strictly in Preview Mode.

enter image description here

Enlargement:
enter image description here

Because if you have a gap or overlap between the rectangles:

enter image description here

…. and everything is stroked the same color, all you’ll see in Preview Mode (View > Preview) is the apparent “thicker” stroke:

enter image description here

What actually happens is the two strokes overlap each other and are not aligned properly:

enter image description here

So, basically, this issue is ultimately because your two rectangles are not butting against each other.

Correctly aligned objects will have correctly aligned strokes which, when overlapping will not give the appearance of a thicker stroke.

You may also find it helpful to ensure Use Preview Bounds is not checked in the Preferences. This will allow snapping to use actual object paths for snapping rather than their preview containing the stroke appearance.

Attribution
Source : Link , Question Author : Carrein , Answer Author : Scott

Leave a Comment