LDCad script integration of LDInspector's collision detection


RE: LDCad script integration of LDInspector's collision detection
#5
(2022-07-09, 7:33)Stefan Frenz Wrote: Hi all,

inspired and motivated by this thread, I tried to port the collision detection algorithm of LDInspector to LDCad / Lua. Thanks to Roland and his massive support I have a first version running that seems to not crash immediately. Wink

In the attached example TestMini there are three collisions:


Running the collision detection coloring macro, it marks all colliding parts correctly:


Having some parts in sub-models like in TextMiniSub, the macro marks the parts in the sub-models recursively which may lead to spurious false-collisions. I'm working on some kind of work-around by (a) adding collision indicators instead of coloring the parts or (b) creating a new flat file which then allows individual coloring of parts.


If you are interested in the still-very-beta-proof-of-concept-script, it is attached as txt file - just rename to lua and copy it do LDCad-1-7-Alpha-2/scripts/default/global/ directory. You will need LDCad 1.7 Alpha 2 or later - thanks again to Roland for providing all needed functions. Smile Please do not run the collision detection with too many parts as the time will increase squared to the number of parts. Running this small example with 15 parts already requires 32ms on may machine and the default maximum macro runtime is 250 ms which leads to a maximum of about 40 parts without prolonging the macro execution time.

I will try this...
Jaco van der Molen
lpub.binarybricks.nl
Reply
« Next Oldest | Next Newest »



Messages In This Thread
RE: LDCad script integration of LDInspector's collision detection - by Jaco van der Molen - 2022-08-31, 13:16

Forum Jump:


Users browsing this thread: 1 Guest(s)