41 Type type = Type::ThickGyroid;
42 float frequency = 1.f;
43 float resolution = 5.f;
46struct MeshParams : VolumeParams
98 Type
type = Type::Cylinder;
105 bool highRes =
false;
112 bool preserveTips =
false;
143using MeshParamsRef = std::variant
144 < std::reference_wrapper<TPMS::MeshParams>
145 , std::reference_wrapper<CellularSurface::Params>
148using ConstMeshParamsRef = std::variant
149 < std::reference_wrapper<const TPMS::MeshParams>
150 , std::reference_wrapper<const CellularSurface::Params>
155MR_BIND_IGNORE
MRVOXELS_API Expected<Mesh>
fill(
const Mesh& mesh, ConstMeshParamsRef params, ProgressCallback cb = {} );
167 [] (
const TPMS::MeshParams& p ){
return Vector3f::diagonal( 1.f / p.frequency ); },
#define MRVOXELS_API
Definition MRVoxelsFwd.h:14
Definition MRFillingSurface.h:97
new unsafe ref MR.Vector3f width
new unsafe ref MR.Vector3f period
new unsafe ref MR.FillingSurface.CellularSurface.Type type
Definition MRFillingSurface.h:47
Definition MRFillingSurface.h:40
Definition MRMesh/MRMesh.h:23
auto width(const Box< V > &box)
returns size along x axis
Definition MRMesh/MRBox.h:354
MRVOXELS_API float estimateDensity(float period, float width, float r)
Estimate the density of the cellular surface.
MRVOXELS_API Expected< Mesh > fill(const Mesh &mesh, const Params ¶ms, const ProgressCallback &cb={})
Fill given mesh with a cellular surface.
MRVOXELS_API std::optional< float > estimateWidth(float period, float r, float targetDensity)
MRVOXELS_API std::vector< std::string > getTypeNames()
Returns the names for each type of filling.
MRVOXELS_API Expected< Mesh > build(const Vector3f &size, const Params ¶ms, const ProgressCallback &cb={})
Build a cellular surface of size size.
MRVOXELS_API float estimateIso(Type type, float targetDensity)
MRVOXELS_API std::vector< std::string > getTypeTooltips()
Returns the tooltips for each type of filling.
MRVOXELS_API bool isThick(Type type)
Returns true if the type is thick.
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 float getMinimalResolution(Type type, float iso)
Returns minimal reasonable resolution for given parameters.
MRVOXELS_API Expected< Mesh > build(const Vector3f &size, const MeshParams ¶ms, ProgressCallback cb={})
Constructs TPMS level-set and then convert it to mesh.
MRVOXELS_API Expected< Mesh > fill(const Mesh &mesh, const MeshParams ¶ms, ProgressCallback cb={})
Constructs TPMS-filling for the given mesh.
MRVOXELS_API FunctionVolume buildVolume(const Vector3f &size, const VolumeParams ¶ms)
MRVOXELS_API float estimateDensity(Type type, float targetIso)
MRVOXELS_API std::vector< std::string > getTypeNames()
Returns the names for each type of filling.
Definition MRFillingSurface.h:12
ParamsFacade(MeshParamsRef) -> ParamsFacade< MeshParamsRef >
MRVOXELS_API std::vector< std::string > getKindNames()
MR_BIND_IGNORE MRVOXELS_API Expected< Mesh > build(const Vector3f &size, ConstMeshParamsRef params, ProgressCallback cb={})
Unified functions to build and fill using the specified filling structures.
MR_BIND_IGNORE MRVOXELS_API Expected< Mesh > fill(const Mesh &mesh, ConstMeshParamsRef params, ProgressCallback cb={})
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:29
A helper to access parameters common for different kind of surfaces.
Definition MRFillingSurface.h:161
Vector3f getPeriod() const
Definition MRFillingSurface.h:164
T params
Definition MRFillingSurface.h:162
static MR.Vector3f diagonal(float a)
Definition MRMeshFwd.h:774