521 double torus_radius = 1.0,
522 double tube_radius = 0.5,
523 int radial_resolution = 30,
524 int tubular_resolution = 20,
547 double cylinder_radius = 1.0,
548 double cone_radius = 1.5,
549 double cylinder_height = 5.0,
550 double cone_height = 4.0,
552 int cylinder_split = 4,
568 const Eigen::Vector3d &origin = Eigen::Vector3d(0.0, 0.0, 0.0),
589 int length_split = 70,
590 int width_split = 15,
610 const std::string &text,
659 bool relative =
true);
698 const std::vector<double> contour_values = {0.0})
const;
748 bool preserve_volume =
true)
const;
762 double tolerance = 1e-6)
const;
775 double tolerance = 1e-6)
const;
788 double tolerance = 1e-6)
const;
823 float max_stretch = 1.f / 6);
852 const std::unordered_set<std::string> &vertex_attr = {},
855 bool update_material =
true);
883 const std::unordered_set<std::string> &triangle_attr = {},
886 bool update_material =
true);
899 double translation = 0.0,
900 bool capping =
true)
const;
909 bool capping =
true)
const;
const TensorMap & GetVertexAttr() const
Getter for vertex_attr_ TensorMap. Used in Pybind.
Definition: TriangleMesh.h:146
void SetTriangleIndices(const core::Tensor &value)
Set the value of the "indices" attribute in triangle_attr_.
Definition: TriangleMesh.h:304
bool HasVertexColors() const
Definition: TriangleMesh.h:343
constexpr nullopt_t nullopt
Definition: Optional.h:171
std::unordered_map< std::string, core::Tensor > BakeVertexAttrTextures(int size, const std::unordered_set< std::string > &vertex_attr={}, double margin=2., double fill=0., bool update_material=true)
Definition: TriangleMesh.cpp:630
TriangleMesh ComputeConvexHull(bool joggle_inputs=false) const
Definition: TriangleMesh.cpp:298
TriangleMesh & Clear() override
Clear all data in the trianglemesh.
Definition: TriangleMesh.h:618
TriangleMesh SimplifyQuadricDecimation(double target_reduction, bool preserve_volume=true) const
Definition: TriangleMesh.cpp:372
const Dtype Int64
Definition: Dtype.cpp:66
TriangleMesh & Scale(double scale, const core::Tensor ¢er)
Scales the VertexPositions of the TriangleMesh.
Definition: TriangleMesh.cpp:166
static TriangleMesh CreateTorus(double torus_radius=1.0, double tube_radius=0.5, int radial_resolution=30, int tubular_resolution=20, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMeshFactory.cpp:190
TensorMap vertex_attr_
Definition: TriangleMesh.h:913
virtual ~TriangleMesh() override
Definition: TriangleMesh.h:129
void SetVertexNormals(const core::Tensor &value)
Definition: TriangleMesh.h:288
core::Tensor & GetVertexPositions()
Definition: TriangleMesh.h:161
static TriangleMesh CreateArrow(double cylinder_radius=1.0, double cone_radius=1.5, double cylinder_height=5.0, double cone_height=4.0, int resolution=20, int cylinder_split=4, int cone_split=1, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMeshFactory.cpp:208
void SetVertexAttr(const std::string &key, const core::Tensor &value)
Definition: TriangleMesh.h:267
static TriangleMesh CreateSphere(double radius=1.0, int resolution=20, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMeshFactory.cpp:104
A triangle mesh contains vertices and triangles.
Definition: TriangleMesh.h:111
const core::Tensor & GetTriangleNormals() const
Definition: TriangleMesh.h:252
TriangleMesh FillHoles(double hole_size=1e6) const
Definition: TriangleMesh.cpp:448
bool HasTriangleAttr(const std::string &key) const
Definition: TriangleMesh.h:356
void SetTriangleAttr(const std::string &key, const core::Tensor &value)
Definition: TriangleMesh.h:298
std::string ToString() const
Text description.
Definition: TriangleMesh.cpp:81
TriangleMesh Clone() const
Returns copy of the triangle mesh on the same device.
Definition: TriangleMesh.h:143
open3d::geometry::TriangleMesh ToLegacy() const
Convert to a legacy Open3D TriangleMesh.
Definition: TriangleMesh.cpp:243
void SetTriangleNormals(const core::Tensor &value)
Definition: TriangleMesh.h:311
const core::Tensor & GetVertexPositions() const
Definition: TriangleMesh.h:212
const Dtype Float32
Definition: Dtype.cpp:61
Tensor Min(const SizeVector &dims, bool keepdim=false) const
Definition: Tensor.cpp:1217
static TriangleMesh CreateCoordinateFrame(double size=1.0, const Eigen::Vector3d &origin=Eigen::Vector3d(0.0, 0.0, 0.0), core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMeshFactory.cpp:229
static TriangleMesh CreateText(const std::string &text, double depth=0.0, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMeshFactory.cpp:264
core::Tensor & GetVertexColors()
Definition: TriangleMesh.h:165
const core::Tensor & GetTriangleIndices() const
Definition: TriangleMesh.h:246
Tensor Max(const SizeVector &dims, bool keepdim=false) const
Definition: Tensor.cpp:1224
#define AssertTensorShape(tensor,...)
Definition: TensorCheck.h:77
const core::Tensor & GetVertexAttr(const std::string &key) const
Definition: TriangleMesh.h:200
void RemoveTriangleAttr(const std::string &key)
Definition: TriangleMesh.h:240
TriangleMesh ExtrudeRotation(double angle, const core::Tensor &axis, int resolution=16, double translation=0.0, bool capping=true) const
Definition: TriangleMesh.cpp:750
core::Tensor & GetVertexAttr(const std::string &key)
Definition: TriangleMesh.h:155
TriangleMesh ExtrudeLinear(const core::Tensor &vector, double scale=1.0, bool capping=true) const
Definition: TriangleMesh.cpp:760
void ComputeUVAtlas(size_t size=512, float gutter=1.0f, float max_stretch=1.f/6)
Definition: TriangleMesh.cpp:462
void SetVertexColors(const core::Tensor &value)
Definition: TriangleMesh.h:281
TriangleMesh BooleanUnion(const TriangleMesh &mesh, double tolerance=1e-6) const
Definition: TriangleMesh.cpp:425
core::Device GetDevice() const override
Returns the device of the geometry.
Definition: TriangleMesh.h:700
core::Tensor & GetTriangleAttr(const std::string &key)
Definition: TriangleMesh.h:181
TriangleMesh & Transform(const core::Tensor &transformation)
Transforms the VertexPositions, VertexNormals and TriangleNormals (if exist) of the TriangleMesh...
Definition: TriangleMesh.cpp:137
bool Contains(const std::string &key) const
Definition: TensorMap.h:206
const TensorMap & GetTriangleAttr() const
Getter for triangle_attr_ TensorMap. Used in Pybind.
Definition: TriangleMesh.h:172
bool IsEmpty() const override
Returns !HasVertexPositions(), triangles are ignored.
Definition: TriangleMesh.h:625
std::unordered_map< std::string, core::Tensor > BakeTriangleAttrTextures(int size, const std::unordered_set< std::string > &triangle_attr={}, double margin=2., double fill=0., bool update_material=true)
Definition: TriangleMesh.cpp:696
void SetVertexPositions(const core::Tensor &value)
Definition: TriangleMesh.h:274
const core::Tensor & GetVertexColors() const
Definition: TriangleMesh.h:218
TriangleMesh To(const core::Device &device, bool copy=false) const
Definition: TriangleMesh.cpp:284
static TriangleMesh CreateTetrahedron(double radius=1.0, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMeshFactory.cpp:117
void RemoveVertexAttr(const std::string &key)
Definition: TriangleMesh.h:208
Tensor Mean(const SizeVector &dims, bool keepdim=false) const
Definition: Tensor.cpp:1196
core::Tensor GetMinBound() const
Definition: TriangleMesh.h:627
static TriangleMesh CreateMobius(int length_split=70, int width_split=15, int twists=1, double radius=1, double flatness=1, double width=1, double scale=1, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMeshFactory.cpp:243
static TriangleMesh CreateOctahedron(double radius=1.0, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMeshFactory.cpp:130
TriangleMesh BooleanDifference(const TriangleMesh &mesh, double tolerance=1e-6) const
Definition: TriangleMesh.cpp:438
#define AssertTensorDevice(tensor,...)
Definition: TensorCheck.h:62
The base geometry class.
Definition: Geometry.h:40
A LineSet contains points and lines joining them and optionally attributes on the points and lines...
Definition: LineSet.h:103
Definition: PinholeCameraIntrinsic.cpp:35
TriangleMesh & Translate(const core::Tensor &translation, bool relative=true)
Translates the VertexPositions of the TriangleMesh.
Definition: TriangleMesh.cpp:152
core::Device device_
Definition: TriangleMesh.h:912
Mix-in class for geometry types that can be visualized.
Definition: DrawableGeometry.h:38
LineSet SlicePlane(const core::Tensor &point, const core::Tensor &normal, const std::vector< double > contour_values={0.0}) const
Extract contour slices given a plane. This method extracts slices as LineSet from the mesh at specifi...
Definition: TriangleMesh.cpp:334
TriangleMesh(const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMesh.cpp:59
core::Tensor & GetTriangleColors()
Definition: TriangleMesh.h:195
TensorMap & GetTriangleAttr()
Getter for triangle_attr_ TensorMap.
Definition: TriangleMesh.h:175
core::Tensor & GetVertexNormals()
Definition: TriangleMesh.h:169
const core::Tensor & GetTriangleAttr(const std::string &key) const
Definition: TriangleMesh.h:232
core::Tensor & GetTriangleNormals()
Definition: TriangleMesh.h:191
bool HasVertexNormals() const
Definition: TriangleMesh.h:350
TriangleMesh ClipPlane(const core::Tensor &point, const core::Tensor &normal) const
Clip mesh with a plane. This method clips the triangle mesh with the specified plane. Parts of the mesh on the positive side of the plane will be kept and triangles intersected by the plane will be cut.
Definition: TriangleMesh.cpp:303
A bounding box that is aligned along the coordinate axes and defined by the min_bound and max_bound...
Definition: BoundingVolume.h:63
static TriangleMesh CreateCone(double radius=1.0, double height=2.0, int resolution=20, int split=1, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMeshFactory.cpp:173
Triangle mesh contains vertices and triangles represented by the indices to the vertices.
Definition: TriangleMesh.h:54
bool HasVertexAttr(const std::string &key) const
Definition: TriangleMesh.h:327
std::size_t Erase(const std::string key)
Erase elements for the TensorMap by key value, if the key exists. If the key does not exists...
Definition: TensorMap.h:111
bool HasTriangleColors() const
Definition: TriangleMesh.h:380
TensorMap & GetVertexAttr()
Getter for vertex_attr_ TensorMap.
Definition: TriangleMesh.h:149
bool HasTriangleNormals() const
Definition: TriangleMesh.h:373
TriangleMesh BooleanIntersection(const TriangleMesh &mesh, double tolerance=1e-6) const
Definition: TriangleMesh.cpp:431
bool copy
Definition: VtkUtils.cpp:89
static TriangleMesh CreateCylinder(double radius=1.0, double height=2.0, int resolution=20, int split=4, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMeshFactory.cpp:156
TriangleMesh & Rotate(const core::Tensor &R, const core::Tensor ¢er)
Rotates the VertexPositions, VertexNormals and TriangleNormals (if exists).
Definition: TriangleMesh.cpp:177
int64_t GetLength() const
Definition: Tensor.h:1130
TensorMap triangle_attr_
Definition: TriangleMesh.h:914
AxisAlignedBoundingBox GetAxisAlignedBoundingBox() const
Create an axis-aligned bounding box from vertex attribute "positions".
Definition: TriangleMesh.cpp:444
static TriangleMesh CreateIcosahedron(double radius=1.0, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMeshFactory.cpp:143
static geometry::TriangleMesh FromLegacy(const open3d::geometry::TriangleMesh &mesh_legacy, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMesh.cpp:192
void SetTriangleColors(const core::Tensor &value)
Definition: TriangleMesh.h:318
core::Tensor GetCenter() const
Definition: TriangleMesh.h:631
bool HasVertexPositions() const
Definition: TriangleMesh.h:336
Definition: TensorMap.h:50
const core::Tensor & GetTriangleColors() const
Definition: TriangleMesh.h:258
bool HasTriangleIndices() const
Definition: TriangleMesh.h:366
static TriangleMesh CreateBox(double width=1.0, double height=1.0, double depth=1.0, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMeshFactory.cpp:40
const core::Tensor & GetVertexNormals() const
Definition: TriangleMesh.h:224
core::Tensor & GetTriangleIndices()
Definition: TriangleMesh.h:187
core::Tensor GetMaxBound() const
Definition: TriangleMesh.h:629