# 2D Polygon

A 2D Polygon is an annotation tool used to draw a closed shape by connecting multiple points or vertices on a 2D plane, typically on an image. It allows you to outline irregular or complex objects with precision by placing a series of points around the object's boundary, making it ideal for objects that don't fit into simple rectangular boxes.

***

## Create 2D Polygon&#x20;

1. Click the '+' icon next to the class you want to annotate from the class list.
2. Select 'Polygon2D' from the tool list.
3. The cursor pointer turns into a red circle marker while hovering over the image.
4. Click multiple times around the object of interest to define its boundary. Move your mouse to the next desired location, and a line extending from the initial point will dynamically follow the cursor.
   * Each `Left-click` adds a vertex to the polygon, allowing for a more precise shape.
5. `Right-click` to close and finalize the polygon.
6. Enter the annotation details.
7. The saved instance will appear in the class list with a 2D icon next to the instance name, indicating it was created in the image sensor.&#x20;

***

## Lasso Mode

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FXLAq4VwhDm5LF2pEctOH%2F2DLasso.gif?alt=media&#x26;token=00f6254b-3478-4eb9-a63f-6d7fcc640dee" alt=""><figcaption></figcaption></figure>

Lasso mode lets you draw a polygon boundary by moving your cursor rather than clicking for each vertex individually. This is especially useful for tracing objects with curved or irregular outlines - such as pedestrians, or vegetation - where click-by-click placement would be slow or imprecise.

**Toggling lasso mode:**

Press **`G`** while in polygon drawing mode to toggle lasso mode on. Press **`G`** again to toggle it off.

When lasso mode is active:

* Vertices are placed automatically along your cursor's path as it moves, producing a dense, smooth trace of the object's boundary.
* A visual indicator confirms the mode is active - the cursor style changes and the lasso tool is highlighted in the toolbar.

When lasso mode is toggled off:

* Vertex auto-placement pauses. The polygon remains open and in-progress.
* You can continue placing individual vertices by clicking, or `Right-click` to close and complete the polygon.

> **Recommended Tip:** Lasso mode and standard click-to-place mode can be combined within the same annotation. For example, hold the cursor steady and press **`G`** to switch to click mode when you need a precise curve, then press **`G`** again to resume freehand tracing.

Lasso mode remains active until you manually toggle it off and works across all polygon types in the editor, including both 2D and 3D polygons.

***

## Modify 2D Polygon

To modify an existing polygon:

1. **Move a vertex:** Select a vertex and drag it to a new location.
2. **Add a vertex:** Hover over an edge of the polygon until a vertex symbol appears, then left-click to insert a new vertex.
3. **Delete a vertex:** Drag the vertex into an adjacent one to remove it.

***

### Copy and Paste 2D Polygon

2D Polygon annotations can be copied and pasted to another image sensor where they don't currently exist using `Ctrl+C` to copy and `Ctrl+V` to paste. When pasting, an annotation detail prompt will appear for you to enter information. By default, the pasted 2D Polygon will share the same Instance ID as the original copied polygon.
