> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pixldata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Line Tool

> Annotate lanes, edges, shelf rails, cables and other linear structures in PixlHub with multi-point polylines, finished with a single Enter keystroke.

Roads have lanes, shelves have rails, circuit boards have traces, and none of them fit in a rectangle. The Line tool draws multi-point polylines that follow any linear structure through the image, however it bends or recedes into perspective.

<Info>
  Available in image projects. A line is a polyline: two clicks make a straight segment, more clicks trace a path. Lines share classes, hotkeys and the instance list with every other annotation type.
</Info>

## Draw a line

<Frame caption="Supermarket example: the Shelf Edge class armed, the Line tool picked, and the finish rule worth memorizing.">
  <img src="https://mintcdn.com/pixldata/z5Zhk03e28LorCD5/images/docs/editor/line-tool-annotated.jpg?fit=max&auto=format&n=z5Zhk03e28LorCD5&q=85&s=52ba19b994f3f123012f982627a7dbc3" alt="PixlHub editor with the Shelf Edge class and Line tool highlighted, showing a long supermarket shelf" width="1440" height="900" data-path="images/docs/editor/line-tool-annotated.jpg" />
</Frame>

<Steps>
  <Step title="Arm the class">
    Press the class hotkey (Shelf Edge is 3 in this project) or click the class name.
  </Step>

  <Step title="Pick the Line tool">
    Click the line icon in the floating palette.
  </Step>

  <Step title="Click along the structure">
    Each click drops a vertex; a dashed preview follows your cursor between clicks. Trace the edge with as many vertices as its curvature needs.
  </Step>

  <Step title="Press Enter to finish">
    Enter completes the polyline. This is the detail everyone misses on day one: lines are open shapes, so there is no first vertex to double-click back to.
  </Step>
</Steps>

The full sequence on a real shelf edge, three vertices and an Enter:

<video autoPlay muted loop playsInline className="w-full rounded-xl border border-zinc-200" src="https://mintcdn.com/pixldata/z5Zhk03e28LorCD5/images/docs/editor/draw-line.mp4?fit=max&auto=format&n=z5Zhk03e28LorCD5&q=85&s=6d469d8a6e242e1d56e9f72ef44eba3c" data-path="images/docs/editor/draw-line.mp4" />

<Frame caption="The finished polyline hugs the shelf rail through perspective; the class chip and instance entry appear like any other annotation.">
  <img src="https://mintcdn.com/pixldata/z5Zhk03e28LorCD5/images/docs/editor/line-result-zoom.jpg?fit=max&auto=format&n=z5Zhk03e28LorCD5&q=85&s=bc392ff4db86132e7ff52531c26bdde0" alt="Orange Shelf Edge polyline drawn along a supermarket shelf rail in PixlHub" width="1100" height="180" data-path="images/docs/editor/line-result-zoom.jpg" />
</Frame>

## Edit a line

Select the line with the **Select** tool and its vertices become draggable handles, exactly like polygon vertices. Drag to refine the path, press a different hotkey to reclassify, Delete to remove. Undo steps back through individual vertex operations.

## Technique notes

* **Vertices where the direction changes.** A straight rail needs two; a curving lane needs one per bend. Extra vertices on straight runs add noise, not precision.
* **Perspective is normal.** Structures that recede (like this shelf) are the tool's home ground; place vertices at consistent visual landmarks such as shelf-lip corners.
* **Zoom for the endpoints.** Where a line starts and stops is usually a guideline decision; zoom in at both ends so the cutoff is deliberate.

## Frequently asked questions

<AccordionGroup>
  <Accordion title="Line or polygon for something like a road marking?">
    If the model needs the centerline or trajectory, use a line. If it needs the painted area itself (for segmentation), outline it with a <a href="/guides/basics/polygon">polygon</a>.
  </Accordion>

  <Accordion title="Can I continue a line after pressing Enter?">
    No, Enter seals the shape. Draw a second line and keep them under the same class, or delete and redraw if it must be one continuous path.
  </Accordion>

  <Accordion title="How do lines export?">
    As ordered vertex lists with class and metadata, so downstream code can treat them as polylines or sample them into points. Details in <a href="/guides/essentials/exports">Exports</a>.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Polygon tool" icon="draw-polygon" href="/guides/basics/polygon">
    Closed outlines for regions instead of paths.
  </Card>

  <Card title="Freeform tool" icon="pen-nib" href="/guides/basics/freeform">
    Continuous freehand drawing when clicking vertices is too slow.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.