| 14 | |
| 15 | namespace py = pybind11; |
| 16 | void cstrIntersection(py::module_&m) |
| 17 | { |
| 18 | py::class_<LNLib::Intersection>(m, "Intersection") |
| 19 | .def_static("ComputeRays", [](const LNLib::XYZ& point0, const LNLib::XYZ& vector0, const LNLib::XYZ& point1, const LNLib::XYZ& vector1) { |
| 20 | double param0, param1; |
| 21 | LNLib::XYZ intersectPoint; |
| 22 | LNLib::CurveCurveIntersectionType type = LNLib::Intersection::ComputeRays(point0, vector0, point1, vector1, param0, param1, intersectPoint); |
| 23 | return py::make_tuple(type, param0, param1, intersectPoint); |
| 24 | }) |
| 25 | .def_static("ComputeLineAndPlane", [](const LNLib::XYZ& normal, const LNLib::XYZ& pointOnPlane, const LNLib::XYZ& pointOnLine, const LNLib::XYZ& lineDirection) { |
| 26 | LNLib::XYZ intersectPoint; |
| 27 | LNLib::LinePlaneIntersectionType type = LNLib::Intersection::ComputeLineAndPlane(normal, pointOnPlane, pointOnLine, lineDirection, intersectPoint); |
| 28 | return py::make_tuple(type, intersectPoint); |
| 29 | }); |
| 30 | } |