Parametric design in MoI?

 From:  mkdm
7713.527 In reply to 7713.526 
Hi everyone,

Thanks a lot James for your appreciation.

Damn "recycle bin" and "overwrite" !!
I tried also to use some recovery tools but without success...it's been too long....

Anyway, here's just some info in the case of someone wants to write something similar.

I was writing these nodes :

code:
"ArrayDistinct" node :

Input : A PointArray[], a DELTA (a javascript float number) and a PRECISION (a javascript int number) 

Output : a new PointArray[] containing all the "DISTINCT" PointArray elements found in the source PointArray[].

All the PointArray elements of the source, far from each other, NOT MORE THAN DELTA (considering the required PRECISION)
are WELDED into a SINGLE PointArray element, that is, the element currently investigated (simple "For loop" with some flags to mark already processed elements).



code:
"ArrayBoolean" node that did exactly what its name means : Basic boolean operations between two PointArray[] objects.

More in depth, it provided these operations :

1) Array Union : 
Input : Two PointArray[] (named "A" and "B") also with different amount of elements, a DELTA (a javascript float number) and a PRECISION (a javascript int number) 

Output : a new PointArray[] containing all the "DISTINCT" PointArray elements of both arrays.

All the PointArray elements of "A" and "B" far from each other, NOT MORE THAN DELTA (considering the required PRECISION)
are WELDED into a SINGLE PointArray element.

2) Array Difference : 
Input : Two PointArray[] (named "A" and "B") also with different amount of elements, a DELTA (a javascript float number) and a PRECISION (a javascript int number) 

Output : a new PointArray[] containing all the PointArray elements of "A" that are NOT PRESENT in "B".

All the PointArray elements of "A" that are far from each "B" elements, for AT LEAST DELTA (considering the required PRECISION)
are returned into the output PointArray[].


I don't know if I made myself clear..

It's really too bad that "ArrayDistinct" and "ArrayBoolean" node that I was writing were lost because they were at and advanced alpha stage,
and from many tests I did they seemed to be very powerful for interesting elaborations in order to create some "exotic" nurbs objects.

Anyway, I must also say that they have been written with a very coarse businnes logic, and crunching more than some hundreds of PointArray elements,
produced very poor performances.


Have a nice day,

- Marco (mkdm)