Martin Osieka

Parallel Lines and Patterns

Recommended Posts

 

'Parallel Lines and Patterns' Render Effect Plugin

Summary

This Paint.NET effect plugin allows you to fill the selection of the current layer with parallel lines or patterns.

 

Ok there are two plugins already allowing to fill with parallel lines (Scan Lines, Diagonal lines) but maybe you like this basic one too.

Keywords

Render, Fill, Parallel Lines, Diagonal Lines, Waves, Hatches, Patterns, Moire effect

Author

Martin Osieka

Download >>  ParallelLines v1.6 (8.3.2015)

Installation

Follow the instructions carefully

  • Unzip "ParallelLines.Effect vX.X.zip"
  • Copy the two files OptionBasedLibrary vX.X.dll/.dlc to the Paint.NET\ folder (NOT to Paint.NET\Effects\ !!!) A typical location is "C:\Program Files\Paint.NET".
  • Copy the two files 'ParallelLines.Effect.dll/dlc' to the Paint.NET\Effects\ folder. A typical location is "C:\Program Files\Paint.NET\Effects".

  • Do not remove older versions of the OptionBasedLibrary if they are required from other plugins.      

After a restart of Paint.NET you will find the plugin at Menu->Effects->Render->Parallel Lines and Patterns...

(oder für deutsche Anwender unter Menu->Effekte->Rendern->Parallele Linien und Muster... ;-)

Compatibility

Paint.NET 3.5.11 and 4.0.5

Supported languages

The language used in the plugin depends on the language setting of Paint.NET and the support of this language by the plugin. The fallback is the first supported language of the plugin. Languages are defined in the .dlc files. This plugin supports the following languages in the moment:

  • English
  • Deutsch

You may add your own translation to the .dlc file.

Dialog options

The options of the effect are subdivided in three sections: Proportions, Orientation, and Colors. You can select a section
via the tabulators on top of the dialog.

 

Proportions Section

 

The options in this section define the proportions of the final fill pattern. A line is composited from line segments.
A line segment has several options which define shape and size of the segment and because the segment is repetitive
also of the whole line.

 

ParallelLines.Dialog.ProportionsTab.jpg

 

  • Parallels

    • Count: You may select
      'Infinite' to fill the area above and below of the reference vector
      'One line' which means there are no parallel lines just one single line.
      'Custom' which enables the value control below. There you can enter the number of lines you like to get.

    • Distance: The distance between the parallel lines depends on the setting 'Center of lines' and 'Border of lines'. 'Border of lines' means somehow the maximum bounding box of a single line. This value is an estimate because it depends on a lot of options and the way the rendering engine works. if 'Center of lines' is selected then the lines may overlap.

    • Drift: This value defines how much a line is shifted horizontally compared to its neighbour line.

  • Whole Line

    • Length: Choose between
          'Infinite' which means there is no limitation of the length in the visible area
          'One period' the length is defined by the 'Period' option of the 'Repetitive line segment'
          'Custom' s user defined length. But repect that the real length is in most cases a multiple of a 'Period'.

    • Thickness: The width of the pen used to draw a line.

    • Joining: Defines how vertices of a line segment are drawn. Only used for lines with vertices.

    • Caps: The caps at the start and the end of a continous line.

  • Repetitive Line Segment

    • Shape: Defines the basic look of the segment. There are basic lines, waves and closed shapes.
          ParallelLines.Dialog.ShapeTypes.jpg

    • Amplitude: The distance between top and bottom of lines with vertical elements.

    • Period: The length of a line segment before it repeats

    • Split at: Some shapes are divided in a first and a second half. Changing the split value changes the ratio of the two parts. Here a Square Wave using different split values:
      ParallelLines.Dialog.SplitAt.jpg

    • Tilt: Some shapes show a tilted line element in the shape. Respect changing the tilt value does not change the amplitude instead the length of the tilted element will change.

Orientation Section

 

In this section you are defining the reference vector of the lines, and optional scale factor, and the dpi value of the layer (if you like to use cm or inch input values).

 

