MeshLib C Docs
Loading...
Searching...
No Matches
MRFillingSurface.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMesh/MRVector3.h>
4#include <MRCMisc/common.h>
5#include <MRCMisc/exports.h>
6
7#include <stdbool.h>
8#include <stddef.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef struct MR_FunctionVolume MR_FunctionVolume; // Defined in `#include <MRCVoxels/MRVoxelsVolume.h>`.
15typedef struct MR_Mesh MR_Mesh; // Defined in `#include <MRCMesh/MRMesh.h>`.
16typedef struct MR_expected_MR_Mesh_std_string MR_expected_MR_Mesh_std_string; // Defined in `#include <MRCMisc/expected_MR_Mesh_std_string.h>`.
17typedef struct MR_std_function_bool_from_float MR_std_function_bool_from_float; // Defined in `#include <MRCMisc/std_function_bool_from_float.h>`.
18typedef struct MR_std_optional_float MR_std_optional_float; // Defined in `#include <MRCMisc/std_optional_float.h>`.
19typedef struct MR_std_vector_std_string MR_std_vector_std_string; // Defined in `#include <MRCMisc/std_vector_std_string.h>`.
20
21
31
38
45
52
56
57// Different kinds of filling surface
63
68
73
77
78// Type of the surface
84
85// Type of the surface
91
92// Type of the surface
98
99// Frequency of oscillations (determines size of the "cells" in the "grid")
105
106// Frequency of oscillations (determines size of the "cells" in the "grid")
111
112// Frequency of oscillations (determines size of the "cells" in the "grid")
118
119// Ratio `n / T`, between the number of voxels and period of oscillations
125
126// Ratio `n / T`, between the number of voxels and period of oscillations
131
132// Ratio `n / T`, between the number of voxels and period of oscillations
138
142
147
153
157
161
167
172
178
181
184
192
198
203
209
215
220
226
227// Type of the surface
233
234// Type of the surface
240
241// Type of the surface
247
248// Frequency of oscillations (determines size of the "cells" in the "grid")
254
255// Frequency of oscillations (determines size of the "cells" in the "grid")
260
261// Frequency of oscillations (determines size of the "cells" in the "grid")
267
268// Ratio `n / T`, between the number of voxels and period of oscillations
274
275// Ratio `n / T`, between the number of voxels and period of oscillations
280
281// Ratio `n / T`, between the number of voxels and period of oscillations
287
291
296
300
304
309
313
319
322
325
333
342
350
358
362MRC_API MR_uint64_t MR_FillingSurface_TPMS_getNumberOfVoxels_MR_Mesh(const MR_Mesh *mesh, float frequency, float resolution);
363
367MRC_API MR_uint64_t MR_FillingSurface_TPMS_getNumberOfVoxels_MR_Vector3f(const MR_Vector3f *size, float frequency, float resolution);
368
374
380
384
391
398
405
412
419
426
433
440
447
454
460
467
468// used in tests in order to make surfaces close to their analytical expression
469// recommended to be false for real usage for better performance
475
476// used in tests in order to make surfaces close to their analytical expression
477// recommended to be false for real usage for better performance
482
483// used in tests in order to make surfaces close to their analytical expression
484// recommended to be false for real usage for better performance
490
491// Used in tests for roughly the same purpose: the computations of density estimation are made under the assumption of an infinite surface.
492// Thus, we must impose "boundary conditions" that inflict the "tips" of the bars (cylinders or cubes) to be preserved on the boundary of the
493// generated filling surface. However, for the aesthetic reasons, it was requested that the tips must be cut in the UI. And here comes this flag.
494// Note that for the estimation of density in UI the influence of "tips" is not significant (it tends to zero with growing size), however
495// we cannot afford to run tests on too big surfaces as it takes too long.
501
502// Used in tests for roughly the same purpose: the computations of density estimation are made under the assumption of an infinite surface.
503// Thus, we must impose "boundary conditions" that inflict the "tips" of the bars (cylinders or cubes) to be preserved on the boundary of the
504// generated filling surface. However, for the aesthetic reasons, it was requested that the tips must be cut in the UI. And here comes this flag.
505// Note that for the estimation of density in UI the influence of "tips" is not significant (it tends to zero with growing size), however
506// we cannot afford to run tests on too big surfaces as it takes too long.
511
512// Used in tests for roughly the same purpose: the computations of density estimation are made under the assumption of an infinite surface.
513// Thus, we must impose "boundary conditions" that inflict the "tips" of the bars (cylinders or cubes) to be preserved on the boundary of the
514// generated filling surface. However, for the aesthetic reasons, it was requested that the tips must be cut in the UI. And here comes this flag.
515// Note that for the estimation of density in UI the influence of "tips" is not significant (it tends to zero with growing size), however
516// we cannot afford to run tests on too big surfaces as it takes too long.
522
526
531
539
543
547
553
556
559
567
572
581
590
593MRC_API float MR_FillingSurface_CellularSurface_estimateDensity(float period, float width, float r);
594
597// Due to the simplification of the formula (sphere must either fully contain the intersection of cylinders or be inside it), solution not always exists.
600MRC_API MR_std_optional_float *MR_FillingSurface_CellularSurface_estimateWidth(float period, float r, float targetDensity);
601
605
606#ifdef __cplusplus
607} // extern "C"
608#endif
struct MR_std_function_bool_from_float MR_std_function_bool_from_float
Definition MR3mf.h:10
struct MR_std_optional_float MR_std_optional_float
Definition MRBestFitPolynomial.h:14
struct MR_expected_MR_Mesh_std_string MR_expected_MR_Mesh_std_string
Definition MRCtm.h:24
struct MR_Mesh MR_Mesh
Definition MRCtm.h:16
MRC_API MR_std_vector_std_string * MR_FillingSurface_TPMS_getTypeNames(void)
MRC_API MR_FillingSurface_CellularSurface_Params * MR_FillingSurface_CellularSurface_Params_DefaultConstruct(void)
MRC_API MR_std_vector_std_string * MR_FillingSurface_getKindNames(void)
MRC_API MR_FillingSurface_TPMS_VolumeParams * MR_FillingSurface_TPMS_VolumeParams_ConstructFrom(MR_FillingSurface_TPMS_Type type, float frequency, float resolution)
MRC_API void MR_FillingSurface_CellularSurface_Params_Set_period(MR_FillingSurface_CellularSurface_Params *_this, MR_Vector3f value)
MRC_API float MR_FillingSurface_TPMS_estimateIso(MR_FillingSurface_TPMS_Type type, float targetDensity)
MRC_API MR_FunctionVolume * MR_FillingSurface_TPMS_buildVolume(const MR_Vector3f *size, const MR_FillingSurface_TPMS_VolumeParams *params)
MRC_API MR_uint64_t MR_FillingSurface_TPMS_getNumberOfVoxels_MR_Vector3f(const MR_Vector3f *size, float frequency, float resolution)
MRC_API MR_FillingSurface_CellularSurface_Params * MR_FillingSurface_CellularSurface_Params_ConstructFrom(MR_FillingSurface_CellularSurface_Type type, MR_Vector3f period, MR_Vector3f width, float r, bool highRes, bool preserveTips)
struct MR_FillingSurface_TPMS_VolumeParams MR_FillingSurface_TPMS_VolumeParams
Definition MRFillingSurface.h:37
MRC_API const MR_FillingSurface_TPMS_MeshParams * MR_FillingSurface_TPMS_MeshParams_OffsetPtr(const MR_FillingSurface_TPMS_MeshParams *ptr, ptrdiff_t i)
MRC_API MR_FillingSurface_CellularSurface_Params * MR_FillingSurface_CellularSurface_Params_DefaultConstructArray(size_t num_elems)
MRC_API float * MR_FillingSurface_TPMS_MeshParams_GetMutable_frequency(MR_FillingSurface_TPMS_MeshParams *_this)
MRC_API void MR_FillingSurface_CellularSurface_Params_Destroy(const MR_FillingSurface_CellularSurface_Params *_this)
Destroys a heap-allocated instance of MR_FillingSurface_CellularSurface_Params. Does nothing if the p...
MRC_API void MR_FillingSurface_TPMS_MeshParams_Set_resolution(MR_FillingSurface_TPMS_MeshParams *_this, float value)
MRC_API MR_FillingSurface_TPMS_Type * MR_FillingSurface_TPMS_MeshParams_GetMutable_type(MR_FillingSurface_TPMS_MeshParams *_this)
MRC_API void MR_FillingSurface_CellularSurface_Params_Set_preserveTips(MR_FillingSurface_CellularSurface_Params *_this, bool value)
MRC_API void MR_FillingSurface_TPMS_MeshParams_Set_frequency(MR_FillingSurface_TPMS_MeshParams *_this, float value)
MRC_API const float * MR_FillingSurface_TPMS_VolumeParams_Get_frequency(const MR_FillingSurface_TPMS_VolumeParams *_this)
MRC_API const float * MR_FillingSurface_TPMS_VolumeParams_Get_resolution(const MR_FillingSurface_TPMS_VolumeParams *_this)
MRC_API void MR_FillingSurface_CellularSurface_Params_Set_width(MR_FillingSurface_CellularSurface_Params *_this, MR_Vector3f value)
MR_FillingSurface_Kind
Definition MRFillingSurface.h:59
@ MR_FillingSurface_Kind_TPMS
Definition MRFillingSurface.h:60
@ MR_FillingSurface_Kind_Cellular
Definition MRFillingSurface.h:61
MRC_API bool MR_FillingSurface_TPMS_isThick(MR_FillingSurface_TPMS_Type type)
MRC_API void MR_FillingSurface_TPMS_VolumeParams_Destroy(const MR_FillingSurface_TPMS_VolumeParams *_this)
Destroys a heap-allocated instance of MR_FillingSurface_TPMS_VolumeParams. Does nothing if the pointe...
MRC_API void MR_FillingSurface_CellularSurface_Params_DestroyArray(const MR_FillingSurface_CellularSurface_Params *_this)
Destroys a heap-allocated array of MR_FillingSurface_CellularSurface_Params. Does nothing if the poin...
MRC_API void MR_FillingSurface_TPMS_VolumeParams_Set_frequency(MR_FillingSurface_TPMS_VolumeParams *_this, float value)
MRC_API float * MR_FillingSurface_TPMS_MeshParams_GetMutable_resolution(MR_FillingSurface_TPMS_MeshParams *_this)
MRC_API void MR_FillingSurface_TPMS_VolumeParams_DestroyArray(const MR_FillingSurface_TPMS_VolumeParams *_this)
Destroys a heap-allocated array of MR_FillingSurface_TPMS_VolumeParams. Does nothing if the pointer i...
MRC_API const MR_Vector3f * MR_FillingSurface_CellularSurface_Params_Get_width(const MR_FillingSurface_CellularSurface_Params *_this)
MRC_API MR_FillingSurface_CellularSurface_Params * MR_FillingSurface_CellularSurface_Params_OffsetMutablePtr(MR_FillingSurface_CellularSurface_Params *ptr, ptrdiff_t i)
MRC_API MR_expected_MR_Mesh_std_string * MR_FillingSurface_TPMS_build(const MR_Vector3f *size, const MR_FillingSurface_TPMS_MeshParams *params, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb)
MRC_API const MR_FillingSurface_TPMS_Type * MR_FillingSurface_TPMS_VolumeParams_Get_type(const MR_FillingSurface_TPMS_VolumeParams *_this)
MRC_API MR_FillingSurface_CellularSurface_Params * MR_FillingSurface_CellularSurface_Params_ConstructFromAnother(const MR_FillingSurface_CellularSurface_Params *_other)
MRC_API const float * MR_FillingSurface_TPMS_MeshParams_Get_iso(const MR_FillingSurface_TPMS_MeshParams *_this)
MRC_API MR_FillingSurface_TPMS_VolumeParams * MR_FillingSurface_TPMS_VolumeParams_AssignFromAnother(MR_FillingSurface_TPMS_VolumeParams *_this, const MR_FillingSurface_TPMS_VolumeParams *_other)
MRC_API const bool * MR_FillingSurface_CellularSurface_Params_Get_preserveTips(const MR_FillingSurface_CellularSurface_Params *_this)
MRC_API bool * MR_FillingSurface_CellularSurface_Params_GetMutable_highRes(MR_FillingSurface_CellularSurface_Params *_this)
MRC_API MR_std_vector_std_string * MR_FillingSurface_CellularSurface_getTypeNames(void)
MRC_API const MR_FillingSurface_TPMS_VolumeParams * MR_FillingSurface_TPMS_MeshParams_UpcastTo_MR_FillingSurface_TPMS_VolumeParams(const MR_FillingSurface_TPMS_MeshParams *object)
MRC_API bool * MR_FillingSurface_CellularSurface_Params_GetMutable_preserveTips(MR_FillingSurface_CellularSurface_Params *_this)
MRC_API MR_expected_MR_Mesh_std_string * MR_FillingSurface_TPMS_fill(const MR_Mesh *mesh, const MR_FillingSurface_TPMS_MeshParams *params, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb)
MRC_API MR_FillingSurface_CellularSurface_Params * MR_FillingSurface_CellularSurface_Params_AssignFromAnother(MR_FillingSurface_CellularSurface_Params *_this, const MR_FillingSurface_CellularSurface_Params *_other)
MRC_API bool * MR_FillingSurface_TPMS_MeshParams_GetMutable_decimate(MR_FillingSurface_TPMS_MeshParams *_this)
MRC_API MR_expected_MR_Mesh_std_string * MR_FillingSurface_CellularSurface_build(const MR_Vector3f *size, const MR_FillingSurface_CellularSurface_Params *params, const MR_std_function_bool_from_float *cb)
MRC_API void MR_FillingSurface_TPMS_VolumeParams_Set_type(MR_FillingSurface_TPMS_VolumeParams *_this, MR_FillingSurface_TPMS_Type value)
MRC_API void MR_FillingSurface_CellularSurface_Params_Set_r(MR_FillingSurface_CellularSurface_Params *_this, float value)
MRC_API void MR_FillingSurface_CellularSurface_Params_Set_type(MR_FillingSurface_CellularSurface_Params *_this, MR_FillingSurface_CellularSurface_Type value)
MRC_API float MR_FillingSurface_TPMS_estimateDensity(MR_FillingSurface_TPMS_Type type, float targetIso)
MRC_API MR_FillingSurface_CellularSurface_Type * MR_FillingSurface_CellularSurface_Params_GetMutable_type(MR_FillingSurface_CellularSurface_Params *_this)
MRC_API void MR_FillingSurface_CellularSurface_Params_Set_highRes(MR_FillingSurface_CellularSurface_Params *_this, bool value)
MRC_API MR_FillingSurface_TPMS_MeshParams * MR_FillingSurface_TPMS_MeshParams_DefaultConstruct(void)
MRC_API float * MR_FillingSurface_CellularSurface_Params_GetMutable_r(MR_FillingSurface_CellularSurface_Params *_this)
MRC_API void MR_FillingSurface_TPMS_VolumeParams_Set_resolution(MR_FillingSurface_TPMS_VolumeParams *_this, float value)
MRC_API void MR_FillingSurface_TPMS_MeshParams_DestroyArray(const MR_FillingSurface_TPMS_MeshParams *_this)
Destroys a heap-allocated array of MR_FillingSurface_TPMS_MeshParams. Does nothing if the pointer is ...
MRC_API const bool * MR_FillingSurface_CellularSurface_Params_Get_highRes(const MR_FillingSurface_CellularSurface_Params *_this)
MRC_API MR_FillingSurface_TPMS_VolumeParams * MR_FillingSurface_TPMS_VolumeParams_DefaultConstructArray(size_t num_elems)
MRC_API MR_FillingSurface_TPMS_MeshParams * MR_FillingSurface_TPMS_MeshParams_DefaultConstructArray(size_t num_elems)
MRC_API MR_std_vector_std_string * MR_FillingSurface_TPMS_getTypeTooltips(void)
MRC_API const bool * MR_FillingSurface_TPMS_MeshParams_Get_decimate(const MR_FillingSurface_TPMS_MeshParams *_this)
MRC_API MR_FillingSurface_TPMS_VolumeParams * MR_FillingSurface_TPMS_MeshParams_MutableUpcastTo_MR_FillingSurface_TPMS_VolumeParams(MR_FillingSurface_TPMS_MeshParams *object)
MRC_API const float * MR_FillingSurface_TPMS_MeshParams_Get_resolution(const MR_FillingSurface_TPMS_MeshParams *_this)
MRC_API MR_Vector3f * MR_FillingSurface_CellularSurface_Params_GetMutable_period(MR_FillingSurface_CellularSurface_Params *_this)
MRC_API MR_FillingSurface_TPMS_VolumeParams * MR_FillingSurface_TPMS_VolumeParams_OffsetMutablePtr(MR_FillingSurface_TPMS_VolumeParams *ptr, ptrdiff_t i)
MRC_API MR_expected_MR_Mesh_std_string * MR_FillingSurface_CellularSurface_fill(const MR_Mesh *mesh, const MR_FillingSurface_CellularSurface_Params *params, const MR_std_function_bool_from_float *cb)
MRC_API float * MR_FillingSurface_TPMS_VolumeParams_GetMutable_frequency(MR_FillingSurface_TPMS_VolumeParams *_this)
MRC_API MR_FillingSurface_TPMS_MeshParams * MR_FillingSurface_TPMS_VolumeParams_MutableStaticDowncastTo_MR_FillingSurface_TPMS_MeshParams(MR_FillingSurface_TPMS_VolumeParams *object)
struct MR_FunctionVolume MR_FunctionVolume
Definition MRFillingSurface.h:14
MRC_API const MR_Vector3f * MR_FillingSurface_CellularSurface_Params_Get_period(const MR_FillingSurface_CellularSurface_Params *_this)
MRC_API const float * MR_FillingSurface_TPMS_MeshParams_Get_frequency(const MR_FillingSurface_TPMS_MeshParams *_this)
MRC_API MR_FillingSurface_TPMS_Type * MR_FillingSurface_TPMS_VolumeParams_GetMutable_type(MR_FillingSurface_TPMS_VolumeParams *_this)
MRC_API MR_FillingSurface_TPMS_MeshParams * MR_FillingSurface_TPMS_MeshParams_OffsetMutablePtr(MR_FillingSurface_TPMS_MeshParams *ptr, ptrdiff_t i)
MRC_API MR_FillingSurface_TPMS_MeshParams * MR_FillingSurface_TPMS_MeshParams_ConstructFromAnother(const MR_FillingSurface_TPMS_MeshParams *_other)
MRC_API const MR_FillingSurface_TPMS_Type * MR_FillingSurface_TPMS_MeshParams_Get_type(const MR_FillingSurface_TPMS_MeshParams *_this)
MRC_API const MR_FillingSurface_TPMS_VolumeParams * MR_FillingSurface_TPMS_VolumeParams_OffsetPtr(const MR_FillingSurface_TPMS_VolumeParams *ptr, ptrdiff_t i)
MR_FillingSurface_CellularSurface_Type
Type of cellular surface base element.
Definition MRFillingSurface.h:48
@ MR_FillingSurface_CellularSurface_Type_Rect
Definition MRFillingSurface.h:50
@ MR_FillingSurface_CellularSurface_Type_Cylinder
Definition MRFillingSurface.h:49
struct MR_FillingSurface_TPMS_MeshParams MR_FillingSurface_TPMS_MeshParams
Definition MRFillingSurface.h:44
MRC_API void MR_FillingSurface_TPMS_MeshParams_Destroy(const MR_FillingSurface_TPMS_MeshParams *_this)
Destroys a heap-allocated instance of MR_FillingSurface_TPMS_MeshParams. Does nothing if the pointer ...
MRC_API MR_Vector3f * MR_FillingSurface_CellularSurface_Params_GetMutable_width(MR_FillingSurface_CellularSurface_Params *_this)
MRC_API MR_FillingSurface_TPMS_MeshParams * MR_FillingSurface_TPMS_MeshParams_AssignFromAnother(MR_FillingSurface_TPMS_MeshParams *_this, const MR_FillingSurface_TPMS_MeshParams *_other)
MRC_API const float * MR_FillingSurface_CellularSurface_Params_Get_r(const MR_FillingSurface_CellularSurface_Params *_this)
MRC_API float MR_FillingSurface_TPMS_getMinimalResolution(MR_FillingSurface_TPMS_Type type, float iso)
MRC_API float * MR_FillingSurface_TPMS_VolumeParams_GetMutable_resolution(MR_FillingSurface_TPMS_VolumeParams *_this)
MRC_API void MR_FillingSurface_TPMS_MeshParams_Set_decimate(MR_FillingSurface_TPMS_MeshParams *_this, bool value)
MRC_API const MR_FillingSurface_CellularSurface_Type * MR_FillingSurface_CellularSurface_Params_Get_type(const MR_FillingSurface_CellularSurface_Params *_this)
MRC_API const MR_FillingSurface_CellularSurface_Params * MR_FillingSurface_CellularSurface_Params_OffsetPtr(const MR_FillingSurface_CellularSurface_Params *ptr, ptrdiff_t i)
struct MR_FillingSurface_CellularSurface_Params MR_FillingSurface_CellularSurface_Params
Definition MRFillingSurface.h:55
MRC_API void MR_FillingSurface_TPMS_MeshParams_Set_iso(MR_FillingSurface_TPMS_MeshParams *_this, float value)
MR_FillingSurface_TPMS_Type
Supported types of TPMS (Triply Periodic Minimal Surfaces)
Definition MRFillingSurface.h:24
@ MR_FillingSurface_TPMS_Type_ThickGyroid
Definition MRFillingSurface.h:28
@ MR_FillingSurface_TPMS_Type_ThickSchwartzP
Definition MRFillingSurface.h:26
@ MR_FillingSurface_TPMS_Type_DoubleGyroid
Definition MRFillingSurface.h:27
@ MR_FillingSurface_TPMS_Type_SchwartzP
Definition MRFillingSurface.h:25
@ MR_FillingSurface_TPMS_Type_Count
Definition MRFillingSurface.h:29
MRC_API float MR_FillingSurface_CellularSurface_estimateDensity(float period, float width, float r)
MRC_API MR_std_optional_float * MR_FillingSurface_CellularSurface_estimateWidth(float period, float r, float targetDensity)
MRC_API MR_FillingSurface_TPMS_VolumeParams * MR_FillingSurface_TPMS_VolumeParams_DefaultConstruct(void)
MRC_API const MR_FillingSurface_TPMS_MeshParams * MR_FillingSurface_TPMS_VolumeParams_StaticDowncastTo_MR_FillingSurface_TPMS_MeshParams(const MR_FillingSurface_TPMS_VolumeParams *object)
MRC_API float * MR_FillingSurface_TPMS_MeshParams_GetMutable_iso(MR_FillingSurface_TPMS_MeshParams *_this)
MRC_API void MR_FillingSurface_TPMS_MeshParams_Set_type(MR_FillingSurface_TPMS_MeshParams *_this, MR_FillingSurface_TPMS_Type value)
MRC_API MR_uint64_t MR_FillingSurface_TPMS_getNumberOfVoxels_MR_Mesh(const MR_Mesh *mesh, float frequency, float resolution)
MRC_API MR_FillingSurface_TPMS_VolumeParams * MR_FillingSurface_TPMS_VolumeParams_ConstructFromAnother(const MR_FillingSurface_TPMS_VolumeParams *_other)
struct MR_std_vector_std_string MR_std_vector_std_string
Definition MRPdf.h:29
Generated from class MR::Vector3f.
Definition MRVector3.h:47