Utility Scripts for analysis : FilterCurvesByLength

 From:  mkdm
8608.1 
Hi Michael and everyone.

After a long conversation with Michael, started at http://moi3d.com/forum/index.php?webtag=MOI&msg=8604.4,
about the chance and the way of trying to write some script for curves and surfaces analysis (altougth the latter is much more difficult),
and the way to do that keeping a decent execution time, even for a decent amount of objects (let's say more than 10000),
yesterday I've written this little script.

This script, starting from the selected curves, filter them by their length and automatically select them.

Please keep in mind this consideration when using it :

1) It is the very first alpha version

2) For the moment it processes only curves. As you can see in the picture, I've already prepared the UI to manage other kind of filtering,
but for the moment, these flags are not active.

3) The code itself is very simple and it has not particular optimization.
I only executes a simple pre-calculation of the length of the selected curves and stores the data into a "proxy" array,
so in this way the script execution is much faster in realtime, when you drag the sliders.
Later on I want to add at least a sort and binary search of the array.

4) it seem that only sliders works.
I mean that if you enter a value in the numeric fields and press the enter key, nothing happens.
I don't know why this happens.
If someone knows how to manage the manual numeric input for fields please tell me :)


I hope that this is a very first script of a series of script that I wish to write for simple analysis purposes (curve length and surface area).

This is the script file, place it into "Commands" folder : http://take.ms/Ol5BM

This is a brief demo video : http://take.ms/0PMQ9

As you can see with my pc (i7-7700K 4.2-4.5 Ghz 32GB Ram DD4 3000 and Gtx 1080 Ti) the performance in realtime is very satisfying.

The scene has 30.000 control point curves.

This is the screen capture :



Bye!

- Marco (mkdm)