# How can you end a pattern along a path with a fractional pattern?

In Inkscape, it's possible to set a pattern along a path. There are four options for the pattern copies:

• Single
• Single, stretched
• Repeated
• Repeated, stretched

I wish to use the repeated option, but want the pattern to continue right to the end of the path, ending on a fractional pattern when necessary. Is there a way to do this in Inkscape?

In my case, I'm trying to draw a railway line using a pattern given in the left top of the figure, together with the red path shown in the rest of the figure. Gaps occur between lines when there's less than full pattern width distance - I want to avoid these gaps.

• Can't you use "Repeated, stretched"? See example. That would avoid the problem of a partial pattern, and a gap at the end. Aug 11, 2020 at 12:43

While not directly answering the question on fractional repeating patterns, there is a possible solution to the railway problem.

Inspired by a comment made by @user287001, the railway gaps could be solved by creating duplicate paths. One path can be set to have a dashed pattern, and the other can be converted in two parallel lines using 'stroke to path' with a stroke but no fill. This replicates the railway effect sought while avoiding any gaps in the paths.

I guess you cannot accept "repeated & stretched" because the pattern isn't exactly the same everywhere with it.

Here's one suggestion - absolutely nothing elegant, but possible.

Have 2 copies of the path. Insert to one a tail so that you get full repeated patterns when you apply Pattern along path. Insert a mask which hides the tail. It can be a solid white version of the right length path.

Masking: Have the white version on top, select both and apply Object > Mask > Set.

You must be disciplined. Use layers or groups to keep the multiple copies in order.

• Or maybe just playing with the `spacing` option of the path effect? Aug 11, 2020 at 13:25
I think you could simply solve that by playing with the following two parameters of the Path effect: `Spacing` and `Tangential offset`: