Extrude a solved sketch profile into a solid (C track C5)
curl --request POST \
--url https://api.eddy.engineer/v1/sketch.extrude \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"height": 0.5,
"sketch": {
"constraints": [
{
"kind": "horizontal",
"line": 0
},
{
"kind": "vertical",
"line": 1
},
{
"kind": "horizontal",
"line": 2
},
{
"kind": "vertical",
"line": 3
},
{
"d": 2,
"kind": "distance",
"p": 0,
"q": 1
},
{
"d": 1,
"kind": "distance",
"p": 1,
"q": 2
}
],
"lines": [
{
"a": 0,
"b": 1
},
{
"a": 1,
"b": 2
},
{
"a": 2,
"b": 3
},
{
"a": 3,
"b": 0
}
],
"points": [
{
"fixed": true,
"x": 0,
"y": 0
},
{
"x": 1.7,
"y": -0.1
},
{
"x": 1.9,
"y": 1.2
},
{
"x": -0.1,
"y": 0.8
}
]
}
}
'import requests
url = "https://api.eddy.engineer/v1/sketch.extrude"
payload = {
"height": 0.5,
"sketch": {
"constraints": [
{
"kind": "horizontal",
"line": 0
},
{
"kind": "vertical",
"line": 1
},
{
"kind": "horizontal",
"line": 2
},
{
"kind": "vertical",
"line": 3
},
{
"d": 2,
"kind": "distance",
"p": 0,
"q": 1
},
{
"d": 1,
"kind": "distance",
"p": 1,
"q": 2
}
],
"lines": [
{
"a": 0,
"b": 1
},
{
"a": 1,
"b": 2
},
{
"a": 2,
"b": 3
},
{
"a": 3,
"b": 0
}
],
"points": [
{
"fixed": True,
"x": 0,
"y": 0
},
{
"x": 1.7,
"y": -0.1
},
{
"x": 1.9,
"y": 1.2
},
{
"x": -0.1,
"y": 0.8
}
]
}
}
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({
height: 0.5,
sketch: {
constraints: [
{kind: 'horizontal', line: 0},
{kind: 'vertical', line: 1},
{kind: 'horizontal', line: 2},
{kind: 'vertical', line: 3},
{d: 2, kind: 'distance', p: 0, q: 1},
{d: 1, kind: 'distance', p: 1, q: 2}
],
lines: [{a: 0, b: 1}, {a: 1, b: 2}, {a: 2, b: 3}, {a: 3, b: 0}],
points: [
{fixed: true, x: 0, y: 0},
{x: 1.7, y: -0.1},
{x: 1.9, y: 1.2},
{x: -0.1, y: 0.8}
]
}
})
};
fetch('https://api.eddy.engineer/v1/sketch.extrude', 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/sketch.extrude",
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([
'height' => 0.5,
'sketch' => [
'constraints' => [
[
'kind' => 'horizontal',
'line' => 0
],
[
'kind' => 'vertical',
'line' => 1
],
[
'kind' => 'horizontal',
'line' => 2
],
[
'kind' => 'vertical',
'line' => 3
],
[
'd' => 2,
'kind' => 'distance',
'p' => 0,
'q' => 1
],
[
'd' => 1,
'kind' => 'distance',
'p' => 1,
'q' => 2
]
],
'lines' => [
[
'a' => 0,
'b' => 1
],
[
'a' => 1,
'b' => 2
],
[
'a' => 2,
'b' => 3
],
[
'a' => 3,
'b' => 0
]
],
'points' => [
[
'fixed' => true,
'x' => 0,
'y' => 0
],
[
'x' => 1.7,
'y' => -0.1
],
[
'x' => 1.9,
'y' => 1.2
],
[
'x' => -0.1,
'y' => 0.8
]
]
]
]),
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/sketch.extrude"
payload := strings.NewReader("{\n \"height\": 0.5,\n \"sketch\": {\n \"constraints\": [\n {\n \"kind\": \"horizontal\",\n \"line\": 0\n },\n {\n \"kind\": \"vertical\",\n \"line\": 1\n },\n {\n \"kind\": \"horizontal\",\n \"line\": 2\n },\n {\n \"kind\": \"vertical\",\n \"line\": 3\n },\n {\n \"d\": 2,\n \"kind\": \"distance\",\n \"p\": 0,\n \"q\": 1\n },\n {\n \"d\": 1,\n \"kind\": \"distance\",\n \"p\": 1,\n \"q\": 2\n }\n ],\n \"lines\": [\n {\n \"a\": 0,\n \"b\": 1\n },\n {\n \"a\": 1,\n \"b\": 2\n },\n {\n \"a\": 2,\n \"b\": 3\n },\n {\n \"a\": 3,\n \"b\": 0\n }\n ],\n \"points\": [\n {\n \"fixed\": true,\n \"x\": 0,\n \"y\": 0\n },\n {\n \"x\": 1.7,\n \"y\": -0.1\n },\n {\n \"x\": 1.9,\n \"y\": 1.2\n },\n {\n \"x\": -0.1,\n \"y\": 0.8\n }\n ]\n }\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/sketch.extrude")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"height\": 0.5,\n \"sketch\": {\n \"constraints\": [\n {\n \"kind\": \"horizontal\",\n \"line\": 0\n },\n {\n \"kind\": \"vertical\",\n \"line\": 1\n },\n {\n \"kind\": \"horizontal\",\n \"line\": 2\n },\n {\n \"kind\": \"vertical\",\n \"line\": 3\n },\n {\n \"d\": 2,\n \"kind\": \"distance\",\n \"p\": 0,\n \"q\": 1\n },\n {\n \"d\": 1,\n \"kind\": \"distance\",\n \"p\": 1,\n \"q\": 2\n }\n ],\n \"lines\": [\n {\n \"a\": 0,\n \"b\": 1\n },\n {\n \"a\": 1,\n \"b\": 2\n },\n {\n \"a\": 2,\n \"b\": 3\n },\n {\n \"a\": 3,\n \"b\": 0\n }\n ],\n \"points\": [\n {\n \"fixed\": true,\n \"x\": 0,\n \"y\": 0\n },\n {\n \"x\": 1.7,\n \"y\": -0.1\n },\n {\n \"x\": 1.9,\n \"y\": 1.2\n },\n {\n \"x\": -0.1,\n \"y\": 0.8\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/sketch.extrude")
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 \"height\": 0.5,\n \"sketch\": {\n \"constraints\": [\n {\n \"kind\": \"horizontal\",\n \"line\": 0\n },\n {\n \"kind\": \"vertical\",\n \"line\": 1\n },\n {\n \"kind\": \"horizontal\",\n \"line\": 2\n },\n {\n \"kind\": \"vertical\",\n \"line\": 3\n },\n {\n \"d\": 2,\n \"kind\": \"distance\",\n \"p\": 0,\n \"q\": 1\n },\n {\n \"d\": 1,\n \"kind\": \"distance\",\n \"p\": 1,\n \"q\": 2\n }\n ],\n \"lines\": [\n {\n \"a\": 0,\n \"b\": 1\n },\n {\n \"a\": 1,\n \"b\": 2\n },\n {\n \"a\": 2,\n \"b\": 3\n },\n {\n \"a\": 3,\n \"b\": 0\n }\n ],\n \"points\": [\n {\n \"fixed\": true,\n \"x\": 0,\n \"y\": 0\n },\n {\n \"x\": 1.7,\n \"y\": -0.1\n },\n {\n \"x\": 1.9,\n \"y\": 1.2\n },\n {\n \"x\": -0.1,\n \"y\": 0.8\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Parts (CAD)
Extrude a solved sketch profile into a solid (C track C5)
The sketch->feature bridge: solves the sketch’s constraints, extracts its closed profile (a line loop -> prism, a lone circle -> cylinder, an outer boundary with inner loops -> a plate with through-holes), and extrudes it by height into a B-rep, returning a face-tagged viz (with mass properties). Non-convex profiles and holes are supported (C5.1); disjoint profiles with no single outer boundary, or inconsistent constraints, return a typed reason.
POST
/
v1
/
sketch.extrude
Extrude a solved sketch profile into a solid (C track C5)
curl --request POST \
--url https://api.eddy.engineer/v1/sketch.extrude \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"height": 0.5,
"sketch": {
"constraints": [
{
"kind": "horizontal",
"line": 0
},
{
"kind": "vertical",
"line": 1
},
{
"kind": "horizontal",
"line": 2
},
{
"kind": "vertical",
"line": 3
},
{
"d": 2,
"kind": "distance",
"p": 0,
"q": 1
},
{
"d": 1,
"kind": "distance",
"p": 1,
"q": 2
}
],
"lines": [
{
"a": 0,
"b": 1
},
{
"a": 1,
"b": 2
},
{
"a": 2,
"b": 3
},
{
"a": 3,
"b": 0
}
],
"points": [
{
"fixed": true,
"x": 0,
"y": 0
},
{
"x": 1.7,
"y": -0.1
},
{
"x": 1.9,
"y": 1.2
},
{
"x": -0.1,
"y": 0.8
}
]
}
}
'import requests
url = "https://api.eddy.engineer/v1/sketch.extrude"
payload = {
"height": 0.5,
"sketch": {
"constraints": [
{
"kind": "horizontal",
"line": 0
},
{
"kind": "vertical",
"line": 1
},
{
"kind": "horizontal",
"line": 2
},
{
"kind": "vertical",
"line": 3
},
{
"d": 2,
"kind": "distance",
"p": 0,
"q": 1
},
{
"d": 1,
"kind": "distance",
"p": 1,
"q": 2
}
],
"lines": [
{
"a": 0,
"b": 1
},
{
"a": 1,
"b": 2
},
{
"a": 2,
"b": 3
},
{
"a": 3,
"b": 0
}
],
"points": [
{
"fixed": True,
"x": 0,
"y": 0
},
{
"x": 1.7,
"y": -0.1
},
{
"x": 1.9,
"y": 1.2
},
{
"x": -0.1,
"y": 0.8
}
]
}
}
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({
height: 0.5,
sketch: {
constraints: [
{kind: 'horizontal', line: 0},
{kind: 'vertical', line: 1},
{kind: 'horizontal', line: 2},
{kind: 'vertical', line: 3},
{d: 2, kind: 'distance', p: 0, q: 1},
{d: 1, kind: 'distance', p: 1, q: 2}
],
lines: [{a: 0, b: 1}, {a: 1, b: 2}, {a: 2, b: 3}, {a: 3, b: 0}],
points: [
{fixed: true, x: 0, y: 0},
{x: 1.7, y: -0.1},
{x: 1.9, y: 1.2},
{x: -0.1, y: 0.8}
]
}
})
};
fetch('https://api.eddy.engineer/v1/sketch.extrude', 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/sketch.extrude",
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([
'height' => 0.5,
'sketch' => [
'constraints' => [
[
'kind' => 'horizontal',
'line' => 0
],
[
'kind' => 'vertical',
'line' => 1
],
[
'kind' => 'horizontal',
'line' => 2
],
[
'kind' => 'vertical',
'line' => 3
],
[
'd' => 2,
'kind' => 'distance',
'p' => 0,
'q' => 1
],
[
'd' => 1,
'kind' => 'distance',
'p' => 1,
'q' => 2
]
],
'lines' => [
[
'a' => 0,
'b' => 1
],
[
'a' => 1,
'b' => 2
],
[
'a' => 2,
'b' => 3
],
[
'a' => 3,
'b' => 0
]
],
'points' => [
[
'fixed' => true,
'x' => 0,
'y' => 0
],
[
'x' => 1.7,
'y' => -0.1
],
[
'x' => 1.9,
'y' => 1.2
],
[
'x' => -0.1,
'y' => 0.8
]
]
]
]),
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/sketch.extrude"
payload := strings.NewReader("{\n \"height\": 0.5,\n \"sketch\": {\n \"constraints\": [\n {\n \"kind\": \"horizontal\",\n \"line\": 0\n },\n {\n \"kind\": \"vertical\",\n \"line\": 1\n },\n {\n \"kind\": \"horizontal\",\n \"line\": 2\n },\n {\n \"kind\": \"vertical\",\n \"line\": 3\n },\n {\n \"d\": 2,\n \"kind\": \"distance\",\n \"p\": 0,\n \"q\": 1\n },\n {\n \"d\": 1,\n \"kind\": \"distance\",\n \"p\": 1,\n \"q\": 2\n }\n ],\n \"lines\": [\n {\n \"a\": 0,\n \"b\": 1\n },\n {\n \"a\": 1,\n \"b\": 2\n },\n {\n \"a\": 2,\n \"b\": 3\n },\n {\n \"a\": 3,\n \"b\": 0\n }\n ],\n \"points\": [\n {\n \"fixed\": true,\n \"x\": 0,\n \"y\": 0\n },\n {\n \"x\": 1.7,\n \"y\": -0.1\n },\n {\n \"x\": 1.9,\n \"y\": 1.2\n },\n {\n \"x\": -0.1,\n \"y\": 0.8\n }\n ]\n }\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/sketch.extrude")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"height\": 0.5,\n \"sketch\": {\n \"constraints\": [\n {\n \"kind\": \"horizontal\",\n \"line\": 0\n },\n {\n \"kind\": \"vertical\",\n \"line\": 1\n },\n {\n \"kind\": \"horizontal\",\n \"line\": 2\n },\n {\n \"kind\": \"vertical\",\n \"line\": 3\n },\n {\n \"d\": 2,\n \"kind\": \"distance\",\n \"p\": 0,\n \"q\": 1\n },\n {\n \"d\": 1,\n \"kind\": \"distance\",\n \"p\": 1,\n \"q\": 2\n }\n ],\n \"lines\": [\n {\n \"a\": 0,\n \"b\": 1\n },\n {\n \"a\": 1,\n \"b\": 2\n },\n {\n \"a\": 2,\n \"b\": 3\n },\n {\n \"a\": 3,\n \"b\": 0\n }\n ],\n \"points\": [\n {\n \"fixed\": true,\n \"x\": 0,\n \"y\": 0\n },\n {\n \"x\": 1.7,\n \"y\": -0.1\n },\n {\n \"x\": 1.9,\n \"y\": 1.2\n },\n {\n \"x\": -0.1,\n \"y\": 0.8\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/sketch.extrude")
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 \"height\": 0.5,\n \"sketch\": {\n \"constraints\": [\n {\n \"kind\": \"horizontal\",\n \"line\": 0\n },\n {\n \"kind\": \"vertical\",\n \"line\": 1\n },\n {\n \"kind\": \"horizontal\",\n \"line\": 2\n },\n {\n \"kind\": \"vertical\",\n \"line\": 3\n },\n {\n \"d\": 2,\n \"kind\": \"distance\",\n \"p\": 0,\n \"q\": 1\n },\n {\n \"d\": 1,\n \"kind\": \"distance\",\n \"p\": 1,\n \"q\": 2\n }\n ],\n \"lines\": [\n {\n \"a\": 0,\n \"b\": 1\n },\n {\n \"a\": 1,\n \"b\": 2\n },\n {\n \"a\": 2,\n \"b\": 3\n },\n {\n \"a\": 3,\n \"b\": 0\n }\n ],\n \"points\": [\n {\n \"fixed\": true,\n \"x\": 0,\n \"y\": 0\n },\n {\n \"x\": 1.7,\n \"y\": -0.1\n },\n {\n \"x\": 1.9,\n \"y\": 1.2\n },\n {\n \"x\": -0.1,\n \"y\": 0.8\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Body
application/json
Response
Face-tagged viz of the extruded solid (viz_blob_id, faces, volume, ...)