MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::TPMS Namespace Reference

Enumerations

enum class  Type : int {
  SchwartzP , DoubleSchwartzP , Gyroid , DoubleGyroid ,
  Count
}
 Supported types of TPMS (Triply Periodic Minimal Surfaces) More...
 

Functions

MRVOXELS_API std::vector< std::string > getTypeNames ()
 
MRVOXELS_API FunctionVolume buildVolume (Type type, const Vector3f &size, float frequency, float resolution)
 
MRVOXELS_API Expected< Meshbuild (Type type, const Vector3f &size, float frequency, float resolution, float iso, ProgressCallback cb={})
 Constructs TPMS level-set and then convert it to mesh.
 
MRVOXELS_API Expected< Meshfill (Type type, const Mesh &mesh, float frequency, float resolution, float iso, ProgressCallback cb={})
 Constructs TPMS-filling for the given mesh.
 
MRVOXELS_API size_t getNumberOfVoxels (const Mesh &mesh, float frequency, float resolution)
 Returns number of voxels that would be used to perform fillWithTPMS.
 
MRVOXELS_API size_t getNumberOfVoxels (const Vector3f &size, float frequency, float resolution)
 Returns number of voxels that would be used to perform buildTPMS or buildTPMSVolume.
 
MRVOXELS_API float estimateIso (Type type, float targetDensity)
 
MRVOXELS_API float estimateDensity (Type type, float targetIso)
 

Enumeration Type Documentation

◆ Type

enum class MR::TPMS::Type : int
strong

Supported types of TPMS (Triply Periodic Minimal Surfaces)

Enumerator
SchwartzP 
DoubleSchwartzP 
Gyroid 
DoubleGyroid 
Count 

Function Documentation

◆ build()

MRVOXELS_API Expected< Mesh > MR::TPMS::build ( Type type,
const Vector3f & size,
float frequency,
float resolution,
float iso,
ProgressCallback cb = {} )

Constructs TPMS level-set and then convert it to mesh.

◆ buildVolume()

MRVOXELS_API FunctionVolume MR::TPMS::buildVolume ( Type type,
const Vector3f & size,
float frequency,
float resolution )

Construct TPMS using implicit function (https://www.researchgate.net/publication/350658078_Computational_method_and_program_for_generating_a_porous_scaffold_based_on_implicit_surfaces)

Parameters
typeType of the surface
sizeSize of the cube with the surface
frequencyFrequency of oscillations (determines size of the "cells" in the "grid")
resolutionRatio n / T, between the number of voxels and period of oscillations
Returns
Distance-volume starting at (0, 0, 0) and having specified size

◆ estimateDensity()

MRVOXELS_API float MR::TPMS::estimateDensity ( Type type,
float targetIso )

Returns approximate density corresponding to the given ISO value

Parameters
targetIsovalue in [-1; 1]
Returns
Value in [0; 1]

◆ estimateIso()

MRVOXELS_API float MR::TPMS::estimateIso ( Type type,
float targetDensity )

Returns approximated ISO value corresponding to the given density

Parameters
targetDensityvalue in [0; 1]
Returns
Value in [-1; 1]

◆ fill()

MRVOXELS_API Expected< Mesh > MR::TPMS::fill ( Type type,
const Mesh & mesh,
float frequency,
float resolution,
float iso,
ProgressCallback cb = {} )

Constructs TPMS-filling for the given mesh.

◆ getNumberOfVoxels() [1/2]

MRVOXELS_API size_t MR::TPMS::getNumberOfVoxels ( const Mesh & mesh,
float frequency,
float resolution )

Returns number of voxels that would be used to perform fillWithTPMS.

◆ getNumberOfVoxels() [2/2]

MRVOXELS_API size_t MR::TPMS::getNumberOfVoxels ( const Vector3f & size,
float frequency,
float resolution )

Returns number of voxels that would be used to perform buildTPMS or buildTPMSVolume.

◆ getTypeNames()

MRVOXELS_API std::vector< std::string > MR::TPMS::getTypeNames ( )