Open3D (C++ API)  0.17.0
Data Structures | Functions
open3d::t::geometry::vtkutils Namespace Reference

Data Structures

struct  VtkToTensorType
 
struct  VtkToTensorType< long long >
 

Functions

int DtypeToVtkType (const core::Dtype &dtype)
 
vtkSmartPointer< vtkPolyData > CreateVtkPolyDataFromGeometry (const Geometry &geometry, const std::unordered_set< std::string > &point_attr_include, const std::unordered_set< std::string > &face_attr_include, const std::unordered_set< std::string > &point_attr_exclude, const std::unordered_set< std::string > &face_attr_exclude, bool copy)
 
TriangleMesh CreateTriangleMeshFromVtkPolyData (vtkPolyData *polydata, bool copy)
 
OPEN3D_LOCAL LineSet CreateLineSetFromVtkPolyData (vtkPolyData *polydata, bool copy)
 
OPEN3D_LOCAL TriangleMesh ExtrudeRotationTriangleMesh (const Geometry &geometry, const double angle, const core::Tensor &axis, int resolution, double translation, bool capping)
 
OPEN3D_LOCAL LineSet ExtrudeRotationLineSet (const PointCloud &pointcloud, const double angle, const core::Tensor &axis, int resolution, double translation, bool capping)
 
OPEN3D_LOCAL TriangleMesh ExtrudeLinearTriangleMesh (const Geometry &geometry, const core::Tensor &vector, double scale, bool capping)
 
OPEN3D_LOCAL LineSet ExtrudeLinearLineSet (const PointCloud &pointcloud, const core::Tensor &vector, double scale, bool capping)
 
OPEN3D_LOCAL TriangleMesh ComputeNormals (const TriangleMesh &mesh, bool vertex_normals, bool face_normals, bool consistency, bool auto_orient_normals, bool splitting, double feature_angle_deg)
 

Function Documentation

◆ ComputeNormals()

TriangleMesh open3d::t::geometry::vtkutils::ComputeNormals ( const TriangleMesh mesh,
bool  vertex_normals,
bool  face_normals,
bool  consistency,
bool  auto_orient_normals,
bool  splitting,
double  feature_angle_deg = 30 
)

Computes the normals for a mesh. In addition to computing the normals this function can fix the face vertex order and orient the normals to point outwards. This function can be applied to non-manifold or non-closed meshes but without any guarantees to correctness or quality for the result.

Parameters
meshA point cloud.
vertex_normalsIf true compute the vertex normals.
face_normalsIf true compute the face normals.
consistencyIf true the algorithm fixes the vertex order of faces.
auto_orient_normalsIf true normals will be flipped to point outwards
splittingIf true allows splitting of edges to account for sharp edges. Splitting an edge will create new vertices.
feature_angle_degThe angle in degrees that defines sharp edges for splitting.
Returns
A new mesh with the computed normals.

◆ CreateLineSetFromVtkPolyData()

LineSet open3d::t::geometry::vtkutils::CreateLineSetFromVtkPolyData ( vtkPolyData *  polydata,
bool  copy = false 
)

Creates a LineSet a vtkPolyData object. The returned LineSet may directly use the memory of the data arrays in the vtkPolyData object. The returned LineSet will hold references to the arrays and it is not necessary to keep other references to the vtkPolyData object or its arrays alive.

Parameters
polydataInput polyData object.
copyIf true always create a copy of the data.

◆ CreateTriangleMeshFromVtkPolyData()

TriangleMesh open3d::t::geometry::vtkutils::CreateTriangleMeshFromVtkPolyData ( vtkPolyData *  polydata,
bool  copy = false 
)

Creates a triangle mesh from a vtkPolyData object. The returned TriangleMesh may directly use the memory of the data arrays in the vtkPolyData object. The returned TriangleMesh will hold references to the arrays and it is not necessary to keep other references to the vtkPolyData object or its arrays alive.

Parameters
polydataInput polyData object.
copyIf true always create a copy of the data.

