Skip to content

Commit

Permalink
feat: add bindings for 3d composite - cone (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishwa2710 authored Mar 14, 2024
1 parent c4b341c commit d8275e2
Show file tree
Hide file tree
Showing 3 changed files with 242 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <OpenSpaceToolkit/Mathematics/Geometry/3D/Intersection.hpp>
#include <OpenSpaceToolkit/Mathematics/Geometry/3D/Object/Composite.hpp>
#include <OpenSpaceToolkit/Mathematics/Geometry/3D/Object/Cone.hpp>

inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Object_Composite(pybind11::module& aModule)
{
Expand All @@ -26,6 +27,7 @@ inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Object_Composite(pybind11:
using ostk::mathematics::geometry::d3::object::Ellipsoid;
using ostk::mathematics::geometry::d3::object::Cuboid;
using ostk::mathematics::geometry::d3::object::Pyramid;
using ostk::mathematics::geometry::d3::object::Cone;
using ostk::mathematics::geometry::d3::object::Composite;
using ostk::mathematics::geometry::d3::Intersection;
using ostk::mathematics::geometry::d3::transformation::rotation::Quaternion;
Expand Down Expand Up @@ -123,6 +125,13 @@ inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Object_Composite(pybind11:
return aComposite.is<Pyramid>();
}
)
.def(
"is_cone",
+[](const Composite& aComposite) -> bool
{
return aComposite.is<Cone>();
}
)
.def(
"is_composite",
+[](const Composite& aComposite) -> bool
Expand Down Expand Up @@ -213,6 +222,13 @@ inline void OpenSpaceToolkitMathematicsPy_Geometry_3D_Object_Composite(pybind11:
return aComposite.as<Pyramid>();
}
)
.def(
"as_cone",
+[](const Composite& aComposite) -> Cone
{
return aComposite.as<Cone>();
}
)
.def(
"as_composite",
+[](const Composite& aComposite) -> Composite
Expand Down
Loading

0 comments on commit d8275e2

Please sign in to comment.