Nodebundle for playing with nodes
 1-8  …  1229-1248  1249-1268  1269-1288  1289-1308  1309-1328  …  1849-1859
Thread Split: Some posts in this thread have been moved here

Previous
Next
 From:  Karsten (KMRQUS)
7777.1269 In reply to 7777.1267 
Hello James,

Have a look to this:
code:
    // SetStyle
 function SetStyle()
 {
 this.addInput("obj","objectlist");
 this.addInput("idx","numarray");

 this.addOutput("Out","objectlist");
	  this.properties = {Style: [0]};
 }

 SetStyle.title = "SetStyle";
 SetStyle.desc = "SetStyle";

 SetStyle.prototype.onExecute = function()
 {
 var objects = this.getInputData(0, moi.geometryDatabase.createObjectList());
        this.properties.Style = this.getInputData(1, this.properties.Style);
//for(var i=0; i<objects.length; i++)objects.item(i).styleIndex = this.properties.Style[0];
objects.setProperty('styleIndex', this.properties.Style[0]);
 var output = objects;
 this.setOutputData(0, output);
 }
 LiteGraph.registerNodeType("Objects2/SetStyle", SetStyle);


Have a nice day
Karsten

p.s.: Don't forget - you are working with Arrays!!! It's not like arays in C, where the adress/name points to the first element;-)

EDITED: 12 Nov 2018 by KMRQUS

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

Message 7777.1270 deleted 12 Nov 2018 by JFH

Previous
Next
 From:  James (JFH)
7777.1271 In reply to 7777.1269 
Hi Karsten,

Thanks again for setStyle node.
At the risk of appearing ungrateful (which I'm not at all, quite the opposite), would it be difficult to make this node multiprocessing?

To colour facets in accordance to distance from an attractor, it was necessary to replicate the geometry 8 times & remove those facets with ptDist that have been remapped to range between 0 - 7 and rounded to integers and then tested in series. This approach quickly becomes cumbersome with each additional style attribution.





I have also attached the .nod file, however on running, the colours will appear different to those above because they will instead index default styles.

The ideal solution would be a setColor node that had inputs for Red, Green, & Blue values and handled the indexing automatically. Whether setColor and setStyle nodes should be combined into a single node or separate nodes, I'm not sure which is best....

Your thoughts?
James

EDITED: 8 Aug 2020 by JFH

  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:  Karsten (KMRQUS)
7777.1272 In reply to 7777.1271 
Hello James,

I'm not sure which way is the best, but a RGB input would create a lot of styles or you have to create and delete again and again. I made a while ago a function for coloring vectors and for the curvature analysis, that create some kind of rainbow styles. It uses sigmoid functions to calculate the RGB parts for blending the colors. It's not perfect, but short code:-) I've included it in the SetStyle-node. So you can put a value between 0 and 254 to choose a color. The node is now multiprocessing the input objects. It's a proposal. Maybe we will find a better solution later.

code:
    // SetStyle
 function SetStyle()
 {
 this.addInput("obj","objectlist");
 this.addInput("idx","numarray");

 this.addOutput("Out","objectlist");
	  this.properties = {/*mode: ["Long", "Long", "Short"],*/Style: [0]};
 }

 SetStyle.title = "SetStyle";
 SetStyle.desc = "SetStyle";
    SetStyle.prototype.onAdded = function (){this.rbID = createRainbow();}
 SetStyle.prototype.onExecute = function()
 {
            var data = this.processInOut("Long" /*this.properties.mode[0]*/, this.multiProcess, null, this.properties.Style);
            this.properties.Style = data.inputs[1];
            this.setOutputData(0, data.outputs[0]);
        
    };


    SetStyle.prototype.multiProcess = function (obj, style)
    {
        var out = [];
        obj.setProperty('styleIndex', this.rbID[style]);
        out[0]=obj;
        return out;
    };
 
 LiteGraph.registerNodeType("Objects2/SetStyle", SetStyle);


Have a nice day
Karsten
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)
7777.1273 In reply to 7777.1272 
Thanks Karsten,

>> It's not perfect, but short code:-) <<

No, this really is an elegant solution, and yes the code is amazingly compact.
Is "createRainbow()" a function you wrote for colouring vectors, that you are calling here?
Clever!

>> It's a proposal. Maybe we will find a better solution later. <<

It is true that control of colour spectrum it limited, however there is a lot of ways to manipulate
the output: varying the range input into reRange node and reMapper widget as well as shifting vales with addition/subtraction etc.


Thanks again Karsten, it's brilliant
I'm so grateful for your skills and efforts,
James

PS I have attached here objects2.js with new node to replace existing in extensions folder, for anyone who may be interested.

EDITED: 14 May 2019 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:  Karsten (KMRQUS)
7777.1274 In reply to 7777.1273 
Hello James,

the result looks great. And yes, the function is to create styles for vectors and the curvature analysis. You can find it in the basicfunctions.js. It returns an array of the indices of the created styles.

Have a nice day
Karsten

EDITED: 14 Nov 2018 by KMRQUS

Image Attachments:
Size: 22 KB, Downloaded: 46 times, Dimensions: 475x281px
  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:  speedy (AL2000)
