Geometry
Ray-AABB intersection API
Ray vs axis-aligned bounding box via the slab method (2D or 3D), returning near/far t and the entry point, robust to axis-parallel rays. Answers 'does this ray hit the box, and where does it enter?'.
Price$0.02per request
MethodPOST
Route/v1/geometry/ray-aabb
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
intersectionrayaabbbounding-boxslab3draytracing
API URL
Integration docshttps://x402.hexl.dev/v1/geometry/ray-aabbExample request
{
"origin": [
-5,
0,
0
],
"direction": [
1,
0,
0
],
"min": [
-1,
-1,
-1
],
"max": [
1,
1,
1
]
}Example response
{
"hit": true,
"tNear": 4,
"tFar": 6,
"entryPoint": [
-1,
0,
0
],
"originInside": false
}Input schema
{
"type": "object",
"required": [
"origin",
"direction",
"min",
"max"
],
"properties": {
"origin": {
"type": "array",
"items": {
"type": "number"
},
"examples": [
[
-5,
0,
0
]
]
},
"direction": {
"type": "array",
"items": {
"type": "number"
},
"examples": [
[
1,
0,
0
]
]
},
"min": {
"type": "array",
"items": {
"type": "number"
},
"examples": [
[
-1,
-1,
-1
]
]
},
"max": {
"type": "array",
"items": {
"type": "number"
},
"examples": [
[
1,
1,
1
]
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}