To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 7807
7806  |  7808
Subject: 
Re: dragNdrop (Was: Ldglite must be faster)
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 10 Sep 2002 02:51:17 GMT
Viewed: 
1115 times
  
I don't exactly have an algorithm for "spread out parts", all I really have
done is to find an empty spot when dropping one part. Along a line collect
up the intersection of all bounding boxes of other parts; find an interval
that your part fits into. That works for dropping one part downward to a
baseplate, or scooting it on a line. (I actually collect up a list of all
coordinate intervals where another part intrudes on a rectangular volume
"airspace"; mine is O(N) but XY search algorithms should be O(log N). See
Preparata.)

That said, a real nice algorithm would make a round pile of parts. This
could be done randomly or systematically. Given: a point the drop takes
place. A random approach would drop the part at the given point, then
randomly jog it outward until it came to rest in an empty space. A certain
amount of buffer space between pieces could be specified. A systematic
approach might resemble a Graham scan (convex hull) wherein each part laid
down is sorted by subtended arc, and a new piece is placed in an arc chosen
by least density, and scooted outward as needed. (This needs more thought.)

The random approach might resemble dendritic growth fractals, and might tend
to fill a square, depending on your choice of random. The systematic
approach might be consistently lopsided.

Of course I'm intrigued by "Lego" and "Fractal" mentioned together...

There, I've published the two methods. Now nobody can patent them.

-Erik



Message is in Reply To:
  Re: dragNdrop (Was: Ldglite must be faster)
 
(...) I examined the source (aren't you glad you posted it) and now I can drag in a part from LDList (cool!), but I'm still not sure about the rest of the 'protocol'. What's the point of the X and Y coordinates? And is it the empty message that (...) (22 years ago, 9-Sep-02, to lugnet.cad, lugnet.cad.dev)

39 Messages in This Thread:















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

Custom Search

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