ParallelLines.Dialog.OrientationTab.jpg

 

  • Reference vector

    • 'Origin at center of pixel
        If set then
          - the position (0,0) is at the center of the top/left pixel of the bounding rectangle of the selection
          - reference point values will be rounded to integer values without fractional parts
        If not set then
          - the position (0,0) is at top/left of the top/left pixel of the bounding rectangle of the selection
          - reference point values will not be rounded
        So if the switch is off you get more precise results but maybe not what a user expects at first glance.
      Check the difference by drawing a one pixel line.

    • Starting Point and angle: These values define the origin and orientation of the basic line segment. All other line segments are drawn relative to the basic line segment.

    • Length: Not used in the moment

    • Show while dialog is open: If checkmarked then the layer will show a red rectangle and a small circle.
      The circle is the origin and the rectangle is calculated from amplitude, period and reference angle.
      In the final rendering of the layer these indicators will never be visible.

  • Reference Scale

    • Scaling happens in the final drawing. Means if you enter a value
        of 1cm somewhere and the scale factor is set to two then 2cm will be used in the drawing!
        Pressing the 'Apply' button will scale the depending options and reset the scale factor to one.

  • Image

    • Resolution: The resolution option is only of interest if you like to enter cm or inch values in the dialog. You should set the value used in the image here. Makes most sense if you like to print the image later in the specified resolution. Best is to use the 'Print It' plugin ;-)

Colors Section

 

You may set the color of the lines and the background here.

 

ParallelLines.Dialog.ColorsTab.jpg

 

The default values are: Use Paint.NETs Primary Color for the lines and the original layer content for the background.

Lines are always rendered against the selected background. So changing the opacity of the line color will show you the selected background color below.

 

Hints

  • You may use units like cm and inch to specify values in the controls (see the tooltip of the control).
  • Converting from the current value in the control to a different unit is done by just typing the new unit into the edit field without a value. Clearing the editfield will return to the current value with the base unit (the first unit in the tooltip.
  • Some controls provide additional features if you are pressing shift while the mouse is used. I.e. the slider values will be catched to fixed values. Instead of shift you may press the right mouse button together with the left one.

Known issues

  • Paint.NET does not provide the dpi value of the current image to effect plugins. The plugin uses the dpi value to allow the user to enter values in cm or inch. To get correct values you have to enter the dpi value of the image in the reference tab of the dialog. The default value is 96 dpi.

Examples

CircleVariations%20240x180.gif

History

  • 1.6 (8.3.2015)
    - The Circle, square, dieamond, and hexagon shape use the center parameter.
    - The dialog can be resized.
    - The interference layer angle got the option to 'spread' the reference vector or to ' add' to the vector
  • 1.5 (18.1.2015)
    - Added 'Interference layer' option: Allows to overlay a duplicate of the line pattern with a different angle. This may be used to create a moire effect.
  • 1.4 (4.1.2015)
    - Reorganized the shape line types to make it easier to use regular shape types and their stretched parts. The size of Circles, Squares, Diamonds and Hexagons is defined only by the amplitude option now. The streched variants like ellipse, rectangle, streched diamonds and stretched hexagons work as before.
    - Added Hexagon Shapes
    - Length of whole line allows to select 'One Period' now. This makes it easier to render just one single line segment like a single hexagon.
    - Added reference scaling. Scaling happens in the final drawing. Means if you enter a value of 1cm somewhere and the scale factor is set to two then 2cm will be used in the drawing! Pressing the 'Apply' button will scale the depending options and reset the scale factor to one.
    - The reference point option control allows to enter pixel or other unit values now (instead of percent).
    - Added switch 'Origin at center of pixel (else in-between pixels)'
    If set then
      - the position (0,0) is at the center of the top/left pixel of the bounding rectangle of the selection
      - reference point values will be rounded to integer values without fractional parts
    If not set then
      - the position (0,0) is at top/left of the top/left pixel of the bounding rectangle of the selection
      - reference point values will not be rounded
    So if the switch is off you get more precise results but maybe not what a user expects at first glance.
    - Tooltip of NumericUpDown controls shows the value of the control in different units now (before just the possible unit names).
    - Added a work-around to avoid that sometimes the first tab page of the dialog shows a slider. The basic issue is still not fixed in OptionBasedLibrary but it should be OK for this dialog.
  • 1.3 (19.12.2014)
    - Diamond, Ellipse and Rectangle Shape cover now the whole period if 'Center at' is set to 50% (the default value) This makes it easier to create overlapping shapes without loosing any of the old functionality.
    - Changed the start point of the Spiral Wave so that it looks more symmetric in limited length mode.
    - Added 'Fill Color of Lines'. Because waves do not have closed shapes they will look half-filled. 'Stroke color of Lines' allows to set the value 'None'.
    - Added 'Fir Tree' shape
  • 1.2 (17.12.2014)
    - Added option to limit the length of the parallel lines to reference section.
    - Added start end end caps for limited continous lines (without gaps).
    - Added 'Spiral' line type
    - Added keywords to the code used by plugin browser
  • 1.1 (11.12.2014)
    - Fixed the wrong symbol image of the 'Divided Line' shape (an error in the OptionBasedLibrary)
    - Added the option to specify an amount of parallel lines
    - Added dash-dotted line shape
  • 1.0 (10.12.2014)
    - First public release
Edited by Ego Eram Reputo
Added link to zipped DLL
  • Upvote 8

Share this post


Link to post
Share on other sites

Why can't I alter the Tilt value (under the lines tab ? ) or alter the length value (under the reference tab ? )

Share this post


Link to post
Share on other sites
Thanks Martin (or Midora?). I like your plugin and I apreciate your work.

One suggestion: how about a color wheel in your plugin?

And one question: how to get diagonal lines?

 

I don't want to be misunderstood, but I want to remove some plugins from my Effect folder.

It is desirable for the specific plug-ins to do many things and your plugin do.

 

zGK7XtL.png

  • Upvote 1

Share this post


Link to post
Share on other sites

Why can't I alter the Tilt value (under the lines tab ? ) or alter the length value (under the reference tab ? )

 

Not all shapes do allow to alter the tilt value. Basicly all which show a tilted vertical bar in the icon of the shape. I.e. The Slashed Line shape.

BTW: The icon of the Divided Line shape is wrong. It must be just a vertical bar.

 

The length value of the reference vector is not used in the moment by the plugin. That's why it is disabled.

In the moment the plugin just works in fill mode. In the future it may be possible just to draw lines from the reference point with the reference length and the parallels.

 

 

One suggestion: how about a color wheel in your plugin?

And one question: how to get diagonal lines?

 

Have a look to the tabs at the top of the dialog.

In the reference section you may rotate the lines.

In the color tab you may select different colors for the lines and the background.

 

 

I don't want to be misunderstood, but I want to remove some plugins from my Effect folder.

It is desirable for the specific plug-ins to do many things and your plugin do.

 

I'm not quite sure about the question. There are always pros and cons for a specific plugin.

Sometimes you prefer to use plugins with a minimum amount of controls but sometimes you want to control everything.

The Paint.NET philosophy is too provide less but easy to understand features.

But plugins may provide you much more features.

The important thing is that the user interface has the right structure.

I.e: I really like the power of the 'Curly lines' plugin but I can not use it because it takes me too much time to remember the individual options.

That's the reason why ParallelLines uses the OptionBasedLibrary to visualize the UI. It allows you to provide the user a more detailed and structured UI but still follows the look and feel of Paint.NET. 

Share this post


Link to post
Share on other sites

Ok, here is a fishy! :D

I did the scales, top and bottom fin lines, and the background waves with this plugin. This plugin is really fun. :)

