Skip to content

Commit

Permalink
Update citlist interface to pack2
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesBremner committed Jun 30, 2020
1 parent 5d09b07 commit 51bd358
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
12 changes: 12 additions & 0 deletions src/TimberAllocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,24 @@ bool CS2Pack2(
cInstance& I,
cLevel& level, int h );

/** Record a cut for an order in the instance
@param[in] I the instance
@param[in] stock order is cut from
@param[in] order being cut
@param[[in] length position
@param[[in] width position
@param[[in] height position
*/
void CutOrder(
cInstance& I,
timber_t& stock,
timber_t& order,
int length, int width, int height );

/** Record the V cut for a level in the instance
@param[in] I the instance
@param[in] level
*/
void CutLevel(
cInstance& I,
cLevel& level );
Expand Down
19 changes: 15 additions & 4 deletions src/taCutter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,26 +310,37 @@ bool CS2Pack2(
return false;
}

auto binList = RawCutList( E )[0];
for( auto& c : binList )
// output the cuts

/* Loop over cuts in level
The pack2 engine returns a vector of vectors, one for each bin
There is only one bin, the level,
so we need only look at the first vector of cuts
*/
for( auto& c : CutList( E )[0] )
{
// add to cutting list

char LW;
if( c.myIsVertical )
{
// vertical cuts in pack2 ( which is 2d ) are orthogonasl to the length dimension in 3D
LW = 'L';
}
else
{
// horizontal cuts in pack2 ( which is 2d ) are orthogonasl to the width dimension in 3D
LW = 'W';
}

// construct a 3D cut
cCut cut(
level.myStock,
LW,
c.myIntercept,
h );
//std::cout << cut.text() << "\n\n";

// add it to the instance cut list
I.myCut.push_back( cut );
}

Expand Down

0 comments on commit 51bd358

Please sign in to comment.