To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 12713
12712  |  12714
Subject: 
Re: Make Small BOMs
Newsgroups: 
lugnet.cad
Date: 
Mon, 23 May 2005 22:14:11 GMT
Viewed: 
806 times
  
When LPub is doing PLI's it sorts all the parts by width, and drops the widest
part in the first column (bottom of the PLI).  The width of this part defines
the column width.

From there it tries to add part(s) to the next row within the column, starting
with the widest unplaced part.  If a part is narrower than (or equal to) the
column width then the part is placed into the column.  If there are no parts
that fit unto the column, we start on a new column with the widest unplaced
part.

So LPub allocates rows and columns.


<snip>

So PLIs can be packed pretty densly, but still maintain some sort of column/row
motif.

That's essentially what my algorithm does but I give the bias to whichever side
will make the biggest new area rather than basing it on a specific preference.

I used to allow BOMs to be placed just like PLIs, and they became *very* dense,
but they lacked any sense of order.  If I tried to use the BOM to walk over to
my sorted collection and pick out all the parts, the picking was very
haphazzard.

Although there's no particular reason for it to happen, my algorithm does seem
to group parts to some degree. I suspect it's more fluke than anything
though(to do with the spaces left over with the particular parts collections).

Mindstorms' Bill Of Materials were sorted by part type, then width.

I was actually somewhat inspired by the parts collections you see on the side of
tubs. On those the parts seem to be more jumbled.

LPub sorts the BOM parts list by part type and then part width.  It also
restricts placement to rows and columns, not allowing subcolumns or subrows.
This makes the BOM easy to work with, but leaves it not packed as densly as if
it were treated as a PLI.

I'm adding a new meta-command to control the sort type, and allow/disallow
subcols/subrows.

That would be great. I much prefer the compact lists but I can understand if
people (particularly technic-heads) would prefer the simple column/row format.

*** But *****

<snip>

Notice that this leaves two triangles unallocated at the bottom and top of the
column.  We can further allocate subrows and subcolumns in these triangles.

I want to enhance LPub to pack parallelograms rather than rectangles, but I'm
very open to other ideas too.

I wanted to do this one too. Of course once you clip the paralellograms (perhaps
by choosing an angle based in an ad-hoc way from the projection angle?) then the
packing problem is identical to the rectangle packing but with a sort of diamond
shape like this

     __
   _|  |
_|     |
|AAAAAAAA|
|AAAAAAAA|
|AAAAAAAA|
|    _|
  |__|

which can be packed as a big rectangle A followed by the other smaller
rectangles.

Another idea I had was generating an ldraw file with all the parts arranged as
above and just rendering the whole thing and then adding the part counts to
where they should be. If the parts were spaced far enough apart and the
light-source placed above there shouldn't be any shadowing problems either.

Thanks a lot for the feedback by the way. It's really interesting hearing about
your algorithms etc.

Tim

PS. It would be neat to have the parts counts appear as Lego tiles with the
correct numbers in my ldraw method. A new project perhaps!



Message has 1 Reply:
  Re: Make Small BOMs
 
(...) You know, I think Kevin and I were discussing this not too long ago. I vaguely remember something about using the (URL) minkowski sum> on the alpha channel of the png files. But I don't remember exactly what for. Anyhow, there's a nifty applet (...) (20 years ago, 24-May-05, to lugnet.cad, FTX)

Message is in Reply To:
  Re: Make Small BOMs
 
(...) Very cool! Welcome to the fold. (...) When LPub is doing PLI's it sorts all the parts by width, and drops the widest part in the first column (bottom of the PLI). The width of this part defines the column width. From there it tries to add (...) (20 years ago, 22-May-05, to lugnet.cad)

8 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR