MoI discussion forum
MoI discussion forum

Full Version: Parametric design in MoI?

Show messages:  1-18  …  259-278  279-298  299-318  319-338  339-358  359-378  379-398  …  899-912

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 


From: Karsten (KMRQUS)
17 May 2016   [#334]
Hello to all,

I want to share the idea to make a wrapping function for additional outputs. The advantage would be to reduce nodes. Every node have nearly the same code and new functions could be registered central in one function. The new function would than present in every node that carries the code. The attached code is experimental and full of bugs, but it's the best I can give at the moment. So please study and give a feedback, if it worth to think about.





It's not useful to play with it or integrate the files - only to study what I'm making wrong or make it perhaps better.
The litegraph.js is needed for a function that Marco posted. Thanks for that(for those who can not leave it;-)

Have a nice day
Karsten

Attachments:
litegraph.js
wrappedFunctions.js

Image Attachments:
addOut.gif 


From: Karsten (KMRQUS)
17 May 2016   [#335] In reply to [#334]
forgot to post!

Attachments:
curves2.js


From: mkdm
18 May 2016   [#336]
Hi everyone!

While waiting for new versions of Max's NodeEditor,
i'm doing some experiments with PatternArray selection :

Here's my current unfinished version of the node PatternSelectArray :

code:
// PatternSelectArray
function PatternSelArray()
{
	this.addInput("In","pointarray");
	this.addInput("Start","number");
	this.addInput("Qt_Max","number");
	this.addInput("Step","number");		
	
	this.addOutput("Out","pointarray");
	this.addOutput("Elems","number");
	this.addOutput("Source","pointarray");
	
	this.properties = { mode:["Pattern + Subset", "Pattern + Subset", "Subset + Pattern"],
		pattern:"+",
		start:0,
		qt_max:-1,
		step:1};
	
}

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

PatternSelArray.prototype.onExecute = function()
{
	//if (this.properties.order[0] == "By Selection") {
		
	var source = this.getInputData(0, new pointArray());
	this.properties.pattern = this.properties.pattern.trim();
	
	var usePattern = false;
	var isMixedPattern = false;
	
	// check the pattern
	if (this.properties.pattern != '') {
		// check if pattern contains valid characters
		usePattern = this.properties.pattern.match('^[+\-0-1]+$');
		
		if (usePattern) {
			// check if pattern contains only include characters (+ or 1)
			usePattern = !this.properties.pattern.match('^[+1]+$');
			
			if (usePattern) {
				// if pattern contains both include and exclude characters, then the pattrn will be used
				// otherwise it means that contains only exclude characters (- or 0), and therefore
				// the output pointarray list will be empty
				isMixedPattern = !this.properties.pattern.match('^[\-0]+$');
			}
		}
	}

	var output = new pointArray(); // init to empty list

	if (usePattern) {
		if (isMixedPattern) {
			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;
			}
		}
	} else {
		// elaborate the whole source pointarray
		this.properties.pattern = '';
		output = source;		
	}

	var outLength = output.getLength();
	
	this.properties.start = this.getInputData(1, this.properties.start);
	if (this.properties.start < 0) this.properties.start = 0;
	if (this.properties.start > (outLength - 1)) this.properties.start = (outLength - 1);

	this.properties.qt_max = this.getInputData(2, this.properties.qt_max);
	if ((this.properties.qt_max < 0) || (this.properties.qt_max > outLength)) this.properties.qt_max = outLength;
	
	this.properties.step = this.getInputData(3, this.properties.step);
	if (this.properties.step <= 0) this.properties.step = 1;
	if (this.properties.step > outLength) this.properties.step = outLength;
	
	// generate the final pointarray list
	var outputFinal = new pointArray();
		
	for (i = this.properties.start, cont = 0; i < outLength && cont < this.properties.qt_max; i += this.properties.step, cont++) {
		var source_elem = output.getElement(i);
		
		outputFinal.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);
	}
	
	output = null;
	
	this.setOutputData(0, outputFinal);
	this.setOutputData(1, outputFinal.getLength());
	this.setOutputData(2, source);
	
	this.outputs[1].label = "Elems(" + outputFinal.getLength() + ")";
}

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


The inputs and outputs are :

1 - In : the source PointArray
2 - pattern : the filter pattern string : 1 or + pick the element, 0 or - skip the element
Example "1001" or "+--+"

3 - Start : the first element index of the resulting array after the pattern filtering
4 - Qt_Max : Max quantity of elements present in the final output array
5 - Step : The step used while iterate over the patterned array

6 - Out : the final array
7 - Elems : the number of elements present in the final array
8 - Source : The initial source PointArray


Actually the node works in this way :

1) The pattern is applied to the source array
2) Start , Qt_Max and Step are used to iterate over the patterned PointArray

Actually the property "mode" is not used, but when activated,
will determine the order of the used logic :
First do Pattern operation and then Iterates
or
First Iterates and then do Pattern operation


Nice evening to all,


Marco.
From: James (JFH)
18 May 2016   [#337] In reply to [#334]
Hi Karsten

Great work!

I am totally onboard with your wrapping function for additional outputs proposal.
However could it be achieved with a two tiered menu as shown?
& removed in a similar method to the removal of additional inputs

This way the info panel is not further crowded with non-dynamic elements.

Just a thought
-James

Image Attachments:
Outputs.gif 


From: Karsten (KMRQUS)
18 May 2016   [#338] In reply to [#337]
Hello James,

I had the same idea also, but I could not get it to run:-( I don't understand the core stuff already. Every time I have a short look in it, I have to google for hours. Nevertheless I am still learning. The other reason why I switched back to a selection of the function in the info panel was, that I don't know a good way for multiple outputs (not implemented, but I think possible this way) So the code is only an experiment to explain the idea, not a real solution. I hope Max will implement such a feature. It would help to extend the nodeeditor with such basic functions in a simple way.

Have a nice day
Karsten

Show messages:  1-18  …  259-278  279-298  299-318  319-338  339-358  359-378  379-398  …  899-912