Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to evenly space lines among shapes using pixel grid

Engaged ,
Jun 09, 2023 Jun 09, 2023

Hi Forum.

 

I have my canvas set to 162 pixels height. and the grid settings to: Grid line every 100 and subdivisions to every 100 to make it even.

 

The red lines is 1 pixel height, one on the top, one in the middle, and one on the bottom. I then make 10 Cyan lines 1 pixel height, and try to evenly distribute them within the middle red line, and bottom red line, but the Cyan Lines do not sit within in the pixel grid perfectly. I know this is a maths issue, so any help appreciated. 

 

So what Im trying to achieve is having my canvas 162 Height. Red line on the top, Red line in the middle, Red line on the bottom. And in between the red lines, 10 Cyan lines distributed evenly sitting within the pixel canvas. 

 

StefanCargoski_0-1686354089854.png

 

 

StefanCargoski_1-1686354181325.png

 

 

PS: One thing I noticed is, when I selected the middle red line, and clicked Vertical align centre to the canvas, it wasn't 100% in the middle of the canvas. I then clicked the option in the Properties> quick actions> Align to pixel grid. The only was it sitting 100% between the pixels.

TOPICS
How-to
372
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 10, 2023 Jun 10, 2023

Stefan,

 

As far as I can see, you red lines are actually red rectangles (live with Corner Widgets and all), and the same with the Cyan ones.

 

Apart from that, how about your forgetting all about Pixel Grid, which really makes no sense here (see reason below), and just (presuming you wish to have 10 Cyan lines/rectangles in between the red ones, otherwise adapt the number below):

 

1) Place a Cyan rectangle, or just a Cyan open path with 1px Width and Butt Caps, on top of the bottom red one,

2)

...
Translate
Adobe
Community Expert ,
Jun 10, 2023 Jun 10, 2023
LATEST

Stefan,

 

As far as I can see, you red lines are actually red rectangles (live with Corner Widgets and all), and the same with the Cyan ones.

 

Apart from that, how about your forgetting all about Pixel Grid, which really makes no sense here (see reason below), and just (presuming you wish to have 10 Cyan lines/rectangles in between the red ones, otherwise adapt the number below):

 

1) Place a Cyan rectangle, or just a Cyan open path with 1px Width and Butt Caps, on top of the bottom red one,

2) Move a copy up on top of the middle red one,

3) Select both Cyan lines/rectangles and Object>Blend>Blend Options with Specified Steps = 10, then Object>Blend>Make,

 

Now you have an appearance with the red ones covered by Cyan ones, then:

 

4) Object>Blend>Expand, then delete the original top and bottom Cyan ones that cover the red ones.

 

Now you have the even distribution.

 

 

The reason the Pixel Grid makes no sense here is that if you wish to place 10 Cyan lines/rectangles between the red ones, there will be 11 intervals over the 81 px vertical centre to centre distance between the two red ones (162/2), and that will give you a distance between Cyan/Red ones of 81/11 ~ 7.3636 px.

 

If you actually wish to place 9 Cyan lines/rectangles between the red ones, to have 10 intervals over the 81 px vertical centre to centre distance between the two red ones (162/2), that will give you a distance between Cyan/Red ones of 81/1 = 8.1 px.

 

The latter is a nicer number, but you still have no integer pixel distances and no integer pixel positions.

 

That would require something like a canvas that is 160 px along with 9 Cyan lines/rectangles in between the two lower Red ones with integer pixel distances of 8 px, and integer pixel positions.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines