VonKoch

New in v0.47.

This effect creates fractals. The most classic fractal is perhaps the Von Koch snowflake. An alternative to using this LPE is to use the L-System extension.

Applying this effect to a path creates two additional control paths: a Reference segment and a Generating path. The structure of the fractal is completely determined by these control paths. The first generation is created by placing copies of the skeleton path so that the Reference segment of each copy lies on top of one of the sub-path segments of the Generating path. Each additional generation is created in the same way, using the Generating path of each copy of the previous generation.

VonKoch effect 1.
Left: A skeleton path. Center: After applying the VonKoch with default parameters. Right: Showing the default Reference segment (top line) and Generating path (bottom two lines).

When applying the VonKoch LPE to a path, the Reference segment is created so that it divides the bounding box vertically in half. The Generating path is initially composed of two single-segment sub-paths, each covering one-third of the lower edge of the bounding box. The Reference segment and the Generating path can be editing just like normal paths by clicking on the icon icon in the Reference segment or Generating path lines of the LPE dialog.

VonKoch effect 2.
Left: A diamond path with the VonKoch LPE applied. The default control paths are shown. Center: After moving the Generating paths. Right: After increasing the number of generations to six and changing the Fill and Stroke.

If each sub-path of the Generating path consists of a single segment, then each copy of the skeleton path is simply scaled and/or rotated. With multiple segments, one can skew each copy. The first path segment controls scaling in the orthogonal direction to the Reference segment and it controls skewing. The second path segment is matched to the Reference segment. The use of the first segment can be disabled by checking the Use uniform transforms only box.

VonKoch effect 3.
Left: A square path with the VonKoch LPE applied. The default control paths are shown. Center: After editing the Generating path to add a second path segment to each sub-path. Right: After increasing the number of generations to two.

Like all LPEs, this one can also be applied to groups.

VonKoch effect 4.
Left: A fourth generation Sierpinski triangle (triangle with three Generating paths). Right: The same VonKoch LPE applied to a group consisting of a triangle and circle.

Here is a short tutorial to create one side of a Von Koch snowflake:

  1. Create a regular six-pointed star using the Star Tool (set Spoke ratio to 0.577).
  2. Convert star to a path (Path icon Object to Path (Shift+Ctrl+C)); remove nodes as shown in figure below (use icon and icon from the Node Tool-Tool Controls).
    VonKoch effect: star step 1.
    Left: A regular six pointed star. Right: The skeleton path after deleting nodes from the star.
  3. Make a duplicate of the path as we will need a copy later; move it aside.
  4. Apply the VonKoch effect to the original path, this will create default control paths.
  5. We need to edit both control paths, it is perhaps slightly easier to start with the Generating path. This control path, by default, consists of two separate path segments. We need four segments exactly like in the skeleton path. Select the duplicate of the skeleton path and use icon on each of the middle three nodes. When you are finished, the Status Bar should report the path consists of eight nodes.
  6. Copy the duplicated path to the clipboard; select the original path and in the Path Effect Editor dialog click on the icon in the Generating path line. This will replace the default path. You will probably see the first-generation paths jump to the upper-right corner. Don't panic! We'll need to drag the Generating path to where it belongs.
  7. Click on the icon icon in the Generating path line of the LPE dialog. You should see the Generating path as a green path. Select all the nodes and drag them to overlap the skeleton path.
    VonKoch effect: star step 2.
    Left: After copying the skeleton path and applying the VonKoch LPE. Both the Reference segment and Generating path are shown (the skeleton path Stroke has been set to grey so it is easier to see the control paths). Right: The duplicate of the skeleton path has been separated into four sub-paths. It was then pasted into the LPE to replace the Generating path. The resulting Generating path has been translated as shown.
  8. Next we need to edit the Reference segment. Click on the icon icon in the Reference segment line of the LPE dialog. Select both nodes and move them down to them to overlap the base of the skeleton path.
  9. Finally, you can increase the number of generations. If you select four or more generations, you will have to increase the Max complexity value. You can also uncheck the Draw all generations box.
    VonKoch effect: star step 3.
    Left: After the Reference segment has been moved. Right: The final result with the number of generations set to 3 and the Draw all generations unchecked.