TriangleMesh3.h
Go to the documentation of this file.
const Point3UI & UVIndex(size_t i) const
Returns constant reference to the UV indices of i-th triangle.
void AddPointTriangle(const Point3UI &newPointIndices)
Adds a triangle with points.
Vector3D ClosestPointLocal(const Vector3D &otherPoint) const override
const Point3UI & NormalIndex(size_t i) const
Returns constant reference to the normal indices of i-th triangle.
size_t NumberOfTriangles() const
Returns number of triangles.
double ClosestDistanceLocal(const Vector3D &otherPoint) const override
const Point3UI & PointIndex(size_t i) const
Returns constant reference to the point indices of i-th triangle.
SurfaceRayIntersection3 ClosestIntersectionLocal(const Ray3D &ray) const override
Returns the closest intersection point for given ray in local frame.
Builder & WithUVIndices(const IndexArray &uvIndices)
Returns builder with uv indices.
Builder & WithNormals(const NormalArray &normals)
Returns builder with normals.
Builder & WithPointIndices(const IndexArray &pointIndices)
Returns builder with point indices.
TriangleMesh3 & operator=(const TriangleMesh3 &other)
Copies other mesh.
BoundingBox3D BoundingBoxLocal() const override
Returns the bounding box of this surface object in local frame.
bool ReadObj(std::istream *stream)
Reads the mesh in obj format from the input stream.
Builder & WithUVs(const UVArray &uvs)
Returns builder with uvs.
const Vector2D & UV(size_t i) const
Returns constant reference to the i-th UV coordinates.
Array1< Vector3D > Vector3DArray
Definition: TriangleMesh3.h:33
const Vector3D & Normal(size_t i) const
Returns constant reference to the i-th normal.
void WriteObj(std::ostream *stream) const
Writes the mesh in obj format to the output stream.
Structure that represents ray-surface intersection point.
Definition: Surface3.h:23
Front-end to create TriangleMesh3 objects step by step.
Definition: TriangleMesh3.h:233
void UpdateQueryEngine() override
Updates internal spatial query engine.
Builder & WithNormalIndices(const IndexArray &normalIndices)
Returns builder with normal indices.
Definition: pybind11Utils.h:24
TriangleMesh3(const Transform3 &transform=Transform3(), bool isNormalFlipped=false)
Default constructor.
void AddPointUVTriangle(const Point3UI &newPointIndices, const Point3UI &newUVIndices)
Adds a triangle with point and UV.
std::shared_ptr< TriangleMesh3 > TriangleMesh3Ptr
Shared pointer for the TriangleMesh3 type.
Definition: TriangleMesh3.h:228
Array1< Vector2D > Vector2DArray
Definition: TriangleMesh3.h:32
Transform3 transform
Local-to-world transform.
Definition: Surface3.h:36
Vector3D ClosestNormalLocal(const Vector3D &otherPoint) const override
bool isNormalFlipped
Flips normal when calling Surface3::closestNormal(...).
Definition: Surface3.h:39
TriangleMesh3Ptr MakeShared() const
Builds shared pointer of TriangleMesh3 instance.
Builder & WithPoints(const PointArray &points)
Returns builder with points.
const Vector3D & Point(size_t i) const
Returns constant reference to the i-th point.
void SetAngleWeightedVertexNormal()
Sets angle weighted vertex normal.
void AddPointNormalTriangle(const Point3UI &newPointIndices, const Point3UI &newNormalIndices)
Adds a triangle with point and normal.
void AddPointUVNormalTriangle(const Point3UI &newPointIndices, const Point3UI &newUVIndices, const Point3UI &newNormalIndices)
Adds a triangle with point, normal, and UV.
void Set(const TriangleMesh3 &other)
Copies the contents from other mesh.
bool IntersectsLocal(const Ray3D &ray) const override