[solved] Define custom dash(stroke)

Post questions on how to use or achieve an effect in Inkscape.
tobis

[solved] Define custom dash(stroke)

Postby tobis » Fri Jul 25, 2008 8:19 pm

Is it possible to define custom dash(stroke) ?

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Define custom dash(stroke)

Postby sas » Fri Jul 25, 2008 8:24 pm

I think the only way to produce a custom dash pattern is with the XML editor. Select the path, open the XML editor (Ctrl+Shift+X), click on the style attribute and look for the "stroke-dasharray" property. This property is just an alternating list of dash lengths and gap lengths. Change it as required, and then click Set. There's also a "stroke-dashoffset" property if you need to shift the dash pattern.

SureWhyNot
Posts: 137
Joined: Mon Jun 16, 2008 11:37 pm
Location: United States

Re: Define custom dash(stroke)

Postby SureWhyNot » Sat Jul 26, 2008 2:22 am

Pfft, XML editing. :roll:

You could try using custom markers. What that does is place a predefined shape on top of each node in a path. If you make sure all the nodes in a path are evenly spaced, it should have a kinda similar effect.

To make a custom marker, you need to first draw what you want each one look like. Then select it (make sure it's all one combined path, if you used more than one shape) and do object->objects to marker. Note: This doesn't appear to do anything at first.

Now make (or select) the stroke you want to apply the markers to. Go to the fill and stroke dialog, and set all the markers to your new one, or one of the premade ones. (You might have to close and open the menu a time or two before yours will show up).

I hate how changing the stroke width changes the size of the markers. But if you start off with markers that are really small, then increase the stroke width to what you want, the markers might be the correct size. You'll have to experiment. Or just mess with the XML. :geek:

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Define custom dash(stroke)

Postby microUgly » Sat Jul 26, 2008 8:33 am

You could also use pattern along path.

EDIT: ...but that'll remove any fill effect on your object.


Return to “Help with using Inkscape”