---
title: "Add a feature to the CAD"
method: POST
path: "/cads/{cadId}/states/{cadStateId}/features"
tags: ["CAD Features"]
---

# Add a feature to the CAD

`POST /cads/{cadId}/states/{cadStateId}/features`

Adding a CAD feature that involves complex computation might take some time to complete. 
Please refer to the following steps to start a CAD feature generation and check its progress:
1. Trigger the CAD feature generation via `POST /cads/{cadId}/states/{cadStateId}/features`
2. Monitor progress via `GET /cads/{cadId}/features/progress`

## Request body

- CadCadFeatureRequest
  - `feature` 'close_sheet_v2' | 'create_box' | 'create_cylinder_v3' | 'delete_face_v2' | 'delete_occurrences' | 'extrude_faces' | 'facet_split_bodies' | 'fix_interferences' | 'flow_volume_create_caps' | 'flow_volume_extraction_external' | 'flow_volume_extraction_internal' | 'imprint_bodies' | 'improve_bodies' | 'intersect_bodies' | 'move_faces' | 'rotate_bodies' | 'scale_bodies' | 'simplify' | 'split_bodies' | 'subtract_bodies' | 'translate_bodies' | 'union_bodies' | 'wrap_occurrences', required — Available feature types: - `close_sheet_v2`: Close selected sheet bodies in order to create solid regions. - `create_box`: Create a box body from selected faces or from the given dimensions. - `create_cylinder_v3`: Create a cylindrical body from selected faces or from the given center, axis, radius and height. - `delete_face_v2`: Delete selected faces. - `delete_occurrences`: Delete selected sheet bodies or solid regions. - `extrude_faces`: Extrude selected faces for a given distance or up to a given entity. - `facet_split_bodies`: Create faces in the input sheet bodies and/or solid regions by defining edges based on the given split angle. This feature impacts only bodies with underlying triangulated geometry. - `fix_interferences`: Remove any interference between solid regions in the model. The interferences are removed by subtracting interfering parts from the larger solid region. - `flow_volume_create_caps`: Create a sheet body whose faces cover the holes defined by the given boundary faces. The operation is intended for defining the internal flow volume in the Immersed Boundary analysis. - `flow_volume_extraction_external`: Create a body that represents an external flow volume. The flow volume boundary is defined by the bounding box and the model itself. If the flow volume is disjoint, a seed face can be used to select one of the flow regions. - `flow_volume_extraction_internal`: Create a body that represents an internal flow volume. The flow spans from the seed face to the boundary faces. The boundary faces describe holes in the model that must be closed by the internal flow volume. - `imprint_bodies`: Create faces on the contact surface between two sheet bodies and/or solid regions. The shape of the new face will correspond to the profile of the part in contact. - `intersect_bodies`: Create a body by intersecting the selected sheet bodies and/or solid regions. - `move_faces`: Move selected faces for a given distance or up to a given entity. The operation modifies all adjacent faces accordingly. - `rotate_bodies`: Rotate selected sheet bodies and/or solid regions around an axis for a given angle. - `scale_bodies`: Scale selected sheet bodies and/or solid regions with a given scaling factor. - `simplify`: Replace selected sheet bodies and/or solid regions with a box or a cylinder. - `split_bodies`: Split selected sheet bodies and/or solid regions in two by a given plane. - `subtract_bodies`: Subtract selected tool sheet bodies and/or solid regions from target sheet bodies and/or solid regions. - `translate_bodies`: Translate selected sheet bodies and/or solid regions either in a given direction and for a selected distance, or up to a given entity. - `union_bodies`: Unite the selected sheet bodies and/or solid regions. The operation produces up to two resulting bodies: one sheet body and one solid body, since sheet bodies and solid bodies are merged independently. - `wrap_occurrences`: Create a solid body that wraps selected sheet bodies and/or solid regions.
  - `parameters` union — Defines the parameters that configure the feature. The specific parameters available depend on the feature type.
    - object
      - `occurrences` string[] — List of sheet bodies.
      - `heal_option` 'cap' | 'grow_from_child', required — The `cap` healing option creates a surface to cover the existing holes. The `grow_from_child` healing option extends the faces around the holes in order to create a patch.
    - object
      - `method` CadCreateBoxMethod, required — Defines how the box is created.
        - `selected` 'create-box-from-definition' | 'create-box-from-faces', required — Defines how the box should be created. It can be either: - `create-box-from-definition`, in which case the `box` parameter needs to be defined, including min/max corner coordinates and a unit, or - `create-box-from-faces`, in which case the `faces` parameter needs to be defined, with an optional `scaling_factor`.
        - `box` CadBoxWithUnit — Axis-aligned box with unit.
          - `box` CadBox, required — Axis-aligned box.
            - `minX` number, double, required — Min x
            - `minY` number, double, required — Min y
            - `minZ` number, double, required — Min z
            - `maxX` number, double, required — Max x
            - `maxY` number, double, required — Max y
            - `maxZ` number, double, required — Max z
          - `unit` 'm' | 'cm' | 'mm' | 'yd' | 'ft' | 'in', required — Unit of measurement.
        - `faces` string[] — List of faces used to fit the box. This parameter is only valid for `create-box-from-faces` mode.
        - `scaling_factor` number, double — Optional scale factor applied to the fitted box. If omitted, the box fits the selected faces. This parameter is only valid for `create-box-from-faces` mode.
    - object
      - `method` CadCreateCylinderGroupParameter, required
        - `selected` 'create-cylinder-from-definition' | 'create-cylinder-from-faces', required — Defines how the cylinder should be created. It can be either: - `create-cylinder-from-definition`, in which case the `cylinder` parameter needs to be defined, including center, axis, radius, and height, or - `create-cylinder-from-faces`, in which case the `faces` parameter needs to be defined. The cylinder will be fitted to enclose only those selected faces, with optional `radial_clearance_factor` and `height_clearance_factor` scale factors to adjust the fit.
        - `faces` string[] — List of faces used to fit the cylinder. This parameter is only valid for `create-cylinder-from-faces` mode.
        - `radial_clearance_factor` number, double — Optional scale factor applied to the fitted cylinder radius. If omitted, the radius fits the selected faces. This parameter is only valid for `create-cylinder-from-faces` mode.
        - `height_clearance_factor` number, double — Optional scale factor applied to the fitted cylinder height. If omitted, the height fits the selected faces. This parameter is only valid for `create-cylinder-from-faces` mode.
        - `cylinder` CadCylinder — Cylinder with unit.
          - `center` CadVector, required — 3D vector.
            - `X` number, double, required — X
            - `Y` number, double, required — Y
            - `Z` number, double, required — Z
          - `axis` CadVector, required — 3D vector.
            - `X` number, double, required — X
            - `Y` number, double, required — Y
            - `Z` number, double, required — Z
          - `radius` number, double, required — Radius of the cylinder. Uses the sibling `unit` field.
          - `height` number, double, required — Height of the cylinder. Uses the sibling `unit` field.
          - `unit` 'm' | 'cm' | 'mm' | 'yd' | 'ft' | 'in', required — Unit of measurement.
    - object
      - `faces` string[] — List of faces.
      - `heal_action` 'cap' | 'shrink' | 'no', required — The available healing actions are: - `cap`: to replace deleted faces with a new face, - `shrink`: to close (shrink away) the hole left by the deleted face by extending the neighboring faces to cover it, - `no`: to simply removes the faces, thus potentially converting solid bodies into sheet bodies.
    - object
      - `occurrences` string[] — List of solid regions and/or sheet bodies.
    - object
      - `faces` string[] — List of faces.
      - `extrude_method` 'merge' | 'remove' | 'add_new', required — The available extrude methods are: - `merge`: to merge the extrusion back to the original body, - `remove`: to extrude in the negative normal direction and subtract the result from the original body, - `add_new`: to save the extrusion as a new body in the CAD.
      - `extrude_by` CadExtrudeByParameter, required
        - `selected` 'extrude_faces_mode_distance' | 'extrude_faces_mode_to_entity', required — Defines the parameter set used to define the extrusion. It can be either: - `extrude_faces_mode_distance`, in which case the extrusion distance will be provided, or - `extrude_faces_mode_to_entity`, in which case the extrusion distance will be computed based on the provided face.
        - `extrude_distance` CadLength — Length with unit.
          - `value` number, double, required — Length value.
          - `unit` 'm' | 'cm' | 'mm' | 'yd' | 'ft' | 'in', required — Unit of measurement.
        - `extrude_up_to_face` string — Face limiting the extrusion.
    - object
      - `angle` number, double, required — Maximum split angle, in degrees.
      - `occurrences` string[] — List of solid regions and/or sheet bodies.
    - object — Fix interfering bodies feature does not require any parameter.
    - object
      - `flow_box` CadBoxWithUnit, required — Axis-aligned box with unit.
        - `box` CadBox, required — Axis-aligned box.
          - `minX` number, double, required — Min x
          - `minY` number, double, required — Min y
          - `minZ` number, double, required — Min z
          - `maxX` number, double, required — Max x
          - `maxY` number, double, required — Max y
          - `maxZ` number, double, required — Max z
        - `unit` 'm' | 'cm' | 'mm' | 'yd' | 'ft' | 'in', required — Unit of measurement.
      - `seed_face` string — Seed face indicating an area adjacent to the flow. A seed face is needed only when the flow is unclear and could correspond to multiple flow regions.
      - `excluded_parts` string[] — List of solid regions and/or sheet bodies to exclude from the flow volume.
    - object
      - `seed_face` string — Seed face indicating an area adjacent to the flow.
      - `boundary_faces` string[] — List of faces representing the boundary of the internal flow region. Boundary faces are needed in case the internal flow is not bounded by the geometry.
      - `excluded_parts` string[] — List of solid regions and/or sheet bodies to exclude from the flow volume.
    - object
      - `occurrences` string[] — List of solid regions and/or sheet bodies.
    - object
      - `occurrences` string[] — List of solid regions and/or sheet bodies.
    - object
      - `faces` string[] — List of faces.
      - `move_method` CadMoveFacesGroupParameter, required
        - `selected` 'move_faces_mode_distance' | 'move_faces_mode_to_entity', required — Defines how the move distance is specified. It can be either: - `move_faces_mode_distance`, in which case the move distance will be provided, or - `move_faces_mode_to_entity`, in which case the move distance will be computed based on the provided face.
        - `move_distance` CadLength — Length with unit.
          - `value` number, double, required — Length value.
          - `unit` 'm' | 'cm' | 'mm' | 'yd' | 'ft' | 'in', required — Unit of measurement.
        - `move_up_to_face` string — Face limiting the move.
    - object
      - `occurrences` string[] — List of solid regions and/or sheet bodies.
      - `axis` CadAxis, required — Axis of rotation.
        - `value` CadVector — 3D vector.
          - `X` number, double, required — X
          - `Y` number, double, required — Y
          - `Z` number, double, required — Z
      - `angle` number, double, required — Angle or rotation in degrees.
      - `copy_bodies` boolean, required — If true, the operation creates new bodies instead of modifying the selected ones; if false, the selected bodies are modified in place.
    - object
      - `factor` number, double, required — Scaling factor. Must be greater than zero.
      - `occurrences` string[] — List of solid regions and/or sheet bodies.
    - object
      - `occurrences` string[] — List of solid regions and/or sheet bodies.
      - `primitive` 'box' | 'cylinder', required — Type of body used in the simplification. It can be either: `box`, or `cylinder`.
      - `replace_each` boolean, required — Controls the result. If `true`, each body will be replaced singularly; otherwise all bodies will be replaced by a single primitive.
    - object
      - `plane` CadPlane, required — Plane with unit.
        - `point` CadVector, required — 3D vector.
          - `X` number, double, required — X
          - `Y` number, double, required — Y
          - `Z` number, double, required — Z
        - `normal` CadVector, required — 3D vector.
          - `X` number, double, required — X
          - `Y` number, double, required — Y
          - `Z` number, double, required — Z
        - `unit` 'm' | 'cm' | 'mm' | 'yd' | 'ft' | 'in', required — Unit of measurement.
      - `keep_both` boolean, required — Controls the split. If `true`, both sides of the bodies are kept; otherwise, only the side facing the normal is retained.
      - `occurrences` string[] — List of solid regions and/or sheet bodies.
    - object
      - `targets` string[] — List of target solid regions and/or sheet bodies.
      - `tools` string[] — List of tool solid regions and/or sheet bodies.
      - `keep_tools` 'keep' | 'discard', required — Controls whether the tool bodies are retained after the subtraction. If `keep`, the tool bodies are kept alongside the resulting target bodies; if `discard`, the tool bodies are removed and only the resulting target bodies are retained.
    - object
      - `occurrences` string[] — List of solid regions and/or sheet bodies.
      - `translation_method` CadTranslateGroupParameter, required — Translation method.
        - `selected` 'translate_to_entity' | 'translate_vector', required — Defines how the translation is specified. It can be either: - `translate_vector`, in which case the translation distance and direction will be provided, or - `translate_to_entity`, in which case the translation distance and direction will be computed based on the provided face.
        - `translation_vector` CadVectorWithUnit — 3D vector with unit.
          - `value` CadVector, required — 3D vector.
            - `X` number, double, required — X
            - `Y` number, double, required — Y
            - `Z` number, double, required — Z
          - `unit` 'm' | 'cm' | 'mm' | 'yd' | 'ft' | 'in', required — Unit of measurement.
        - `translation_face` string — Face limiting the translation.
      - `copy_bodies` boolean, required — If true, the operation creates new bodies instead of modifying the selected ones; if false, the selected bodies are modified in place.
    - object
      - `occurrences` string[] — List of solid regions and/or sheet bodies.
    - object
      - `occurrences` string[] — List of solid regions and/or sheet bodies.
      - `wrap_type` 'features' | 'outside', required — Defines the behavior of the wrapper. It can be either: - `features` (shown in the UI as "Snap to edges"): to try to preserve the edges of the selected volumes, or - `outside` (shown in the UI as "Fit to surface"): to create a body closely fitted to the selected volumes.
      - `resolution` number, double, required — Resolution of the wrapper, the higher the resolution, the closer the result would be to the selected volumes. Must be a whole number between 1 and 10.
      - `allow_tunnels` boolean, required — Defines the behavior with respect to tunnels in the selected bodies. If `true`, the wrapper will attempt to go through the tunnels.
      - `cap_tunnels` boolean, required — Defines the behavior with respect to tunnels in the selected bodies. If `true`, the wrapper will create patches to cover the tunnels.
      - `tunnel_detection` CadWrapTunnelDetectionParameter, required
        - `selected` 'wrap_surface_tunnel_detection_manual' | 'wrap_surface_tunnel_detection_auto', required — Defines the method to detect tunnels in the input bodies. It can be either: - `wrap_surface_tunnel_detection_manual`, in which case `min_tunnel_diameter` must be specified, or - `wrap_surface_tunnel_detection_auto`, in which case the tunnel detection happens automatically.
        - `min_tunnel_diameter` CadLength — Length with unit.
          - `value` number, double, required — Length value.
          - `unit` 'm' | 'cm' | 'mm' | 'yd' | 'ft' | 'in', required — Unit of measurement.
      - `replace_each` boolean, required — Controls the result. If `true`, each body is wrapped individually; otherwise, one wrap body encloses all selected bodies.

## Response `201`

Successful start of the CAD feature generation.

- CadFeatureResponse
  - `cadStateId` string, uuid — The ID of the CAD state once completed.
  - `cadFeatureId` string, uuid — The ID of the CAD feature once completed.
  - `status` 'READY' | 'QUEUED' | 'RUNNING' | 'FINISHED' | 'CANCELED' | 'FAILED', required — Status of the operation.
  - `failureReason` LogEntry
    - `severity` 'INFO' | 'SUCCESS' | 'WARNING' | 'ERROR', required
    - `code` string, required — Code for e.g. programmatic handling of error conditions.
    - `message` string, required — Human-readable description of the entry.
    - `details` object — Additional data to interpret and handle the entry.

## Other responses

- `400` — Bad request.
- `403` — Insufficient Permissions
- `404` — Not found.
- `409` — Conflict

---

[API](https://skmtc.net/simscale/apis/simscale-api.md) · [All operations](https://skmtc.net/simscale/apis/simscale-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/simscale/simscale-api/revisions/53223abaceb7/schema)
