nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.22k stars 233 forks source link

Procedural Matryoshka in 2 Grease Strokes - Space Distribution Accumulation #244

Closed enzyme69 closed 10 years ago

enzyme69 commented 10 years ago

prtscr capture_30 prtscr capture_29

I am stuck with this, very embarrassing. UV Connect is not doing what I expected to.

Of maybe separating UV Plane into U lines and V lines (?)

https://www.dropbox.com/s/msoq2rcpmwgtikd/Matryoshka_007.blend

nortikin commented 10 years ago

try to list split vertices in number of units and than UV connect you may even not unwrap, and connect UV connection in 2 level!

enzyme69 commented 10 years ago

separated_verts @nortikin used to be able to do this.

enzyme69 commented 10 years ago

We don't have it anymore.

enzyme69 commented 10 years ago

Thanks @nortikin !!! the Sverchok Jedi.

prtscr capture_33 ![Uploading PrtScr capture_32.png . . .]()

enzyme69 commented 10 years ago

List Split heh... I missed that :D

nortikin commented 10 years ago

list split

enzyme69 commented 10 years ago

спасибі Никита @nortikin !!!! This clear up 3 Sverchok Concepts for me.

enzyme69 commented 10 years ago

@zeffii does Lathe does Vectorized Input? Hmm... curious.

enzyme69 commented 10 years ago

prtscr capture_34

enzyme69 commented 10 years ago

prtscr capture_35

О, Боже мій! бабуся Лялька, це працює!

enzyme69 commented 10 years ago

Cute. http://alicedarkling.blogspot.com.au/2013/06/studio-ghibli-russian-nesting-dolls.html

enzyme69 commented 10 years ago

@ly29 @zeffii @nortikin Furthermore, any idea how I could arrange those Doll nicely in a structure kind of way?

Imagine each doll has Bounding Box. And I want to arrange it from left to right, so that the spacing fits the Bounding Box quite nicely.

[] [----] [-----] [---------] [-------------] [--------------] and so on.....

zeffii commented 10 years ago

this too you will figure out.

nortikin commented 10 years ago

oh my God, you speaking Russian!! OMG did you know, that Japan has own traditional boxes-in_boxes concept? there are same principle for that.

nortikin commented 10 years ago

fibbonachi range and geometrical range could handle some kind simple way

nortikin commented 10 years ago

I'm ukrainian, but now i hate Ukraine. Ukrainian fashistic government killing people in own country... sad. Study Russian better. Russia have not it's army on others territory

enzyme69 commented 10 years ago

Yes the Fibonacci pattern ...hmm. It's like dejavu. prtscr capture_7

prtscr capture_8

I have a Houdini friend he said: prtscr capture_9

But how to make sense of all this ( brain thinking... )

@zeffii I hope so.

@nortikin There is some kind of similar brain wave pattern between Japan and Russia. Yes in the way, in any country, I found government is corrupt. Let's talk politics in private emails :] I want to study Russian.

I think what my Houdini friend talking is: Fibonacci range and geometrical range indeed.

In my case, I need Bounding Box, but I cheated using just the first last point and then measure from 0,0,0. Hopefully though, the first / last point is at the bottom, not the one at the top. Close approximation. But to think about ...not very elegant, probably Bounding Box way is better.

This is the second time I encounter the same problem: the need of placing and distributing object nicely next to each other with "gap" between them.

enzyme69 commented 10 years ago

prtscr capture_13

Ok, looking at the BBOX vertices, I can sort of get the distance I needed. And just need gap.

Once I figure out, you help making it nicer please.

enzyme69 commented 10 years ago

Weird.

prtscr capture_14 prtscr capture_11

enzyme69 commented 10 years ago

It's weird.

Rounded, I found the radius of M dolls: 4,7,11,14,17,20,23

This means, when distributed properly: -4, 4, 7, 7, 11, 11, 14, 14, 17, 17, 20,20,23,23

The 1st doll center pivot should be at (0,0,0) 2nd = (11,0,0) 3rd = (29,0,0) 4th = (54,0,0) and so on...

I used to be pretty good at this in high school. But brain quite never understand it.

Must have a loose screw.

enzyme69 commented 10 years ago

Crap, I miscalculated, that's not the Radius, that's the actual Diameter of each doll, because I use Bounding Box. Need to divide it by two.

Rounded, I found the radius of M dolls: 2,3,5,6,7,10,11

When laid out on the X: (2),2,3,3,5,5,7,7,8,8,10,10,11,11

enzyme69 commented 10 years ago

Get Radius of 7 Dolls R0,R1,R2,R3,R4,R5,R6

