cars_mesh.tools.handlers ======================== .. py:module:: cars_mesh.tools.handlers .. autoapi-nested-parse:: Define classes for handling common objects Attributes ---------- .. autoapisummary:: cars_mesh.tools.handlers.COLORS cars_mesh.tools.handlers.NORMALS cars_mesh.tools.handlers.UVS Classes ------- .. autoapisummary:: cars_mesh.tools.handlers.PointCloud cars_mesh.tools.handlers.Mesh Functions --------- .. autoapisummary:: cars_mesh.tools.handlers.read_input_path Module Contents --------------- .. py:data:: COLORS :value: ['red', 'green', 'blue', 'nir'] .. py:data:: NORMALS :value: ['n_x', 'n_y', 'n_z'] .. py:data:: UVS :value: ['uv1_row', 'uv1_col', 'uv2_row', 'uv2_col', 'uv3_row', 'uv3_col'] .. py:class:: PointCloud(df: Union[None, pandas.DataFrame] = None, o3d_pcd: Union[None, open3d.geometry.PointCloud] = None) Point cloud data .. py:attribute:: df :value: None .. py:attribute:: o3d_pcd :value: None .. py:method:: set_df_from_o3d_pcd() Set pandas.DataFrame from open3D PointCloud .. py:method:: set_df_from_vertices(vertices: numpy.ndarray) -> None Set point coordinates in the pandas DataFrame .. py:method:: set_df_colors(colors: numpy.ndarray, color_names: list) -> None Set color attributes per point in the pandas DataFrame .. py:method:: set_df_normals(normals: numpy.ndarray) -> None Set normal attributes per point in the pandas DataFrame .. py:method:: set_o3d_pcd_from_df() Set open3d PointCloud from pandas.DataFrame .. py:method:: set_o3d_colors() -> None Set color attribute of open3D PointCloud .. py:method:: set_o3d_normals() -> None Set normal attribute of open3D PointCloud .. py:method:: get_vertices() -> pandas.DataFrame Get vertex data .. py:method:: get_colors() -> pandas.DataFrame Get color data .. py:method:: get_normals() -> pandas.DataFrame Get normals .. py:method:: set_unitary_normals() Make normals unitary (i.e. with a norm equal to 1.) .. py:property:: has_colors :type: bool Whether colors are specified .. py:property:: has_normals :type: bool Whether point normals are specified .. py:property:: are_normals_unitary :type: bool Whether normals are unitary (i.e. of norm equal to 1) .. py:property:: has_classes :type: bool Whether point cloud has classes specified by point .. py:method:: serialize(filepath: str, **kwargs) -> None Serialize point cloud .. py:method:: deserialize(filepath: str) -> None Deserialize point cloud .. py:class:: Mesh(pcd: Union[None, pandas.DataFrame] = None, mesh: Union[None, pandas.DataFrame] = None, o3d_pcd: Union[None, open3d.geometry.PointCloud] = None, o3d_mesh: Union[None, open3d.geometry.TriangleMesh] = None) Mesh data .. py:attribute:: pcd .. py:attribute:: df :value: None .. py:attribute:: o3d_mesh :value: None .. py:attribute:: image_texture_path :value: None .. py:method:: set_df_from_o3d_mesh() -> None Set pd.DataFrame from open3d TriangleMesh data .. py:method:: set_df_from_vertices(vertices) -> None Set pd.DataFrame from an array of vertices .. py:method:: set_image_texture_path(image_texture_path) -> None Set image texture path .. py:method:: set_df_uvs(uvs) -> None UVs :param uvs: Image texture (row, col) normalized coordinates per triangle vertex :type uvs: (N, 6) np.ndarray or list .. py:method:: set_o3d_mesh_from_df() -> None Set open3d TriangleMesh from a pd.DataFrame .. py:method:: set_o3d_vertex_colors() -> None Set color attribute of open3D TriangleMesh .. py:method:: set_o3d_vertex_normals() -> None Set normal attribute of open3D TriangleMesh .. py:method:: set_o3d_image_texture_and_uvs() -> None Set image texture path and uvs of open3D TriangleMesh .. py:method:: get_triangles() -> pandas.DataFrame Get point triangle indexes .. py:method:: get_triangle_uvs() -> pandas.DataFrame Get triangle uvs .. py:method:: get_image_texture_path() -> str Get image texture path .. py:property:: has_triangles :type: bool Whether mesh has triangles specified .. py:property:: has_texture :type: bool Whether mesh has a texture specified .. py:property:: has_triangle_uvs :type: bool Whether mesh has triangle uvs .. py:property:: has_normals :type: bool Whether mesh has face normals .. py:property:: has_classes :type: bool Whether mesh has a classification by face .. py:method:: serialize(filepath: str, **kwargs) -> None Serialize mesh .. py:method:: deserialize(filepath: str) -> None Deserialize mesh .. py:function:: read_input_path(input_path: str) -> Mesh Read input path as either a PointCloud or a Mesh object and returns in generic Mesh() object (containing pcd dict if point cloud) :param input_path: Input path to read (best with absolute path) :type input_path: str :returns: **mesh** -- Mesh object :rtype: Mesh