Fabric-like Behavior

I am trying to wrap some geometry with surface that behaves like a fabric.
I found similar ideas online and was trying to follow the steps but I am getting warnings on the 1st codeblock. Can anyone point out why it’s not working?
Note: There’s one custom node called “IsLine

Fabric.dyn (113.9 KB)
Fabric Wrap.rvt (1.6 MB)


Yes, those are the steps I was trying to follow, but still getting warnings.
I am trying to do that 1st codeblock with dones, but it’s not working, my coding reading is still basic.

It looks like I found an issue that this code block had, but it still not fully working.

It seems to be working only on round geometries for me.

Fabric.dyn (98.5 KB)


Have you checked this out?


DynaShape looks very interesting and I can’t wait to try it out.
I was looking to do this.

1 Like

I was trying to make this in Dynamo, no luck so far.
This was made in 3Ds Max. Is Dynamo available in 3Ds Max?

I would like to work with this surface and apply various weave patterns.

Created a version that works with polygons

cloth1.dyn (14.2 KB)

obmx = obj1.BoundingBox.MaxPoint;
obmn = obj1.BoundingBox.MinPoint;
obcn = Point.ByCoordinates((obmx.X + obmn.X)/2 , (obmx.Y + obmn.Y)/2 , obmx.Z);

divs = 10;
clt2 = clt1.Translate(Vector.ZAxis(), obmx.Z).PerimeterCurves();
clt3 = clt2<1>.PointAtParameter((0..1..#divs)<2>);

cll1 = Line.ByStartPointEndPoint(clt3<1>,obcn);
cll2 = PolyCurve.ByJoinedCurves(obj1.ProjectInputOnto(cll1,Vector.ByCoordinates(0,0,-1)));
cll3 = Line.ByStartPointDirectionLength(cll2.StartPoint,Vector.ZAxis(),cll2.Length-cll1.Length);

cld1 = NurbsCurve.ByPoints(cll3.EndPoint).Length/divs;
cld2 = Math.Sqrt(Math.Pow(clt2.Length/divs,2)-Math.Pow(cld1,2));

cld3 = List.Shuffle(List.Flatten(List.Transpose(List.Transpose([List.Cycle(0,Math.Floor(List.Count(cll3.EndPoint<1>)/2)),
dis1 = Vector.ByTwoPoints(Point.ByCoordinates(obcn.X,obcn.Y,List.MinimumItem(List.Flatten(cll3.EndPoint,-1).Z)),cll3.EndPoint);

clc1 = PolyCurve.ByJoinedCurves(obj1.PerimeterCurves());

clc2 = NurbsCurve.ByPoints(List.Flatten(cll3.EndPoint.Translate(dis1,cld3),-1),true);

srf1 = PolySurface.ByJoinedSurfaces(List.Flatten([obj1,Surface.ByLoft([clc1,clc2])],-1));

This is pretty cool. Thanks Vikram!
What I like about Dynamo is that it gives a polysurface if I am not mistaken whereas 3Ds Max gives me mesh surfaces and they are hard to work with afterwords.
Could the cloth be applied onto multiple objects just like in the animation above?

1 Like

This woudn’t work on multiple surfaces.
Will need to explore some ideas for that to happen, but not sure if I’ll succeed. :neutral_face:
Also please note that this approach results is an approximation. Just geometry, no physics.

Yes, geometry is what I am after.
I was trying to have the cloth over two table slightly apart, but it failed.