Optics files → their objects: the lens file (.zmx) and, by `format`, every file the solver reads (OP16)
curl --request POST \
--url https://api.eddy.engineer/v1/optics.import \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.eddy.engineer/v1/optics.import"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.eddy.engineer/v1/optics.import', 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/optics.import",
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([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/optics.import"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
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/optics.import")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/optics.import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_bodyOptics
Optics files → their objects: the lens file (.zmx) and, by `format`, every file the solver reads (OP16)
Body: `zmx` (the file's text; UTF-16 files decoded by the client), `catalogs` (default: the file's GCAT line), `resolve_glasses` (default true: the named glasses are read from the local AGF catalogs and embedded). Returns {system, catalogs, mode, resolved_glasses, skipped_keywords, warnings}. Slice-1 grammar: the system lines, the surface types, CURV solves, DISZ, GLAS, DIAM, CONI, PARM / XDAT, STOP, COAT, the aperture lines, PZUP, GDAT / GARR. OP16: with `format` (default `zmx`) the body is the file's `text` or its bytes as `data_hex`, its `name` and, for a ray file, `max_rays`; the engine answers {format, name, file_key (the bytes' content address), bytes, counts, object} through the solver's own reader — `agf` (glass catalog: the glasses), `coating` (COATING.DAT: materials, coatings, encrypted names, tapers), `abg` (ABg scatter data), `bsdf` (tabular BSDF), `ies` / `ldt` (photometric files as their candela table), `ray` (a source ray file: text, the binary DAT / SDF form or TM-25, sniffed), `zbf` (a beam file: the header and the samples), `ima` / `bim` (image sources), `spcd` (a spectrum), `pob` / `stl` (meshes), `uda` (a user-defined aperture), `zrd` (a ray database: uncompressed version 2003 as hex; other forms refuse naming themselves), `seq` (a CODE V sequence file: the object also carries `system`, `complete`, `dropped` naming what the engine cannot hold, `skipped`, `warnings`, `vendor_stamp`), `speos_ray` (a Speos binary ray file as hex). `zar` and `lpf` are 422 NOT_YET naming OP16.b; `zec` (an encrypted coating) is sealed vendor IP; an unknown format is a 400 listing the formats.
POST
/
v1
/
optics.import
Optics files → their objects: the lens file (.zmx) and, by `format`, every file the solver reads (OP16)
curl --request POST \
--url https://api.eddy.engineer/v1/optics.import \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.eddy.engineer/v1/optics.import"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.eddy.engineer/v1/optics.import', 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/optics.import",
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([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/optics.import"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
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/optics.import")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/optics.import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_bodyBody
application/json
The body is of type object.
Response
the system