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

Helical spring mesh element aligned along the Z axis. More...

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

Inheritance diagram for a3d::Spring:
[legend]

Public Member Functions

 Spring (float minorRadius, float majorRadius, float length, unsigned slices=DEFAULT_SLICES, unsigned segments=DEFAULT_SEGMENTS)
 Generates spring geometry with the supplied dimensions and subdivisions. More...
 
float minorRadius () const
 Returns the configured spring-tube radius. More...
 
float majorRadius () const
 Returns the configured radius from the Z axis to the tube centerline. More...
 
float length () const
 Returns the configured axial length. More...
 
unsigned slices () const
 Returns the tube cross-section subdivision count. More...
 
unsigned segments () const
 Returns the helical-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 (float minorRadius, float majorRadius, float length, unsigned slices=DEFAULT_SLICES, unsigned segments=DEFAULT_SEGMENTS, std::shared_ptr< Material > material=nullptr)
 Creates a Mesh containing a Spring and optional material. More...
 

Detailed Description

Helical spring mesh element aligned along the Z axis.

Minor radius is the radius of the spring tube itself; major radius is the distance from the Z axis to the tube centerline. Length is the full axial length. Slices subdivide the tube cross-section and segments subdivide the helical path.

Definition at line 29 of file Spring.h.

Constructor & Destructor Documentation

◆ Spring()

a3d::Spring::Spring ( float  minorRadius,
float  majorRadius,
float  length,
unsigned  slices = DEFAULT_SLICES,
unsigned  segments = DEFAULT_SEGMENTS 
)

Generates spring geometry with the supplied dimensions and subdivisions.

Member Function Documentation

◆ length()

float a3d::Spring::length ( ) const

Returns the configured axial length.

◆ majorRadius()

float a3d::Spring::majorRadius ( ) const

Returns the configured radius from the Z axis to the tube centerline.

◆ Mesh()

static std::shared_ptr< Mesh > a3d::Spring::Mesh ( float  minorRadius,
float  majorRadius,
float  length,
unsigned  slices = DEFAULT_SLICES,
unsigned  segments = DEFAULT_SEGMENTS,
std::shared_ptr< Material material = nullptr 
)
static

Creates a Mesh containing a Spring and optional material.

◆ minorRadius()

float a3d::Spring::minorRadius ( ) const

Returns the configured spring-tube radius.

◆ segments()

unsigned a3d::Spring::segments ( ) const

Returns the helical-path subdivision count.

◆ slices()

unsigned a3d::Spring::slices ( ) const

Returns the tube cross-section subdivision count.


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