Testing Waters
  • Scrapbook
  • Projects
    • Bamiyan Cultural Center
    • Bauhaus Museum
    • Better Hebbal
    • Bicycle Station
    • Cross Laminated Timber
    • Facade
    • Flowing Fabrication
    • Form from Images
    • Guggenheim Helsinki
    • National War Museum
    • National War Memorial
    • Indflorescence
    • Rectangular Compartments
    • Retail Space Layout
    • Noise Barrier : Swedevia Airport
    • Walden
    • Wilson Garden
  • Patterns
    • Area Graph
    • Array along Curve
    • Fibbonacci and Factorial
    • Gyroid
    • Hexagonal Pattern From Image
    • Hexagonal Grid
    • Koch Star
    • Mandelbrot Set
    • Pattern
    • Pattern
    • Pattern
    • Phyllotaxis
    • Random Strip Widths
    • Skewed Surface
    • Staggered Checkerboard
    • Triangle subdivision
    • Vector Field
    • Voronoi
    • Waves
    • Weave
  • Geometry
    • Boundary Curve
    • Bridging parallel curves
    • British Museum Great Court
    • Catenary
    • Delete Adjacent
    • Geodesic Sphere
    • Group Branching Curves
    • Group Circles
    • Group curves
    • K Mean
    • Nurbs Surface Irregular
    • Overlapping Petals
    • Pair Nearest
    • Parametric Shapes
    • Platonic Solids
    • Polyline to PolyArc
    • Roman Surface
    • Sagrada Familia Schools Roof
    • Sine Curve
    • Sine Ribbon
    • Spherical Transformations
    • Split Rectangle
    • Tangential Circle through Point
    • Travelling Salesman Problem
    • Unaligned Bounding Box
  • Lists
    • Alter by Boolean Sequence
    • Color by distance
    • Consecutive Points
    • Distancing
    • Divide Equally
    • Geometry from Image
    • Image based Point Density
    • Isovists
    • Reduce Color Palette
    • Replace Consecutive
    • Replace Multiple
    • Replace Recurring
    • Shadow Area
    • Shortest Path
    • Solar Analysis
    • Topography Analysis
  • Motion
    • Adjacency
    • Animate Sphere
    • Cellular Automation
    • Cloth
    • Hypotrochoid
    • Manakin
    • Rolling Spiral
    • Tan Curve
    • Trammel of Archemedes
    • Image to Integer
  • Articles
    • A Conceptual Approach to Integrating Computational Methods in Early Stage Design
    • Design Script's ambiguous and versatile Replication Guides <1>
    • Design Script's ambiguous and versatile Replication Guides <2>
Powered by GitBook
On this page
  1. Motion

Cloth

Approximation of cloth draped over a surface

PreviousCellular AutomationNextHypotrochoid

Last updated 4 years ago

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

clt2 = clt1.Translate(Vector.ZAxis(), obmx.Z).PerimeterCurves();
clt3 = clt2.PointAtParameter(0..1..#(clt2.Length/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/(clt2.Length/2);
cld2 = Math.Sqrt(Math.Pow(clt2.Length/(clt2.Length/2),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)),List.Cycle(cld2<1>,Math.Ceiling(List.Count(cll3.EndPoint<1>)/2)<1>)])<1>)<1>,-1)<1>);
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.Clean(List.Flatten(cll3.EndPoint.Translate(dis1,cld3),-1),false),true);

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

3KB
cloth1.zip
archive
Dynamo ver 2.8