(the tail fin and heart fin lines were done with curly lines plugin since that plugin let me render lines in a "fan" shape.)

 

FishyPatterns_zps0e202052.jpg

Edited by Cc4FuzzyHuggles
  • Upvote 1

Share this post


Link to post
Share on other sites

Excellent!!!! I was looking for plugins like this one. I think it's very useful. Nice interface too. I like the way you show the positioning  with the red "resolution size" box.

 

Topiary.png?raw=1

 

Height Map  https://www.dropbox.com/s/f0lku0uqifx3p8d/TopiaryMap.png?raw=1

 

 

 

 

Thanks Martin (or Midora?). I like your plugin and I apreciate your work.

Ssssshhhhhh! don't reveal his secret identity. I think you just got un-invited to Bruce Wayne's next party.

  • Upvote 2

Share this post


Link to post
Share on other sites

Useful and fun - Thank you!

(Hey, this would qualify for the 'Iterative lines' Submenu!) ;) :D

Impressive example images posted here too.

Share this post


Link to post
Share on other sites

Oh Cc4FuzzyHuggles figured out already how to create fish-scales or roofing shingles and TechnoRobbo shows us how to increase the entropie of a simple regular pattern, great.

 

(Hey, this would qualify for the 'Iterative lines' Submenu!) ;) :D

 

I thought about this. For a quarter of a second ;-) But there are all the users using an other language setting.

BTW: If you prefer a different submenu then you can change it in the .dlc file. You may even translate it there.

Look for the key ParallelLinesEffect.SubmenuName=

 

 

Nice interface too.

 

Typical case of a plugin where the coding takes 10% and designing of the UI 90% of the time.

Share this post


Link to post
Share on other sites

Update 1.2 (17.12.2014)
- Added option to limit the length of the parallel lines to reference section.
- Added start end end caps for limited continous lines (without gaps).

post-84641-0-22159300-1418851057_thumb.j
- Added 'Spiral' line type

post-84641-0-10650000-1418850670_thumb.j
- Added keywords to the code used by plugin browser
 

 

  • Upvote 1

Share this post


Link to post
Share on other sites

