hi,
i have trouble uploading binary .stl's over the Api,
the file is a simple cube from rhino exported in binary and ascii. (see attached).
The ascii seems to work;
it keeps giving me the following error for the binary file:
We're unable to process this file. Check your file for errors and click 'Update File' to upload a new version.
Automatic rescale failed. Model is not within acceptable bounds in any unit. When rescaling to units in:
- millimeter, model is 117449404946384660000000000 x 117449404946384660000000000 x 117449404946384660000000000 m
- inch, model is 2983214830297938000000000000 x 2983214830297938000000000000 x 2983214830297938000000000000 m
- meter, model is 117449400666740040000000000000 x 117449400666740040000000000000 x 117449400666740040000000000000 m
Fixed Parsing problem: File size does not match the expected size for the given number of facets. Given 12 facets for a total size of 684 but the file size is 1084
The strange thing is it does recognize the number of mesh facets (12), being a triangulated cube. So it does read something...
the json code (checked valid) for the upload is as follows:
{
"isDownloadable":0,
"file":" Umhpbm9jZXJvcyBCaW5hcnkgU1RMICggT2N0ICA4IDIwMTMgKQ0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQoMAAAAAAAAAAAA 77%2b977%2b9AAAA77%2b9Yu%2b%2fve%2b%2fve%2b%2fve%2b%2fve%2b% 2fve%2b%2fve%2b%2fvQAAAABj77%2b9QO%2b%2fve%2b%2fve%2b%2fve%2 b%2fvQAAAABj77%2b9QO%2b%2fve%2b%2fve%2b%2fve%2b%2fvRdYIEEAAA AAAAAAAO%2b%2fve%2b%2fvQAAAO%2b%2fvWLvv73vv73vv73vv73vv73vv7 3vv70AAAAAY%2b%2b%2fvUDvv73vv73vv73vv70XWCBBYu%2b%2fve%2b%2f ve%2b%2fve%2b%2fve%2b%2fve%2b%2fve%2b%2fvRdYIEEAAAAA77%2b9Pw AAAO%2b%2fvQAAAABj77%2b9QO%2b%2fve%2b%2fve%2b%2fve%2b%2fvQAA AABj77%2b9QCbvv73vv71AAAAAAGPvv71AJu%2b%2fve%2b%2fvUAXWCBBAA AAAO%2b%2fvT8AAADvv70AAAAAY%2b%2b%2fvUDvv73vv73vv73vv70AAAAA Y%2b%2b%2fvUAm77%2b977%2b9QBdYIEFj77%2b9QO%2b%2fve%2b%2fve%2 b%2fve%2b%2fvRdYIEEAAAAAAAAAAO%2b%2fvT8AAAAAY%2b%2b%2fvUAm77 %2b977%2b9QAAAAABi77%2b977%2b977%2b9Ju%2b%2fve%2b%2fvUAAAAAA Yu%2b%2fve%2b%2fve%2b%2fvSbvv73vv71AF1ggQQAAAAAAAAAA77%2b9Pw AAAABj77%2b9QCbvv73vv71AAAAAAGLvv73vv73vv70m77%2b977%2b9QBdY IEFj77%2b9QCbvv73vv71AF1ggQQAAAADvv73vv70AAADvv70AAADvv71i77 %2b977%2b977%2b9Ju%2b%2fve%2b%2fvUAAAAAAYu%2b%2fve%2b%2fve%2 b%2fve%2b%2fve%2b%2fve%2b%2fve%2b%2fvQAAAABi77%2b977%2b977%2 b977%2b977%2b977%2b977%2b9F1ggQQAAAADvv73vv70AAADvv70AAADvv7 1i77%2b977%2b977%2b9Ju%2b%2fve%2b%2fvUAAAAAAYu%2b%2fve%2b%2f ve%2b%2fve%2b%2fve%2b%2fve%2b%2fve%2b%2fvRdYIEFi77%2b977%2b9 77%2b9Ju%2b%2fve%2b%2fvUAXWCBBAAAAAADvv70AAADvv70AAO%2b%2fve %2b%2fvWPvv71A77%2b977%2b977%2b977%2b9AAAAAGLvv73vv73vv73vv7 3vv73vv73vv70AAAAAYu%2b%2fve%2b%2fve%2b%2fvSbvv73vv71AAAAAAA AAAAAAAAAAAAAAAO%2b%2fve%2b%2fvWLvv73vv73vv70m77%2b977%2b9QA AAAABj77%2b9QCbvv73vv71AAAAAAGPvv71A77%2b977%2b977%2b977%2b9 AAAAAAAAAAAAAAAAAO%2b%2fvQAA77%2b9P2Pvv71A77%2b977%2b977%2b9 77%2b9F1ggQWLvv73vv73vv70m77%2b977%2b9QBdYIEFi77%2b977%2b977 %2b977%2b977%2b977%2b977%2b9F1ggQQAAAAAAAAAAAAAAAO%2b%2fvT9i 77%2b977%2b977%2b9Ju%2b%2fve%2b%2fvUAXWCBBY%2b%2b%2fvUDvv73v v73vv73vv70XWCBBY%2b%2b%2fvUAm77%2b977%2b9QBdYIEEAAA%3d%3d ",
"fileName":"initial_sweep.stl",
"hasRightsToModel":1,
"acceptTermsAndConditions":1,
"title":"#6 Api testing a real binary stl file..:S",
"description":"Sweep someone off their feet with the SUUZ Initial sweep ring. This special initials ring consists of characters picked by you. Enter your initials, your lovers' intials or anything else, up to 4 characters. The charactes in this ring designed by SUUZ are connected fluently. It is a comfortable and light ring to wear. Absolutely an elegant and personal jewel! ",
"isPublic":1,
"isForSale":1,
"uploadScale":0.001
}
the C# code for encoding the file contents is as follows:
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(filecontents);
string filecontents_base64 = System.Convert.ToBase64String(bytes);
string filecontents_base64_urlencoded = HttpUtility.UrlEncodeUnicode(filecontents_base64);
anybody from the shapeways team any idea?
chrs,
Elco