◆ CreateVtkPolyDataFromGeometry()

vtkSmartPointer< vtkPolyData > open3d::t::geometry::vtkutils::CreateVtkPolyDataFromGeometry ( const Geometry geometry,
const std::unordered_set< std::string > &  point_attr_include,
const std::unordered_set< std::string > &  face_attr_include,
const std::unordered_set< std::string > &  point_attr_exclude = {},
const std::unordered_set< std::string > &  face_attr_exclude = {},
bool  copy = false 
)

Creates a vtkPolyData object from a point cloud or triangle mesh. The returned vtkPolyData object may directly use the memory of the tensors stored inside the Geometry object. Therefore, the Geometry object must be kept alive until the returned vtkPolyData object is deleted.

Parameters
geometryOpen3D geometry object, e.g., a TriangleMesh.
copyIf true always create a copy of the data.
point_attr_includeA set of keys to select which point/vertex attributes should be added. Note that the primary key may be included and will silently be ignored.
face_attr_includeA set of keys to select which face attributes should be added. Note that the primary key may be included and will silently be ignored.
point_attr_excludeA set of keys for which point/vertex attributes will not be added to the vtkPolyData. The exclusion set has precedence over the included keys.
face_attr_excludeA set of keys for which face attributes will not be added to the vtkPolyData. The exclusion set has precedence over the included keys.

◆ DtypeToVtkType()

int open3d::t::geometry::vtkutils::DtypeToVtkType ( const core::Dtype dtype)

Returns the corresponding vtk data type for core::Dtype Logs an error if no conversion exists.

◆ ExtrudeLinearLineSet()

LineSet open3d::t::geometry::vtkutils::ExtrudeLinearLineSet ( const PointCloud pointcloud,
const core::Tensor vector,
double  scale,
bool  capping 
)

Sweeps the geometry along a direction vector.

Parameters
pointcloudA point cloud.
vectorThe direction vector.
scaleScalar factor which essentially scales the direction vector.
cappingIf true adds caps to the mesh.
Returns
A triangle mesh with the result of the sweep operation.

◆ ExtrudeLinearTriangleMesh()

TriangleMesh open3d::t::geometry::vtkutils::ExtrudeLinearTriangleMesh ( const Geometry geometry,
const core::Tensor vector,
double  scale,
bool  capping 
)

Sweeps the geometry along a direction vector.

Parameters
geometryOpen3D geometry object, e.g., a TriangleMesh.
vectorThe direction vector.
scaleScalar factor which essentially scales the direction vector.
cappingIf true adds caps to the mesh.
Returns
A triangle mesh with the result of the sweep operation.

◆ ExtrudeRotationLineSet()

LineSet open3d::t::geometry::vtkutils::ExtrudeRotationLineSet ( const PointCloud pointcloud,
double  angle,
const core::Tensor axis,
int  resolution = 16,
double  translation = 0.0,
bool  capping = true 
)

Sweeps the geometry rotationally about an axis.

Parameters
pointcloudA point cloud.
angleThe rotation angle in degree.
axisThe rotation axis.
resolutionThe resolution defines the number of intermediate sweeps about the rotation axis.
translationThe translation along the rotation axis.
cappingIf true adds caps to the mesh.
Returns
A line set with the result of the sweep operation.

◆ ExtrudeRotationTriangleMesh()

TriangleMesh open3d::t::geometry::vtkutils::ExtrudeRotationTriangleMesh ( const Geometry geometry,
double  angle,
const core::Tensor axis,
int  resolution = 16,
double  translation = 0.0,
bool  capping = true 
)

Sweeps the geometry rotationally about an axis.

Parameters
geometryOpen3D geometry object, e.g., a TriangleMesh.
angleThe rotation angle in degree.
axisThe rotation axis.
resolutionThe resolution defines the number of intermediate sweeps about the rotation axis.
translationThe translation along the rotation axis.
cappingIf true adds caps to the mesh.
Returns
A triangle mesh with the result of the sweep operation.