You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ok, i did it in a clumsy way. Because the methods have the same signature I changed the name a little. Trying to decide wich method is less worst. Use a input flag or repeating the mehod body just using correct template inputs.
long bl_nest(std::vector<Item*> items, Box bin, long dist=1, BottomLeftConfig config = BottomLeftConfig());
%MethodCode
if (a2<=0){
a2=1;
}
//Pre-process items.
std::vector<Item> to_arrange;
to_arrange.reserve(a0->size());
for(Item* item : *a0)
{
to_arrange.push_back(*item);
}
//Pre-process config.
NestConfig<BottomLeftPlacer, FirstFitSelection> nest_config(*a3);
//NestConfig wraps a placer and selector config. Only with the default selector there is no config, so just the placer then.
std::vector<Item> out_arrange;
out_arrange.reserve(a0->size());
for(Item* item : *a0)
{
out_arrange.push_back(*item);
}
sipRes = nest<BottomLeftPlacer, FirstFitSelection>(to_arrange, *a1, a2, nest_config);
for(size_t i = 0; i < a0->size(); ++i)
{
*(a0->at(i)) = to_arrange[i];
}
%End
Hi everyone
If I want to use BottomLeftPlacer I need to chance pynest2d.sip and rebuild the package or there's another way?
Can someone provide a brief code to explain how to use other placers?
The text was updated successfully, but these errors were encountered: