Search code examples
linuxgraphicsdrawinglines

Drawing a segment with dashes


I need to draw an horizontal segment with dashes on it for a doc I'm writing. I need to subdivide the segment length this way: given l, then length of the segment and n the fraction of the remaining length at each step, the first dash should be at first=l/n from the left, the second at 1/n + (l-first)/n and so on (until the division returns a number less than one)

What tool could I use to draw this automatically, without using a programming language? Or... what script could do this?

I need and image in png/jpg as the final result.


Solution

  • if you need to do it programmitically, then maybe Logo programming language is your tool. it can also be done rather easily with LATEX and TikZ package, in this case you can consult with the TEX-LATEX site, also have a look at library for image creation, all the answers there link to usefull resources, which could be a bit overkill for what you need, but will work. if it's not have to be done programmiticaly, you can just create the image with Gimp or InkScape, though if you need to create many such dashed lines, it would be better to automate the process, and i don't know if these tools has batch action capability like photoshop.