Hello everyone.
This is my first post on these forums.
How can I draw a box (a long horizontal rectangle) and then divide that rectangle into 10 equally sized boxes along it's length?
It should look like the attached picture..
Divide a box into equal parts?
Divide a box into equal parts?
- Attachments
-
- Untitled.png (1.91 KiB) Viewed 19143 times
Re: Divide a box into equal parts?
Welcome to InkscapeForum!
Hhmmm.....I don't know if there's a way to do that automatically.....I don't think so. But I'm not clear what you're asking. Well, first, the spaces between the vertical lines in your illustration are not equal. But assuming you want them to be equal.... Do you want the outer rectangle, with 9 vertical lines, equally spaced, creating 10 spaces in between? Or do you actually want 10 rectangles all in a line? Those 2 scenarios would look identical. It would only be when you start selecting things, to do whatever else you're going to do, that it would matter how it's made.
If it's the 1st one, then draw the rectangle and 9 lines. Use the various values on Selection tool control bar, and simple math, to place the lines. Or you could use Align and Distribute dialog, rather than control bar values.
For the 2nd one, you'll also need to know the width of the outside rectangle, and divide by 10. Now draw a new rectangle with a width equal to the result of the division. Enable snapping, duplicate, move it over (snapping left side of duplicate to right side of original). Repeat until you have 10 in a row.
Or maybe someone else knows a different way to do it?
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Divide a box into equal parts?
Thanks for the reply..
and I apologize for the confusion. I was referring to the first scenario.. that is to draw the outer rectangle and then divide it with 9 vertical lines. (The boxes in the figure aren't equal because I sketched them manually--and hastily. )
and I apologize for the confusion. I was referring to the first scenario.. that is to draw the outer rectangle and then divide it with 9 vertical lines. (The boxes in the figure aren't equal because I sketched them manually--and hastily. )
Re: Divide a box into equal parts?
Here's one approach that should work, using the Align and Distribute dialogue to do the heavy lifting:
1) Draw your rectangle. While it's selected, copy it to the clipboard.
2) Draw a vertical line using just above or below the rectangle - use the CTRL key to ensure it's vertical.
3) Edit > Paste Size > Paste Height to make your line the same height as the rectangle.
4) Duplicate your line 10 times, to give you 11 copies in total. You can simply press CTRL-D 10 times as one option.
5) Select the rectangle, hold shift and select one of the lines (check the status bar to see that you've got 2 objects of type Rectangle and Path).
6) Objects > Align and Distribute. Set the "Relative to:" popup to "First selected".
7) Click the "Align left edges" button (first row, second icon). Leave the dialogue open.
8 ) Select the rectangle and another line. Click the "Align right edges" button (first row, fourth icon).
9) Select all the lines, but not the rectangle, then click the "Distribute the centres equidistantly horizontally" button (in the Distribute section, second icon).
10) Delete the first and last lines to leave you with your 9 equally spaced vertical lines.
11) Select the rectangle first, then add all the lines to the selection.
12) Click the "Centre on horizontal axis" button (second row, third icon).
Do those steps one at a time, making sure you understand what's happening at each step, and I think you'll find that it's quite straightforward. There are ways to reduce some of the steps, but probably at the expense of clarity, so this is an instructional set of steps, not an optimal set.
1) Draw your rectangle. While it's selected, copy it to the clipboard.
2) Draw a vertical line using just above or below the rectangle - use the CTRL key to ensure it's vertical.
3) Edit > Paste Size > Paste Height to make your line the same height as the rectangle.
4) Duplicate your line 10 times, to give you 11 copies in total. You can simply press CTRL-D 10 times as one option.
5) Select the rectangle, hold shift and select one of the lines (check the status bar to see that you've got 2 objects of type Rectangle and Path).
6) Objects > Align and Distribute. Set the "Relative to:" popup to "First selected".
7) Click the "Align left edges" button (first row, second icon). Leave the dialogue open.
8 ) Select the rectangle and another line. Click the "Align right edges" button (first row, fourth icon).
9) Select all the lines, but not the rectangle, then click the "Distribute the centres equidistantly horizontally" button (in the Distribute section, second icon).
10) Delete the first and last lines to leave you with your 9 equally spaced vertical lines.
11) Select the rectangle first, then add all the lines to the selection.
12) Click the "Centre on horizontal axis" button (second row, third icon).
Do those steps one at a time, making sure you understand what's happening at each step, and I think you'll find that it's quite straightforward. There are ways to reduce some of the steps, but probably at the expense of clarity, so this is an instructional set of steps, not an optimal set.
- shawnhcorey
- Posts: 149
- Joined: Mon Jan 07, 2008 12:17 pm
Re: Divide a box into equal parts?
Another method:
- Draw two lines over the two ends of the box.
- Select them both but not the box.
- Select: Extensions -> Generate from Path -> Interpolate...
- Set the Interpolate Steps to 9 (one less than you want).
- Click Apply.
- flamingolady
- Posts: 687
- Joined: Wed Jun 10, 2009 1:40 pm
Re: Divide a box into equal parts?
While my first thought was the same as XAVs (make vertical lines, then use align, then add a rectangle on top of them), another method would be simple as well: draw the first vertical line, then duplicate it (Ctrl + D), then use Shift + space bar and hit it say 6 times (however much space you want), then create the next line (repeat the process), duplicate it, then hit Shift + space bar 6 times, do this until you have completed your 10 boxes, then add a rectangle to box them in, or add more lines. (of course you will need to group them together, or combine them when done).
Re: Divide a box into equal parts?
Why not use the Construct Grid path effect with size X =1 and size Y = 10 (draw the initial path as big as an approximated single cell, then apply the path effect, adjust the parameters, and then resize (with node snapping) the resulting grid itself to match the required size of the original rectangle).
- shawnhcorey
- Posts: 149
- Joined: Mon Jan 07, 2008 12:17 pm
Re: Divide a box into equal parts?
If you're going to use a grid, any grid will do. Draw a rectangle ten units wide and draw the lines to divide it into sections. Group them all together, remove the grid, and resize the group to the size you want.