Skip to content

Commit 86bdec4

Browse files
committed
Slice plane: bindings to get center and normal
1 parent 0bb1295 commit 86bdec4

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/cpp/core.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ PYBIND11_MODULE(polyscope_bindings, m) {
329329
py::class_<ps::SlicePlane>(m, "SlicePlane")
330330
.def(py::init<std::string>())
331331
.def_readonly("name", &ps::SlicePlane::name)
332+
.def("get_center", &ps::SlicePlane::getCenter, "get plane center")
333+
.def("get_normal", &ps::SlicePlane::getNormal, "get plane normal")
332334
.def("set_pose", &ps::SlicePlane::setPose, "set pose")
333335
.def("set_active", &ps::SlicePlane::setActive, "set active")
334336
.def("get_active", &ps::SlicePlane::getActive, "get active")

src/polyscope/core.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,15 @@ def __init__(self, instance):
544544
def get_name(self):
545545
return self.bound_slice_plane.name
546546

547+
def get_center(self):
548+
return self.bound_slice_plane.get_center()
549+
550+
def get_normal(self):
551+
return self.bound_slice_plane.get_normal()
552+
553+
def get_pose(self):
554+
return (self.bound_slice_plane.get_center(), self.bound_slice_plane.get_normal())
555+
547556
def set_pose(self, plane_position, plane_normal):
548557
self.bound_slice_plane.set_pose(glm3(plane_position), glm3(plane_normal))
549558

0 commit comments

Comments
 (0)