プリント可能性 API

3DモデルのFDMプリント可能性を分析します — 密閉性、体積、穴、非多様体の辺、および縮退面。


POST/openapi/v1/print/analyze

プリント可能性を分析するタスクを作成する

このエンドポイントは、新しいプリント可能性を分析するタスクを作成します。このタスクは3Dモデルを評価し、そのプリント可能性の指標を報告します。

入力タスクがすでにキャッシュされたプリント可能性を持っている場合、返されるタスクは即座に準備が整い、最初のGETでワーカーを通過せずに分析結果を返します。

パラメータ

  • Name
    model_url
    Type
    string
    必須
    Description

    分析する3DモデルのURL。サポートされている形式:.glb.gltf.obj.fbx.stl。最大ファイルサイズ:100 MB。httphttps、またはdata: URLを使用する必要があります(データURLは拡張子チェックをバイパスします)。

戻り値

レスポンスのresultプロパティには、新しく作成されたプリント可能性を分析するタスクのidが含まれています。

失敗モード

  • Name
    400 - Bad Request
    Description

    リクエストは受け入れられませんでした。一般的な原因:

    • パラメータが不足しているinput_task_idmodel_urlも提供されていない。
    • 無効なUUIDinput_task_idが有効なUUIDではない。
    • 無効なモデルURLmodel_urlが不正な形式である、サポートされていないスキームを使用している、またはサポートされていないファイル拡張子を持っている。
    • モデルファイルが大きすぎるmodel_urlのボディが100 MBを超えた。
    • タスクが成功していない:参照されたタスクがまだ保留中、進行中、または失敗している。
  • Name
    401 - Unauthorized
    Description

    認証に失敗しました。APIキーを確認してください。

  • Name
    403 - Forbidden
    Description

    タスクは存在しますが、異なるユーザーによって所有されています。

  • Name
    404 - Not Found
    Description

    一般的な原因:

    • タスクが存在しないか、削除されています。
    • タスクがMeshy 6より古いモデルを使用しているか、そのモードが3Dアセットを生成しない。
    • 基本となるモデルファイルがストレージにもう存在しない。
  • Name
    429 - Too Many Requests
    Description

    保留中のタスクのクォータまたはレート制限を超えました。

Request

POST
/openapi/v1/print/analyze
# Analyze an existing task
curl https://api.meshy.ai/openapi/v1/print/analyze \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
    "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578"
  }'

# Or analyze a model URL directly
curl https://api.meshy.ai/openapi/v1/print/analyze \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
    "model_url": "https://example.com/model.glb"
  }'

Response

{
  "result": "0193bfc5-ee4f-73f8-8525-44b398884ce9"
}

GET/openapi/v1/print/analyze/:id

プリント可能性を分析タスクを取得する

このエンドポイントは、IDによってプリント可能性を分析タスクを取得します。

パラメーター

  • Name
    id
    Type
    path
    Description

    取得するプリント可能性を分析タスクのID。

戻り値

プリント可能性を分析タスクオブジェクト。タスクがSUCCEEDEDに達するまで、printabilityフィールドはnullです。

Request

GET
/openapi/v1/print/analyze/a43b5c6d-7e8f-901a-234b-567c890d1e2f
curl https://api.meshy.ai/openapi/v1/print/analyze/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
-H "Authorization: Bearer ${YOUR_API_KEY}"

Response

{
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "print-analyze",
  "status": "SUCCEEDED",
  "progress": 100,
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000001000,
  "expires_at": 1715725401000,
  "task_error": null,
  "printability": {
    "_version": "v1",
    "status": "warning",
    "issue_count": 1,
    "error_count": 0,
    "warning_count": 1,
    "metrics": {
      "is_watertight": true,
      "volume": 1.316167354292668,
      "non_manifold_edges": 0,
      "degenerate_faces": 43242,
      "holes": 0
    },
    "evaluated_at": 1700000001000
  },
  "consumed_credits": 0
}

DELETE/openapi/v1/print/analyze/:id

プリント可能性を分析タスクを削除する

このエンドポイントは、プリント可能性を分析タスクとそのキャッシュされた結果を永久に削除します。この操作は元に戻せません。

パスパラメータ

  • Name
    id
    Type
    path
    Description

    削除するプリント可能性を分析タスクのID。

