MeshLib C Docs
Loading...
Searching...
No Matches
MRMinimalSurface.h File Reference
#include <MRCMisc/common.h>
#include <MRCMisc/exports.h>
#include <stdint.h>

Go to the source code of this file.

Typedefs

typedef struct MR_FunctionVolume MR_FunctionVolume
 
typedef struct MR_Mesh MR_Mesh
 
typedef struct MR_Vector3f MR_Vector3f
 
typedef struct MR_expected_MR_Mesh_std_string MR_expected_MR_Mesh_std_string
 
typedef struct MR_std_function_bool_from_float MR_std_function_bool_from_float
 
typedef struct MR_std_vector_std_string MR_std_vector_std_string
 
typedef int32_t MR_TPMS_Type
 Supported types of TPMS (Triply Periodic Minimal Surfaces)
 

Enumerations

enum  {
  MR_TPMS_Type_SchwartzP = 0 , MR_TPMS_Type_DoubleSchwartzP = 1 , MR_TPMS_Type_Gyroid = 2 , MR_TPMS_Type_DoubleGyroid = 3 ,
  MR_TPMS_Type_Count = 4
}
 

Functions

MRC_API MR_std_vector_std_stringMR_TPMS_getTypeNames (void)
 
MRC_API MR_FunctionVolumeMR_TPMS_buildVolume (MR_TPMS_Type type, const MR_Vector3f *size, float frequency, float resolution)
 
MRC_API MR_expected_MR_Mesh_std_stringMR_TPMS_build (MR_TPMS_Type type, const MR_Vector3f *size, float frequency, float resolution, float iso, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb)
 
MRC_API MR_expected_MR_Mesh_std_stringMR_TPMS_fill (MR_TPMS_Type type, const MR_Mesh *mesh, float frequency, float resolution, float iso, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb)
 
MRC_API MR_uint64_t MR_TPMS_getNumberOfVoxels_MR_Mesh (const MR_Mesh *mesh, float frequency, float resolution)
 
MRC_API MR_uint64_t MR_TPMS_getNumberOfVoxels_MR_Vector3f (const MR_Vector3f *size, float frequency, float resolution)
 
MRC_API float MR_TPMS_estimateIso (MR_TPMS_Type type, float targetDensity)
 
MRC_API float MR_TPMS_estimateDensity (MR_TPMS_Type type, float targetIso)
 

Typedef Documentation

◆ MR_expected_MR_Mesh_std_string

◆ MR_FunctionVolume

◆ MR_Mesh

typedef struct MR_Mesh MR_Mesh

◆ MR_std_function_bool_from_float

◆ MR_std_vector_std_string

◆ MR_TPMS_Type

typedef int32_t MR_TPMS_Type

Supported types of TPMS (Triply Periodic Minimal Surfaces)

◆ MR_Vector3f

typedef struct MR_Vector3f MR_Vector3f

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MR_TPMS_Type_SchwartzP 
MR_TPMS_Type_DoubleSchwartzP 
MR_TPMS_Type_Gyroid 
MR_TPMS_Type_DoubleGyroid 
MR_TPMS_Type_Count 

Function Documentation

◆ MR_TPMS_build()

MRC_API MR_expected_MR_Mesh_std_string * MR_TPMS_build ( MR_TPMS_Type type,
const MR_Vector3f * size,
float frequency,
float resolution,
float iso,
MR_PassBy cb_pass_by,
MR_std_function_bool_from_float * cb )

Constructs TPMS level-set and then convert it to mesh Generated from function MR::TPMS::build. Parameter size can not be null. It is a single object. Parameter cb has a default argument: {}, pass MR_PassBy_DefaultArgument and a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_MR_Mesh_std_string_Destroy() to free it when you're done using it.

◆ MR_TPMS_buildVolume()

MRC_API MR_FunctionVolume * MR_TPMS_buildVolume ( MR_TPMS_Type type,
const MR_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 Generated from function MR::TPMS::buildVolume. Parameter size can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FunctionVolume_Destroy() to free it when you're done using it.

◆ MR_TPMS_estimateDensity()

MRC_API float MR_TPMS_estimateDensity ( MR_TPMS_Type type,
float targetIso )

Returns approximate density corresponding to the given ISO value

Parameters
targetIsovalue in [-1; 1]
Returns
Value in [0; 1] Generated from function MR::TPMS::estimateDensity.

◆ MR_TPMS_estimateIso()

MRC_API float MR_TPMS_estimateIso ( MR_TPMS_Type type,
float targetDensity )

Returns approximated ISO value corresponding to the given density

Parameters
targetDensityvalue in [0; 1]
Returns
Value in [-1; 1] Generated from function MR::TPMS::estimateIso.

◆ MR_TPMS_fill()

MRC_API MR_expected_MR_Mesh_std_string * MR_TPMS_fill ( MR_TPMS_Type type,
const MR_Mesh * mesh,
float frequency,
float resolution,
float iso,
MR_PassBy cb_pass_by,
MR_std_function_bool_from_float * cb )

Constructs TPMS-filling for the given mesh Generated from function MR::TPMS::fill. Parameter mesh can not be null. It is a single object. Parameter cb has a default argument: {}, pass MR_PassBy_DefaultArgument and a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_MR_Mesh_std_string_Destroy() to free it when you're done using it.

◆ MR_TPMS_getNumberOfVoxels_MR_Mesh()

MRC_API MR_uint64_t MR_TPMS_getNumberOfVoxels_MR_Mesh ( const MR_Mesh * mesh,
float frequency,
float resolution )

Returns number of voxels that would be used to perform fillWithTPMS Generated from function MR::TPMS::getNumberOfVoxels. Parameter mesh can not be null. It is a single object.

◆ MR_TPMS_getNumberOfVoxels_MR_Vector3f()

MRC_API MR_uint64_t MR_TPMS_getNumberOfVoxels_MR_Vector3f ( const MR_Vector3f * size,
float frequency,
float resolution )

Returns number of voxels that would be used to perform buildTPMS or buildTPMSVolume Generated from function MR::TPMS::getNumberOfVoxels. Parameter size can not be null. It is a single object.

◆ MR_TPMS_getTypeNames()

MRC_API MR_std_vector_std_string * MR_TPMS_getTypeNames ( void )

Generated from function MR::TPMS::getTypeNames. Never returns null. Returns an instance allocated on the heap! Must call MR_std_vector_std_string_Destroy() to free it when you're done using it.