<span id="cad-图纸分割"></span>

# CAD Drawing Segmentation

Analyze drawing pages to identify regions, text, and part relationships, producing drawing reports or retrieval units.

Input drawing PDFs or images for visual retrieval, information extraction, and indexing.

<span id="配置输入与模式"></span>

## Configure input and mode

| Setting | Description |
| --- | --- |
| Files | Catalog `file_ids` of drawings to process |
| LLM model | Workspace model for analysis |
| Vision model | Model for OCR and visual assessment |
| Parsing mode | Prefilled: `deep`; `fast` uses coarse retrieval parsing |
| Report mode | Prefilled: `drawing_report`; `segments` returns segmentation results, and `retrieval_index` supports fast retrieval |
| CAD segmentation service URL | Optional self-hosted endpoint; leave empty for the built-in shared service |

Fast mode uses `retrieval_index`. Deep mode uses `drawing_report` or `segments`.

<span id="控制处理预算"></span>

## Control the processing budget

Configuration defaults are 16 agent rounds, 4 concurrent tools, 64 candidate regions per page, 24 crops, 18 refinements, and 12 visual assessments.

The default CV profile is `cad-default-v1`, the SAM profile is `sam2-default-v1`, and the artifact level is `review`.

In `drawing_report` mode, set maximum agent rounds to 0 to skip additional agent enhancement and retain the base results.

<span id="使用输出"></span>

## Use the output

Segmentation or report paths can return `segments`, `parts`, `relationships`, and `ocr_texts`. Fast retrieval returns units such as `items`. Read the fields corresponding to the chosen report mode.

`manifest_file_id` identifies the result manifest; `artifact_files` contains related artifacts. Check `status` and `review` for result status. Retain the full result, especially `page_sources` and image references, when building a visual manifest.

<span id="示例为图纸建立视觉索引"></span>

## Example: build a visual drawing index

Flow: Read MOI Volume → CAD Drawing Segmentation → Build Document Visual Manifest → Image Embedding.

Choose deep parsing and drawing report mode. Pass the full CAD result to the manifest node's `cad_result`, then use the manifest to build the image index.

<span id="继续阅读"></span>

## Further reading

- [Variables and data flow](../../variables-and-data.md)
- [Run and debug](../../run-debug.md)

<span id="检查切割质量"></span>

## Check segmentation quality

Default parameters are used when no drawing shape matches. Compare the output with the original: retain long technical requirements, views beside tables and enough context around segments.

For failures, preserve the original page, affected segment and manifest. Default processing and improved segmentation do not guarantee that every drawing is complete; inspect representative pages before indexing.