戻り値

成功時に 200 OK を返します。

Request

DELETE
/openapi/v1/print/analyze/a43b5c6d-7e8f-901a-234b-567c890d1e2f
curl --request DELETE \
  --url https://api.meshy.ai/openapi/v1/print/analyze/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Response

// Returns 200 Ok on success.

GET/openapi/v1/print/analyze

プリント可能性を分析タスクをリスト

このエンドポイントを使用すると、プリント可能性を分析タスクのリストを取得できます。

パラメータ

オプションの属性

  • Name
    page_num
    Type
    integer
    Description

    ページネーションのページ番号。1から始まり、デフォルトも1です。

  • Name
    page_size
    Type
    integer
    Description

    ページサイズの制限。デフォルトは10アイテムです。最大許可数は50アイテムです。

  • Name
    sort_by
    Type
    string
    Description

    ソートするフィールド。利用可能な値:

    • +created_at: 作成時間で昇順にソート。
    • -created_at: 作成時間で降順にソート。

戻り値

ページネーションされたプリント可能性を分析タスクオブジェクトのリストを返します。

Request

GET
/openapi/v1/print/analyze
curl https://api.meshy.ai/openapi/v1/print/analyze?page_size=10 \
-H "Authorization: Bearer ${YOUR_API_KEY}"

Response

[
  {
    "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
    "type": "print-analyze",
    "status": "SUCCEEDED",
    "progress": 100,
    "preceding_tasks": 0,
    "created_at": 1699999999000,
    "started_at": 1700000000000,
    "finished_at": 1700000001000,
    "expires_at": 1715725401000,
    "task_error": null,
    "printability": {
      "_version": "v1",
      "status": "warning",
      "issue_count": 1,
      "error_count": 0,
      "warning_count": 1,
      "metrics": {
        "is_watertight": true,
        "volume": 1.316167354292668,
        "non_manifold_edges": 0,
        "degenerate_faces": 43242,
        "holes": 0
      },
      "evaluated_at": 1700000001000
    },
    "consumed_credits": 0
  }
]

GET/openapi/v1/print/analyze/:id/stream

プリント可能性を分析タスクをストリームする

このエンドポイントは、Server-Sent Events (SSE) を使用してプリント可能性を分析タスクのリアルタイム更新をストリームします。

パラメータ

  • Name
    id
    Type
    path
    Description

    ストリームするプリント可能性を分析タスクの一意の識別子。

戻り値

Server-Sent Events として プリント可能性を分析タスクオブジェクト のストリームを返します。

PENDING または IN_PROGRESS のタスクの場合、レスポンスストリームには必要な progressstatus フィールドのみが含まれます。タスクが SUCCEEDED に達したときのみ printability ブロックが送信されます。

Request

GET
/openapi/v1/print/analyze/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream
curl -N https://api.meshy.ai/openapi/v1/print/analyze/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream \
-H "Authorization: Bearer ${YOUR_API_KEY}"

Response Stream

// Error event example
event: error
data: {
  "status_code": 404,
  "message": "Task not found"
}

// Message event examples illustrate task progress.
// For PENDING or IN_PROGRESS tasks, the response stream will not include all fields.
event: message
data: {
  "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f",
  "progress": 0,
  "status": "PENDING"
}

event: message
data: {
  "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f",
  "type": "print-analyze",
  "status": "SUCCEEDED",
  "progress": 100,
  "preceding_tasks": 0,
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000001000,
  "expires_at": 1715725401000,
  "task_error": null,
  "printability": {
    "_version": "v1",
    "status": "warning",
    "issue_count": 1,
    "error_count": 0,
    "warning_count": 1,
    "metrics": {
      "is_watertight": true,
      "volume": 1.316167354292668,
      "non_manifold_edges": 0,
      "degenerate_faces": 43242,
      "holes": 0
    },
    "evaluated_at": 1700000001000
  },
  "consumed_credits": 0
}