Distance is: (R0 + R1), (R1+R2), (R2 + R3), (R3 + R 4 ) ... and so on. => wrong

enzyme69 commented 10 years ago

2+3 = 5 2+3+3+5 = 13 2+3+3+5+5+7 = 25 2+3+3+5+5+7+7+8 = 40 ....

enzyme69 commented 10 years ago

Stupid, I should not use rounding.

Get Radius of 7 Dolls R0,R1,R2,R3,R4,R5,R6

Laid out dolls on the X axis: -R0 | R0 R1 | R1 R2 | R2 R3 | R3 R4 | R4 R5 | R5 R6 | R6

Location for each doll to get distance: 0 R0+R1 R0+R1+R1+R2 R0+R1+R1+R2+R2+R3 R0+R1+R1+R2+R2+R3+R3+R4 R0+R1+R1+R2+R2+R3+R3+R4+R4+R5 R0+R1+R1+R2+R2+R3+R3+R4+R4+R5+R5+R6

enzyme69 commented 10 years ago

dist0 = 0 dist1 = dist0+R0+R1 dist2 = dist1+R1+R2 dist3 = dist2+R2+R3 dist4 = dist3+R3+R4 dist5 = dist4+R4+R5 dist6 = dist5+R5+R6

enzyme69 commented 10 years ago

I failed the math, trying the more Sverchok way.

prtscr capture_16

enzyme69 commented 10 years ago

List Slice node did not take Vectorized Input ....

enzyme69 commented 10 years ago

Correction: List Slice does take Vectorized Input, probably didn't update properly. List Sum did not take Vectorized Input :p

enzyme69 commented 10 years ago

List Sum need to have "Vectorized Input" enabled.

prtscr capture_17

Feel I am not very smart with Math.

enzyme69 commented 10 years ago

prtscr capture_18

I can do it for 7 M-Dolls, but that manual List Join and lots of List Repeats makes me thinking. Those 30+ nodes can be simplified to simple Math or Scripted Node.

However, next time I encounter this again, I will be prepared.

There must be a more efficient way to achieve Fibonaccci style of list

enzyme69 commented 10 years ago

I also need to have ability to add "gap" between dolls.

I shelf this for now.

enzyme69 commented 10 years ago

if I have a bit more time sitting in front of computer, I either

I will go out and do some drawing.


zeffii commented 10 years ago

jimmy got a link to a latest .blend, you look close and i'd like to try.. but am lazy to setup own dolls etc.

On Sun, Jun 22, 2014 at 4:55 AM, Jimmy Gunawan notifications@github.com wrote:

if I have a bit more time sitting in front of computer, I either

  • Vectorized the List Sum node
  • Make SN node that does Vectorized Sum
  • simplify all those ugly with Math formula

I will go out and do some drawing.


— Reply to this email directly or view it on GitHub https://github.com/nortikin/sverchok/issues/244#issuecomment-46771030.

ly29 commented 10 years ago

List sum and cumulative sum sounds like two modes that are needed for the List Math node. The list sum just sums all numbers in a list.

22 jun 2014 kl. 06:56 skrev "Dealga McArdle" notifications@github.com:

jimmy got a link to a latest .blend, you look close and i'd like to try.. but am lazy to setup own dolls etc.

On Sun, Jun 22, 2014 at 4:55 AM, Jimmy Gunawan notifications@github.com wrote:

if I have a bit more time sitting in front of computer, I either

  • Vectorized the List Sum node
  • Make SN node that does Vectorized Sum
  • simplify all those ugly with Math formula

I will go out and do some drawing.


— Reply to this email directly or view it on GitHub https://github.com/nortikin/sverchok/issues/244#issuecomment-46771030.

— Reply to this email directly or view it on GitHub.

enzyme69 commented 10 years ago

Hi Dealga, as soon as I got home, I will send you the file.

The Sum node is not Vectorized.

Reading this now... http://www.mathsisfun.com/algebra/sequences-sums-arithmetic.html

On Sunday, June 22, 2014, Dealga McArdle notifications@github.com wrote:

jimmy got a link to a latest .blend, you look close and i'd like to try.. but am lazy to setup own dolls etc.

On Sun, Jun 22, 2014 at 4:55 AM, Jimmy Gunawan <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

if I have a bit more time sitting in front of computer, I either

  • Vectorized the List Sum node
  • Make SN node that does Vectorized Sum
  • simplify all those ugly with Math formula

I will go out and do some drawing.


— Reply to this email directly or view it on GitHub https://github.com/nortikin/sverchok/issues/244#issuecomment-46771030.

— Reply to this email directly or view it on GitHub https://github.com/nortikin/sverchok/issues/244#issuecomment-46772572.


