|
DART 6.12.2
|
The class Icosphere represents an icosphere where the subdivision and radius are configurable. More...
#include <Icosphere.hpp>
Public Types | |
| using | S = S_ |
| using | Base = TriMesh< S > |
| using | Index = typename Base::Index |
| using | Vector3 = typename Base::Vector3 |
| using | Triangle = typename Base::Triangle |
| using | Vertices = std::vector< Vector3 > |
| using | Normals = typename Base::Normals |
| using | Triangles = std::vector< Triangle > |
| using | Indices = std::vector< Index > |
Public Member Functions | |
| Icosphere (S radius, std::size_t subdivisions) | |
| Construct an icosphere given radius and subdivisions. | |
| S | getRadius () const |
| Returns the radius of the icosphere. | |
| std::size_t | getNumSubdivisions () const |
| Returns the number of subdivisions of the icosphere. | |
| void | setTriangles (const Vertices &vertices, const Triangles &triangles) |
| Sets vertices and triangles. | |
| void | computeVertexNormals () |
| Computes vertex normals. | |
| bool | hasTriangles () const |
| Returns true if the mesh contains triangles. | |
| bool | hasTriangleNormals () const |
| Returns true if the mesh contains triangle normals. | |
| const Triangles & | getTriangles () const |
| Returns the triangles of the mesh. | |
| const Normals & | getTriangleNormals () const |
| Returns the triangle normals of the mesh. | |
| void | clear () override |
| Clears all the data in the trimesh. | |
| TriMesh | operator+ (const TriMesh &other) const |
| Addition operator. | |
| Mesh | operator+ (const Mesh &other) const |
| Addition operator. | |
| TriMesh & | operator+= (const TriMesh &other) |
| Addition assignment operator. | |
| Mesh & | operator+= (const Mesh &other) |
| Addition assignment operator. | |
| std::shared_ptr< TriMesh< S > > | generateConvexHull (bool optimize=true) const |
| Generates a convex hull that encloses the trimesh. | |
| bool | hasVertices () const |
| Returns true if the mesh contains vertices. | |
| bool | hasVertexNormals () const |
| Returns true if the mesh contains vertex normals. | |
| const Vertices & | getVertices () const |
| Returns the vertices of the mesh. | |
| const Normals & | getVertexNormals () const |
| Returns the vertex normals of the mesh. | |
| bool | isEmpty () const |
| Returns true if the mesh has no vertices. | |
| void | translate (const Vector3 &translation) |
Translates the mesh vertices by adding translation to the vertices. | |
Static Public Member Functions | |
| static std::size_t | getNumVertices (std::size_t subdivisions) |
| Returns the number of vertices of icosphere given subdivisions. | |
| static std::size_t | getNumEdges (std::size_t subdivisions) |
| Returns the number of edges of icosphere given subdivisions. | |
| static std::size_t | getNumTriangles (std::size_t subdivisions) |
| Returns the number of triangles of icosphere given subdivisions. | |
| static std::pair< Vertices, Triangles > | computeIcosahedron (S radius) |
| Returns vertices and faces of icosahedron given radius. | |
Protected Member Functions | |
| void | computeTriangleNormals () |
| Computes triangle normals. | |
| void | normalizeTriangleNormals () |
| Normalizes triangle normals. | |
| void | normalizeVertexNormals () |
| Normalizes the vertex normals. | |
Protected Attributes | |
| Triangles | mTriangles |
| Triangle indices of the mesh. | |
| Normals | mTriangleNormals |
| Triangle normals of the mesh. | |
| Vertices | mVertices |
| Vertices of the mesh. | |
| Normals | mVertexNormals |
| Vertex normals of the mesh. | |
Private Member Functions | |
| void | build () |
| Internal function to build icosphere given radius and subdivisions. | |
Private Attributes | |
| S | mRadius |
| Radius of icosphere. | |
| std::size_t | mSubdivisions |
| Number of subdividing an icosahedron. | |
The class Icosphere represents an icosphere where the subdivision and radius are configurable.
| using dart::math::Icosphere< S_ >::Base = TriMesh<S> |
| using dart::math::Icosphere< S_ >::Index = typename Base::Index |
|
inherited |
| using dart::math::Icosphere< S_ >::Normals = typename Base::Normals |
| using dart::math::Icosphere< S_ >::S = S_ |
| using dart::math::Icosphere< S_ >::Triangle = typename Base::Triangle |
| using dart::math::Icosphere< S_ >::Triangles = std::vector<Triangle> |
| using dart::math::Icosphere< S_ >::Vector3 = typename Base::Vector3 |
| using dart::math::Icosphere< S_ >::Vertices = std::vector<Vector3> |
| dart::math::Icosphere< S >::Icosphere | ( | S | radius, |
| std::size_t | subdivisions | ||
| ) |
Construct an icosphere given radius and subdivisions.
| [in] | radius | The radius of the icosphere. |
| [in] | subdivisions | The number of subdividing an icosahedron. Passing 1 generates icosahedron without subdividing. |
|
private |
Internal function to build icosphere given radius and subdivisions.
|
overridevirtualinherited |
Clears all the data in the trimesh.
Reimplemented from dart::math::Mesh< S_ >.
|
static |
Returns vertices and faces of icosahedron given radius.
|
protectedinherited |
Computes triangle normals.
|
inherited |
Computes vertex normals.
|
inherited |
Generates a convex hull that encloses the trimesh.
| [in] | optimize | (Optional) Whether to discard vertices that are not used in the convex hull. |
|
static |
Returns the number of edges of icosphere given subdivisions.
| std::size_t dart::math::Icosphere< S >::getNumSubdivisions | ( | ) | const |
Returns the number of subdivisions of the icosphere.
|
static |
Returns the number of triangles of icosphere given subdivisions.
|
static |
Returns the number of vertices of icosphere given subdivisions.
| S dart::math::Icosphere< S >::getRadius | ( | ) | const |
Returns the radius of the icosphere.
|
inherited |
Returns the triangle normals of the mesh.
|
inherited |
Returns the triangles of the mesh.
|
inherited |
Returns the vertex normals of the mesh.
|
inherited |
Returns the vertices of the mesh.
|
inherited |
Returns true if the mesh contains triangle normals.
|
inherited |
Returns true if the mesh contains triangles.
|
inherited |
Returns true if the mesh contains vertex normals.
|
inherited |
Returns true if the mesh contains vertices.
|
inherited |
Returns true if the mesh has no vertices.
|
protectedinherited |
Normalizes triangle normals.
|
protectedinherited |
Normalizes the vertex normals.
|
inherited |
Addition operator.
|
inherited |
Addition operator.
|
inherited |
Addition assignment operator.
|
inherited |
Addition assignment operator.
|
inherited |
Sets vertices and triangles.
|
inherited |
Translates the mesh vertices by adding translation to the vertices.
|
private |
Radius of icosphere.
|
private |
Number of subdividing an icosahedron.
|
protectedinherited |
Triangle normals of the mesh.
|
protectedinherited |
Triangle indices of the mesh.
|
protectedinherited |
Vertex normals of the mesh.
|
protectedinherited |
Vertices of the mesh.