nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.23k stars 232 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

i try to insert middle socket to firstlast node, but find, that upgrade file not understand my sockets, the order is shuffled and middle socket not give right result. Am i stupud?

nortikin commented 10 years ago

or, i can make result, but order in upfrade is disorder.

nortikin commented 10 years ago

when i insert node, it is ok, when i plug input data it makes middle socket in first place

nortikin commented 10 years ago

this is wrong behaviour

zeffii commented 10 years ago

of course not exactly what you want, but can give you a hint of the Tsunami deletion you can do on your node tree with a dedicated node for a concept. image https://www.dropbox.com/s/cnnq8ubysve3yu2/Matryoshka_030redux.blend

nortikin commented 10 years ago

@zeffii great monitor! 1655*900+ wiiiiide

nortikin commented 10 years ago

may i push first last with broken sockets order?

zeffii commented 10 years ago

@nortikin , samsung syncmaster 24 inch.

if you think it's broken, maybe not? or make new nodev2?

zeffii commented 10 years ago

@enzyme69 this would give you control over the spacer distance too

from mathutils import Vector

def sv_main(bboxes=[[]], spacer=1.2):

    in_sockets = [
        ['s', 'bboxes', bboxes],
        ['s', 'spacer', spacer]]

    accumulator = [0]

    if bboxes and len(bboxes)>0 and len(bboxes[0]) > 0:
        for b in bboxes:
            v1 = Vector(b[0])
            v2 = Vector(b[1])
            dist = (v1-v2).length
            accumulator.append(accumulator[-1] + dist + spacer)

    accumulator.pop()        

    out_sockets = [
        ['s', 'acc dist', [accumulator]]
    ]

    return in_sockets, out_sockets
zeffii commented 10 years ago

spacer_demo

nortikin commented 10 years ago

i just commited with middle at the first place. it needs willing to deconstruct definition, i will not for now

nortikin commented 10 years ago

over all it is good to have algorythm of spreading shapes with minimal space left - optimal covering of plane. there are two approaches - to calculate and to recursively pick values that can be cosy with rotation, with moving. it is hard job. never meet open solution for this

enzyme69 commented 10 years ago

While making this huge setup, occasionally feel there is a strange behaviour, but hard to explain. Kind of like when thing does not update.

@nortikin I will send you the blend.

ly29 commented 10 years ago

@nortikin in the node put it in place 0, first, in upgrade pos=2? any reason, it seems a bit odd.

nortikin commented 10 years ago
    def init(self, context):
        self.outputs.new('StringsSocket', "Middl", "Middl")
        self.inputs.new('StringsSocket', "Data", "Data")
        self.outputs.new('StringsSocket', "First", "First")
        self.outputs.new('StringsSocket', "Last", "Last")
    'ListFLNode':
        [['outputs', 'StringsSocket', 'Middl', 2]],
    }
enzyme69 commented 10 years ago

@zeffii Super! I am very impressed. Thanks for this immediate and alternative solution. It seems very simple and elegant with the SN.

By the way, the Blend you gave is totally empty. Would you mind sending me the Blend? Email is ok.

Careful sometimes Sverchok when (F) not turned On for Node-Tree will delete the data.

ly29 commented 10 years ago

@nortikin Sockets are created in order and end up being placed last unless moved.

 def init(self, context): 
       self.inputs.new('StringsSocket', "Data", "Data")

       self.outputs.new('StringsSocket', "Middl") # outsputs[0]
       self.outputs.new('StringsSocket', "First") # outsputs[1]
       self.outputs.new('StringsSocket', "Last") # outputs[2]

The following matches the node, first position in the outputs. If it doesn't work we have to solve it.

'ListFLNode':
        [['outputs', 'StringsSocket', 'Middl', 0]],

I'm not sure that having middle first is such a good idea, either in the middle or last considering the name of the node. But upgrade doesn't support reordering or advande things.

ly29 commented 10 years ago

Also sum in List Math node fit right into works for each sublist, accumulate doesn't fit into there without some changes but feels like it belongs there or in similar node. Something that unlike scalar math works over whole list instead of element by element.

enzyme69 commented 10 years ago

Cheers @zeffii for the SN accumulator example. That works.