プリント可能性を分析タスクオブジェクト

  • Name
    id
    Type
    string
    Description

    タスクの一意の識別子です。タスクIDにはkソート可能なUUIDを使用していますが、IDの形式については何も仮定しないでください。

  • Name
    type
    Type
    string
    Description

    プリント可能性を分析タスクのタイプです。値はprint-analyzeです。

  • Name
    status
    Type
    string
    Description

    タスクのステータスです。可能な値はPENDINGIN_PROGRESSSUCCEEDEDFAILEDCANCELEDのいずれかです。

  • Name
    progress
    Type
    integer
    Description

    タスクの進捗です。タスクがまだ開始されていない場合、このプロパティは0になります。タスクが成功すると、これが100になります。

  • Name
    preceding_tasks
    Type
    integer
    Description

    先行タスクの数です。

  • Name
    created_at
    Type
    timestamp
    Description

    タスクが作成された時のタイムスタンプ(ミリ秒単位)です。

  • Name
    started_at
    Type
    timestamp
    Description

    タスクが開始された時のタイムスタンプ(ミリ秒単位)です。タスクがまだ開始されていない場合、このプロパティは0になります。

  • Name
    finished_at
    Type
    timestamp
    Description

    タスクが終了した時のタイムスタンプ(ミリ秒単位)です。タスクがまだ終了していない場合、このプロパティは0になります。

  • Name
    expires_at
    Type
    timestamp
    Description

    タスク結果がシステムから期限切れになる時のタイムスタンプ(ミリ秒単位)です。タスクがまだ終了していない場合は0です。

  • Name
    task_error
    Type
    object
    Description

    タスクが失敗した場合のエラー情報です。タスクが失敗していない場合、このプロパティはnullです。詳細はエラーを参照してください。

    • Name
      message
      Type
      string
      Description

      何が問題だったのかを説明するエラーメッセージです。

  • Name
    printability
    Type
    object
    Description

    プリント可能性の評価結果です。タスクがSUCCEEDEDに達するまでnullです。

    • Name
      _version
      Type
      string
      Description

      プリント可能性結果のスキーマバージョンです。現在はv1です。

    • Name
      status
      Type
      string
      Description

      全体のステータスです。以下のいずれかです:

      • healthy: エラーも警告もありません。
      • warning: 少なくとも1つの警告がありますが、エラーはありません。
      • error: 少なくとも1つのエラーがあります。
      • unknown: モデルを分析できませんでした。
    • Name
      issue_count
      Type
      integer
      Description

      問題の総数で、error_count + warning_countに等しいです。

    • Name
      error_count
      Type
      integer
      Description

      エラーレベルの問題の数です。モデルが水密でない非正の体積を持つ、または非多様体の辺を持つ場合にエラーが発生します。

    • Name
      warning_count
      Type
      integer
      Description

      警告レベルの問題の数です。モデルに縮退面が含まれている場合に警告が発生します。

    • Name
      metrics
      Type
      object
      Description

      評価者によって返される生のジオメトリメトリクスです。

      • Name
        is_watertight
        Type
        boolean
        Description

        メッシュに境界エッジがない(つまり、閉じている)場合はtrueです。

      • Name
        volume
        Type
        number
        Description

        モデルの体積(立方メートル単位)です。

      • Name
        non_manifold_edges
        Type
        integer
        Description

        非多様体の辺の数です。

      • Name
        degenerate_faces
        Type
        integer
        Description

        縮退面(ゼロ面積または無効な面)の数です。

      • Name
        holes
        Type
        integer
        Description

        メッシュ内の穴(境界ループ)の数です。

    • Name
      evaluated_at
      Type
      timestamp
      Description

      分析が計算された時のタイムスタンプ(エポックからのミリ秒単位)です。

  • Name
    consumed_credits
    Type
    integer
    Description

    常に0です。このエンドポイントは無料です。

プリント可能性を分析タスクオブジェクト

{
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "print-analyze",
  "status": "SUCCEEDED",
  "progress": 100,
  "preceding_tasks": 0,
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000001000,
  "expires_at": 1715725401000,
  "task_error": null,
  "printability": {
    "_version": "v1",
    "status": "warning",
    "issue_count": 1,
    "error_count": 0,
    "warning_count": 1,
    "metrics": {
      "is_watertight": true,
      "volume": 1.316167354292668,
      "non_manifold_edges": 0,
      "degenerate_faces": 43242,
      "holes": 0
    },
    "evaluated_at": 1700000001000
  },
  "consumed_credits": 0
}