Code Monkey home page Code Monkey logo

forge.model.derivative-js's People

Contributors

autodesk-adn avatar cyrillef avatar xing-zheng avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

khoaho xing-zheng

forge.model.derivative-js's Issues

GetThumbnail not working...

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.)

getManifest does not include derivative urns and statuses

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.