Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Potential "hatching" script
#7
Making some progress: presets allow to generate some complex stuff:

   

Basically a "style" is an angle, a spacing and  a thickness. In addition one of more dash patterns can be applied cyclically to the lines. Values can be left unspecified so that they take their value from the parameter dialog. So you can for instance have a style that is always at 45° and another one that takes whatever angle is specified in the UI.

Now, one last question, should the thickness of the lines be expressed as an absolute size , for instance 5px, or should it be a ratio of the spacing? Since everything that defines the dash patterns is expressed as a ratio of the thickness, having the thickness expressed as as ratio of the spacing would make the whole preset scalable by just changing the spacing.

Donning my spanish cardinal hat: one more last question: the presets are kept in a file which is loosely based on the .ini but it is not very practical. Would JSON format be too technical? All decent text editors support it:

Current INI:

Code:
[Complex]
angle: 45
dashPeriod1: 20
dashPeriod2: 4
dashPeriod3: 20
dashPeriod4: 4
dashPeriod5: 20
dashRatio1: 100
dashRatio5: 100
dashRatio2: 50
dashRatio3: 50
dashRatio4: 50
dashOffset1: 0
dashOffset2: 0
dashOffset3: 0
dashOffset4: 0
dashOffset5: 0

The equivalent JSON would look like:

Code:
{
    "Name":"Complex",
    "Angle": 45,
    "Dashes": [
        {   
            "dashPeriod":20,
            "dashRatio":100,
            "dashOffset":0
        },
        {   
            "dashPeriod":4,
            "dashRatio":50,
            "dashOffset":0
        },
        {   
            "dashPeriod":20,
            "dashRatio":50,
            "dashOffset":0
        },
        {   
            "dashPeriod":4,
            "dashRatio":50,
            "dashOffset":0
        },
        {   
            "dashPeriod":20,
            "dashRatio":100,
            "dashOffset":0
        }
    ]
}

One benefit of JSON is that if you use several dash patterns you don't have to keep track of their index which is implicitly determined by their position.
Reply


Messages In This Thread
Potential "hatching" script - by Ofnuts - 08-29-2020, 11:16 AM
RE: Potential "hatching" script - by denzjos - 08-29-2020, 05:49 PM
RE: Potential "hatching" script - by Ofnuts - 08-29-2020, 07:40 PM
RE: Potential "hatching" script - by Krikor - 08-29-2020, 06:28 PM
RE: Potential "hatching" script - by Ofnuts - 08-30-2020, 09:23 AM
RE: Potential "hatching" script - by denzjos - 08-30-2020, 03:01 PM
RE: Potential "hatching" script - by Ofnuts - 08-30-2020, 10:52 PM
RE: Potential "hatching" script - by Krikor - 08-30-2020, 11:50 PM
RE: Potential "hatching" script - by denzjos - 08-31-2020, 07:35 AM
RE: Potential "hatching" script - by Ofnuts - 08-31-2020, 12:26 PM
RE: Potential "hatching" script - by denzjos - 08-31-2020, 03:30 PM
RE: Potential "hatching" script - by Ofnuts - 09-02-2020, 09:19 AM

Forum Jump: