Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8697

Geometry encoding for Compute

$
0
0

Could you show how you create this input data? I’ve got an error when I’m trying to pass Points using this method:

let x = new this._rhino.Point([-5, 5, 0]);
let dataD = {
      definition: "test.gh",
      inputs: { X: x.encode() },
    };

    let jsonData = JSON.stringify(dataD);

    const request = {
      method: "POST",
      body: jsonData,
      headers: { "Content-Type": "application/json" },
    };

When I create points as string like that:
'{"X":' + 80 + ',"Y":' + 200 + ',"Z":' + 0 + "}",
everything works fine…

8 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 8697

Latest Images

Trending Articles



Latest Images