MoI discussion forum
MoI discussion forum

Full Version: Parametric design in MoI?

Show messages:  1-13  …  254-273  274-293  294-313  314-333  334-353  354-373  374-393  …  894-912

From: Karsten (KMRQUS)
13 May 2016   [#314] In reply to [#313]
Hello Marco,

>>>>> Only for info....my name's Marco, not Mauro.
sorry for that! I know it :-)

I have made a quick test of your nodes and I like them :-) I hope that Max will integrate it. One thing I would prefer, is to collect new nodes first in a separate JS-File, so e.g. curvesMKDM.js with a separate Menu, so everybody can set apart the nodes from Maxs core development. And you can register them for tests very simple in the index.htm.
Updates and a discussion about is in my opinion also easier.
Anyway, the idea is good and we have some new nodes for playing:-)

Have a nice weekend
Karsten

Message 7713.315 was deleted


From: mkdm
13 May 2016   [#316] In reply to [#314]
Hello Karsten,

Here's my new node : PatternSelectArray

It's an idea based on the Max's script PatternSelection.
(http://moi3d.com/forum/index.php?webtag=MOI&msg=6518.11)

code:
// PatternSelectArray
function PatternSelArray()
{
	this.addInput("In","pointarray");
	this.addOutput("Out","pointarray");
	this.addOutput("Elems","number");
	
	this.properties = { pattern:"+-", elems:0 };
}

PatternSelArray.title = "PatternSelArray";
PatternSelArray.desc = "PatternSelArray";

PatternSelArray.prototype.onExecute = function()
{
	var output = new pointArray();
	var source = this.getInputData(0, new pointArray());
	if (this.properties.pattern == '') this.properties.pattern = "+-";
	var len = source.getLength();
	
	var cn = 0;
	for (i = 0; i < len ; i++) {
		if ( this.properties.pattern[cn] === '1' || this.properties.pattern[cn] === '+') {
					
			var source_elem = source.getElement(i);
			
			output.push(source_elem.pt.x,
				source_elem.pt.y,
				source_elem.pt.z,
				source_elem.AngleX,
				source_elem.AngleY,
				source_elem.AngleZ,
				source_elem.Size);
		}
		cn = (cn < this.properties.pattern.length-1) ? cn+1 : 0;
	}
	
	this.properties.elems = output.getLength();
	
	this.setOutputData(0, output);
	this.setOutputData(1, output.getLength());
}

LiteGraph.registerNodeType("Arrays/PatternSelArray", PatternSelArray);


In order to use it, it's necessary to add this function definition to the "pointArray" section of the file litegraph.js

code:
pointArray.prototype.getElement = function(n)
{
	var shift = n*this.recordLength;
	
	var element = {"pt":this.getPoint(n),
		"AngleX":this.data[shift+3],
		"AngleY":this.data[shift+4],
		"AngleZ":this.data[shift+5],
		"Size":this.data[shift+6]};
		
	return element;
}


I hope it can be useful.

Ciao!

Marco.

Attachments:
PatternSelArray.nod

Image Attachments:
01_Capture.PNG  02_Capture.PNG 


From: mkdm
13 May 2016   [#317] In reply to [#315]
Hi James,

>I wonder though whether it would be simpler to just add these to
>the CloneToArray node rather than to each of the curve/solid nodes,
>to achieve the same effect?

It could be a very good idea, but i don't know if the results would be the same.

That is, CloneToArray can generates Points, whilemy intention was to maintain the output as plain Pointarray.

But i'm sure that all this things could be intermixed.

I will make some test.

Anyway, thanks for your interesting suggestion.

Regards.

Marco.

Message 7713.318 was deleted


From: Karsten (KMRQUS)
14 May 2016   [#319] In reply to [#317]
Hello Marco,

I don't have tested the pattern manipulation at the moment, but it's another very interesting idea. I'm not a "pattern man", but I can't avoid some ideas to the stuff (damn, I really wanted to do something different ;-): Is it possible to make a random option? Would it then be possible to create sinter materials, porous materials like cheese, particles ... with some clicks? Or is it possible to split in two,three, ... streams of pointarrays (random or structured) to create mosaics???

Anyway, let the ideas flow and share them:-)
Many thanks
Karsten
From: Karsten (KMRQUS)
14 May 2016   [#320] In reply to [#319]
@Marco,
in my opinion, the idea with the node overview panel can help a lot in the future, but think about scrollbars:-) Max should have a look!
From: Max Smirnov (SMIRNOV)
14 May 2016   [#321]
Hi Marco,
thank you for nodes.

In fact I already writing SplitArray node, which can split point arrays according a pattern or a logical expression.
Also I have plans to use series everywhere instead of number type. Therefore I'll rewrite all basic nodes such as circle, sphere, cone etc.
From: mkdm
14 May 2016   [#322] In reply to [#318]
Hi James,

Thanks a lot for your appreciations...

At the moment i'm thinking about many ideas regarding the possibility to integrate all pointArray nodes,
with a unified logic in order to better manages series, patterns, and the order in witch those points are picked and passed to output.

But i must admint that it's not so easy, 'cause i'm not quite familiar with math formulas :)

But, some minutes ago, i've just read that Max is working on all these ideas....

So while waiting its solutions, i keep on working on my personal tests.

Have a nice day!

P.S. Where's the Sweep node that you used in your test ? Could you share it ?

Marco.
From: mkdm
14 May 2016   [#323] In reply to [#321]
Hi Max,

Thanks for everything, i'm pleased that you appreciated my attempts to create new logic for array nodes.

At the moment i'm thinking about many ideas regarding the possibility to integrate all pointArray nodes,
with a unified logic in order to better manages series and patterns.

I'm also thinking about a unified method to specify how is the order in witch the points of the array, could be picked up.
just in order to create a less random and not predictable outputs.
This is hard to achieve i think...

But i must admit that it's not so easy, 'cause i'm not quite familiar with math formulas :)

Anyway, i was happy to read that you are already working on all these ideas!

So while waiting your solutions, i keep on working on my personal tests.

P.S.
Karsten wrote :
>>in my opinion, the idea with the node overview panel can help a lot in the future, but think about scrollbars:-) Max should have a look!

I hope hat you share this idea.

Have a nice day!

Marco.
From: mkdm
14 May 2016   [#324] In reply to [#319]
Hi Karsten,

Thanks a lot for your appreciations and suggestions!

And keep on working together on sharing new ideas.

Have a nice day!

Marco.
From: James (JFH)
14 May 2016   [#325] In reply to [#322]
Hi Marco

Sweep node was one contributed by Karsten.
I can't find the original thread
but please find all attached

-James
From: Karsten (KMRQUS)
14 May 2016   [#326] In reply to [#324]
Hello Marco,

if you want to use sweep it is also useful to evaluate the startFrame of the railcurve for profile placement. You will find a node for that in infonodes. To get it run you have to replace the pushFrame function in litegraph.js with the posted in this thread. What I am think about at the moment is to put such meta informations like startframes of curves, boundingboxes, curve length, mass, ... in a functions container. Max has already made a addOutput-function. I think it would be better to put such functions as additional outputs to nodes, than create separate nodes for it. Unfortunateli are my programming skill are very limited and I can't find a node with an addOutput as a template to study. Maybe Max have one?
A nice weekend to all
Karsten
From: mkdm
14 May 2016   [#327] In reply to [#325]
Hi James,

Thanks for your prompt reply!

Ciao!

Marco.
From: mkdm
14 May 2016   [#328] In reply to [#326]
Hi Karsten,

Thanks for your reply and your suggestions.

As soon as possible i'll take a better look at those functions and nodes.

Nice day,

Marco.
From: Barry-H
15 May 2016   [#329]
Hi Karsten,
looking at your motor node using the boolean function to indicate a clash of objects gave me an idea.
Is it possible to automatically space an array by using the boolean function.
At the moment I have a AutoArray based on the object bounding box plus gap and orientation
that will automatically fill a given square or rectangle area.
The only problem with this is I have to manually adjust the gap for objects that can
overlap the bounding box.
Ideally I would like to set a minimum gap between objects to maximise the fill.
The way I see it working is to Offset the object by half the gap required.
Space the array centres based on the offset object bounding box .
If boolean of offset object = true ok finish
else reduce centres by given step till boolean true.
So the question is how do I get a true or false from the boolean to use and how to keep
looping reducing the centre distance till true.
Any idea's ?

Cheers
Barry.


Image Attachments:
2016.05.15-11.34.58-[Top].png 


From: Karsten (KMRQUS)
15 May 2016   [#330] In reply to [#329]
Hi Barry,

the simplest way to detect a clash is in my opinion the number of result objects of an intersection. No intersection - no result. So it should be possible to make an interation until no resultobjects exists or vice versa. I don't have time at the moment, so I hope it helps in a first step.

Have a nice day
Karsten
From: Karsten (KMRQUS)
15 May 2016   [#331] In reply to [#330]
p.s.: An iterration algorithm has to be defined inside one node, because I`m not sure if loops are really possible in the nodeeditor.
From: bemfarmer
15 May 2016   [#332] In reply to [#331]
I have seen a feedback loop for another node-type program.
From: mkdm
17 May 2016   [#333] In reply to [#321]
Hi Michael and Max (and everyone),

While i was doing some testing with "Array" family nodes, i wondered a thing regarding the rules followed by Moi and Nodeeditor,
in order to manage the order of selected objects.

I hope that both the .3dm and .nod files that i have attached, are sufficiently clear to explain what i'm trying to understand.

In order to run the example i think that it is necessary the latest Nodeeditor version (0.65).

But, to be clearer, i'll show you what are the steps that i have followed, what is the result that i wanted and what instead is the result that i get.

Given that this is nothing more than an exercise, my goal is to better understand the way used by Moi to manage a set of selected objects,
and if it could be possible to control the order of the objects inside a specific set of selected objects,
and if it could be possible to get the same behavior inside Nodeeditor.

So, i have followed these steps :

01 - Open the .3dm and .nod files
02 - Select all the points in .3dm file, picking them individually in the order shown by the numbers
03 - Assign the selection to the "Selected" node present into the nodeeditor, via the "update" command by right-clicking the node
04 - Run the editor

And....as you can see in the 01_Capture.PNG file, the resulting curve, displayed in violet, doesn't follows the order of picked points.

My question is.....am i doing something wrong ?

Is there a way to instruct Moi or NodeEditor to keep unaltered the order of picked objects ?
Or does Moi apply a different rules to the selected objects, in order to manage a different ordering ?

And, a final consideration...

I think that having the ability to control the order of selected objects, manually or via some sort of programmatic criteria,
would be a very powerful thing inside both Moi and Nodeeditor.

Well then everyone... have a good day,

Marco (mkdm).

Attachments:
03_order_of_selection.3dm
04_order_of_selection.nod

Image Attachments:
01_Capture.PNG  02_Capture.PNG 


Show messages:  1-13  …  254-273  274-293  294-313  314-333  334-353  354-373  374-393  …  894-912