使用 autodesk forge api 获得 "mass properties" 但一无所获
use autodesk forge api to get "mass properties" but got nothing
使用 autodesk forge api,首先我得到一个 access_token 并创建一个 bucketkey,然后上传一个 stl 文件,然后验证作业是否完成,然后得到 guid。使用 access_token, urn , guid I post 调用 :
curl -X 'GET' -H 'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJjbGllbnRfaWQiOiJTRmxONGFFOTMzZ0dkU1FzbFZzbXk0TlZZTFNsSnc1dyIsImV4cCI6MTQ5OTQ3OTg4NCwic2NvcGUiOlsiZGF0YTpyZWFkIiwiZGF0YTp3cml0ZSIsImJ1Y2tldDpjcmVhdGUiLCJidWNrZXQ6cmVhZCJdLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiJiWUE0TWRSc3VlazVnQlZsV3lwMmwydDN6SllvOXVnMjR4VEI2TmtZUld5YTdPT0NVOWU2c3JGcEk0UWRTWHFJIn0.ckLsWxfaUUa_zY2UDumUApxcDZR6xfCRE18GCHvIpPc'
-v 'https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Zm9yZ2UtamF2YS1zYW1wbGUtYXBwLXNmbG40YWU5MzNnZ2RzcXNsdnNteTRudnlsc2xqdzV3LzIwMTcwNzA4MDkxMTU2NTkwMjgzMC5zdGw/metadata/a1f8def6-4c68-4bac-8c88-d14353252d67/properties'
正如autodesk教程中描述的那样:我应该得到"mass properties"像体积和面积,但我两个都没有:
< HTTP/1.1 200 OK < Access-Control-Allow-Credentials: true <
Access-Control-Allow-Origin: * < Content-Type: application/json;
charset=utf-8 < Date: Sat, 08 Jul 2017 01:15:18 GMT < Server: Apigee
Router < x-ads-app-identifier:
platform-viewing-2017.03.08.15.bf43c23-production < x-ads-duration:
181 ms < x-ads-startup-time: Wed Jun 21 05:40:27 UTC 2017 <
Content-Length: 387 < Connection: keep-alive <
* Connection #0 to host developer.api.autodesk.com left intact {"data":{"type":"properties", "collection":[
{"objectid":1,"name":"201707080911565902830",
"properties":{"Name":"201707080911565902830"}},
{"objectid":2,"name":"201707080911565902830",
"properties":{"Component
Name":"201707080911565902830","Name":"201707080911565902830"}},
{"objectid":3,"name":"mesh_name_undefined",
"properties":{"Appearance":"191, 191,
191","Name":"mesh_name_undefined"}}]}}
感谢任何帮助,谢谢 whosebug.com。
此端点只是 returns 从本机种子文件中提取的属性,它不会为您计算质量、体积等。我不认为这些物理属性是 STL 文件的一部分,因此您也不会在 /properties 端点看到它们。
如果您上传 Inventor 或 dwf 文件,您将看到附加到该文件的属性。要进行简单测试,请将您的文件上传到我们的查看器 https://a360.autodesk.com/viewer 并使用属性面板查看可用的属性,您将从端点获得的属性相同。
希望对您有所帮助
使用 autodesk forge api,首先我得到一个 access_token 并创建一个 bucketkey,然后上传一个 stl 文件,然后验证作业是否完成,然后得到 guid。使用 access_token, urn , guid I post 调用 :
curl -X 'GET' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJjbGllbnRfaWQiOiJTRmxONGFFOTMzZ0dkU1FzbFZzbXk0TlZZTFNsSnc1dyIsImV4cCI6MTQ5OTQ3OTg4NCwic2NvcGUiOlsiZGF0YTpyZWFkIiwiZGF0YTp3cml0ZSIsImJ1Y2tldDpjcmVhdGUiLCJidWNrZXQ6cmVhZCJdLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiJiWUE0TWRSc3VlazVnQlZsV3lwMmwydDN6SllvOXVnMjR4VEI2TmtZUld5YTdPT0NVOWU2c3JGcEk0UWRTWHFJIn0.ckLsWxfaUUa_zY2UDumUApxcDZR6xfCRE18GCHvIpPc' -v 'https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Zm9yZ2UtamF2YS1zYW1wbGUtYXBwLXNmbG40YWU5MzNnZ2RzcXNsdnNteTRudnlsc2xqdzV3LzIwMTcwNzA4MDkxMTU2NTkwMjgzMC5zdGw/metadata/a1f8def6-4c68-4bac-8c88-d14353252d67/properties'
正如autodesk教程中描述的那样:我应该得到"mass properties"像体积和面积,但我两个都没有:
< HTTP/1.1 200 OK < Access-Control-Allow-Credentials: true < Access-Control-Allow-Origin: * < Content-Type: application/json; charset=utf-8 < Date: Sat, 08 Jul 2017 01:15:18 GMT < Server: Apigee Router < x-ads-app-identifier: platform-viewing-2017.03.08.15.bf43c23-production < x-ads-duration: 181 ms < x-ads-startup-time: Wed Jun 21 05:40:27 UTC 2017 < Content-Length: 387 < Connection: keep-alive < * Connection #0 to host developer.api.autodesk.com left intact {"data":{"type":"properties", "collection":[ {"objectid":1,"name":"201707080911565902830", "properties":{"Name":"201707080911565902830"}}, {"objectid":2,"name":"201707080911565902830", "properties":{"Component Name":"201707080911565902830","Name":"201707080911565902830"}}, {"objectid":3,"name":"mesh_name_undefined", "properties":{"Appearance":"191, 191, 191","Name":"mesh_name_undefined"}}]}}
感谢任何帮助,谢谢 whosebug.com。
此端点只是 returns 从本机种子文件中提取的属性,它不会为您计算质量、体积等。我不认为这些物理属性是 STL 文件的一部分,因此您也不会在 /properties 端点看到它们。
如果您上传 Inventor 或 dwf 文件,您将看到附加到该文件的属性。要进行简单测试,请将您的文件上传到我们的查看器 https://a360.autodesk.com/viewer 并使用属性面板查看可用的属性,您将从端点获得的属性相同。
希望对您有所帮助