Avara3D 0.2.0
C++ API reference
a3d::TorusKnot Class Reference

Tubular torus-knot mesh element controlled by the knot parameters p and q. More...

#include <a3d/mesh/primitive/TorusKnot.h>

Inheritance diagram for a3d::TorusKnot:
[legend]

Public Member Functions

 TorusKnot (unsigned p, unsigned q, unsigned slices=DEFAULT_SLICES, unsigned segments=DEFAULT_SEGMENTS)
 Generates torus-knot geometry with the supplied knot parameters and subdivisions. More...
 
unsigned p () const
 Returns the configured p knot parameter. More...
 
unsigned q () const
 Returns the configured q knot parameter. More...
 
unsigned slices () const
 Returns the tube cross-section subdivision count. More...
 
unsigned segments () const
 Returns the knot-path subdivision count. More...
 
- Public Member Functions inherited from a3d::MeshElement
 MeshElement (VertexLayout layout, std::span< const std::byte > vertexBytes, uint32_t vertexCount, uint16_t vertexStride, PrimitiveTopology topology, IndexFormat indexFormat, std::span< const std::byte > indexBytes, uint32_t indexCount)
 Creates a MeshElement by copying the supplied vertex and index data. More...
 

Static Public Member Functions

static std::shared_ptr< MeshMesh (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. More...
 

Detailed Description

Tubular torus-knot mesh element controlled by the knot parameters p and q.

Slices subdivide the tube cross-section and segments subdivide the knot path.

Definition at line 26 of file TorusKnot.h.

Constructor & Destructor Documentation

◆ TorusKnot()

a3d::TorusKnot::TorusKnot ( unsigned  p,
unsigned  q,
unsigned  slices = DEFAULT_SLICES,
unsigned  segments = DEFAULT_SEGMENTS 
)

Generates torus-knot geometry with the supplied knot parameters and subdivisions.

Member Function Documentation

◆ Mesh()

static std::shared_ptr< Mesh > a3d::TorusKnot::Mesh ( unsigned  p,
unsigned  q,
unsigned  slices = DEFAULT_SLICES,
unsigned  segments = DEFAULT_SEGMENTS,
std::shared_ptr< Material material = nullptr 
)
static

Creates a Mesh containing a TorusKnot and optional material.

◆ p()

unsigned a3d::TorusKnot::p ( ) const

Returns the configured p knot parameter.

◆ q()

unsigned a3d::TorusKnot::q ( ) const

Returns the configured q knot parameter.

◆ segments()

unsigned a3d::TorusKnot::segments ( ) const

Returns the knot-path subdivision count.

◆ slices()

unsigned a3d::TorusKnot::slices ( ) const

Returns the tube cross-section subdivision count.


The documentation for this class was generated from the following file: