| 1494 | } |
| 1495 | |
| 1496 | void ODObject::getBoundary(std::vector<ODXYZ>& points, |
| 1497 | std::function<void(double s, double t, ODXYZ& P, double& T)> getP) const { |
| 1498 | points.clear(); |
| 1499 | ODXYZ P; |
| 1500 | double T = 0; |
| 1501 | getP(s, t, P, T); |
| 1502 | points.reserve(4); |
| 1503 | std::vector<ODXYZ> pts; |
| 1504 | if (width < 1e-6 && length < 1e-6) { |
| 1505 | pts.push_back(ODXYZ(0, 0)); |
| 1506 | if (height > 1e-6) { |
| 1507 | pts.push_back(ODXYZ(0, 0, height)); |
| 1508 | } |
| 1509 | } else if (width > 1e-6 && length < 1e-6) { |
| 1510 | pts.push_back(ODXYZ(0, -width * 0.5, 0)); |
| 1511 | pts.push_back(ODXYZ(0, width * 0.5, 0)); |
| 1512 | } else if (width < 1e-6 && length > 1e-6) { |
| 1513 | pts.push_back(ODXYZ(-length * 0.5, 0)); |
| 1514 | pts.push_back(ODXYZ(length * 0.5, 0)); |
| 1515 | } else { |
| 1516 | pts.push_back(ODXYZ(-length * 0.5, -width * 0.5)); |
| 1517 | pts.push_back(ODXYZ(length * 0.5, -width * 0.5)); |
| 1518 | pts.push_back(ODXYZ(length * 0.5, width * 0.5)); |
| 1519 | pts.push_back(ODXYZ(-length * 0.5, width * 0.5)); |
| 1520 | } |
| 1521 | |
| 1522 | for (const auto& p : pts) { |
| 1523 | ODXYZ np = ODRPY(T) * (ODRPY(hdg, roll, pitch) * p) + P + ODXYZ(0, 0, zoffset); |
| 1524 | points.push_back(np); |
| 1525 | } |
| 1526 | } |
| 1527 | |
| 1528 | void ODObject::getRepeateBoundarys(std::vector<std::vector<ODXYZ>>& points, |
| 1529 | std::function<void(double s, double t, ODXYZ& P, double& T)> getP) { |