nortikin / sverchok

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

Loft Node (follow curvature as option) #207

Closed zeffii closed 10 years ago

zeffii commented 10 years ago

This one is self explanatory, but before I tackle it I'd like to know if anyone had plans or has started their own Loft Node, or has objections to one.

ly29 commented 10 years ago

I had one planed after cleaning up some older nodes and done interpolation. But going for really simple just place at vertices. Go for it.

nortikin commented 10 years ago

Alex preparing something interesting for us, and yes, lets take as rule to share plans for some nodes. i doing fractal node, that will make fractals by iterating something on vertices or centers of polygons or other way.

nortikin commented 10 years ago

2ji_pidvmpw generated fractal

enzyme69 commented 10 years ago

I am waiting in anticipation on that Fractal thing, thanks Nikitron.

many incoming new nodes make Poly feels like NURBS and that is very interesting too.

I supposed to work on character generator using Sverchok. But currently playing wih Renderman also. And thinking of learning Swift.

Brain fragmented in deed.

nortikin commented 10 years ago

@enzyme69 , sverchok not for character modelling. it is better to usr mesh inside blender. but for me sverchok could be used to generate some animation or even interaction in future - i.e. bacteria life and virus life and behaviour with particles boids from blender - this is possible usage

enzyme69 commented 10 years ago

Could be for generic type of procedural characters, because Edge => Skin Modifier. With weight and connection of lines with proportion and parametric, we can create: spider, centipede, bugs, insects and grasshopper and crickets.

zeffii commented 10 years ago

crickets I plan to make this little friend in sverchok purely parametric

So loting needs

These features of the Node are planned, and flash infront of my eyes whenever I think about it. Perfect for flora, fauna and architecture.

enzyme69 commented 10 years ago

Yes, same here. I know it's weird, but the reason Sverchok in Blender can do more.

Procedural Spider in Houdini. https://www.youtube.com/watch?v=2b11iiBjS9Y

zeffii commented 10 years ago

image this is so bad -- i thought it would be humorous to share :)

https://gist.github.com/anonymous/6d1e05555353e438b262

nortikin commented 10 years ago

try to output only grouped vertices, than lines connection node to connect

zeffii commented 10 years ago

yes. will do -- does lines_connection node accept cyclic edge lists ?

nortikin commented 10 years ago

http://www.pasteall.org/blend/29667 cyclic only for one direction, i didn't finished lines connection node, there are many thoughts of it to make universal node.

zeffii commented 10 years ago

image

zeffii commented 10 years ago

yeah, mode to set cyclic in u or v would be great.

nortikin commented 10 years ago

will do

zeffii commented 10 years ago

your profile .blend shows me how I should think about fixing the Loft algorithm :) but will sleep on, let brain process over night

zeffii commented 10 years ago

image

nortikin commented 10 years ago

now i will upload full line connect (some to fix and to clean code left for later) try possibilities: lines-connection1

nortikin commented 10 years ago

i thinking of renaming this node to something like Connection or Geometrise

zeffii commented 10 years ago

or UV EdgeSurf ?

ly29 commented 10 years ago

Line Connection is great indeed.

@zeffii How do you handle orientation of profile and rotation around curve? I always needed to determine profile normal and a orientation vector.

zeffii commented 10 years ago

I haven't done serious code yet.

but a few thoughts:

ly29 commented 10 years ago

Sounds good, here is an old layout to illustrate the problem I had with twist. twist I did an old layout with normal for the profile in January sometime, updated it a bit now with interpolation and line connections which makes it simpler. Didn't solve the twisting problem. https://www.dropbox.com/s/4jbdyjqawul7mrt/updated-loft-test.blend

loft

ly29 commented 10 years ago

In the above case the profile normal could have been easily guessed by the software, also the rotation should be minimized, didn't figure out how to do that in a layout.

zeffii commented 10 years ago

yeah, the twisting is an interesting emergence, and why so prominently at that one corner?

zeffii commented 10 years ago

I know Three.js has some useful implementation of this : http://threejs.org/examples/#webgl_geometry_extrude_splines

I thought lofting was on that list at one point.. must have been seeing things

ly29 commented 10 years ago

The rotation axis gotten from the cross product changes sign.

nortikin commented 10 years ago

if you have triangle, than you have normal - use previouse and next points i made example with snake, but it use only tangent to point

loop tools loft has the same problem - they didn't solve it correctly. no approximation or normal searching

zeffii commented 10 years ago

let's visualize the problem. Step 1 (n, n+1, n+2)... {0..n-2} image

nortikin commented 10 years ago

yes. optionally it could be replaced by user defined vector normal + vector tangent (concerning current point) or even vectorized user-defined normals. such way we could let user (and us) to make loft in different ways and control over all stages

ly29 commented 10 years ago

Two problems with that approach: If 3 points are in line or close to being in a line normal might point anywhere or have big changes for almost straight lines. And more seriously, it isn't that good an approach, as seen here that leads to more twisting than needed. We want to minimize the twisting, in general. To have minimum rotation between the vector and say (0,0,1). What I did above was to define the orientation/direction/tangent, d[i] for a point n[i] by taking d[i]=n[i+1]-n[i-1], from this we can rotate the profile using rotation_difference between profile normal and d[i], however then we need to rotate the profile around d[i] for minimize twist. I am sure there are better approaches... For this to work maybe we should allow over sampling of input and only use every nth point to actually place a profile.

And to have more control we need be able to provide rotation data for each part.

ps And of course d[0]=n[1]-n[0] and likewise for d[n]

Just for fun, my original attempt at this, page 14 in the sverchok thread: http://blenderartists.org/forum/showthread.php?272679-Addon-WIP-Sverchok-parametric-nodes-for-architects&p=2549433&viewfull=1#post2549433

zeffii commented 10 years ago

multi-sampling - yes! As option? not all lofts will need twists n crazy turns

nortikin commented 10 years ago

that is it