cyrillef / forge.model.derivative-js Goto Github PK
View Code? Open in Web Editor NEWAsynchronous Javascript/Node.js library for the Autodesk Forge Model Derivative API
License: MIT License
Asynchronous Javascript/Node.js library for the Autodesk Forge Model Derivative API
License: MIT License
When getThumneil (Binary) with the Request module,
It's required set "Encoding: null" paramater,
but it can not be specified.
I changed the ApiClient.js,DerivativesApi.js.
##############
##############
ApiClient.js #367
if(queryParams.isBinary && queryParams.isBinary==true) {
requestParams.encoding=null;
}
DerivativesApi.js #462
var queryParams = {
'width': opts['width'],
'height': opts['height'],
'isBinary' : opts["isBinary"]
};
https://www.npmjs.com/package/request
Note: if you expect binary data, you should set encoding: null.)
deleteManifest throws exception and doesn't seem to be working ...
The docs state that getManifest
includes derivative URNs, but the returned manifest doesn't include them.
I've used forge.commandline-nodejs to test. Calling node forge-cb.js manifest Au.obj
(after all other steps, as described in the readme) returns this:
{
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dG1wYmNrdDEvQXUub2Jq",
"type": "manifest",
"progress": "complete",
"status": "success",
"hasThumbnail": true,
"derivatives": [
{
"name": "Au.obj",
"hasThumbnail": true,
"progress": "complete",
"status": "success",
"children": [
{
"type": "geometry",
"role": "3d",
"name": "3d Scene",
"hasThumbnail": true,
"progress": "complete",
"status": "success"
}
],
"outputType": "svf"
}
],
"region": "US"
}
But the expected object (as tested using cURL) looks like this:
{
"type": "manifest",
"hasThumbnail": "true",
"status": "success",
"progress": "complete",
"region": "US",
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dG1wYmNrdDEvQXUub2Jq",
"version": "1.0",
"derivatives": [
{
"name": "Au.obj",
"hasThumbnail": "true",
"status": "success",
"progress": "complete",
"outputType": "svf",
"children": [
{
"type": "geometry",
"role": "3d",
"name": "3d Scene",
"status": "success",
"progress": "complete",
"hasThumbnail": "true",
"children": [
{
"type": "resource",
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dG1wYmNrdDEvQXUub2Jq/output/Au.obj.svf",
"role": "graphics",
"mime": "application/autodesk-svf"
},
{
"type": "resource",
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dG1wYmNrdDEvQXUub2Jq/output/Au.obj.svf.png01_thumb_400x400.png",
"resolution": [
400.0,
400.0
],
"mime": "image/png",
"role": "thumbnail"
},
{
"type": "resource",
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dG1wYmNrdDEvQXUub2Jq/output/Au.obj.svf.png01_thumb_200x200.png",
"resolution": [
200.0,
200.0
],
"mime": "image/png",
"role": "thumbnail"
},
{
"type": "resource",
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dG1wYmNrdDEvQXUub2Jq/output/Au.obj.svf.png01_thumb_100x100.png",
"resolution": [
100.0,
100.0
],
"mime": "image/png",
"role": "thumbnail"
}
]
}
]
}
]
}
There are children inside children of derivatives when using cURL, which don't exist when using the library.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.