9#ifndef AVARA3D_MESH_PRIMITIVE_SPRING_H
10#define AVARA3D_MESH_PRIMITIVE_SPRING_H
14#include "a3d/mesh/MeshElement.h"
38 unsigned slices = DEFAULT_SLICES,
39 unsigned segments = DEFAULT_SEGMENTS,
40 std::shared_ptr<Material> material =
nullptr);
48 unsigned slices = DEFAULT_SLICES,
49 unsigned segments = DEFAULT_SEGMENTS);
71 static constexpr unsigned DEFAULT_SLICES = 8;
72 static constexpr unsigned DEFAULT_SEGMENTS = 32;
Owns the vertex and optional index data for one mesh primitive.
Helical spring mesh element aligned along the Z axis.
static std::shared_ptr< Mesh > Mesh(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.
float majorRadius() const
Returns the configured radius from the Z axis to the tube centerline.
unsigned slices() const
Returns the tube cross-section subdivision count.
Spring(float minorRadius, float majorRadius, float length, unsigned slices=DEFAULT_SLICES, unsigned segments=DEFAULT_SEGMENTS)
Generates spring geometry with the supplied dimensions and subdivisions.
float length() const
Returns the configured axial length.
float minorRadius() const
Returns the configured spring-tube radius.
unsigned segments() const
Returns the helical-path subdivision count.