# 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

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.

***

## Lasso Mode

<figure><img src="/files/KuFhUkK5vgRbKFLWxpQE" 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.imerit.net/3d-multi-sensor-fusion/labeling/3d-multi-sensor-fusion-labeling-editor/drawing-tools/2d-polygon.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
