Get 3D Refined Mesh
Retrieve a refined 3D mesh from a preview Image-to-3D session.
Request
POST https://api.csm.ai/image-to-3d-sessions/get-3d/refine/<Session Code>
Parameters
scaled_bbox OPTIONAL
type: array
in: body
description: Specifies the scaled bounding box dimensions for the generated asset. This parameter should be a list of three float values, representing width
, height
, and depth
, respectively.
pivot_point OPTIONAL
type: array
in: body
example: [0.0, 0.0, 0.0]
description: Sets the pivot point (origin) of the exported mesh. This should be a list of three float values for the x, y, and z coordinates. The values should range from [-0.5, 0.5]
, normalized to the bounding box dimensions. Examples:
- Center of bounding box (default):
[0, 0, 0]
- Left-bottom-back corner:
[-0.5, -0.5, -0.5]
- Right-top-front corner:
[0.5, 0.5, 0.5]
- Center-bottom:
[0, -0.5, 0]
Code Snippets
Python
import requests
import json
url = "https://api.csm.ai/image-to-3d-sessions/get-3d/refine/SESSION_P_44569824122"
payload = json.dumps({})
headers = {
'x-api-key': '<X-API_KEY>',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Node.js
var request = require('request');
var options = {
method: 'POST',
url: 'https://api.csm.ai/image-to-3d-sessions/get-3d/refine/SESSION_P_44569824122',
headers: {
'x-api-key': '<X-API_KEY>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Curl
curl -k --location 'https://api.csm.ai/image-to-3d-sessions/get-3d/refine/SESSION_P_44569824122' \
--header 'x-api-key: <X-API_KEY>' \
--header 'Content-Type: application/json' \
--data '{}'
Response
{
"error": "",
"message": "Generating Mesh",
"statusCode": 200,
"data": {
"scenario": "SESSION_P_44569824122",
"unique_trial_key": "168923176748ZJ@NcRfUjXn2r5u8x",
"status": "unprocessed",
"complete_job_data": {
"scenario": "SESSION_P_44569824122",
"job_priority": "2",
"username": "admin@test.com",
"call": "dreamfusion",
"user_id": "000000",
"status": "unprocessed",
"start_time": "1689231769.6472576",
"unique_trial_key": "168923176748ZJ@NcRfUjXn2r5u8x",
"task_data": "{\"scenario\": \"SESSION_P_44569824122\", \"unique_trial_key\": \"168923176748ZJ@NcRfUjXn2r5u8x\", \"customer_email\": \"admin@yopmail.com\", \"image_url\": \"https://via.placeholder.com/300/09f/fff.png\", \"text_prompt\": \"Walk\", \"keyword\": \"\", \"discord_user_id\": \"\"}",
"id": "job:dreamfusion:SESSION_P_44569824122_168923176748ZJ@NcRfUjXn2r5u8x"
}
}
}