Revolve a solved sketch profile into a solid of revolution (C track C5.1)
curl --request POST \
--url https://api.eddy.engineer/v1/sketch.revolve \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"segments": 96,
"sketch": {
"lines": [
{
"a": 0,
"b": 1
},
{
"a": 1,
"b": 2
},
{
"a": 2,
"b": 3
},
{
"a": 3,
"b": 0
}
],
"points": [
{
"x": 0,
"y": 0
},
{
"x": 0.5,
"y": 0
},
{
"x": 0.5,
"y": 2
},
{
"x": 0,
"y": 2
}
]
}
}
'import requests
url = "https://api.eddy.engineer/v1/sketch.revolve"
payload = {
"segments": 96,
"sketch": {
"lines": [
{
"a": 0,
"b": 1
},
{
"a": 1,
"b": 2
},
{
"a": 2,
"b": 3
},
{
"a": 3,
"b": 0
}
],
"points": [
{
"x": 0,
"y": 0
},
{
"x": 0.5,
"y": 0
},
{
"x": 0.5,
"y": 2
},
{
"x": 0,
"y": 2
}
]
}
}
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({
segments: 96,
sketch: {
lines: [{a: 0, b: 1}, {a: 1, b: 2}, {a: 2, b: 3}, {a: 3, b: 0}],
points: [{x: 0, y: 0}, {x: 0.5, y: 0}, {x: 0.5, y: 2}, {x: 0, y: 2}]
}
})
};
fetch('https://api.eddy.engineer/v1/sketch.revolve', 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.revolve",
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([
'segments' => 96,
'sketch' => [
'lines' => [
[
'a' => 0,
'b' => 1
],
[
'a' => 1,
'b' => 2
],
[
'a' => 2,
'b' => 3
],
[
'a' => 3,
'b' => 0
]
],
'points' => [
[
'x' => 0,
'y' => 0
],
[
'x' => 0.5,
'y' => 0
],
[
'x' => 0.5,
'y' => 2
],
[
'x' => 0,
'y' => 2
]
]
]
]),
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.revolve"
payload := strings.NewReader("{\n \"segments\": 96,\n \"sketch\": {\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 \"x\": 0,\n \"y\": 0\n },\n {\n \"x\": 0.5,\n \"y\": 0\n },\n {\n \"x\": 0.5,\n \"y\": 2\n },\n {\n \"x\": 0,\n \"y\": 2\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.revolve")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"segments\": 96,\n \"sketch\": {\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 \"x\": 0,\n \"y\": 0\n },\n {\n \"x\": 0.5,\n \"y\": 0\n },\n {\n \"x\": 0.5,\n \"y\": 2\n },\n {\n \"x\": 0,\n \"y\": 2\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/sketch.revolve")
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 \"segments\": 96,\n \"sketch\": {\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 \"x\": 0,\n \"y\": 0\n },\n {\n \"x\": 0.5,\n \"y\": 0\n },\n {\n \"x\": 0.5,\n \"y\": 2\n },\n {\n \"x\": 0,\n \"y\": 2\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Parts (CAD)
Revolve a solved sketch profile into a solid of revolution (C track C5.1)
Solves the sketch’s constraints, extracts its closed profile, and revolves it 360 degrees about the sketch Y axis (the line x=0) into a B-rep — a rectangle becomes a cylinder, a right triangle a cone, a circle centered on the axis an analytic sphere, an offset circle a torus, and inner loops become sealed internal cavities (C5.2). The profile must lie on one side of the axis (all x >= 0); a profile straddling the axis, a hole touching the axis, an open chain, or inconsistent constraints return a typed reason.
POST
/
v1
/
sketch.revolve
Revolve a solved sketch profile into a solid of revolution (C track C5.1)
curl --request POST \
--url https://api.eddy.engineer/v1/sketch.revolve \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"segments": 96,
"sketch": {
"lines": [
{
"a": 0,
"b": 1
},
{
"a": 1,
"b": 2
},
{
"a": 2,
"b": 3
},
{
"a": 3,
"b": 0
}
],
"points": [
{
"x": 0,
"y": 0
},
{
"x": 0.5,
"y": 0
},
{
"x": 0.5,
"y": 2
},
{
"x": 0,
"y": 2
}
]
}
}
'import requests
url = "https://api.eddy.engineer/v1/sketch.revolve"
payload = {
"segments": 96,
"sketch": {
"lines": [
{
"a": 0,
"b": 1
},
{
"a": 1,
"b": 2
},
{
"a": 2,
"b": 3
},
{
"a": 3,
"b": 0
}
],
"points": [
{
"x": 0,
"y": 0
},
{
"x": 0.5,
"y": 0
},
{
"x": 0.5,
"y": 2
},
{
"x": 0,
"y": 2
}
]
}
}
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({
segments: 96,
sketch: {
lines: [{a: 0, b: 1}, {a: 1, b: 2}, {a: 2, b: 3}, {a: 3, b: 0}],
points: [{x: 0, y: 0}, {x: 0.5, y: 0}, {x: 0.5, y: 2}, {x: 0, y: 2}]
}
})
};
fetch('https://api.eddy.engineer/v1/sketch.revolve', 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.revolve",
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([
'segments' => 96,
'sketch' => [
'lines' => [
[
'a' => 0,
'b' => 1
],
[
'a' => 1,
'b' => 2
],
[
'a' => 2,
'b' => 3
],
[
'a' => 3,
'b' => 0
]
],
'points' => [
[
'x' => 0,
'y' => 0
],
[
'x' => 0.5,
'y' => 0
],
[
'x' => 0.5,
'y' => 2
],
[
'x' => 0,
'y' => 2
]
]
]
]),
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.revolve"
payload := strings.NewReader("{\n \"segments\": 96,\n \"sketch\": {\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 \"x\": 0,\n \"y\": 0\n },\n {\n \"x\": 0.5,\n \"y\": 0\n },\n {\n \"x\": 0.5,\n \"y\": 2\n },\n {\n \"x\": 0,\n \"y\": 2\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.revolve")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"segments\": 96,\n \"sketch\": {\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 \"x\": 0,\n \"y\": 0\n },\n {\n \"x\": 0.5,\n \"y\": 0\n },\n {\n \"x\": 0.5,\n \"y\": 2\n },\n {\n \"x\": 0,\n \"y\": 2\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/sketch.revolve")
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 \"segments\": 96,\n \"sketch\": {\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 \"x\": 0,\n \"y\": 0\n },\n {\n \"x\": 0.5,\n \"y\": 0\n },\n {\n \"x\": 0.5,\n \"y\": 2\n },\n {\n \"x\": 0,\n \"y\": 2\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 revolved solid (viz_blob_id, faces, volume, ...)