I have this curved surface with UV grid. How would I go about mapping my seamless pattern (image) into the grid? Should the grid be equality divided for it to work?
Surface - UV Grid Image Mapping.dyn (13.7 KB)
I have this curved surface with UV grid. How would I go about mapping my seamless pattern (image) into the grid? Should the grid be equality divided for it to work?
Original Image (Seamless Pattern)
You might want to look into the pattern toolkit package, as that may save you some time for the type of work you are after. The Alias integration with Dynamo has some great videos on how to use them starting here:
//Sample Surface
sr = Surface.ByLoft([NurbsCurve.ByPoints(Point.ByCoordinates
(-50,[0,12,1,3],[0,25,50,75])),NurbsCurve.ByPoints
(Point.ByCoordinates(50,[0,-8,1,4],[0,30,62,75]))]);
//Image repetition
n = 7;
//Replicating brightness data
b1 = Math.Floor(Color.Brightness(Image.Pixels(img,8,8)));
b2 = List.Flatten(List.OfRepeatedItem(List.Flatten
(List.OfRepeatedItem(b1<1>,n)<1>,-1),n),1);
// Parameters on surface
c = 0..1..# (8*n);
//Shifting points by brightness normal to surface
p1 = Surface.PointAtParameter(sr,c<1>,c<2>);
v1 = Surface.NormalAtPoint(sr,p1);
v2 = v1.Scale(b2==0?-1:b2);
v3 = List.Transpose(v1).Scale(b2==0?1:-1);
p2 = p1.Add(v2);
p3 = List.Transpose(p1).Add(v3);
//Loft based on curve connecting points
n1 = List.Flatten(NurbsCurve.ByPoints([p2,p3]),-1);
n2 = Circle.ByPlaneRadius(n1<1>.PlaneAtParameter(0..1..#60)<2>,0.25);
n3 = Solid.ByLoft(n2,n1);
Here is the graph version of the initial steps of a similar process.
This is like music to my ears, which I enjoy and understand, but have very little knowledge to make it myself.
I see that the surface is in your script. Now how can I take my surface that I have modeled in dynamo and use your coding to apply weaving onto it?
weave1 Surface.dyn (199.0 KB)
Yes. Just remove the sample surface provided
However, the loft/sweep (the last line in the code) might sometimes generate an error (though it seems to create majority of the geometry)