瓮寿命有多长
How to long is urn life
我在 derivativesApi 的代码中得到 urn 需要多长时间
Autodesk.Forge.Model.DynamicJsonResponse translateResponse = derivativesApi.Translate(job, true);
字符串 responseUrn = translateResponse.Dictionary["urn"].ToString();
我猜你问的是 base64 urn 的字符串长度。
取决于objectId
的字符(a.k.a由PUT /buckets/:bucketKey/objects/:objectName) you passed into the base64 string encoder with my experience, and it will be the same urn you pass to the POST job of the Forge Model Derivative API. Normally, each Base64 digit represents exactly 6 bits of data from the wiki and here is a formula to calculate the encoded string length link返回的对象瓮:
((4 * n / 3) + 3) & ~3
note1. n
是你的objectId
.
的字符串长度
比如urn:adsk.objects:os.object:mybucket/example.txt
的长度是47,经过base64编码后,结果dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bXlidWNrZXQvZXhhbXBsZS50eHQ=
的长度是((4 * 47 / 3) + 3) & ~3 = 64
。
note2. 手动触发 Forge 翻译作业时必须删除填充字符 =
,Forge 模型导数 API 不允许这样做。这是公式:
len of the urn = 64 - n of the padding character `=`
因此,您从 API 响应中获得的骨灰盒的最终字符串长度为 64 - 1 = 63
。
参考。 https://en.wikipedia.org/wiki/Base64
note3.除非你调用DELETE :urn/manifest to deleted the translated results (a.k.a.viewable bubbles), viewable bubbles will be stored in Forge server permanently. You can also use viewable bubbles' urn to access them, despite the model file stored in your managed OSS bucket is deleted by the bucket policy你已经设置好了。
我在 derivativesApi 的代码中得到 urn 需要多长时间
Autodesk.Forge.Model.DynamicJsonResponse translateResponse = derivativesApi.Translate(job, true); 字符串 responseUrn = translateResponse.Dictionary["urn"].ToString();
我猜你问的是 base64 urn 的字符串长度。
取决于objectId
的字符(a.k.a由PUT /buckets/:bucketKey/objects/:objectName) you passed into the base64 string encoder with my experience, and it will be the same urn you pass to the POST job of the Forge Model Derivative API. Normally, each Base64 digit represents exactly 6 bits of data from the wiki and here is a formula to calculate the encoded string length link返回的对象瓮:
((4 * n / 3) + 3) & ~3
note1. n
是你的objectId
.
比如urn:adsk.objects:os.object:mybucket/example.txt
的长度是47,经过base64编码后,结果dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bXlidWNrZXQvZXhhbXBsZS50eHQ=
的长度是((4 * 47 / 3) + 3) & ~3 = 64
。
note2. 手动触发 Forge 翻译作业时必须删除填充字符 =
,Forge 模型导数 API 不允许这样做。这是公式:
len of the urn = 64 - n of the padding character `=`
因此,您从 API 响应中获得的骨灰盒的最终字符串长度为 64 - 1 = 63
。
参考。 https://en.wikipedia.org/wiki/Base64
note3.除非你调用DELETE :urn/manifest to deleted the translated results (a.k.a.viewable bubbles), viewable bubbles will be stored in Forge server permanently. You can also use viewable bubbles' urn to access them, despite the model file stored in your managed OSS bucket is deleted by the bucket policy你已经设置好了。