How to use the pyntcloud.scalar_fields.sf_normals.ScalarField_Normals function in pyntcloud

To help you get started, we’ve selected a few pyntcloud examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github daavoo / pyntcloud / pyntcloud / scalar_fields / sf_normals.py View on Github external
import numpy as np
from .base import ScalarField


class ScalarField_Normals(ScalarField):
    def extract_info(self):
        self.normals = self.pyntcloud.points[["nx", "ny", "nz"]].values


class InclinationDegrees(ScalarField_Normals):
    """ Vertical inclination with respect to Z axis in degrees.
    """
    def compute(self):
        inclination = np.arccos(self.normals[:, -1])
        self.to_be_added["inclination_deg"] = np.rad2deg(inclination)


class InclinationRadians(ScalarField_Normals):
    """ Vertical inclination with respect to Z axis in radians.
    """
    def compute(self):
        inclination = np.arccos(self.normals[:, -1])
        self.to_be_added["inclination_rad"] = inclination


class OrientationDegrees(ScalarField_Normals):
github daavoo / pyntcloud / pyntcloud / scalar_fields / sf_normals.py View on Github external
def compute(self):
        inclination = np.arccos(self.normals[:, -1])
        self.to_be_added["inclination_rad"] = inclination


class OrientationDegrees(ScalarField_Normals):
    """ Horizontal orientation with respect to the XY plane in degrees.
    """
    def compute(self):
        angle = np.arctan2(self.normals[:, 0], self.normals[:, 1])
        # convert (-180 , 180) to (0 , 360)
        angle = np.where(angle < 0, angle + (2 * np.pi), angle)
        self.to_be_added["orientation_deg"] = np.rad2deg(angle)


class OrientationRadians(ScalarField_Normals):
    """ Horizontal orientation with respect to the XY plane in radians.
    """
    def compute(self):
        angle = np.arctan2(self.normals[:, 0], self.normals[:, 1])
        # convert (-180 , 180) to (0 , 360)
        angle = np.where(angle < 0, angle + (2 * np.pi), angle)
        self.to_be_added["orientation_rad"] = angle
github daavoo / pyntcloud / pyntcloud / scalar_fields / sf_normals.py View on Github external
""" Vertical inclination with respect to Z axis in degrees.
    """
    def compute(self):
        inclination = np.arccos(self.normals[:, -1])
        self.to_be_added["inclination_deg"] = np.rad2deg(inclination)


class InclinationRadians(ScalarField_Normals):
    """ Vertical inclination with respect to Z axis in radians.
    """
    def compute(self):
        inclination = np.arccos(self.normals[:, -1])
        self.to_be_added["inclination_rad"] = inclination


class OrientationDegrees(ScalarField_Normals):
    """ Horizontal orientation with respect to the XY plane in degrees.
    """
    def compute(self):
        angle = np.arctan2(self.normals[:, 0], self.normals[:, 1])
        # convert (-180 , 180) to (0 , 360)
        angle = np.where(angle < 0, angle + (2 * np.pi), angle)
        self.to_be_added["orientation_deg"] = np.rad2deg(angle)


class OrientationRadians(ScalarField_Normals):
    """ Horizontal orientation with respect to the XY plane in radians.
    """
    def compute(self):
        angle = np.arctan2(self.normals[:, 0], self.normals[:, 1])
        # convert (-180 , 180) to (0 , 360)
        angle = np.where(angle < 0, angle + (2 * np.pi), angle)
github daavoo / pyntcloud / pyntcloud / scalar_fields / sf_normals.py View on Github external
class ScalarField_Normals(ScalarField):
    def extract_info(self):
        self.normals = self.pyntcloud.points[["nx", "ny", "nz"]].values


class InclinationDegrees(ScalarField_Normals):
    """ Vertical inclination with respect to Z axis in degrees.
    """
    def compute(self):
        inclination = np.arccos(self.normals[:, -1])
        self.to_be_added["inclination_deg"] = np.rad2deg(inclination)


class InclinationRadians(ScalarField_Normals):
    """ Vertical inclination with respect to Z axis in radians.
    """
    def compute(self):
        inclination = np.arccos(self.normals[:, -1])
        self.to_be_added["inclination_rad"] = inclination


class OrientationDegrees(ScalarField_Normals):
    """ Horizontal orientation with respect to the XY plane in degrees.
    """
    def compute(self):
        angle = np.arctan2(self.normals[:, 0], self.normals[:, 1])
        # convert (-180 , 180) to (0 , 360)
        angle = np.where(angle < 0, angle + (2 * np.pi), angle)
        self.to_be_added["orientation_deg"] = np.rad2deg(angle)