nortikin / sverchok

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

Sv Curve node - Some thoughts #758

Closed zeffii closed 8 years ago

zeffii commented 8 years ago

At present (2015 Dec) this node only produces single Segment Curves of type 'POLY' . This just means

  vertex ------------ vertex  ------------ vertex ------------ vertex

  becomes

  vertex ------------ vertex      
  vertex ------------ vertex
  vertex ------------ vertex

And that's all it was designed to do. This only uses a very small portion of the available features of Curve Objects. It's definitely a bit of a compromise. but handy for renderable edges.

Naturally you might want to feed it multi-segment polylines, or even rings (cyclic). Most of the code is already in place for that, but extra logic needs to be added to allow us to switch between single segments and chained segments, or cyclic segments.

To me it makes the most sense if we add an extra enum to decide ( segments | chains | cyclic chains ) and if in chains / cyclic chains mode there could be a U subdiv level to get smooth splines from fewer points.

zeffii commented 8 years ago

What should the node be able to do?

These are the scenarios

verts + edges + faces inputs:

zeffii commented 8 years ago

I'd propose to call it the Curve Output node, and give it Enums for the various modes [Path, Bezier, 3ptArc] and within these modes also have submodes where applicable.

zeffii commented 8 years ago

but.. because these top-level modes are so different, i'm inclined to make them separate nodes but register them from the same file. There's a lot that can be reused between nodes, and i'd love to get away from the Greek naming.

zeffii commented 8 years ago

no more groups, use parent instead. that simplifies some code

for i in obj.children:
...     i.select=1
nortikin commented 8 years ago

yes, all that was in mind, but i needed fast solution to show what Sverchok can do. Next step to organize mk1/mk2 for enum and others.

zeffii commented 8 years ago

https://github.com/nortikin/sverchok/tree/CurveOutput i did start branch . hope to find time tomorrow start getting it useable.

zeffii commented 8 years ago

uch... this needs a polyline mode :) meaning: if edges are not connected, then the node assumes that each list of vertices are intended to be connected continuously like a polyline..

zeffii commented 8 years ago

Okay, instead I think this deserves a polyline node (not Mode,.... Node! ). This should give a chance to streamline some of what feels bloaty about svCurvenode..

https://github.com/nortikin/sverchok/tree/curve_node_polylines_mode (crappy name for branch... it's a new Node)

zeffii commented 8 years ago

also... it doesn't work yet :)