curl --request POST \
--url https://api.eddy.engineer/v1/train.field_dataset \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"cases": [
{
"case_blob_id": "<string>",
"explore": {},
"id": "<string>",
"meta": {},
"result_key": "<string>"
}
],
"extend": "<string>",
"name": "<string>",
"voxel_size": 123
}
'import requests
url = "https://api.eddy.engineer/v1/train.field_dataset"
payload = {
"cases": [
{
"case_blob_id": "<string>",
"explore": {},
"id": "<string>",
"meta": {},
"result_key": "<string>"
}
],
"extend": "<string>",
"name": "<string>",
"voxel_size": 123
}
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({
cases: [
{
case_blob_id: '<string>',
explore: {},
id: '<string>',
meta: {},
result_key: '<string>'
}
],
extend: '<string>',
name: '<string>',
voxel_size: 123
})
};
fetch('https://api.eddy.engineer/v1/train.field_dataset', 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/train.field_dataset",
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([
'cases' => [
[
'case_blob_id' => '<string>',
'explore' => [
],
'id' => '<string>',
'meta' => [
],
'result_key' => '<string>'
]
],
'extend' => '<string>',
'name' => '<string>',
'voxel_size' => 123
]),
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/train.field_dataset"
payload := strings.NewReader("{\n \"cases\": [\n {\n \"case_blob_id\": \"<string>\",\n \"explore\": {},\n \"id\": \"<string>\",\n \"meta\": {},\n \"result_key\": \"<string>\"\n }\n ],\n \"extend\": \"<string>\",\n \"name\": \"<string>\",\n \"voxel_size\": 123\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/train.field_dataset")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cases\": [\n {\n \"case_blob_id\": \"<string>\",\n \"explore\": {},\n \"id\": \"<string>\",\n \"meta\": {},\n \"result_key\": \"<string>\"\n }\n ],\n \"extend\": \"<string>\",\n \"name\": \"<string>\",\n \"voxel_size\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/train.field_dataset")
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 \"cases\": [\n {\n \"case_blob_id\": \"<string>\",\n \"explore\": {},\n \"id\": \"<string>\",\n \"meta\": {},\n \"result_key\": \"<string>\"\n }\n ],\n \"extend\": \"<string>\",\n \"name\": \"<string>\",\n \"voxel_size\": 123\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Build or extend a field dataset: part voxel nodes with the truth at those nodes (G6, field slice)
A field dataset is what a field surrogate trains on: each case is one part’s voxel nodes (the inputs /v1/preview.explore with physics: predict reads) and a stored linear static structural result read at the same nodes. A case is either {explore, result_key} — an Explore structural setup (the /v1/preview.explore body: fixed supports and one force, one material) and the result of solving that setup, featurized here at voxel_size (default: the extended dataset’s, else the served model’s 2 mm), at most 200 a request — or {case_blob_id}, a field case already stored (FDC1: the magic, a u32 header length, the header JSON , then rel f32[n3], cov f32[n], sdf f32[n], fixed u8[n], load u8[n], u f32[n3] (NaN outside the truth mesh), vm f32[n]; upload it with POST /v1/blobs; ml/dx9/upload_dataset.py does this from featurized npz). Each case has an id (default its blob id) and a split (train | val | test | ood; default a hash of the id: 15 % test, 5 % val). Every case shares one voxel size and one Poisson ratio. extend adds to a dataset (a new id; the old one is unchanged). The dataset’s id is its manifest’s content address; it is listed at /v1/field_datasets. Refuses typed: FIELD_DATASET_INVALID (a malformed case, a second voxel size or Poisson ratio, a repeated id, no truth inside the part, too many cases), FIELD_DATASET_UNKNOWN (extend names nothing), PREDICT_CONDITIONS (an Explore setup with more than supports and one force).
curl --request POST \
--url https://api.eddy.engineer/v1/train.field_dataset \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"cases": [
{
"case_blob_id": "<string>",
"explore": {},
"id": "<string>",
"meta": {},
"result_key": "<string>"
}
],
"extend": "<string>",
"name": "<string>",
"voxel_size": 123
}
'import requests
url = "https://api.eddy.engineer/v1/train.field_dataset"
payload = {
"cases": [
{
"case_blob_id": "<string>",
"explore": {},
"id": "<string>",
"meta": {},
"result_key": "<string>"
}
],
"extend": "<string>",
"name": "<string>",
"voxel_size": 123
}
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({
cases: [
{
case_blob_id: '<string>',
explore: {},
id: '<string>',
meta: {},
result_key: '<string>'
}
],
extend: '<string>',
name: '<string>',
voxel_size: 123
})
};
fetch('https://api.eddy.engineer/v1/train.field_dataset', 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/train.field_dataset",
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([
'cases' => [
[
'case_blob_id' => '<string>',
'explore' => [
],
'id' => '<string>',
'meta' => [
],
'result_key' => '<string>'
]
],
'extend' => '<string>',
'name' => '<string>',
'voxel_size' => 123
]),
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/train.field_dataset"
payload := strings.NewReader("{\n \"cases\": [\n {\n \"case_blob_id\": \"<string>\",\n \"explore\": {},\n \"id\": \"<string>\",\n \"meta\": {},\n \"result_key\": \"<string>\"\n }\n ],\n \"extend\": \"<string>\",\n \"name\": \"<string>\",\n \"voxel_size\": 123\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/train.field_dataset")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cases\": [\n {\n \"case_blob_id\": \"<string>\",\n \"explore\": {},\n \"id\": \"<string>\",\n \"meta\": {},\n \"result_key\": \"<string>\"\n }\n ],\n \"extend\": \"<string>\",\n \"name\": \"<string>\",\n \"voxel_size\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/train.field_dataset")
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 \"cases\": [\n {\n \"case_blob_id\": \"<string>\",\n \"explore\": {},\n \"id\": \"<string>\",\n \"meta\": {},\n \"result_key\": \"<string>\"\n }\n ],\n \"extend\": \"<string>\",\n \"name\": \"<string>\",\n \"voxel_size\": 123\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Body
Response
{dataset_id, manifest: {format: field-dataset-v1, name, task, voxel, nu, cases (or a pointer when long), counts: {train, val, test, ood}, nodes_total, parent?}, blob_uri, added}
The response is of type object.