12#ifndef EASY3D_ALGO_SURFACE_MESH_FACTORY_H
13#define EASY3D_ALGO_SURFACE_MESH_FACTORY_H
15#include <easy3d/core/surface_mesh.h>
52 float radius = 1.0,
size_t n_slices = 15,
size_t n_stacks = 15);
66 static SurfaceMesh cone(
size_t n_subdivisions = 30,
float radius = 1.0,
float height = 2.5);
74 static SurfaceMesh cylinder(
size_t n_subdivisions = 30,
float radius = 1.0,
float height = 2.5);
83 torus(
size_t radial_resolution = 20,
size_t tubular_resolution = 40,
float radius = 1.0,
float thickness = 0.4);
Factory class to generate different types of basic shapes.
Definition: surface_mesh_factory.h:23
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 UV sphere with given center, radius, n_slices, and n_stacks.
Definition: surface_mesh_factory.cpp:155
static SurfaceMesh quad_sphere(size_t n_subdivisions=3)
Generate quad sphere refined by n_subdivisions .
Definition: surface_mesh_factory.cpp:146
static SurfaceMesh octahedron()
Generate octahedron.
Definition: surface_mesh_factory.cpp:77
static SurfaceMesh cone(size_t n_subdivisions=30, float radius=1.0, float height=2.5)
Generate a cone mesh.
Definition: surface_mesh_factory.cpp:241
static SurfaceMesh cylinder(size_t n_subdivisions=30, float radius=1.0, float height=2.5)
Generate a cylinder mesh.
Definition: surface_mesh_factory.cpp:275
static SurfaceMesh tetrahedron()
Generate tetrahedron.
Definition: surface_mesh_factory.cpp:34
static SurfaceMesh hexahedron()
Generate hexahedron.
Definition: surface_mesh_factory.cpp:54
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.
Definition: surface_mesh_factory.cpp:321
static SurfaceMesh icosahedron()
Generate icosahedron.
Definition: surface_mesh_factory.cpp:91
static SurfaceMesh plane(size_t resolution=4)
Generate a plane mesh.
Definition: surface_mesh_factory.cpp:211
static SurfaceMesh dodecahedron()
Generate dodecahedron.
Definition: surface_mesh_factory.cpp:84
static SurfaceMesh icosphere(size_t n_subdivisions=3)
Generate icosphere refined by n_subdivisions .
Definition: surface_mesh_factory.cpp:137
A halfedge data structure for polygonal meshes of 2-manifold.
Definition: surface_mesh.h:52
Definition: collider.cpp:182
Vec< 3, float > vec3
A 3D point/vector of float type.
Definition: types.h:45