Volume Calculator

3D AI Studio

Volume Calculator

Calculate the volume, surface area, and material estimates of any 3D model at up to 10 different heights in a single request.

Input Requirements

For accurate results, the input model should be watertight (no holes) or have only small holes. Models with small gaps are handled automatically, but large open surfaces may reduce accuracy.

Calculate Volume

POST

/v1/tools/calculate-volume/

Calculate the precise volume and surface area of any 3D model at up to 10 different heights in a single request. Upload a 3D file or provide a URL and specify one or more target heights — the API returns the volume, surface area, bounding box dimensions, hollow shell estimates, and infill-adjusted volumes for each height. The model is processed once and all heights are computed instantly. Supports GLB, glTF, OBJ, STL, PLY, FBX, and ZIP archives. Costs 20 credits per request regardless of how many heights are requested.

Request
# Single height
curl -X POST https://api.3daistudio.com/v1/tools/calculate-volume/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_url": "https://example.com/model.glb",
    "target_height": 10.0,
    "unit": "cm"
  }'

# Multiple heights (up to 10) — same cost, same processing time
curl -X POST https://api.3daistudio.com/v1/tools/calculate-volume/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_url": "https://example.com/model.glb",
    "target_heights": "5,10,15,20",
    "unit": "cm"
  }'

# File upload with multiple heights
curl -X POST https://api.3daistudio.com/v1/tools/calculate-volume/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F model_file=@model.glb \
  -F target_heights=5,10,15,20 \
  -F unit=cm
Response
{
  "task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "created_at": "2026-03-31T12:00:00Z"
}

Parameters

ParameterTypeRequiredDescription
model_urlstring (URL)ConditionalURL of the 3D model. Supports GLB, glTF, OBJ, STL, PLY, FBX, and ZIP. Required if model_file is not provided.
model_filefileConditionalDirect file upload of the 3D model. Supports the same formats as model_url. Required if model_url is not provided.
target_heightnumberConditionalA single height for volume calculation. The model is scaled uniformly so its height matches this value. Minimum: 0.01. Required if target_heights is not provided.
target_heightsstringConditionalComma-separated list of heights (up to 10). Example: "5,10,15,20". Returns results for each height. Required if target_height is not provided.
unitstringNoUnit for heights and all returned measurements: "cm", "mm", or "inches". Default: "cm".

Checking Status

GET

/v1/generation-request/<task_id>/status/

Poll this endpoint with the task_id from the submit response. When status is "FINISHED", the results array contains a JSON report with metrics for each requested height. Results expire after 24 hours.

Request
curl https://api.3daistudio.com/v1/generation-request/YOUR_TASK_ID/status/ \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "status": "FINISHED",
  "progress": 100,
  "failure_reason": null,
  "results": [
    {
      "asset": "https://storage.3daistudio.com/assets/volume_report.json",
      "asset_type": "3D_MODEL",
      "metadata": {
        "heights": [
          {
            "target_height": 5.0,
            "volume": 4.347,
            "unit": "cm³",
            "surface_area": 29.681,
            "surface_area_unit": "cm²",
            "surface_area_to_volume_ratio": 6.8276,
            "bounding_box": { "width": 2.56, "depth": 1.58, "height": 5.0, "unit": "cm" },
            "bounding_box_volume": 20.21,
            "fill_ratio": 0.2151,
            "hollow_estimates": [
              { "wall_thickness_mm": 2.0, "shell_volume": 5.94, "material_saved": 0.0, "material_saved_pct": 0.0 }
            ],
            "infill_estimates": { "20%": 0.869, "100%": 4.347 }
          },
          {
            "target_height": 10.0,
            "volume": 34.774,
            "unit": "cm³",
            "surface_area": 118.721,
            "surface_area_unit": "cm²",
            "bounding_box": { "width": 5.12, "depth": 3.16, "height": 10.0, "unit": "cm" },
            "bounding_box_volume": 161.69,
            "fill_ratio": 0.2151,
            "hollow_estimates": [
              { "wall_thickness_mm": 2.0, "shell_volume": 23.74, "material_saved": 11.03, "material_saved_pct": 31.72 }
            ],
            "infill_estimates": { "20%": 6.955, "100%": 34.774 }
          }
        ],
        "height_unit": "cm"
      }
    }
  ]
}

Response Fields

Each entry in the heights array contains the following fields:

FieldTypeDescription
target_heightnumberThe height this result was calculated for.
volumenumberThe calculated volume of the model in the requested unit (cm³, mm³, or in³).
surface_areanumberTotal surface area of the model (cm², mm², or in²).
surface_area_to_volume_rationumberRatio of surface area to volume. Higher values indicate more intricate or thin-walled models.
bounding_boxobjectWidth, depth, and height of the model's bounding box in the requested unit.
bounding_box_volumenumberVolume of the bounding box.
fill_rationumberHow much of the bounding box the model fills (0 to 1). A cube would be 1.0.
hollow_estimatesarrayMaterial volume estimates if the model were hollowed at 1mm, 1.5mm, 2mm, and 3mm wall thicknesses. Includes material saved percentage.
infill_estimatesobjectVolume at 15%, 20%, 25%, 50%, and 100% infill. Useful for estimating FDM print material usage.

Processing Times

Volume calculation typically completes in 8–20 seconds depending on the complexity of the model. Requesting multiple heights does not increase processing time.