I am working on a organic look pattern. I was able to create a 3d shortest walk pattern on a mesh (this is just a little piece of it cut by a box). I could join and extrude a geometry to be be able 3d print it. It is on the right side of the image.
I would prefer a more organic look by adding a bit of curvature to the polylines. The problem is when I change the curve degree to 2 on the nurbs widget, the segments go away from each other. It is possible to have the original network look with nurbs curves? shortest walk pattern.gh (28.9 KB)
Thank you Daniel! It is great. I have to offset the curve in both sides to be able to make printable stuff. However I have noticed that those area where curves are connected are built from invalid curves. It is strange because when I explode them they become simple lines. Why are they invalid?
Ah, I just noticed that there I output the curves in both directions, so each segment is duplicated, which would cause issues when you try and join them.
Anyway, I think it would be better to do the joining inside the script using the graph. I’ll add something for that.
Hello Daniel
your smoothing tool is very good and not exactly the same as mine as I subdivide Curve like Catmull&Clark algorithm. So it is possible to have 2 flavors of smoothing, yours in white and mine in red.
Ah, got it thanks. Yes - mine is essentially laplacian smoothing of the graph vertices, so a different sort of smoothing to the one you get from subdivision. I think both types could have their uses. An interpolating subdivision type might be another nice one - so the curves get smoothed but still pass through all the original points.
Yes, I can add some graph smoothing components.
I think some more general graph components could be good to have in G2. There’s already some better built in tools there for querying adjacencies of meshes, but I find it’s often helpful to also be able to access this sort of data for sets of edges that don’t neccessarily form closed loops around faces.
I hadn’t realised Clipper could do offsets on this sort of curve network too - good to know.
One more little note on this - if you just want to smoothly interpolate the graph, so it goes through the original points, you can use the joining part with the smoothing iterations set to zero: interpolate_graph.gh (8.6 KB)
That animation above is from the same script I posted further up, just increasing/decreasing the number of smoothing steps with a sine function. So here there are no springs/momentum etc, just iteratively moving each graph node to the average of its neighbours positions.
Of course physics was where I was going with this.
There’s a version of this half-edge graph structure as part of multipipe, but one of the things I was playing with it for is relaxation with topology changes - eg. finding Steiner trees: