elegant way?

Post questions on how to use or achieve an effect in Inkscape.
epiphany2
Posts: 11
Joined: Wed Feb 22, 2017 6:16 am

elegant way?

Postby epiphany2 » Sat Apr 15, 2017 9:53 pm

Is there any elegant way to create a rectangle with upper and lower strokes as dashes and straight lines
on the sides? The rectangle should have a fill color.

I have created the attached rectangle as one without stroke and proceeded to add individual four lines with pen tool.

Thanks & Best,
nib


rectangle.svg
(6.15 KiB) Downloaded 150 times

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: elegant way?

Postby theozh » Sat Apr 15, 2017 10:46 pm

How you have done it, is the most straightforward procedure I can imagine.
What do you expect to be more "elegant"?
A special dialog which let you choose the stroke of all four sides idependently...?

Well, you could use a rectangle with dashed stroke and put only two full lines on top.
Snapping to the corner also might help for the alignment.
Maybe it's useful if you group the three or five objects if you plan to scale or move this rectangle around.
Win7/64, Inkscape 0.92.2

epiphany2
Posts: 11
Joined: Wed Feb 22, 2017 6:16 am

Re: elegant way?

Postby epiphany2 » Sat Apr 15, 2017 10:55 pm

Thanks theozh,

Somehow I feel my method is bit crude. I was thinking on lines of (but it is not working)

1. Create a rectangle with stroke & fill.
2. Convert object into path.
3. Break Apart
3. Use Node tool. Select both top nodes. Convert into dashed line. Select bottom two nodes,
convert into dashed line.

Above doesn't work. I must be missing something.

Your suggestion is better than mine !

Thanks & Regards,
nib

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: elegant way?

Postby theozh » Sun Apr 16, 2017 3:16 am

Well, your second approach would also work.
However, if you have a single path the command "Break apart" (Shift+Ctrl+K) will not break your path into individual segments. If you want to achieve this, you have to use the Node Tool (F2), mark all nodes and use "Break path at selected nodes". Then you can set the dashed strokes of the individual segments as you like.
But since your four sides are not a single connected path the enclosed rectangle will not be filled anymore.
For this you need a (closed) path, which you could achieve with a duplicate of your rectangle just without stroke but with fill. So, but then you are basically back to your first solution.
Win7/64, Inkscape 0.92.2


Return to “Help with using Inkscape”