[OpenSCAD] Evaluating imported STL's

Parkinbot rudolf at parkinbot.com
Wed Jun 15 08:07:24 EDT 2016

lhartmann wrote
> If all you need to know is IF 2 objects are colliding, then you may use
> intersection(), export via commandline, and check for a non-empty
> resulting
> STL (filesize maybe?).

This could work, but I doubt OpenSCAD will export an empty STL. So you'd
have to catch some error, which is viable. 

There is also a fast heuristic way to do a batched collision test, with no
extra rendering involved 
- count the number of vertices v_i and faces f_i in all ingoing STLs and
v_a, f_i of the combined STL. 
- test for sum(v_i) != v_a && sum(f_i) != f_a

Its heuristic, because depending on your problem, there might be a *very*
small probability to get a false result. This is, when two shapes intersect
and have the same number of vertices AND faces.  

View this message in context: http://forum.openscad.org/Evaluating-imported-STL-s-tp17682p17688.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

More information about the Discuss mailing list