# Editing patterns

Treadl offers a rich patten-editor directly within the web platform. This allows you to view and make changes to your patterns as you build up your projects.

## Create or import a new pattern

If you already have a pattern in a project (either from starting from scratch or by importing a WIF file), then you can skip this step.

### Create a pattern

Creating a new pattern from scratch will provide you with a blank canvas to work from.

To begin, find (or newly create) the project that you want to store your pattern in. Navigate to your project and click the **Add something** button and then select the **Create a new weaving pattern** option.

![Creating a new pattern from scratch](/images/docs/editing1.png)

You'll then be presented with the editor showing a new blank pattern to begin editing.

![A new blank pattern](/images/docs/editing2.png)

### Import an existing pattern

If you have a .wif (Weaving Interchange Format) file you have exported from another weaving program, you can import it into Treadl.

To do so, find (or newly create) the project that you want to store your pattern in. Navigate to your project and click the **Add something** button and then select the **Import a WIF file** option.

![Importing a pattern](/images/docs/editing3.png)

Your computer will open up a dialog to let you choose a WIF file to upload. Navigate to the folder on your computer storing the file and select the appropriate file

![Choosing a WIF file](/images/docs/editing4.png)

Once chosen, Treadl will load the file into a pattern. You can then select the pattern to view it in the editor.

![Viewing the imported pattern](/images/docs/editing5.png)

## Using the pattern editor

Once you have a pattern opened up in the editor (whether it's blank or not), you can begin to edit it. The image below shows the layout of the editor.

![The editor components](/images/docs/editing6.png)

**Please note that the drawdown will not display your pattern until you have "drawn" on the warp and weft and have edited your tieups. All of these concepts are described below.**

**Tip: you can hover over tools with your mouse to learn what they are.**

### Using tools to "draw" on the warp and weft

Treadl offers three ways of selecting threads on the warp and weft:

* Manually selecting the thread
* Using "straight draw" to draw threads in diagonal lines
* Using "point draw" to draw threads as a series of points

To **manually** draw individual threads on your warp, simply select either the **straight** or **point** draw (in the tools area) and click the desired threads.

![Manually selecting threads](/images/docs/editing7.png)

To use the "**straight draw**", first select the **straight draw** tool (in the tools area). Next, position your mouse over the start thread, click and hold your mouse button down as you draw from right-to-left (or top-to-down on the weft) moving your mouse gradually upwards to change how the pattern draws. Release the mouse button to complete the draw.

![Performing a straight draw](/images/docs/editing8.png)

To use the "**point draw**", first select the **point draw** tool (in the tools area). Next, position your mouse over the start thread, click and hold your mouse button down as you draw from right-to-left (or top-to-down on the weft) moving your mouse gradually upwards to change how the pattern draws. Release the mouse button to complete the draw.

![Performing a point draw](/images/docs/editing9.png)

As you move the mouse while drawing, you'll notice the draw updating - this allows you to release the mouse and complete the draw once you are happy with the threads being selected.

The example below shows a point draw on both the warp and weft.

![Point draw on warp and weft](/images/docs/editing10.png)

**Note how the drawdown does not yet display any pattern! This is because our tieups are still empty.**

### Tieups

Interacting with tieups is as simple as clicking on the tieups area of the editor until the selected tieup has been achieved.

In the example below you'll see we have a tieup as a diagonal straight line, and this has resulted (along with the threads on the warp and weft) in a simple diamond pattern being shown on the drawdown.

![Adding the tieup](/images/docs/editing11.png)

### Adding colour to threads

Individual threads in your warp and weft can be coloured. This will update the drawdown to display the coloured threads.

To begin, select the **colour** tool, click a colour from the **palette**, and then either click on individual threads in your warp and weft threading, or click and drag to apply the colour to threads more quickly.

![Adding colours](/images/docs/editing12.png)


As you paint, you'll notice the drawdown update to show your new colours.

### Selecting and deleting threads

You can delete threads from the warp and weft.

First, enable the **select** tool from the toolbox. Once selected, you can click on individual threads, or click and drag along the warp or weft, in order to select threads.

Once you have threads selected, a button will display to allow you to delete the selected threads.

![Deleting threads](/images/docs/editing19.png)

### Inserting threads

Threads can be inserted at any point along the warp or weft.

To do so, select the **insert** tool from the toolbox and then click on the thread that you'd like to shift leftwards along the warp or downwards along the weft.

You'll be asked how many threads you'd like to insert before completing the process.

![Inserting threads](/images/docs/editing20.png)

### Configuring your pattern

You can rename and adjust the number of **treadles** and **shafts** your pattern uses in the **properties** menu. This information can be changed at any time.

In the example below we have increased the number of treadles and shafts to 12 - allowing for more complex patterns. Note that the tieup also increases in size accordingly.

![Adding colours](/images/docs/editing13.png)

## Changing the view

Treadl offers a number of ways to view your pattern.

### Zooming and panning

You can zoom in (to see more detail) and out (to view more of your pattern in one go) of your pattern using the **zoom** tool.

To do so, slide the zoom from left-to-right to make your pattern bigger, and from right-to-left to make your pattern appear further away.

In the example below, we have zoomed in further to see it in more detail.

![Zooming the pattern](/images/docs/editing14.png)

If some of your pattern is off the edge of the screen (e.g. if you have zoomed in as described above), you can use the **pan** tool to "move your view" around the pattern.

To do so, select the **pan** tool, and then click and drag in your drawdown area to move the view around your pattern.

In the example below, we have moved our view to the left such that the weft and tieups are no longer visible.

![Panning the pattern](/images/docs/editing15.png)

### View modes

Treadl offers a number of modes for viewing your pattern. The modes are as follows:

* **Interlacement (default)** - a view that uses shadows to mimic how the threads will interlace
* **Colour only** - a view that shows the threads and colours, but without shadow
* **Warp view** - a view that only shows the warp threads
* **Weft view** - a view that only shows the weft threads

In the example below, you can see the view has been set to "Warp view"

![Changing the view](/images/docs/editing16.png)

## Saving your pattern

To ensure you do not lose your changes, we recommend saving your pattern frequently. To do so, click the "Save" button which will appear when you make changes.

![Showing the save button](/images/docs/editing17.png)

## Deleting your pattern

If you want to remove the pattern from your project, it can be deleted from the "**Advanced**" section of the editor.

![Showing the delete button](/images/docs/editing18.png)
