Doing a checkered pattern on a pre-drawn rectanlge

Post questions on how to use or achieve an effect in Inkscape.
aiat_gamer
Posts: 7
Joined: Fri Aug 30, 2013 7:53 pm

Doing a checkered pattern on a pre-drawn rectanlge

Postby aiat_gamer » Mon Sep 02, 2013 9:38 pm

Hi,
I have a rectangle which is 80x900 pixels. Below is the top part of the rectangle:

Image

Now I want to change the whole rectangle to this:

Image.

How can I do that? Please tell me step by step, thanks!

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Doing a checkered pattern on a pre-drawn rectanlge

Postby Lazur » Mon Sep 02, 2013 11:28 pm

Hi,

There are many ways of drawing such.
Here is one of them: adding a checkerboard fill with the right dimensions.
  1. Draw the rectangle at (0;0), the size of 80/900 pixels.
  2. Set page borders around the rectangle at the document's properties panel (Shift+Ctrl+D).
  3. Draw another rectangle at (1;899), the size of 2/2 pixels.
  4. Enable snapping to cusp nodes at the snap bar.
  5. Select the 80/900 sized rectangle and set a black checkerboard pattern for the fill
    at the fill and stroke panel (Shift+Ctrl+F).
  6. Use the node editor tool to adjust the fill pattern's handles.
    They are at the top of the rectangle.
    Select the handle marked with x and snap it to (1;901),
    select the handle marked with square and snap it to (3;899)
    -the top left and bottom right corners of the 2/2 sized rectangle.
  7. Delete the rectangle used as a guide.

If you want to add other colour to the transparent part,
the easiest way is by duplicating the rectangle (Ctrl+D) and adding a solid fill,
and moving it below the one with the checkerboard pattern (PgDown).
Attachments
hlp72.svg
(2.8 KiB) Downloaded 251 times

aiat_gamer
Posts: 7
Joined: Fri Aug 30, 2013 7:53 pm

Re: Doing a checkered pattern on a pre-drawn rectanlge

Postby aiat_gamer » Tue Sep 03, 2013 3:15 am

Dude you are a genius! :shock: . Can you tell me the how you figured this out? I cant really understand it!
Now that I have you here, can you tell me how I can now change the checkered pattern? lets say that this time, only the top left of the square is black and the other three are all white. ;)

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Doing a checkered pattern on a pre-drawn rectanlge

Postby tylerdurden » Tue Sep 03, 2013 3:23 am

Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Doing a checkered pattern on a pre-drawn rectanlge

Postby Lazur » Tue Sep 03, 2013 6:07 am

Learned these things here.
Personally I would have never used this method myself.
It always seemed to me that patterns have some rendering issues at tile seams and that they are not accurate,
but in this case I think it's working well.
Wasn't sure what it was all for, creating some kind of grid?
Because you can't snap nodes to the pattern, and that would need a different method.

In that pattern attached the base pattern was made up of a 2*2 tile, with two black squares the size of 1*1 pixels.
Those handles show exactly the corners of that tile.

Talking of modifying the tile:
  1. select the rectangle
  2. Convert the pattern to objects (Shift+Alt+I)
  3. Change the top left square's size to 2*2 and position to (1;899)
  4. Add a white fill to it
  5. Add the black square to the selection (Shift+Click)
  6. Convert objects to pattern (Alt+I)
  7. Switch display mode to outlines only
  8. Select the original rectangle
  9. Add the newly created pattern fill to it through the fill and stroke panel
  10. Delete white and black squares

You may see some rendering issues if you add an object below the rectangle with a different colour, and if you zoom in/out.
In the current development build the rendering on screen is improved, maybe there it doesn't occour.
If you export the svg at 90 dpi -to a raster image of the same size as on screen-, that doesn't show up so that issue is not a real problem I guess.
Attachments
hlp72II.svg
(2.33 KiB) Downloaded 230 times


Return to “Help with using Inkscape”