Factory class to generate different types of basic shapes.
More...
#include <easy3d/algo/surface_mesh_factory.h>
|
static SurfaceMesh | tetrahedron () |
| Generate a tetrahedron mesh.
|
|
static SurfaceMesh | hexahedron () |
| Generate a hexahedron mesh.
|
|
static SurfaceMesh | octahedron () |
| Generate an octahedron mesh.
|
|
static SurfaceMesh | dodecahedron () |
| Generate a dodecahedron mesh.
|
|
static SurfaceMesh | icosahedron () |
| Generate an icosahedron mesh.
|
|
static SurfaceMesh | icosphere (size_t n_subdivisions=3) |
| Generate an icosphere mesh refined by a given number of subdivisions. The initial icosahedron is refined using Loop subdivision.
|
|
static SurfaceMesh | quad_sphere (size_t n_subdivisions=3) |
| Generate a quad sphere mesh refined by a given number of subdivisions. The initial hexahedron is refined using Catmull-Clark subdivision.
|
|
static SurfaceMesh | uv_sphere (const vec3 ¢er=vec3(0, 0, 0), float radius=1.0, size_t n_slices=15, size_t n_stacks=15) |
| Generate a UV sphere mesh with given parameters.
|
|
static SurfaceMesh | plane (size_t resolution=4) |
| Generate a plane mesh.
|
|
static SurfaceMesh | cone (size_t n_subdivisions=30, float radius=1.0, float height=2.5) |
| Generate a cone mesh.
|
|
static SurfaceMesh | cylinder (size_t n_subdivisions=30, float radius=1.0, float height=2.5) |
| Generate a cylinder mesh.
|
|
static SurfaceMesh | torus (size_t radial_resolution=20, size_t tubular_resolution=40, float radius=1.0, float thickness=0.4) |
| Generate a torus mesh.
|
|
Factory class to generate different types of basic shapes.
◆ cone()
SurfaceMesh cone |
( |
size_t | n_subdivisions = 30, |
|
|
float | radius = 1.0, |
|
|
float | height = 2.5 ) |
|
static |
Generate a cone mesh.
Generates a polygonal mesh of a cone. The circular base lies in the x-y-plane and the tip points in positive z-direction.
- Parameters
-
n_subdivisions | Number of subdivisions of the base circle. Needs to be >= 3. Default: 30. |
radius | Radius of the base circle. Default: 1. |
height | Height of the cone. Default: 2.5. |
- Returns
- The generated cone mesh.
◆ cylinder()
SurfaceMesh cylinder |
( |
size_t | n_subdivisions = 30, |
|
|
float | radius = 1.0, |
|
|
float | height = 2.5 ) |
|
static |
Generate a cylinder mesh.
Generates a polygonal mesh of a cylinder. The cylinder is oriented in z-direction.
- Parameters
-
n_subdivisions | Number of subdivisions of the cylinder. Needs to be >= 3. Default: 30. |
radius | Radius of the cylinder. Default: 1. |
height | Height of the cylinder. Default: 2.5. |
- Returns
- The generated cylinder mesh.
◆ dodecahedron()
Generate a dodecahedron mesh.
- Returns
- The generated dodecahedron mesh.
◆ hexahedron()
Generate a hexahedron mesh.
- Returns
- The generated hexahedron mesh.
◆ icosahedron()
Generate an icosahedron mesh.
- Returns
- The generated icosahedron mesh.
◆ icosphere()
Generate an icosphere mesh refined by a given number of subdivisions. The initial icosahedron is refined using Loop subdivision.
- Parameters
-
n_subdivisions | Number of subdivisions to refine the initial icosahedron. |
- Returns
- The generated icosphere mesh.
- See also
- SurfaceSubdivision
◆ octahedron()
Generate an octahedron mesh.
- Returns
- The generated octahedron mesh.
◆ plane()
Generate a plane mesh.
Generates a pure quad mesh in the x-y plane with origin (0,0,0) and side length 1.
- Parameters
-
resolution | Number of faces in each direction. Needs to be >= 1. Default: 4. |
- Returns
- The generated plane mesh.
◆ quad_sphere()
Generate a quad sphere mesh refined by a given number of subdivisions. The initial hexahedron is refined using Catmull-Clark subdivision.
- Parameters
-
n_subdivisions | Number of subdivisions to refine the initial hexahedron. |
- Returns
- The generated quad sphere mesh.
- See also
- SurfaceMeshSubdivision
◆ tetrahedron()
Generate a tetrahedron mesh.
- Returns
- The generated tetrahedron mesh.
◆ torus()
SurfaceMesh torus |
( |
size_t | radial_resolution = 20, |
|
|
size_t | tubular_resolution = 40, |
|
|
float | radius = 1.0, |
|
|
float | thickness = 0.4 ) |
|
static |
Generate a torus mesh.
Generates a quad mesh of a torus with its major circle in the x-y plane.
- Parameters
-
radial_resolution | Number of subdivisions of the major circle. Needs to be >= 3. Default: 20. |
tubular_resolution | Number of subdivisions along the tube. Needs to be >= 3. Default: 40. |
radius | Radius of the major circle. Default: 1. |
thickness | Thickness of the tube. Default: 0.4. |
- Returns
- The generated torus mesh.
◆ uv_sphere()
SurfaceMesh uv_sphere |
( |
const vec3 & | center = vec3(0, 0, 0), |
|
|
float | radius = 1.0, |
|
|
size_t | n_slices = 15, |
|
|
size_t | n_stacks = 15 ) |
|
static |
Generate a UV sphere mesh with given parameters.
- Parameters
-
center | The center of the sphere. |
radius | The radius of the sphere. |
n_slices | Number of slices (longitudinal divisions). |
n_stacks | Number of stacks (latitudinal divisions). |
- Returns
- The generated UV sphere mesh.
The documentation for this class was generated from the following files: