# Polygon 3D

A **Polygon 3D** is an annotation tool that allows users to draw a closed shape in 3D space by connecting multiple points or vertices. These points (3 or more) are joined together to form a polygonal surface, typically used to annotate complex, irregularly shaped objects or surfaces within a point cloud.

***

## **Use Case**

This tool is particularly useful for capturing areas or surfaces that have more intricate shapes, such as the ground, rooftops, or building facades. By allowing the user to define a series of vertices, the polygon 3D can accurately outline non-uniform objects, providing a detailed and flexible way to annotate large, flat, or irregular surfaces in 3D.

{% hint style="info" %}
Polygon 3D can be created only in point cloud sensor(s).
{% endhint %}

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXdUHxaenrYNe0r1rxRCoARLwuQ3zWsHwsOuvciiNoNmRfMTYl1LpI5ylzwETxVXaKL4OyAXUv_1HC7p1wbbVvvhpF9IjSx958w6quYGeElbTw7uUyUufN8zfmSIps32Z7Rtj09oGoXj6djM9mEnVN9roIL5?key=lGhAQLv5xC3Ciuwf6zBTGQ" alt=""><figcaption></figcaption></figure>

***

## Create Polygon

1. Click on the '+' icon of the class from the [class list](https://docs.imerit-prod.io/annotation-tool/drawing-tools/pages/t1P8d2reKe3nZWAkN2Kh#id-3.-class-list).
2. Select 'Polygon 3D' from the drawing tool list.

   <figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXe7y0fMYuE5A3S_qauIJJ5KFb9XGCzDVPt7y5x_Ytre5ZpAurX28iWWLpP4cu7tXUt3_QXUe5iskibmSHsP5vLcs8eYVt1LoGm_11vOk8cfKyWal5AqmPlWvPYmDUUuZk-ZGzc0jsnLzXK_Bun6D7akSAOE?key=lGhAQLv5xC3Ciuwf6zBTGQ" alt=""><figcaption></figcaption></figure>
3. The cursor pointer shows a grey circle marker to it while hovering over the points.
4. Make multiple clicks around the desired object of interest to define its boundary. Move the mouse to the next desired location, and a line extending from the initial point will dynamically follow the cursor. Each click adds a vertex to the polygon 3D, allowing for a more precise shape.&#x20;
5. All the points falling under the polygon will appear in the colour of the class. The polygon generated has infinite depth to it so it's recommended to use it in [2D Mode](/annotation-tool/tool-layout.md#id-2d-3d-mode) and [Isolate](/annotation-tool/key-features/isolate.md) Mode to avoid marking unnecessary points.
6. `Right-Click` to indicate the end and apply it.

   &#x20;

   <figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXdlkkFCtjfo9s3KKeJLZLW1MPsHAi_Myh6WfArd6eSY_mMAlxkOjTaaxpI5kCugbXyo3MUht4I_qhM_o5is3HVMIpFbfNTI5bN8J2hcffUkMAelVQ39W5Q5il_5WAe5rlYprXf8vi4CSjPEaLrzL71j3iA?key=lGhAQLv5xC3Ciuwf6zBTGQ" alt=""><figcaption></figcaption></figure>
7. Enter the [annotation details](https://docs.imerit-prod.io/annotation-tool/drawing-tools/pages/rZkaXOIF73IyAuNXrSbe#id-6.-annotation-detail-input).
8. The saved instance will appear on the [Class List](https://docs.imerit-prod.io/annotation-tool/drawing-tools/pages/t1P8d2reKe3nZWAkN2Kh#id-3.-class-list) with a triangle icon next to the Instance name.

   <figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXdM3avi2MmFQMfk8TJ9W_BFdBjZWlytbcNIEr8Rkv1FCLfrZzridv8t6bnbyJ_RwF5RNv1yqfSaUH-70o14qAnX07fE_QsvPdr7M1STwSTjEkJX281HnFkBLOtd626BOpie8lB82gfbJjz1ZjIL7mANNHyB?key=lGhAQLv5xC3Ciuwf6zBTGQ" alt=""><figcaption></figcaption></figure>

***

## Modify Polygon 3D

The polygon can be selected again and modified by:

* Selecting any of the vertexes and dragging it to modify its shape.
* Adding a vertex by hovering over the edge of the boundary and clicking the ‘+’ symbol that appears.
* Merging a vertex by clicking and dragging it into its adjacent one.

***

## Add/ Subtract from Polygon 3D

Segments can be added or subtracted from the created polygon.&#x20;

* When the polygon is selected, an expandable box with the option to 'Add/ Subtract' appears on the bottom right of the point cloud.
* Expand the list and the first item on the list is the main segment that is already drawn called the Primary Segment.

  <figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXfLiim38wsQDr3dx_HsevGZkulOv2bTrWWHpF1DEE_C-uXfOF4aLLgDLpRxuJkiEgBANrtXNfW-8XbAPcoWnvCCZRhJsb_RSKIWy4KbjufkAtFXF78FS26lhgMpVu5AEgd3AxmFIhW198ew8uGlFK-QXBA?key=lGhAQLv5xC3Ciuwf6zBTGQ" alt=""><figcaption></figcaption></figure>

### Adding Segment:&#x20;

To add more points to the Primary segment, click on the 'Add' button and draw another polygon on the points that need to be added. `Right-click` to confirm.

* Upon confirmation, the boundary of this polygon will turn green, indicating it as an addition to the primary segment.
* The segment is identified as `Segment n` (in sequential order) and is marked with a green clickable dot to represent its inclusion in the primary segment.
* Clicking the dot changes its state to 'Subtracted' (displayed in red), simultaneously updates the segment boundary color from green to red.

***

### Subtracting Segments:&#x20;

To subtract points from the Primary segment, click on the 'Subtract' button and draw another polygon on the points that need to be subtracted. `Right-click` to confirm

* Upon confirmation, the boundary of this polygon will appear red, signifying its designation as a subtracted segment from the primary segment.
* This segment is labeled as Segment n (in sequential order) and is marked with a red clickable dot to represent its exclusion from the primary segment.
* Clicking the dot changes its state to 'Added' (displayed in green), simultaneously updates the segment boundary color from red to green.

{% hint style="success" %}
Clicking the green/red dot switches the state from Added Segment to Subtracted Segmented or vice versa, depending on the starting state.
{% endhint %}

***

## Copy Paste Polygon 3D

Polygons can be copy and pasted to another frame where it does not exist (`Ctrl+C` / `Ctrl+V`). The [annotation detail input ](https://docs.imerit-prod.io/annotation-tool/drawing-tools/pages/rZkaXOIF73IyAuNXrSbe#id-6.-annotation-detail-input)prompts user for input on pasting annotation. By default, the pasted Polygon 3D will share the same Instance ID as the one of the copied Polygon 3D.&#x20;

{% hint style="success" %}
Copy and pasting of Polygon 3D works inter-frame (across frames where the same instance ID doesn't exist).&#x20;
{% endhint %}


---

# 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-prod.io/annotation-tool/drawing-tools/polygon-3d.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.