@Martin Osieka! This is very interesting plugin. Many thanks for your hard work. Marry Christmas. bdzdah9w.gif

My results: 

 

8dxq2mkq.png

  • Upvote 2

Share this post


Link to post
Share on other sites

Christmas Update:  Many thanks to a great community and peaceful days for all of us.

 

1.3 (19.12.2014)
- Diamond, Ellipse and Rectangle Shape cover now the whole period if 'Center at' is set to 50% (the default value)
  This makes it easier to create overlapping shapes without loosing any of the old functionality.
- Changed the start point of the Spiral Wave so that it looks more symmetric in limited length mode.
- Added 'Fill Color of Lines'. Because waves do not have closed shapes they will look half-filled.
  'Stroke color of Lines' allows to set the value 'None'.
- Added 'Fir Tree' shape (inspired by Seerose ;-)
 

post-84641-0-35228200-1419010232_thumb.p

 

An easy way to check this out is to copy the following options xml text to the clipboard and paste it to the dialog via the menu popup button at the bottom of the dialog 'Menu->Manage Options->Paste'.

Hidden Content:
<?xml version="1.0" encoding="utf-8"?>
<OptionBasedEffectConfigToken xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Effect>
    <name>ParallelLinesEffect</name>
    <version>1.0</version>
  </Effect>
  <Items>
    <Item>
      <Key>
        <string>ReferenceLengthType</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">0</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ReferenceLength</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:double">200</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>LineWidth</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:double">1</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>LineJoin</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">3</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>LineCaps.First</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">0</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>LineCaps.Second</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">0</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>LineShape</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">17</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>LineAmplitude</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:double">60</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>LinePeriod</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:double">80</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>LineSplit</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:double">50</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>LineTilt</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:double">30</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ParallelsCountType</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">0</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ParallelsCount</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">5</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ParallelsDistanceType</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">0</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ParallelsDistance</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:double">80</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ParallelsDrift</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:double">50</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ReferencePoint.X</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:double">0</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ReferencePoint.Y</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:double">0</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ReferenceAngle</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:double">0</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ReferenceShow</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:boolean">true</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ReferenceResolution</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:double">96</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ColorStrokeLinesSource</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">1</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ColorStrokeLinesCustom.Color</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">-16777216</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ColorStrokeLinesCustom.ColorSelect</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">4</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ColorFillLinesSource</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">2</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ColorFillLinesCustom.Color</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">-16711894</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ColorFillLinesCustom.ColorSelect</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">4</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ColorBackgroundSource</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">0</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ColorBackgroundCustom.Color</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">-1</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>ColorBackgroundCustom.ColorSelect</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">4</anyType>
      </Value>
    </Item>
    <Item>
      <Key>
        <string>Pages.PageIndex</string>
      </Key>
      <Value>
        <anyType xsi:type="xsd:int">0</anyType>
      </Value>
    </Item>
  </Items>
</OptionBasedEffectConfigToken>

 

Or save the text to a file and load it via 'Menu->Manage Options->Load...'  Here is an other example file: OverlappingCircles.xml

 

  • Upvote 1

Share this post


Link to post
Share on other sites

Thank you. Nice overlapping functionalities. In addition to the lines tab, is there a possibility to add another one that would allow the insertion of PNG files?

 

There is little adjustment to be donne in the UI:

interface-01-491a68e.png

Edited by Eli
  • Upvote 1

Share this post


Link to post
Share on other sites

 

Thank you. Nice overlapping functionalities. In addition to the lines tab, is there a possibility to add another one that would allow the insertion of PNG files?

 

Hi Eli, from my point of view this would be a feature for a plugin which uses bitmaps already to fill the selection. PLAP is vector oriented. So there is a little dwarf sitting in your computer using a pen and a brush to draw and fill the vector paths ;-)  Maybe in the future you may be able to define your own vector shapes like the fir tree.

 

 

There is little adjustment to be donne in the UI:

 

Yeah I know there is still a small problem if you are using Tabs in OptionBasedLibrary. The Layout engine of .NET behaves a little bit strange using tabs. It happens if you are closing the dialog with OK on a tab which is not completely filled with controls. So in the moment just say OK on the first tab page to avoid it.

Share this post


Link to post
Share on other sites

Or save the text to a file and load it via 'Menu->Manage Options->Load...'  Here is an other example file: attachicon.gifOverlappingCircles.xml

@ Sorry I did not understand. Where Add effect or paint.net folder?
Edited by Seerose

Share this post


Link to post
Share on other sites

 

Give the litle dwarf a hug and tell him I love what he does. May be in the future we will be able to give him a raster and see what he can do with it.  :)  

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now