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
37
43
50
53
54// Different kinds of filling surface
60
65
70
74
75// Type of the surface
80
81// Type of the surface
85
86// Type of the surface
91
92// Frequency of oscillations (determines size of the "cells" in the "grid")
97
98// Frequency of oscillations (determines size of the "cells" in the "grid")
102
103// Frequency of oscillations (determines size of the "cells" in the "grid")
108
109// Ratio `n / T`, between the number of voxels and period of oscillations
114
115// Ratio `n / T`, between the number of voxels and period of oscillations
119
120// Ratio `n / T`, between the number of voxels and period of oscillations
125
129
134
138
141
144
149
153
158
161
164
170
175
179
184
189
193
198
202
207
210
213
217
220
225
228
231
237
246
254
262
266MRC_API MR_uint64_t MR_FillingSurface_TPMS_getNumberOfVoxels_MR_Mesh(const MR_Mesh *mesh, float frequency, float resolution);
267
272
278
284
288
294
299
305
311
316
322
328
333
339
345
350
356
357// used in tests in order to make surfaces close to their analytical expression
358// recommended to be false for real usage for better performance
363
364// used in tests in order to make surfaces close to their analytical expression
365// recommended to be false for real usage for better performance
369
370// used in tests in order to make surfaces close to their analytical expression
371// recommended to be false for real usage for better performance
376
377// Used in tests for roughly the same purpose: the computations of density estimation are made under the assumption of an infinite surface.
378// Thus, we must impose "boundary conditions" that inflict the "tips" of the bars (cylinders or cubes) to be preserved on the boundary of the
379// 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.
380// Note that for the estimation of density in UI the influence of "tips" is not significant (it tends to zero with growing size), however
381// we cannot afford to run tests on too big surfaces as it takes too long.
386
387// Used in tests for roughly the same purpose: the computations of density estimation are made under the assumption of an infinite surface.
388// Thus, we must impose "boundary conditions" that inflict the "tips" of the bars (cylinders or cubes) to be preserved on the boundary of the
389// 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.
390// Note that for the estimation of density in UI the influence of "tips" is not significant (it tends to zero with growing size), however
391// we cannot afford to run tests on too big surfaces as it takes too long.
395
396// Used in tests for roughly the same purpose: the computations of density estimation are made under the assumption of an infinite surface.
397// Thus, we must impose "boundary conditions" that inflict the "tips" of the bars (cylinders or cubes) to be preserved on the boundary of the
398// 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.
399// Note that for the estimation of density in UI the influence of "tips" is not significant (it tends to zero with growing size), however
400// we cannot afford to run tests on too big surfaces as it takes too long.
405
409
414
418
421
424
429
432
435
441
446
455
464
467MRC_API float MR_FillingSurface_CellularSurface_estimateDensity(float period, float width, float r);
468
471// Due to the simplification of the formula (sphere must either fully contain the intersection of cylinders or be inside it), solution not always exists.
475
479
480#ifdef __cplusplus
481} // extern "C"
482#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:17
struct MR_Mesh MR_Mesh
Definition MRCtm.h:12
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:36
MRC_API const MR_FillingSurface_TPMS_MeshParams * MR_FillingSurface_TPMS_MeshParams_OffsetPtr(const MR_FillingSurface_TPMS_MeshParams *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_FillingSurface_CellularSurface_Params * MR_FillingSurface_CellularSurface_Params_DefaultConstructArray(size_t num_elems)
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_CellularSurface_Params_Set_preserveTips(MR_FillingSurface_CellularSurface_Params *_this, bool 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:56
@ MR_FillingSurface_Kind_TPMS
Definition MRFillingSurface.h:57
@ MR_FillingSurface_Kind_Cellular
Definition MRFillingSurface.h:58
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 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)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
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)
Upcasts an instance of MR::FillingSurface::TPMS::MeshParams to its base class MR::FillingSurface::TPM...
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)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
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)
MRC_API const MR_Vector3f * MR_FillingSurface_CellularSurface_Params_Get_period(const MR_FillingSurface_CellularSurface_Params *_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)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_FillingSurface_TPMS_MeshParams * MR_FillingSurface_TPMS_MeshParams_ConstructFromAnother(const MR_FillingSurface_TPMS_MeshParams *_other)
MRC_API const MR_FillingSurface_TPMS_VolumeParams * MR_FillingSurface_TPMS_VolumeParams_OffsetPtr(const MR_FillingSurface_TPMS_VolumeParams *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MR_FillingSurface_CellularSurface_Type
Type of cellular surface base element.
Definition MRFillingSurface.h:46
@ MR_FillingSurface_CellularSurface_Type_Rect
Definition MRFillingSurface.h:48
@ MR_FillingSurface_CellularSurface_Type_Cylinder
Definition MRFillingSurface.h:47
struct MR_FillingSurface_TPMS_MeshParams MR_FillingSurface_TPMS_MeshParams
Definition MRFillingSurface.h:42
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)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
struct MR_FillingSurface_CellularSurface_Params MR_FillingSurface_CellularSurface_Params
Generated from class MR::FillingSurface::CellularSurface::Params.
Definition MRFillingSurface.h:52
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 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
MR_PassBy
Definition common.h:19
uint64_t MR_uint64_t
Definition common.h:14
struct MR_FunctionVolume MR_FunctionVolume
Definition expected_MR_FunctionVolume_std_string.h:12
#define MRC_API
Definition exports.h:11
size_t size() const
Definition MRVector3.h:50