A layout sketch's blocks, pins and sliders as a motion study (MO16.b)
curl --request POST \
--url https://api.eddy.engineer/v1/motion.layout \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"layout": {
"blocks": [
{
"id": "<string>",
"profile": [
[
123
]
],
"fixed": true,
"name": "<string>"
}
],
"gap": 0,
"pins": [
{
"a": "<string>",
"at": [
123
],
"b": "<string>",
"damping": 123,
"id": "<string>",
"limits": [
123
]
}
],
"sliders": [
{
"a": "<string>",
"at": [
123
],
"axis": [
123
],
"b": "<string>",
"damping": 123,
"id": "<string>",
"limits": [
123
]
}
],
"thickness": 0.01
},
"study": {}
}
'import requests
url = "https://api.eddy.engineer/v1/motion.layout"
payload = {
"layout": {
"blocks": [
{
"id": "<string>",
"profile": [[123]],
"fixed": True,
"name": "<string>"
}
],
"gap": 0,
"pins": [
{
"a": "<string>",
"at": [123],
"b": "<string>",
"damping": 123,
"id": "<string>",
"limits": [123]
}
],
"sliders": [
{
"a": "<string>",
"at": [123],
"axis": [123],
"b": "<string>",
"damping": 123,
"id": "<string>",
"limits": [123]
}
],
"thickness": 0.01
},
"study": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
layout: {
blocks: [{id: '<string>', profile: [[123]], fixed: true, name: '<string>'}],
gap: 0,
pins: [
{
a: '<string>',
at: [123],
b: '<string>',
damping: 123,
id: '<string>',
limits: [123]
}
],
sliders: [
{
a: '<string>',
at: [123],
axis: [123],
b: '<string>',
damping: 123,
id: '<string>',
limits: [123]
}
],
thickness: 0.01
},
study: {}
})
};
fetch('https://api.eddy.engineer/v1/motion.layout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/motion.layout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'layout' => [
'blocks' => [
[
'id' => '<string>',
'profile' => [
[
123
]
],
'fixed' => true,
'name' => '<string>'
]
],
'gap' => 0,
'pins' => [
[
'a' => '<string>',
'at' => [
123
],
'b' => '<string>',
'damping' => 123,
'id' => '<string>',
'limits' => [
123
]
]
],
'sliders' => [
[
'a' => '<string>',
'at' => [
123
],
'axis' => [
123
],
'b' => '<string>',
'damping' => 123,
'id' => '<string>',
'limits' => [
123
]
]
],
'thickness' => 0.01
],
'study' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/motion.layout"
payload := strings.NewReader("{\n \"layout\": {\n \"blocks\": [\n {\n \"id\": \"<string>\",\n \"profile\": [\n [\n 123\n ]\n ],\n \"fixed\": true,\n \"name\": \"<string>\"\n }\n ],\n \"gap\": 0,\n \"pins\": [\n {\n \"a\": \"<string>\",\n \"at\": [\n 123\n ],\n \"b\": \"<string>\",\n \"damping\": 123,\n \"id\": \"<string>\",\n \"limits\": [\n 123\n ]\n }\n ],\n \"sliders\": [\n {\n \"a\": \"<string>\",\n \"at\": [\n 123\n ],\n \"axis\": [\n 123\n ],\n \"b\": \"<string>\",\n \"damping\": 123,\n \"id\": \"<string>\",\n \"limits\": [\n 123\n ]\n }\n ],\n \"thickness\": 0.01\n },\n \"study\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/motion.layout")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"layout\": {\n \"blocks\": [\n {\n \"id\": \"<string>\",\n \"profile\": [\n [\n 123\n ]\n ],\n \"fixed\": true,\n \"name\": \"<string>\"\n }\n ],\n \"gap\": 0,\n \"pins\": [\n {\n \"a\": \"<string>\",\n \"at\": [\n 123\n ],\n \"b\": \"<string>\",\n \"damping\": 123,\n \"id\": \"<string>\",\n \"limits\": [\n 123\n ]\n }\n ],\n \"sliders\": [\n {\n \"a\": \"<string>\",\n \"at\": [\n 123\n ],\n \"axis\": [\n 123\n ],\n \"b\": \"<string>\",\n \"damping\": 123,\n \"id\": \"<string>\",\n \"limits\": [\n 123\n ]\n }\n ],\n \"thickness\": 0.01\n },\n \"study\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/motion.layout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"layout\": {\n \"blocks\": [\n {\n \"id\": \"<string>\",\n \"profile\": [\n [\n 123\n ]\n ],\n \"fixed\": true,\n \"name\": \"<string>\"\n }\n ],\n \"gap\": 0,\n \"pins\": [\n {\n \"a\": \"<string>\",\n \"at\": [\n 123\n ],\n \"b\": \"<string>\",\n \"damping\": 123,\n \"id\": \"<string>\",\n \"limits\": [\n 123\n ]\n }\n ],\n \"sliders\": [\n {\n \"a\": \"<string>\",\n \"at\": [\n 123\n ],\n \"axis\": [\n 123\n ],\n \"b\": \"<string>\",\n \"damping\": 123,\n \"id\": \"<string>\",\n \"limits\": [\n 123\n ]\n }\n ],\n \"thickness\": 0.01\n },\n \"study\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Motion
A layout sketch's blocks, pins and sliders as a motion study (MO16.b)
The seat’s layout-sketch mechanism: every block (a closed polygon in the layout plane, metres) becomes a component whose part is the polygon extruded by the layout’s thickness, each block on its own layer along z; every pin a revolute solver-level joint along z at its point (block a moves, block b or the ground holds; angle limits as a joint stop, damping), every slider a prismatic joint along its axis. Gravity defaults to −y in the plane. study overrides the top-level study fields and appends its elements (motors on the pins’ ids, forces, springs). The planar loops’ redundant rows (three per loop) are named by /v1/motion.compile.
POST
/
v1
/
motion.layout
A layout sketch's blocks, pins and sliders as a motion study (MO16.b)
curl --request POST \
--url https://api.eddy.engineer/v1/motion.layout \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"layout": {
"blocks": [
{
"id": "<string>",
"profile": [
[
123
]
],
"fixed": true,
"name": "<string>"
}
],
"gap": 0,
"pins": [
{
"a": "<string>",
"at": [
123
],
"b": "<string>",
"damping": 123,
"id": "<string>",
"limits": [
123
]
}
],
"sliders": [
{
"a": "<string>",
"at": [
123
],
"axis": [
123
],
"b": "<string>",
"damping": 123,
"id": "<string>",
"limits": [
123
]
}
],
"thickness": 0.01
},
"study": {}
}
'import requests
url = "https://api.eddy.engineer/v1/motion.layout"
payload = {
"layout": {
"blocks": [
{
"id": "<string>",
"profile": [[123]],
"fixed": True,
"name": "<string>"
}
],
"gap": 0,
"pins": [
{
"a": "<string>",
"at": [123],
"b": "<string>",
"damping": 123,
"id": "<string>",
"limits": [123]
}
],
"sliders": [
{
"a": "<string>",
"at": [123],
"axis": [123],
"b": "<string>",
"damping": 123,
"id": "<string>",
"limits": [123]
}
],
"thickness": 0.01
},
"study": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
layout: {
blocks: [{id: '<string>', profile: [[123]], fixed: true, name: '<string>'}],
gap: 0,
pins: [
{
a: '<string>',
at: [123],
b: '<string>',
damping: 123,
id: '<string>',
limits: [123]
}
],
sliders: [
{
a: '<string>',
at: [123],
axis: [123],
b: '<string>',
damping: 123,
id: '<string>',
limits: [123]
}
],
thickness: 0.01
},
study: {}
})
};
fetch('https://api.eddy.engineer/v1/motion.layout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/motion.layout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'layout' => [
'blocks' => [
[
'id' => '<string>',
'profile' => [
[
123
]
],
'fixed' => true,
'name' => '<string>'
]
],
'gap' => 0,
'pins' => [
[
'a' => '<string>',
'at' => [
123
],
'b' => '<string>',
'damping' => 123,
'id' => '<string>',
'limits' => [
123
]
]
],
'sliders' => [
[
'a' => '<string>',
'at' => [
123
],
'axis' => [
123
],
'b' => '<string>',
'damping' => 123,
'id' => '<string>',
'limits' => [
123
]
]
],
'thickness' => 0.01
],
'study' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/motion.layout"
payload := strings.NewReader("{\n \"layout\": {\n \"blocks\": [\n {\n \"id\": \"<string>\",\n \"profile\": [\n [\n 123\n ]\n ],\n \"fixed\": true,\n \"name\": \"<string>\"\n }\n ],\n \"gap\": 0,\n \"pins\": [\n {\n \"a\": \"<string>\",\n \"at\": [\n 123\n ],\n \"b\": \"<string>\",\n \"damping\": 123,\n \"id\": \"<string>\",\n \"limits\": [\n 123\n ]\n }\n ],\n \"sliders\": [\n {\n \"a\": \"<string>\",\n \"at\": [\n 123\n ],\n \"axis\": [\n 123\n ],\n \"b\": \"<string>\",\n \"damping\": 123,\n \"id\": \"<string>\",\n \"limits\": [\n 123\n ]\n }\n ],\n \"thickness\": 0.01\n },\n \"study\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/motion.layout")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"layout\": {\n \"blocks\": [\n {\n \"id\": \"<string>\",\n \"profile\": [\n [\n 123\n ]\n ],\n \"fixed\": true,\n \"name\": \"<string>\"\n }\n ],\n \"gap\": 0,\n \"pins\": [\n {\n \"a\": \"<string>\",\n \"at\": [\n 123\n ],\n \"b\": \"<string>\",\n \"damping\": 123,\n \"id\": \"<string>\",\n \"limits\": [\n 123\n ]\n }\n ],\n \"sliders\": [\n {\n \"a\": \"<string>\",\n \"at\": [\n 123\n ],\n \"axis\": [\n 123\n ],\n \"b\": \"<string>\",\n \"damping\": 123,\n \"id\": \"<string>\",\n \"limits\": [\n 123\n ]\n }\n ],\n \"thickness\": 0.01\n },\n \"study\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/motion.layout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"layout\": {\n \"blocks\": [\n {\n \"id\": \"<string>\",\n \"profile\": [\n [\n 123\n ]\n ],\n \"fixed\": true,\n \"name\": \"<string>\"\n }\n ],\n \"gap\": 0,\n \"pins\": [\n {\n \"a\": \"<string>\",\n \"at\": [\n 123\n ],\n \"b\": \"<string>\",\n \"damping\": 123,\n \"id\": \"<string>\",\n \"limits\": [\n 123\n ]\n }\n ],\n \"sliders\": [\n {\n \"a\": \"<string>\",\n \"at\": [\n 123\n ],\n \"axis\": [\n 123\n ],\n \"b\": \"<string>\",\n \"damping\": 123,\n \"id\": \"<string>\",\n \"limits\": [\n 123\n ]\n }\n ],\n \"thickness\": 0.01\n },\n \"study\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}