neuror.cut_plane.planes

This module defines classes PlaneEquation and CutPlane

Functions

_get_displaced_pos

Compute the shifted position wrt the quaternion and axis.

Classes

HalfSpace

A mathematical half-space: https://en.wikipedia.org/wiki/Half-space_(geometry).

PlaneEquation

This class defines the equation of a plane.

class neuror.cut_plane.planes.HalfSpace(a, b, c, d, upward)[source]

Bases: PlaneEquation

A mathematical half-space: https://en.wikipedia.org/wiki/Half-space_(geometry).

\[a X + b Y + c Z + d > 0 if upward == True a X + b Y + c Z + d < 0 else\]
project_on_directed_normal(points)[source]

Project on the normal oriented toward the inside of the half-space.

to_json()[source]

Returns a dict for json serialization.

class neuror.cut_plane.planes.PlaneEquation(a, b, c, d)[source]

Bases: object

This class defines the equation of a plane. It is a mathematical object which is domain agnostic.

\[a X + b Y + c Z + d = 0\]
count_near_plane(points, bin_width)[source]

Return the number of points in ]-bin_width, 0] and ]0, bin_width].

distance(points)[source]

Returns an array containing the distance between the plane and each point.

classmethod from_dict(data)[source]

Instantiate object from dict like: {"a": 1, "b": 2, "c": 0, "d": 10}.

classmethod from_rotations_translations(transformations)[source]

Factory method to build the plane equation from the rotation and translation provided by the viewer.

Parameters:

transformations – An array [rot_x, rot_y, rot_z, transl_x, transl_y, transl_z]

project_on_normal(points)[source]

Returns the points projected on the normal vector.

to_json()[source]

Returns a dict for json serialization.