7777.1275 
Hello Friends
I want to share this work with you;
the Leonardo's Bridge, perhaps one of the first examples of autoparting bridge in History_
How many interested people find images and files at this link:
http://www.mediafire.com/file/2hv5r5rp9wi5w93/Lonardo%2527sBridge.zip/file
Have a nice evening all
alberto

Ps-Good shot Karsten....
SetStyle is wonderful-
  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)
7777.1276 In reply to 7777.1274 
Hi Karsten,

Thank you for posting "sigmoid-xlsx.png", it helped tremendously in comprehending how the indexed colour spectrum is computed, but also hints at future development of the node. Imagine the inclusion of an RGB input on the node fed with 3 concatenated reMapper widgets with 3 different wave forms for each colour range. The widget needs further development to do this, and perhaps in the future it could even have an additional RGB mode where 3 graph curve appear together on widget interface similar to your image. In this way any conceivable spectrum would be possible. Nevertheless, setStyle node is fine the way it is; for now.




Also........and let me start by saying that this is just an enquiry, not a request for action:

Is it possible for extractPoints nodes to be multiprocessing? By that I mean, is it possible for it to treat closed curves discretely?

The attached image contains 5 n-gons of varied side length from which points are extracted to define a closed curve shown in red. Desirably however the result should be as shown in blue outputs.

I have included mPathArray approach (shown in green) by way of comparison, though, of course, only works appropriately if polys are equilateral and with similar number of sides, which is not the case here. Hence, x-length, y-length & z-length cannot be used to group points.

Is there even a way of handling groups of points of unequal number?

Please let me know,
And let me reiterate, this is just a question not a request....
you have done so much for me of late, my friend,
James

EDITED: 14 May 2019 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:  speedy (AL2000)
7777.1277 
Hello Friends
interested parties find this link:
http://www.mediafire.com/file/bbg0q14cd9ev5rg/02-09-CubicFrameMod-Remapper_andSet_Style.zip/file
an exercise of manipulation some cubes arranged on a grid,
using Remapper and SetStyle.
I hope you enjoy it.
Have a nice evenig all
al
  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)
7777.1278 
Hi All,

Here's an architectural screen that transitions between circular and petal shaped holes.

Have a great weekend
James


EDITED: 14 May 2019 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:  Karsten (KMRQUS)
7777.1279 In reply to 7777.1278 
Hello Al, Hello James,

always a pleasure to see your creations!

A nice weekend to all
Karsten
  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:  mkdm
7777.1280 In reply to 7777.1278 
Wonderful! Very elegant!

- Marco (mkdm)
My Procreate portfolio
  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:  Michael Gibson
7777.1281 In reply to 7777.1278 
Hi James, that one has a very particularly pleasing shape transition.

- Michael
  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)
7777.1282 In reply to 7777.1281 
Thank you Michael, Marco & Karsten,

here is animated pattern I'm working on

Have a great weekend
James

May take a little while to fully download before playing

EDITED: 14 May 2019 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:  Frenchy Pilou (PILOU)
7777.1283 
Smart Escher pattern! :)
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery
  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:  mkdm
7777.1284 In reply to 7777.1282 
You rock!!!

- Marco (mkdm)
My Procreate portfolio
  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)
7777.1285 In reply to 7777.1284 
Hi All,

For pattern to respond appropriately to an attractor, each side of 6 sided shape needs to have independent curvature necessitating rebuilding node circuit. Please find attached



And thanks Macro. Your appreciation is always appreciated

The best to all & all the best
James

EDITED: 14 May 2019 by JFH


  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)
7777.1286 
Hi All,

I have posted flows to triangular facets before, but it continues to interest me.

There are a few tricks to get it to work: principally that the base and target triangles need to be lofts rather than planar fills. (If planar fills the flows will be to trimmed surfaces within triangles).

Obviously, this is a lot of messing around compared to quad flows, but the beauty of triangles, of course is that they are alway planar, which can't be guaranteed with quads.

See attached
James


  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:  Frenchy Pilou (PILOU)
7777.1287 
And easily articulated! :)
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery
  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)
7777.1288 In reply to 7777.1287 
Hi Pilou,

FYI I have posted to instagram a series of images to show node circuitry for generating the model.
Instagram's ability to slide multiple images, appearing as a single long image, is an elegant way of displaying process IMHO.

See most recent posting
https://www.instagram.com/nodeology/

I have set up account with strategic hashtagging to see if I can drive new users to Moi3d.
My ulterior motive is to encourage the further development of nodeEditor, by enticing new users with the promise of Moi's parametric capabilities with visual programming.

I'm hoping that students interested in parametric modelling with lots of time but little money, may investigate Moi as an alternative to more expensive solutions.

Moi already offers an intuitive approach to NURBs modelling & this coupled with the ability to visual program complex forms is the double whammy; the old one, two: knockout punch!




Followers briefly edged into triple figures before dropping again below.

James

EDITED: 29 Nov 2018 by JFH

  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-8  …  1209-1228  1229-1248  1249-1268  1269-1288  1289-1308  1309-1328  1329-1348  …  1849-1859