MoI discussion forum
MoI discussion forum

Full Version: Nodebundle for playing with nodes

Show messages:  1-5  …  1386-1405  1406-1425  1426-1445  1446-1465  1466-1485  1486-1505  1506-1525  …  1846-1859

Thread Split: Some posts in this thread have been moved here

From: James (JFH)
6 Apr 2019   [#1446] In reply to [#1445]
Hi Michael,

Was this always on the cards, or is it in response to my enquiries regarding face centroids?
If it is the latter, I don't know what to say.....but thank you.

Well, either way
thank you.

James
https://www.instagram.com/nodeology/
From: Michael Gibson
6 Apr 2019   [#1447] In reply to [#1446]
Hi James, well it's been something I've been planning on adding for some time now but your particular request about it bumped it up!

One thing that tends to make me hesitate in this area is that once script interfaces are added it becomes pretty difficult to change them since there gets to be various things depending on it. So if I mess it up it's something that easily stays messed up for kind of a long time... But here the equivalent is already in there for curves so I can follow the same structure for faces too.

- Michael
From: bemfarmer
6 Apr 2019   [#1448]
It is a rain day, so from 6:30 AM to 8 AM, some initial centroid work was done.
A break is now required, so here is some non-functional code :-)

The task is so easy to understand, yet so hard for this slow amateur programmer to code... :-)

The non functional draft node can be copied to the nodeeditor extension folder, to add it to the construct2 menu.
The node may then be selected from the construct2 menu, and the node is displayed, but does not function further.

- Brian

Bogging down again, so 2nd break...got to go do some work...
From: bemfarmer
7 Apr 2019   [#1449] In reply to [#1448]
Draft3, non functional, but getting closer
(completely untested)

Using both start and end points of each subobject, so length *= 2.
Planar poly, but with z coordinates, needs zsum/(length*2)

- Brian
From: bemfarmer
7 Apr 2019   [#1450] In reply to [#1449]
Draft4, a little progress made, but node is still broken.
From: bemfarmer
8 Apr 2019   [#1451] In reply to [#1450]
Alert messages were added to see what is going on, or not going on.
I left off the () for getStartPt()...
 
- Brian
From: bemfarmer
8 Apr 2019   [#1452] In reply to [#1451]
Here is an early beta version, which actually works in the xy plane, for 3+ planar poly objects.
Further testing needed.
Test 2D polys in 3D space, Poly triangles of portion of an icosahedron, is working.

Copy CentroidNode.js to nodeeditor\nodes\extensions folder.

For Testing, open Ico5Poly.3dm, of color Orange.
Also Load PolyCentroidNodeTest3.nod into nodeeditor, or some other test .nod, and Run it.

The extra point at the origin is to be investigated. EDIT, the pointarray centroidPt (pink node dot and pink wiring), is defective. (Should not be curve mode either.)

- Brian

Earlier a strange effect occurred. An icosahedron was loaded from Obj Library. 15 edges of 5 side faces were joined to form 5 polygons. Did a 2X scale of, and moved, the "Ico5Poly"
Icosahedron was deleted.
Running the CentroidNode found the centers of the Ico5Poly, But strangely also caused the orange icosahedron to re-appear.

Edit: See post 1456 for beta3.

Attachments:
IcosahedronPolyPortionTest.zip


Message 7777.1453 was deleted


From: bemfarmer
8 Apr 2019   [#1454] In reply to [#1453]
Thank you James.
It is easy enough to modify CentroidNode.js to load in the Points2 menu,
or else to just copy paste the code to the Points2 menu, minus a very few characters at beginning and end of CentroidNode.js.

I'm not sure how easy it is to convert from faces to polygon outline with miscellaneous nodes. Or if the CentroidNode should have face to edges to polygon feature added, along
with the next MoI Beta, pending Michaels upcoming surface.isPlanar property, as per previous posts.

The pink centroidPt output is still broken...AFAIK.

The script has barely been tested...

Might as well add circle and ellipse?

- Brian

Integration for closed curves centroids is still a dream:-)
From: James (JFH)
8 Apr 2019   [#1455] In reply to [#1454]
Brian,

>> Might as well add circle and ellipse?.....
Integration for closed curves centroids is still a dream:-) <<

Centroid for these shapes can be can be found by using subD/convertCurveToPoly node
before centroid node. Obviously the higher the "Div Profile" the more accurate.
For circles, any even number (except 0) input to "Div Profile" will give true centre.


For now I think your work is done here. I'd just remove centroidPt output socket.

I'm not saying it is not worth spending any more time on it, just that it good enough for now.
If you are keen to keep coding, in term of outcomes it would be better to investigate other possible nodes.
To this end, I have a suggestion, if you are interested: FATLINES.

A Fatlines node analogous to Max's scripts of the same name would be a real boon IMHO to NE.
Think islamic patterns, for example. Anyway its just a thought.

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

Image Attachments:
closedCurves.gif 


From: bemfarmer
9 Apr 2019   [#1456]
CentroidNodeBeta003

The file is still in its own .js node wrapper, but has been moved to the Points2 menu. (not the Points2.js file, which could/should be done.)
So after placing beta003 in the extensions folder, if the node appears red in your .nod program, replace the node with the one from the Points2 menu.

Also fixed the raw centroid point(s) output (Pink) with the proper code, as shown in Objects.js/ObjtoArray node. (output2.pushPoint(cPtObj.item(0).pt);)
(Just use either the centroidObj point output, or the pink output, to avoid duplicate points...)

Note that Max's cVolume2 script finds centers of gravity for one extruded closed planar object, including extruded curved closed planar objects.
It seems to be a very long script.

Will look at FatLines.

- Brian

Attachments:
CentroidNodeBeta003.zip
PolyCentroidNodeTest4.zip


From: James (JFH)
10 Apr 2019   [#1457]
Just for a bit of Conic Relief



Node circuitry images post to: https://www.instagram.com/nodeology/

James

NE folder can be found here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=9358.1

Attachments:
ConicRelief.nod

Image Attachments:
ConicRelief.jpg 


From: Frenchy Pilou (PILOU)
10 Apr 2019   [#1458] In reply to [#1457]
Cool image for Bees! (and for enlight users about subject of Nodes ! ;)

Sorry I have no times for the moment manage all nodes for a years! :(
From: bemfarmer
10 Apr 2019   [#1459] In reply to [#1457]
Hi James,
Do you have a link to "WaveSurf"?

For your old ProjectSurf.nod, replacing red Project node with Construct1/ProjectMP enabled the .nod to run.

- Brian

Your old paraSurf.nod has a couple of red nodes...in the copy I have.
From: James (JFH)
10 Apr 2019   [#1460] In reply to [#1459]
Brian,

>> Do you have a link to "WaveSurf"? <<

"WaveSurf" is a macro. I have attached nod file to previous post, so macro can be found within.
I had not included before, because there was nothing really new here in terms of technique. It was done specifically to post to instagram, to keep the page fresh.>> Your old ProjectSurf.nod....[&]....paraSurf.nod has a couple of red nodes..<<

All these macro need to be reworked. I don't know that any of them are worthy of dissemination. I only used "WaveSurf" and "B-Hive Grid" for that matter, due to laziness.

,>> Will look at FatLines. <<

Did you get a chance to study Max's script?

Anyway, keep up the good work
James
https://www.instagram.com/nodeology/
From: bemfarmer
10 Apr 2019   [#1461] In reply to [#1460]
James, thank you for WaveSurf macro.

I've looked at FatLines a little, and spread out, to line items, the functions shown scrunched into condensed paragraphs.

I see offset or flow, boolean union, scale1d, and still have to "decipher"/"understand" Max's code. :-)
Max is such a skilled programmer! There seems to be a lot going on...

I think that I will start converting bits of the code..., and fill in gaps in understanding...

- Brian

Message 7777.1462 was deleted


From: Frenchy Pilou (PILOU)
12 Apr 2019   [#1463] In reply to [#1462]
Cool !
I suppose you know that : https://www.etereaestudios.com/docs_html/isfahan_htm/isfahan_index.htm

and this facinated site! http://www.tamabi.ac.jp/idd/shiro/muqarnas/default.htm

and other cool things https://www.ics.uci.edu/~eppstein/junkyard/penrose.html

http://www.dartmouth.edu/~matc/math5.pattern/syllabus.html (Click Art Part section)

http://www.protozone.net/AJinteractives1.html
From: James (JFH)
16 Apr 2019   [#1464]
I was inspired by this image (top) to see if I could generate a buildable structure in NE.

All the plank elements are indeed straight (ie the bow from flow to surface has been removed).
However it is not quite there yet, because the plank thickness varies. They will need to be uniform thickness to make structure fabrication viable. Anyway it is a start.

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



NE folder can be found here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=9358.1

Attachments:
hexPav.nod

Image Attachments:
hexPav.jpg 


From: Anthony (PROP_DESIGN)
16 Apr 2019   [#1465] In reply to [#1464]
wow very cool, useful, and ambitious. I hope you figure it out. Certainly a challenge.

Show messages:  1-5  …  1386-1405  1406-1425  1426-1445  1446-1465  1466-1485  1486-1505  1506-1525  …  1846-1859