enzyme69 commented 10 years ago

@ly29 yes, that will be nice. I thought we have that already. cumulative sum will probably make this easier. this problem brings back my high school Math memory.

I may be close to the answer, that formula that does the placement and distribution automatically, because there is simple pattern.

Easier than having to distribute and alight objects with random shapes, right?

Align Node is probably next in mind.

For now, hopefully the dolls can align itself with X gap.

enzyme69 commented 10 years ago

Known diameters of 7 dolls: D1,D2,D3,D4,D5,D6,D7

Sequence of placement pattern is like this: D1/2 + D2/2 D1/2 + D2 + D3/2 D1/2 + D2 + D3 + D4/2 D1/2 + D2 + D3 + D4 + D5/2 D1/2 + D2 + D3 + D4 + D5 + D6/2 D1/2 + D2 + D3 + D4 + D5 + D6 + D7/2

enzyme69 commented 10 years ago

If I multiply all by two: 0.5 * (D1 + D2) 0.5 * (D1 + 2_D2 + D3) 0.5 * (D1 + 2_D2 + 2_D3 + D4) 0.5 * (D1 + 2_D2 + 2_D3 + 2_D4 + D5) 0.5 * (D1 + 2_D2 + 2_D3 + 2D4 + 2 D5 + D6) 0.5 * (D1 + 2_D2 + 2_D3 + 2D4 + 2 D5 + 2* D6 + D7)

enzyme69 commented 10 years ago

Another word: 0.5 * (D1 + D2) 0.5 * (D1 + 2D2 + D3) 0.5 * (D1 + 2(D2 + D3) + D4) 0.5 * (D1 + 2(D2 + D3 + D4) + D5) 0.5 * (D1 + 2(D2 + D3 + D4 + D5) + D6) 0.5 * (D1 + 2*(D2 + D3 + D4 + D5 + D6) + D7)

zeffii commented 10 years ago

yeah, list math should get an accumulator, i would also argue for a dimensions node, to accompany bbox, so you get convenient width+height+depth

enzyme69 commented 10 years ago

Another word: 0 R1 + R2 R1 + 2R2 + R3 R1 + 2(R2+R3) + R4 R1 + 2(R2+R3+R4) + R5 R1 + 2(R2+R3+R4+R5) + R6 R1 + 2*(R2+R3+R4+R5+R6) + R7

If we know the radius of 7 dolls (r1-r7), the center of: doll1 = 0 doll2 = sum of r1-r2 doll3 = sum of r1-r3 + sum of r2 doll4 = sum of r1-r4 + sum of r2-r3 doll5 = sum of r1-r5 + sum of r2-r4 doll6 = sum of r1-r6 + sum of r2-r5 doll7 = sum of r1-r7 + sum of r2-r6

Yes I think recursive and multi sum will help and this is probably close to be solved.

prtscr capture_20

enzyme69 commented 10 years ago

Another word: 0 R1 + R2 R1 + R2 + R3 + (R2) R1 + R2 + R3 + R4 + (R2 + R3) R1 + R2 + R3 + R4 + R5 + (R2 + R3 + R4) R1 + R2 + R3 + R4 + R5 + R6 + (R2 + R3 + R4 + R5) R1 + R2 + R3 + R4 + R5 + R6 + R7 + (R2 + R3 + R4 + R5 + R6)

SN is the only answer for now.

zeffii commented 10 years ago

it's good to have the gut feeling on relatively simple conceptual problems "hey, this is easy, and this uses way too many nodes", generally I think that gut reaction is correct. If it's tricky on simple setups then imagine the node-soup you'd end up with if the problem was more complicated.

enzyme69 commented 10 years ago

Yes, good that I use my brain a bit on this. This is simple after all.

zeffii commented 10 years ago

http://2.bp.blogspot.com/_4egP1jw8L2o/ShMg4LegWnI/AAAAAAAAAM4/EybuqNuAnFM/s400/spagetti_junction.jpg

zeffii commented 10 years ago

or accumulate list node

enzyme69 commented 10 years ago

Also, would it be necessary to have First Last node also output Others in between?

Although List Slice is kind of doing it and it works for Vectorized Input, it might still be handy.

enzyme69 commented 10 years ago

I have a feeling that for this case, we can also graph the interpolation and then project it to get a nice geometry bounding box distribution.

zeffii commented 10 years ago

[1, -1] should be fine on slice node, I agree it's border-case useful to have a drop FirstLast node. Would we need it because we have to compensate for the lack of some other node, or is it a really useful node. Making the node, as usual, is not difficult -- but is it atomic enough?

enzyme69 commented 10 years ago

Aha, yes get to index with -1.