paulgb / penkit

Tools for pen plotting in Python
MIT License
142 stars 8 forks source link

How can I define stroke width? #11

Open mahtDFR opened 3 years ago

mahtDFR commented 3 years ago

I want to generate an SVG to an A4 page with a stroke of 0.1mm

I can set the page with something like write_plot([proj], name, unit='mm', width=297.0, height=210.0)

But how can I set the stroke?

paulgb commented 3 years ago

You can pass stoke_thickness_pct to write_plot as well. It is expressed as a fraction of the width of the page and defaults to 0.003 (0.3%). If my calculation is correct I think the value you want to pass is about 0.00034.

I admit I haven't put much thought into the styles that apply to penkit output because it's meant to be fed into plotter driver software which only really cares about the paths themselves. You might find you need to open the result in inkscape and do some post-processing to get more control of the output.