Mobile app version of vmapp.org
Login or Join
Ann6370331

: Inkscape: Divide Closed Path in Arbitraty Fractions / Segments I have a closed path that is taken from here (Wikipedia). It's the race track of the 24 Hours of Le Mans race (also known as

@Ann6370331

Posted in: #Inkscape #Path

I have a closed path that is taken from here (Wikipedia). It's the race track of the 24 Hours of Le Mans race (also known as " Circuit de la Sarthe").


I am new to Inkscape and co.




The Basic Problem

I want to indicate the "progress of the race" on a percentage basis by coloring a specific fraction of the path like in the following illustrations (the text is there to make it clear, I don't want the text in the final image).





Why do I want this?

The background is, that I want to use this as a kind of progress bar in a PowerPoint presentation (instead of the common"slide 4/23").

What would be the ideal outcome?

Ideally, there is a batch function that exports 0 to 100 percent in a 1 percent step, like 0.pdf | 1.pdf | 2.pdf | ... | 99.pdf | 100.pdf (pdf or PNG).

Related Question(s)

stackoverflow.com/questions/15365473 (may be related)


Update - LaTeX solution

I am more active on the LaTeX version of stackexchange - inspired by the solution here I figured out an alternative approach (using a custom dashed pattern):
tex.stackexchange.com/questions/347336

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Ann6370331

1 Comments

Sorted by latest first Latest Oldest Best

 

@Turnbaugh909

Manual Approach

Draw a short, vertical line (blue). Holding [ctrl] helps to draw the line exactly vertical.

Select the path (black) and the line (blue) and click Extensions > Generate From Path > Pattern Along Path. Use the settings from the image below. You may adjust the setting Space Between Copies as you like. Using the live preview can be useful here. You can also use Extensions > Visualize Path > Measure to show the length of the path and then compute the required spacing to obtain N segments.



Apply the path effect. Now you should have segments drawn over the path.



Select the segments and the path. Click Path > Cut Path. The blue segments should disapear and the path should be cut into small segments which you can select and color manually.



Hint: You can copy and paste styles. Select one segment. Color the segment red and press [ctrl]+[c]. Select one or multiple other segments and press [ctrl]+[shift]+[v]. The other segments are now red too.

Automated Approach

I'm not aware of an Inkscape feature or plug-in, that animates the path and exports all images. But there is an old trick for animating svg paths which can be used to write a small script which animates the path for you:

Strokes can be dashed and we can choose how big the dashes and gaps in between them are (in Inkscape, you probably have to use the XML editor to do so). In your case, the animation works as follows:


Duplicate the black path and put it above the black path, but under the black start circle.
Color the duplicate red and use a custom dash pattern with gaps bigger than the length of the path.
Change the length of the dashes from 0 to the length of the path.


Please have a look at the linked website for illustrations.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme