![]() |
COLNEO Pro 1.0
|
Tools API interface.
This API object provides access to miscellaneous tools as well as object/domain specific tools.
It is accessed via the API object cnToolsAPI.
Functions | |
| ApiJsonResponse | checkOverlapOBB (QVariantMap &obb1, QVariantMap &obb2) |
| ApiJsonResponse | checkOverlapObjects (QString &objId1, QString &objId2, QVariantMap &options=QVariantMap()) |
|
slot |
Tests whether two oriented bounding boxes (OBBs) overlap.
This function checks if two oriented bounding boxes intersect in 3D space using the Separating Axis Theorem (SAT). Each bounding box is expected to be provided in JSON containing the box parameters:
center : Array (3D vector) defining the box center.axes : Array of three normalized 3D vectors defining the local axes.halfSizes: Array (3D vector) with the half-lengths of the box along each axis.Example input:
| obb1 | The first oriented bounding box (JSON). |
| obb2 | The second oriented bounding box (JSON). |
Example JSON response:
|
slot |
Checks if two objects overlap and gives the overlap amounts.
This function determines whether the minimal oriented bounding boxes in 3D space of two objects intersect and provides a simple measure of how much they overlap.
| objId1 | ID of the first object |
| objId2 | ID of the second object |
| options | Optional options {
"precheck": true, // If true (default), an axis-aligned bounding box check is performed before the OOBB check.
"tolerance": 0.1 // Allowed overlap [m]
}
\return Coverages: fraction of each OBB that is overlapped by the other.
- 0.0 means no overlap
- 1.0 means fully covered
Example JSON response:
\code
{
"overlap": true,
"min_overlap": 0.178277, // smallest overlap distance
"coverage_obb1": 0.057161, // fraction of OBB1 volume overlapped by OBB2
"coverage_obb2": 0.114563 // fraction of OBB2 volume overlapped by OBB1
}
|