MoI discussion forum
MoI discussion forum

Full Version: Node Wish List

Show messages:  1  …  222-241  242-261  262-281  282-301  302-321  322-341  342-361  …  422-425

From: Frenchy Pilou (PILOU)
25 Mar 2022   [#282]
Cool pdf!

In the same order of idea
http://www.entrelacs.net/-Celtic-Knotwork-The-ultimate- by hand

With computer ;)
http://www.hypatiasoft.fr/Folder_KnotsBag/Pages_HTML/KnotsBag_A.html

and my little prog online! ;)
Drag & Drop any png image with a transparent background...(better 1024* 512 )
(An JPG image will made a neutral result )
https://editor.p5js.org/Pilou/full/y1GHaBqyT

you will obtain some funny images




here for example with an Moi obj


or with my recent Gaugan pilouterie :)

From: wayne hill (WAYNEHILL5202)
25 Mar 2022   [#283]
Hi All,

This is what I have so far on my alpha version of L-System for the Node Editor. Still working on the interface. All the l-system samples are working so far.

Wayne

Image Attachments:
l-system.PNG 


From: James (JFH)
25 Mar 2022   [#284] In reply to [#283]
Wayne,
quote:
This is what I have so far on my alpha version of L-System for the Node Editor

It is looking great...very exciting.
I see that you are closely following the approach of onlinemathtools.com/l-system-generator, including its input values of width & height. I purposely excluded these from my node proposal because the consequent distortion of the output would generally be undesirable. The spatial limitation of displaying within the webpage necessitates the inclusion of these (w,h) input values. The virtual 3d space has no such limitation, besides any requirement for scaling and proportioning may be achieved subsequently with Objects2/ScaleUVW node.
quote:
Still working on the interface.

I understand that you are at beta stage and the interface considerations are far from fixed (and you have likely had the same thought) , but the inclusion on the node of inputs for angle and iterations would give greater dynamic control of output.

I also know that there is no scaling factor per generation included in the js code of the online tool, but if this facility was possible it would push the capabilities into a realm beyond; opening up a new world of possibility....worthy of consideration!

Again, thank you for your hard work with this. I can't wait to get my hands on it.
Keep up the good work,
James
https://www.instagram.com/nodeology/
From: James (JFH)
25 Mar 2022   [#285] In reply to [#281]
Brian,
quote:
Thank you .....for the example of the Gate node.

The Gate node is one of my meagre contributions to node library from a few years back.
http://moi3d.com/forum/lmessages.php?webtag=MOI&msg=7777.1251
At the time I thought these would be a real boon to NE's capabilities; after-all digital computation
is based on logic gates.

Instead it languished; all but ignored (even by me).
When we lost John Conway to covid, I attempted to build a cellular automaton circuit
for his "Game of Life" in NE, however never managed to get it to work.

A project for another time....unless it piques your interest.
Have a great weekend,
James
https://www.instagram.com/nodeology/
From: bemfarmer
26 Mar 2022   [#286] In reply to [#285]
Is "Game of Life" an L-System?
- Brian
From: James (JFH)
26 Mar 2022   [#287] In reply to [#286]
Brian,
quote:
Is "Game of Life" an L-System? - Brian

No, if you reread my post, it was in response to your post about the logic gate node, not L-Systems.

Cellular Automaton replies on conditional logic to test each cell's adjacent neighbours at each iteration to operate,
so it should be possible to build in NE with the use of logic nodes.

See the wikipedia entry for generative rules:
https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

James
https://www.instagram.com/nodeology/
From: Frenchy Pilou (PILOU)
26 Mar 2022   [#288]
You have an another cellular Automate with a very simple rule!
Turmites : If it's Black turn on the right!
if it's white turn on the left!
Amazing that after some repetition a striah line apaers from the chaos! :)

Maybe with Moi adtapt it in 3D...



And the top of the must free prog about all the 2D Cellular Automates Golly
http://golly.sourceforge.net

Here with the game of life rules!

From: Frenchy Pilou (PILOU)
28 Mar 2022   [#289]
Found this :)
https://personalpages.manchester.ac.uk/staff/j.montaldi/Choreographies/
From: wayne hill (WAYNEHILL5202)
1 Apr 2022   [#290]
Lsystem New Node!

https://en.wikipedia.org/wiki/L-system

The dropdown menu has several demo patterns.

Select 'Custom' menu to make your own custom pattern based on the previous selection.

Start with a low iteration number when making a custom demo. The calculations can easily overwhelm
the MOI graphic processor.

Thank you to James for the testing and recommendations.

Wayne


Attachments:
lsystem.js

Image Attachments:
lsys.PNG 


From: Frenchy Pilou (PILOU)
1 Apr 2022   [#291] In reply to [#290]
The famous Penrose tilling! The double flying kite! :)
From: Frenchy Pilou (PILOU)
2 Apr 2022   [#292]
PS There is no .nod file for the Lsystem ? Only a js file ?

Edit : ok Found! :) Just put the JS file inside the folder (for PC) ...\Moi\nodeeditor\nodes\extensions\lsystem.js
Will be in the Node / Objects2 if i am right...
Insert 3 nodes "sliders" a an "OutPut" et voilĂ !

And so the .nod! ;) https://moiscript.weebly.com/uploads/3/9/3/8/3938813/lsystem_pil.nod
and the site ;) https://moiscript.weebly.com/objects2.html#lsystem

Absolutly terrific! Bravo! Another infinite toy!






From: coi (MARCO)
2 Apr 2022   [#293]
quote:
Lsystem New Node!

eureka, i was asking for something like this 9 years ago

https://moi3d.com/forum/index.php?webtag=MOI&msg=6148.17

tnx
From: wayne hill (WAYNEHILL5202)
3 Apr 2022   [#294]
Marco / Pilou ,

Very happy you like it.

Wayne
From: Frenchy Pilou (PILOU)
3 Apr 2022   [#295] In reply to [#294]
Used for my hundred of the day! ;) https://imgbox.com/g/tSQCUyur6z








From: wayne hill (WAYNEHILL5202)
13 Mar 2023   [#296]
A modification to the Node Editor to allow multiple object connections.

It is as simple as commenting out one line on the 'main.js' program.

code:
// >>>  if ( this.outputs[slot].type === "objectlist" ) this.disconnectOutput(slot);


code:
LGraphNode.prototype.connect = function (slot, node, target_slot) {
.
.
.
//special case: -1 means node-connection, used for triggers
var output = this.outputs[slot];
if (target_slot === -1) {
	if (output.links == null) output.links = [];
	output.links.push({
		id: node.id,
		slot: -1
	});
} else if (!output.type || //generic output
	!node.inputs[target_slot].type || //generic input
	output.type.toLowerCase() == node.inputs[target_slot].type.toLowerCase()) //same type

	{ // 4-12-2022 wjh
    //  >>>  if ( this.outputs[slot].type === "objectlist" ) this.disconnectOutput(slot);

Image Attachments:
Multi-Obj_Chg.PNG 


From: MO (MO_TE)
14 Mar 2023   [#297] In reply to [#296]
Hi
Thank you wayne. With this modification, we can say goodbye to the "clone" node ! :D

Sometimes an indestructible Object appears in the scene.
The problem will solve after saving the scene and restarting moi.
From: wayne hill (WAYNEHILL5202)
15 Mar 2023   [#298]
Thank you MO!

Here is another one you might like.


Modification to the Node Editor to allow the program name to always appear at the bottom of the display.

Program file 'main.js'

Modify this location:
code:
	//rendering
	if (this.onRender) this.onRender(canvas, ctx);

	//info widget
	if (this.show_info) this.renderInfo(ctx);


Add the five lines to the info widget area:
code:
	//rendering
	if (this.onRender) this.onRender(canvas, ctx);

	//info widget
	if (this.show_info) this.renderInfo(ctx);

	///////////// 4-17-2022 wjh
	ctx.clearRect(0, canvas.height - 20, canvas.width, canvas.height); 
	var dpir = this.pixelRatio * this.uiRatio;
	ctx.font = "bold " + 14 * dpir + "px Arial";
	ctx.fillStyle = LiteGraph.NODE_INFO;
	ctx.fillText(this.graph.filename, 5, this.bgcanvas.height - 3 * dpir);
	///////////



Comment out this line. It is a part of a different routine not required.
code:
//  >>> ctx.fillText(this.graph.filename, 5, this.bgcanvas.height - 3 * dpir); // 4-17-2022 wjh


From this location:

code:
LGraphCanvas.prototype.renderInfo = function (ctx, x, y) {
	x = x || 0;
	y = y || 0;

	ctx.save();
	ctx.translate(x, y);

	var dpir = this.pixelRatio * this.uiRatio;
	ctx.font = 12 * dpir + "px Arial";
	ctx.fillStyle = LiteGraph.NODE_INFO;
	if (this.graph) {
		ctx.fillText("Total: " + this.graph.elapsed_time.toFixed(0) + " ms", 5, dpir * 15 * 1);
		ctx.fillText("FPS:" + this.fps.toFixed(0), 5, dpir * 15 * 2);
		ctx.fillText("F: " + this.frame, 5, dpir * 15 * 3);
		ctx.fillText(this.graph.blocked ? "Graph blocked" : "", 5, dpir * 15 * 4);
		//  >>> ctx.fillText(this.graph.filename, 5, this.bgcanvas.height - 3 * dpir); // 4-17-2022 wjh
	} else ctx.fillText("No graph selected", 5, 13 * 1);
	ctx.restore();
}

Image Attachments:
NE_filename_Display.PNG 


From: MO (MO_TE)
15 Mar 2023   [#299] In reply to [#298]
Hi Wayne

I couldn't find the second part of your modification in my "main.js" file:
"LGraphCanvas.prototype.renderInfo = function (ctx, x, y)"

So I just added the first part and it worked.
Thank you
From: wayne hill (WAYNEHILL5202)
16 Mar 2023   [#300] In reply to [#299]
Hi Mo,

It is located about line 3891 in the original source code. No real need to comment it out, but good practice to eliminate duplicates.

Here is another modification to try out:

On the Node Editor:

To have the Save function use the current file as the save file instead of typing it in everytime:

On the 'editor.js' file location:

code:
Editor.prototype.onSaveButton = function ()
{
	if (this.graph.blocked) return;
	var saveFilePath = moi.filesystem.getSaveFileName( lang.getTranslation('Save as')+' ..',  lang.getTranslation('MoI Nodeeditor files')+' (*.nod)|*.nod' );
	if ( !saveFilePath ) return false;
	if ( this.graph.status !== LGraph.STATUS_STOPPED ) this.onPlayButton();
	var file = moi.filesystem.openFileStream( saveFilePath, 'w' );
	file.writeLine(LiteGraph.JSONprettify(this.graph.serialize(), {"indent":"	", 'maxLength':150}));
	file.close();
	this.graph.filename = saveFilePath;
	this.graph.setDirtyCanvas(true,true);
}


Change the second line:

code:
	var saveFilePath = moi.filesystem.getSaveFileName( lang.getTranslation('Save as')+' ..',  lang.getTranslation('MoI Nodeeditor files')+' (*.nod)|*.nod' );


To:

code:

Editor.prototype.onSaveButton = function () {
.
  // wjh 4-19-2022
	var saveFilePath = moi.filesystem.getSaveFileName(lang.getTranslation('Save as') + '..', lang.getTranslation('MoI Nodeeditor files') + ' (*.nod)|*.nod',lang.getTranslation(this.graph.filename));
.
.
}


From: MO (MO_TE)
16 Mar 2023   [#301] In reply to [#300]
Thank you for these cool modifications.

You are right.
search didn't work because of extra whitespaces .
LGraphCanvas.prototype.renderInfo = function (ctx, x, y)
LGraphCanvas.prototype.renderInfo = function( ctx, x, y )

Now I find it. :)

I usually prefer to have different versions of same node, But I gave it a try.
I added your modification as you showed, but couldn't see any difference.("save as" window pops up with empty name field)


Anyways, I change your code a bit.
Now if you press the save button and alt key , it saves on existing node file without confirmation.
otherwise works like before.
code:
Editor.prototype.onSaveButton = function (e)
{
	if (this.graph.blocked) return;
	var saveFilePath="";
	// var saveFilePath = moi.filesystem.getSaveFileName( lang.getTranslation('Save as')+' ..',  lang.getTranslation('MoI Nodeeditor files')+' (*.nod)|*.nod' );
	// if (e.altKey) {saveFilePath = moi.filesystem.getSaveFileName(lang.getTranslation('Save as') + '..', lang.getTranslation('MoI Nodeeditor files') + ' (*.nod)|*.nod',lang.getTranslation(this.graph.filename));}
	
	if (e.altKey) {saveFilePath = lang.getTranslation(this.graph.filename);}
	else {saveFilePath = moi.filesystem.getSaveFileName( lang.getTranslation('Save as')+' ..',  lang.getTranslation('MoI Nodeeditor files')+' (*.nod)|*.nod' );}

	if ( !saveFilePath ) return false;
	if ( this.graph.status !== LGraph.STATUS_STOPPED ) this.onPlayButton();
	var file = moi.filesystem.openFileStream( saveFilePath, 'w' );
	file.writeLine(LiteGraph.JSONprettify(this.graph.serialize(), {"indent":"	", 'maxLength':150}));
	file.close();
	this.graph.filename = saveFilePath;
	this.graph.setDirtyCanvas(true,true);
}

Show messages:  1  …  222-241  242-261  262-281  282-301  302-321  322-341  342-361  …  422-425