I have interest with box/brick distribution at some point. Not easy. In fact, most everything easy is only after someone made the hard way to make it easy.

prtscr capture_21

We have the linear distribution.

What if I suddenly think that I want to arrange it in a Curve Path as well, maybe spiral? Suddenly a new challenge.

Measuring curve is a different game again.

enzyme69 commented 10 years ago

Let your brain decode this performance: https://www.youtube.com/watch?v=BzEHItrTMHM

enzyme69 commented 10 years ago

@zeffii Maybe connect Sverchok to ChucK and play some music. SverchoK (SK) sounds pretty cool too.

I am trying to do that as well,.

I have Arduino and produces beep. But I think frequency can be changed too.

enzyme69 commented 10 years ago

Kate Bush is awesome. https://www.youtube.com/watch?v=6xckBwPdo1c

Her initial is also KB.

zeffii commented 10 years ago

this is pretty much achieved now, right?

enzyme69 commented 10 years ago

Cheers.

On Monday, June 23, 2014, Dealga McArdle notifications@github.com wrote:

Closed #244 https://github.com/nortikin/sverchok/issues/244.

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


enzyme69 commented 10 years ago

@nortikin @zeffii @ly29 A bit late as issue is closed. But I think, we can use Adaptive Edges for this problem.

I will try the same case scenario with arranging objects by dimensions.

Cheers, Sherpas.

enzyme69 commented 10 years ago

@zeffii sorry, the case is closed because we have:

enzyme69 commented 10 years ago

Silly me.. the adaptive edge and ratio thing still needs "accumulator". Happy with SN solution I guess, it should work for what I am trying to do.

zeffii commented 10 years ago

no, because this issue morphed from one thing to the next. It went from interpolation between two grease strokes, to even distribution based on bounding boxes.

it;s better to start new threads, for future reference and future searches, when topics start to diverge from the title. Distribution is a perfectly good solo topic, but how would someone think to look in a thread titled as this one, if they want to know about distribution. that's why i closed it.

On Tue, Jun 24, 2014 at 12:36 AM, Jimmy Gunawan notifications@github.com wrote:

Silly me.. the adaptive edge and ratio thing still needs "accumulator". Happy with SN solution I guess, it should work for what I am trying to do.

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

enzyme69 commented 10 years ago

Ok, good point. Retitle the question.

I need to start thinking like that.

zeffii commented 10 years ago

heh, retitle isn't what i had in mind. In programming we solve big problems by subdividing them into small manageable problems. Some of the solutions to the smaller problems are general enough to be reused.againt and again.

we want these threads to stay on topic as far as possible, later when you start searching your posts you will wish you started new threads instead of renaming threads.

enzyme69 commented 10 years ago

Yes, no worries I will try to do so. Re-structuring my way of thinking and asking questions.

Dynamic thread in Github is pretty good I think. Wonder if we can also "point" into certain item in thread (like at Blender Artist forum). Maybe not be possible. It's nice that we can tell people to look at thread by number. Sometimes the downside is when we say A and then we edit A to add information, and we need to tell the person: I have edit that part, and that person is now hunting inside the thread to see what has been updated.

See also: #250 for Object Sorting Distribution by arbitrary data.

enzyme69 commented 10 years ago

Old, but kind of something to be do-able using Grease Pencil and some image detection. http://www.wired.com/2013/09/jaw-dropping-software-that-makes-3d-models-from-any-old-photograph/

But it's too 2.5D, ZBrush like.

zeffii commented 10 years ago

image rightclick the underlined text, and save link as, this is a direct link to that post.

Dynamic threads is great for a forum, but this is an issue tracker. for Bugs and Questions... not so much general talk. You could make a dynamic thread, but I'd ask you to set it to closed so it doesn't keeping bubbling to the top of the open issues section ( I have issues sorted by last updated )

enzyme69 commented 10 years ago

​Ok, got it. So if I updated or comment on closed issues, it will popup to the top.

Sorry for this, I didn't know. I must not do that again.

zeffii commented 10 years ago

if viewing issues by last updated then any edit / update / comment will bump the issue to the top. If it's marked closed, it will appear at the top of the closed section. if marked open, then it bubbles to the top of open issues.

I have issues in the closed section, which we still regularly talk in. (scripted node examples, for instance)