9#ifndef AVARA3D_MESH_PRIMITIVE_TORUSKNOT_H
10#define AVARA3D_MESH_PRIMITIVE_TORUSKNOT_H
14#include "a3d/mesh/MeshElement.h"
32 static std::shared_ptr<Mesh>
Mesh(
unsigned p,
34 unsigned slices = DEFAULT_SLICES,
35 unsigned segments = DEFAULT_SEGMENTS,
36 std::shared_ptr<Material> material =
nullptr);
43 unsigned slices = DEFAULT_SLICES,
44 unsigned segments = DEFAULT_SEGMENTS);
63 static constexpr unsigned DEFAULT_SLICES = 8;
64 static constexpr unsigned DEFAULT_SEGMENTS = 96;
Owns the vertex and optional index data for one mesh primitive.
Tubular torus-knot mesh element controlled by the knot parameters p and q.
unsigned slices() const
Returns the tube cross-section subdivision count.
unsigned q() const
Returns the configured q knot parameter.
TorusKnot(unsigned p, unsigned q, unsigned slices=DEFAULT_SLICES, unsigned segments=DEFAULT_SEGMENTS)
Generates torus-knot geometry with the supplied knot parameters and subdivisions.
unsigned segments() const
Returns the knot-path subdivision count.
static std::shared_ptr< Mesh > Mesh(unsigned p, unsigned q, unsigned slices=DEFAULT_SLICES, unsigned segments=DEFAULT_SEGMENTS, std::shared_ptr< Material > material=nullptr)
Creates a Mesh containing a TorusKnot and optional material.
unsigned p() const
Returns the configured p knot parameter.