Surprizing things about MOI3D that you learn by teaching it.
 1  2-21  22-41  42-51

Previous
Next
 From:  James (JFH)
10982.42 In reply to 10982.41 
Mo,

quote:
sometimes it's more convenient to write a node than to finding it.
That made me laugh:)
quote:
My "Extract" node is a completely different node. :)
You have the correct Basic/Extract node, however it is a multi-function node. The numArray operations may be accessed by Right Button Clicking on the title bar. See below


There are a number of these multi-function nodes: Basic/Lenght for example.

quote:
I couldn't find "rectangle2" node.
I have attached below. Also attached are Circle2, Polygon2 & Star2

James
https://www.instagram.com/nodeology/

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  MO (MO_TE)
10982.43 In reply to 10982.42 
You are right. I had not noticed that.
I've changed the extract node to add "sum" function.

Also thanks for attached nodes. :)
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  James (JFH)
10982.44 In reply to 10982.43 
Thanks Mo,
quote:
I've changed the extract node to add "sum" function.

I installed "Extract.js", quit & reopened Moi then NE & numArray Options on Extract node, but "Sum" option did not appear.
This is despite that function Extract() within Extract.js should overwrite previous version in Basic.js
Nevertheless I tried commenting out function Extract() in basic.js, but still no "Sum" option.

Thinking that it may be a caching issue, I restarted the computer, but no luck.
Any idea what could be the issue?

James
https://www.instagram.com/nodeology/
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  MO (MO_TE)
10982.45 In reply to 10982.44 
"extract" function exists in "basic.js" and "basic2.js" files
"basic.js" line : 448
"basic2.js" line 149
They overwrite "extract" node.
Try commenting out "extract" function in "basic2.js" file as well.
Or just manually modify them.
I've changed this line:
code:
this.local = {pointarray:["X", "X", "Y", "Z", "rX", "rY", "rZ", "Scale"], numarray:["Min", "Min", "Max", "Average"]};

To this:
code:
this.local = {pointarray:["X", "X", "Y", "Z", "rX", "rY", "rZ", "Scale"], numarray:["Min", "Min", "Max", "Average", "Sum"]};

and added this line:
code:
case 4:	o = 0; for ( i = 0; i<inp.length; i++) o += inp[i]; break;

after this line:
code:
case 3:	o = 0; for ( i = 0; i<inp.length; i++) o += inp[i];	o /= inp.length; break;
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  James (JFH)
10982.46 In reply to 10982.45 
quote:
Try commenting out "extract" function in "basic2.js" file as well.

Of course this was the solution.
It hadn't occurred to me that there was a second version of function Extract() in basic2.js as well.
Thanks MO

James
https://www.instagram.com/nodeology/

PS I had a go at adding a couple more option for deriving numerical results from a numArray: Median and Mode.
unfortunately this was beyond me. Anyway I don't know how useful these would be, but if you are interested (& only if you are) maybe you could have a crack at it.

EDITED: 29 Mar 2023 by JFH

Image Attachments:
Size: 102.8 KB, Downloaded: 12 times, Dimensions: 924x548px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  MO (MO_TE)
10982.47 In reply to 10982.46 
Hi James
I'm not good at math, and I've never used "median" and "Mode".
but I did some research.
I added the "median" and "Mode" option.
take a look.
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  James (JFH)
10982.48 In reply to 10982.47 
Thanks Mo,
quote:
I added the "median" and "Mode" option. take a look.

Yes that works brilliantly. On small thing: Mode only works for unimodal arrays, ie it only outputs first occurring mode if there are multiple similar occurrence of numbers within an array. Also it outputs the first number if no mode is found. Solving this is likely more effort than is warranted for an application that will be rarely required. Maybe it would be all-round easier to just remove the "Mode" option.


I have been having a play with your other recent node contributions. I wonder if you could post a demonstration of your Points/CoordinateFrames node in use. I was unable to work out how it functions, and how it might be applied.

In the course of this experimentation I was reminded of a much needed, yet missing functionality for NE. The arrayExt/idxSelect node is supremely useful, but it could be made even more so by having the option to invert the selection. See above.

Say you have an numArray : 6,7,8,9,10 and an index input: 0,2,4 with "Invert Selection" option the output would be: 7,9
And it would operate similarly for points and objects.

Certainly this is a need that arises often, whereas the finding the mode of an array is a rather arcane requirement.

Have a great weekend
James
https://www.instagram.com/nodeology/

EDITED: 31 Mar 2023 by JFH

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  MO (MO_TE)
10982.49 In reply to 10982.48 
Hi James
About "mode" option: Yes, I see it works for first mode number.
I'll find a better way to solve this later.
Actually, I decided that "mode" option would return the first input number if there is no mode number.
(having no output causes "Display" node to error)
But if you don't need that, it is as easy as changing this line:
code:
var item = array[0];

to this:
code:
var item ;


I think changing "idxSelect" node to have an inverse mode is possible, But I need to study the code more.

Although I was working on a new node to kinda solve this problem. I called it "FilterArray" node!
I was going to post it, But you were quicker. :)
It searches through an array of numbers and outputs filtered/unfiltered numbers and their indices.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  MO (MO_TE)
10982.50 
"FilterArray" node
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  TMeeks
10982.51 In reply to 10982.49 
I am VERY happy with the direction this thread took.

I am learning tons.

Thanks to all of you that are posting Node information.

Tom
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages:  1  2-21  22-41  42-51