Multi-Color Print API
I-convert ang mga 3D model sa multi-color na 3MF format para sa 3D printing, na may nako-configure na color palette na hanggang 16 na kulay.
Gumawa ng Multi-Color 3D Print Task
Lumilikha ang endpoint na ito ng bagong multi-color 3D print task. Iko-convert ng task ang isang 3D model sa multi-color na 3MF file na angkop para sa 3D printing.
Mga parameter
Isa lang sa input_task_id o model_url ang kinakailangan. Kung parehong ibinigay, may priority ang input_task_id.
- Name
- input_task_id
- Type
- string
- Kinakailangan
- Description
Ang ID ng isang nagtagumpay na task na gagamitin bilang input. Mga sinusuportahang uri ng task: Image to 3D, Multi-Image to 3D, Text to 3D, Remesh, at Retexture. Dapat may status na
SUCCEEDEDang task.
- Name
- model_url
- Type
- string
- Kinakailangan
- Description
URL na publicly accessible o Data URI ng isang 3D model. Kasalukuyan naming sinusuportahan ang mga format na
.glbat.fbx.
- Name
- max_colors
- Type
- integer
- default 4
- Description
Pinakamataas na bilang ng mga kulay sa output palette.
Valid na saklaw:
1hanggang16.
- Name
- max_depth
- Type
- integer
- default 4
- Description
Lalim ng quadtree para sa katumpakan ng kulay. Ang mas matataas na value ay lumilikha ng mas pinong mga hangganan ng kulay ngunit nagpapalaki ng file size.
Valid na saklaw:
3hanggang6.
Mga Ibinabalik
Ang property na result ng response ay naglalaman ng id ng bagong nalikhang 3D print task.
Mga Mode ng Pagkabigo
- Name
400 - Bad Request- Description
Hindi katanggap-tanggap ang request. Karaniwang mga sanhi:
- Nawawalang parameter: Dapat ibigay ang alinman sa
model_urloinput_task_id. - Invalid na format ng model: Ang
model_urlay tumutukoy sa isang file na may hindi sinusuportahang extension (.glbat.fbxlang ang sinusuportahan). - Hindi maabot na URL: Hindi ma-download ang
model_url. - Invalid na input task: Dapat tumukoy ang
input_task_idsa isang matagumpay na task. - Invalid na max_colors: Dapat nasa pagitan ng 1 at 16 ang value.
- Invalid na max_depth: Dapat nasa pagitan ng 3 at 6 ang value.
- Nawawalang parameter: Dapat ibigay ang alinman sa
- Name
401 - Unauthorized- Description
Nabigo ang authentication. Pakisuri ang iyong API key.
- Name
402 - Payment Required- Description
Hindi sapat ang credits para isagawa ang task na ito.
- Name
429 - Too Many Requests- Description
Lumampas ka na sa iyong rate limit.
Request
# Convert a 3D model to multi-color 3MF for printing
curl https://api.meshy.ai/openapi/v1/print/multi-color \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"max_colors": 8,
"max_depth": 5
}'
Response
{
"result": "0193bfc5-ee4f-73f8-8525-44b398884ce9"
}
Kunin ang isang Multi-Color na 3D Print Task
Kinukuha ng endpoint na ito ang isang multi-color na 3D print task gamit ang ID nito.
Mga Parameter
- Name
- id
- Type
- path
- Description
Ang ID ng 3D print task na kukunin.
Ibinabalik
Ang 3D Print Task object.
Request
curl https://api.meshy.ai/openapi/v1/print/multi-color/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response
{
"id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
"type": "print-multi-color",
"model_urls": {
"3mf": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.3mf?Expires=***"
},
"progress": 100,
"status": "SUCCEEDED",
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000001000,
"task_error": null,
"consumed_credits": 10
}
I-delete ang Multi-Color na 3D Print Task
Permanenteng dine-delete ng endpoint na ito ang isang multi-color na 3D print task, kabilang ang lahat ng kaugnay na mga model at data. Hindi na mababawi ang aksyong ito.
Mga Path Parameter
- Name
- id
- Type
- path
- Description
Ang ID ng multi-color na 3D print task na ide-delete.
Mga Return
Nagbabalik ng 200 OK kapag matagumpay.
Request
curl --request DELETE \
--url https://api.meshy.ai/openapi/v1/print/multi-color/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response
// Returns 200 Ok on success.
Ilista ang mga Multi-Color na 3D Print Task
Pinapayagan ka ng endpoint na ito na kunin ang listahan ng mga multi-color na 3D print task.
Mga Parameter
Mga opsyonal na attribute
- Name
- page_num
- Type
- integer
- Description
Numero ng pahina para sa pagination. Nagsisimula at default sa
1.
- Name
- page_size
- Type
- integer
- Description
Limitasyon sa laki ng pahina. Default sa
10item. Ang maximum na pinapayagan ay50item.
- Name
- sort_by
- Type
- string
- Description
Field na gagamitin sa pag-sort. Mga available na value:
+created_at: I-sort ayon sa oras ng paggawa sa pataas na pagkakasunod-sunod.-created_at: I-sort ayon sa oras ng paggawa sa pababang pagkakasunod-sunod.
Mga Ibinabalik
Nagbabalik ng naka-pagination na listahan ng Mga 3D Print Task Object.
Request
curl https://api.meshy.ai/openapi/v1/print/multi-color?page_size=10 \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response
[
{
"id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
"type": "print-multi-color",
"model_urls": {
"3mf": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.3mf?Expires=***"
},
"progress": 100,
"status": "SUCCEEDED",
"preceding_tasks": 0,
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000001000,
"task_error": null,
"consumed_credits": 10
}
]
I-stream ang isang Multi-Color na 3D Print Task
Nag-i-stream ang endpoint na ito ng mga real-time na update para sa isang multi-color na 3D print task gamit ang Server-Sent Events (SSE).
Mga Parameter
- Name
- id
- Type
- path
- Description
Natatanging identifier para sa multi-color na 3D print task na i-stream.
Mga Ibinabalik
Nagbabalik ng stream ng The 3D Print Task Objects bilang Server-Sent Events.
Para sa mga task na PENDING o IN_PROGRESS, isasama lang ng response stream ang kinakailangang mga field na progress at status.
Request
curl -N https://api.meshy.ai/openapi/v1/print/multi-color/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-multi-color",
"model_urls": {
"3mf": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/model.3mf?Expires=***"
},
"progress": 100,
"status": "SUCCEEDED",
"preceding_tasks": 0,
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000001000,
"task_error": null,
"consumed_credits": 10
}
Ang 3D Print Task Object
- Name
- id
- Type
- string
- Description
Natatanging tagatukoy para sa task. Bagama't gumagamit kami ng k-sortable UUID para sa mga task id bilang detalye ng implementasyon, hindi ka dapat gumawa ng anumang palagay tungkol sa format ng id.
- Name
- type
- Type
- string
- Description
Uri ng 3D Print task. Ang value ay
print-multi-color.
- Name
- model_urls
- Type
- object
- Description
Nada-download na URL sa 3D model file na ginawa ng Meshy. Ang property para sa isang format ay aalisin kung hindi ginawa ang format sa halip na magbalik ng walang-lamang string.
- Name
3mf- Type
- string
- Description
Nada-download na URL sa multi-color 3MF file.
- Name
- progress
- Type
- integer
- Description
Progress ng task. Kung hindi pa nagsisimula ang task, ang property na ito ay magiging
0. Kapag nagtagumpay na ang task, magiging100ito.
- Name
- status
- Type
- string
- Description
Status ng task. Ang mga posibleng value ay isa sa
PENDING,IN_PROGRESS,SUCCEEDED,FAILED.
- Name
- preceding_tasks
- Type
- integer
- Description
Ang bilang ng mga nauunang task.
Ang value ng field na ito ay may kahulugan lamang kung ang task status ay
PENDING.
- Name
- created_at
- Type
- timestamp
- Description
Timestamp kung kailan ginawa ang task, sa milliseconds.
- Name
- started_at
- Type
- timestamp
- Description
Timestamp kung kailan sinimulan ang task, sa milliseconds. Kung hindi pa nagsisimula ang task, ang property na ito ay magiging
0.
- Name
- finished_at
- Type
- timestamp
- Description
Timestamp kung kailan natapos ang task, sa milliseconds. Kung hindi pa tapos ang task, ang property na ito ay magiging
0.
- Name
- task_error
- Type
- object
- Description
Mga detalye ng error para sa mga nabigong task. Tingnan ang Errors para sa buong
task_errorobject reference.
- Name
- consumed_credits
- Type
- integer
- Description
Ang bilang ng credits na nakonsumo ng task na ito. Makikita kapag ang task status ay
PENDING,IN_PROGRESS, oSUCCEEDED. Nagbabalik ng0para sa mgaFAILEDtask (ibinabalik ang credits kapag nabigo).
The 3D Print Task Object
{
"id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
"type": "print-multi-color",
"model_urls": {
"3mf": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.3mf?Expires=***"
},
"progress": 100,
"status": "SUCCEEDED",
"preceding_tasks": 0,
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000001000,
"task_error": null,
"consumed_credits": 10
}