MIERUNE / qgis-plugx-plugin

QGIS to Illustrator with PlugX
GNU General Public License v2.0
3 stars 0 forks source link

Dash pattern to penstyle #114

Closed Kanahiro closed 11 months ago

Kanahiro commented 11 months ago
{
    "stroke": "solid", // nopen | solid | dash | dot | dashdot | dashdotdot | customdash
    "cap": "square",
    "join": "bevel"
}

if stroke is not nopen or solid, it is good to assign dash to "stroke" and add dash_pattern prop as following:

"dash_pattern": [2, 1, 4, 2]

To be generic, it is better to treat dash | dot | dashdot | dashdotdot | customdash in one logic. We may be able to translate like: dash -> [5, 2] dot -> [1, 2] dashdot -> [4, 1, 2, 1] dashdotdot -> [4, 1, 2, 1, 2, 1]

Then my proposal is:

{
    "stroke": "solid", // nopen | solid | dash
    "cap": "square",
    "join": "bevel"
    "dash_pattern": [5, 2] // added only when stroke is dash
}
bordoray commented 11 months ago

Looks to become pretty simplier! Should be careful about size translation, which should be close to map portraying. Let me investigate a bit, I will teply today

Kanahiro commented 11 months ago

I mean:

スクリーンショット 2023-08-01 15 49 32

スクリーンショット 2023-08-01 15 49 19

Kanahiro commented 11 months ago

We can convert any units to point!

bordoray commented 11 months ago

I am suspecting dash size to be linked to stroke size. Let me check.

bordoray commented 11 months ago

It looks to be no precision about preset Dash patterns size:

Here is my estimation after measurements, considering stroke_width = s

Dash line : [4s, 2s]
Dot line : [1s, 2s]
Dash dot line : [4s, 2s, 1s, 2s]
Dash dot dot line :  [4s, 2s, 1s, 2s, 1s, 2s]
image image image image