31 virtual void init(
const Box3f& thisBox ) = 0;
#define MRMESH_API
Definition MRMeshFwd.h:80
#define MRMESH_CLASS
Definition MRMeshFwd.h:87
class to override box nesting metrics
Definition MRBoxNesting.h:26
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:753
const std::vector< Box3f > * preNestedVolumes
if not-nullptr contains boxes that are fixed in the nest and should not be intersected by floating (i...
Definition MRBoxNesting.h:71
BoxNestingOptions options
Definition MRBoxNesting.h:87
bool allowRotation
set false to keep original XY orientation
Definition MRBoxNesting.h:52
Expected< Vector< NestingResult, ObjId > > boxNesting(const Vector< MeshXf, ObjId > &meshes, const BoxNestingParams ¶ms)
finds best positions of input meshes to fit the nest (checks them by contacting box corners)
Vector3f pos
Vector3f - corner position.
Definition MRBoxNesting.h:19
virtual double complete() const =0
finalize priority and return the value (more - better)
const std::vector< BoxNestingCorner > * additinalSocketCorners
user might force these sockets to be considered as corners for placing candidates
Definition MRBoxNesting.h:74
std::shared_ptr< IBoxNestingPriority > getNeighborigDensityPriorityMetric(const Box3f &nest, float neighborhood)
priority metric that maximizes density of placement in local neighborhood
uint8_t bitMask
corner mask 0bZYX (0b000 - lower left corner, 0b111 - upper right)
Definition MRBoxNesting.h:21
std::shared_ptr< IBoxNestingPriority > priorityMetric
Definition MRBoxNesting.h:65
bool allow3dNesting
if true allows placing objects over the bottom plane
Definition MRBoxNesting.h:49
tl::expected< T, E > Expected
Definition MRExpected.h:31
bool volumeBasedOrder
if true - nests objects in the order of decreasing volume, otherwise nest in the input order
Definition MRBoxNesting.h:55
virtual void init(const Box3f &thisBox)=0
init priority calculation with box of placed object
Expected< void > fillNestingSocketCorneres(const std::vector< Box3f > &nestedBoxes, std::vector< BoxNestingCorner > &outCorners, const ProgressCallback &cb={})
int iterationLimit
limit maximum number of tries, not to freeze for too long in this function
Definition MRBoxNesting.h:61
std::shared_ptr< IBoxNestingPriority > getNestPostionMinPriorityMetric(const Box3f &nest)
priority metric that minimizes position of new object by Z->Y->X coordinate in nest
virtual ~IBoxNestingPriority()=default
ProgressCallback cb
callback indicating progress of the nesting
Definition MRBoxNesting.h:77
const Vector3f * expansionFactor
optional input expansion of boxes (useful to compensate shrinkage of material)
Definition MRBoxNesting.h:68
bool checkLessCombinations
reduces nesting candidate options for speedup
Definition MRBoxNesting.h:58
NestingBaseParams baseParams
Definition MRBoxNesting.h:86
virtual void addNested(const Box3f &box)=0
accumulate priority by one of already nested boxes
Definition MRNesting3mfExport.h:20
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRBoxNesting.h:17
Definition MRBoxNesting.h:47
Definition MRBoxNesting.h:85
Definition MRNestingStructures.h:33