Skip to content
April 9, 2012

Curve Fitting Script

This is a very simple curve fitting script to find where a short curve fits best along longer curve. I’ve developed this script in the context of my on-going work with bamboo weaving.

The curve fitting script finds where a short curve fits best along longer curve.

The Nest Roof is a result of woven bamboo beams following paths of minimum curvature along a funicular surface.

A 1:50 scale model of the Nest Roof

While the bamboo beams may follow paths of minimum curvature, one is still left with the possibility to further optimize the selection of where along a beam profile to use each individual piece of bamboo. Bamboo being a natural material does not have uniform properties and every piece of bamboo is different. Every piece has a different shape and bends by a different amount. Therefore different pieces of bamboo will be suited to different parts of the roof with different beam curvature. Selecting the right piece of bamboo for a given segment of a beam is fundamentally finding where along the beam a given piece of bamboo fits best so that it will have to be bent a minimum amount, which is what this script does. However, it is far from clear how exactly, and if at all, the script can be used during construction. The principal problem is finding a work flow whereby the curvature of each individual piece of bamboo can be recorded and digitized so as to form an input for this script (or some version of it) during construction, and a way to convey the result of the script in real time to the craftspersons building the roof. These issues were tackled in my SMArchS thesis, but only at a theoretical level and at a table top model scale. I hope to be able to carry this forward to a building scale and a live project through the Nest Roof.

The script uses a very crude brute force algorithm that incrementally slides a short curve (representing an individual piece of bamboo) along a longer curve (the beam profile) while checking the deviation between the two curves at each increment. The length of the increment can be specified and the smaller the increment the more accurate the result will be. An interesting by-product of the brute force algorithm is the plant like shapes that it produces. “Leaves” appear to sprout as the script slides one curve along the other, and then the “leaves” are then shed as the script deletes all but the best-fit result.

"Leaves" formed during the running of the script

Below is a version of the script that works on planar curves, but the same idea can be expanded to apply to 3D curves as well –

Option Explicit
‘Script written by <Ayodh Kamath>
‘Script copyrighted by <Kamath Design Studio/PostScriptDesign>
‘Script version 08 April 2012 14:18:42

Call Main()
Sub Main()

Dim strCrv1, strCrv2, dblDivLength, arrDivPts1, arrDivPts2
Dim intCheckPt, strAlignCrv
Dim intCount, intMin
Dim j, i

strCrv1 = Rhino.GetObject(“Select guide curve to check against”,4)
strCrv2 = Rhino.GetObject(“Select curve to check”,4)

dblDivLength = (Rhino.CurveLength(strCrv2))/10
dblDivLength = Rhino.GetReal(“Enter division length:”, dblDivLength)

arrDivPts1 = Rhino.DivideCurveLength(strCrv1, dblDivLength)
arrDivPts2 = Rhino.DivideCurveLength(strCrv2, dblDivLength)

ReDim arrDot(UBound(arrDivPts1))

For i = 0 To UBound(arrDivPts1)

arrDot(i) = Rhino.AddTextDot(CStr(i), arrDivPts1(i))

Next

intCheckPt = Rhino.GetInteger(“Enter point number to check from”, 0, 0, (UBound(arrDivPts1) – UBound(arrDivPts2)))
Call Rhino.DeleteObjects(arrDot)

ReDim arrDev(((UBound(arrDivPts1) – UBound(arrDivPts2) – intCheckPt + 1)*(UBound(arrDivPts2))) – 1)
ReDim arrAlignCrvs(((UBound(arrDivPts1) – UBound(arrDivPts2) – intCheckPt + 1)*(UBound(arrDivPts2))) – 1)

intCount = 0

For i = intCheckPt To (UBound(arrDivPts1) – UBound(arrDivPts2))

For j = 1 To UBound(arrDivPts2)

arrAlignCrvs(intCount) = Rhino.OrientObject(strCrv2, Array( arrDivPts2(0), arrDivPts2(j)), Array(arrDivPts1(i), arrDivPts1(i + j)),1)

arrDev(intCount) = Deviation(strCrv1, arrAlignCrvs(intCount), i, dblDivLength, arrDivPts1)

intCount = intCount + 1

Next

Next

intCount = intCount – 1

intMin = Minimum(arrDev)

For i = 0 To UBound(arrDev)

If i <> intMin Then

Call Rhino.DeleteObject(arrAlignCrvs(i))

End If

Next

Call Rhino.SelectObject(arrAlignCrvs(intMin))

End Sub

Function Deviation(ByRef strCrv1, strAlignCrv, intFnCheckPt, ByRef dblDivLength, ByRef arrDivPts1)

End Function

Function Minimum(arrCheck)
End Function

April 4, 2012

Digitally Guided Weaving & Other Installations from the Spanz Workshop at SSAA.

"Floating Triads"Canopy Design from the Spanz Workshop at Atharva 2012. Photograph: Yogesh Verma

Lighting Module from the Spanz Workshop. Image: Pragya Vij, Saalanki Saraf

A part of this semester’s 3rd year design studio at Sushant School of Art & Architecture consisted of an introductory workshop on the use of digital design tools that we called Spanz. The workshop was taught by Abhishek Bij and me (both visiting design faculty at the 3rd year design studio) and supported by the rest of the 3rd year design faculty consisting of Shikha Doogar, Gaurav Shorey, Swati Singh, Thomas Oomen and Neeraj Khosla. The workshop started with a crash course on a variety of digital design tools including 3D modelling software, form finding tools, parametric modelling software and form rationalization tools – tools that are applicable to different stages of the digital design workflow, from conceptualization to fabrication. The tools developed tackled a range of structural systems (tensile membranes, funicular shells and folded plates) and fabrication methods (weaving, pipe bending, sheet metal forming, concrete casting etc.).

The students were encouraged to mix and matched these tools to suit their design goals and design styles and no specific methodology was imposed on them. The tools were applied to various real life campus development projects as a part of their annual college festival (Atharva 2012, 30th-31st March) and ranged from canopies to installations to lighting design. The nuances of the digital tools were mastered by them while using them for their developing their designs.

The Interlace Installation. Photo: Gauri Varshney

A student installation of specific interest here is “The Interlace” designed by Akshita, Anushree, Gauri, Parush, Sumit and Suvrita because it is the first time the weaving script I had developed and posted earlier has been applied to a large scale project. The weaving script simply takes a given fibre spacing and fibre thickness and uses the U- and V- curves of a surface to derive fabrication data for the weaving process. My interest in weaving comes from the way it allows complex 3D curved surfaces to be fabricated using only linear measurements (which I have discussed in detail in this earlier post). In “The Interlace” the students started out by using a form finding algorithm based on David Rutten’s classic mesh relaxation algorithm. The basic mesh relaxation algorithm was modified specifically for the workshop to allow the students to model the effects of gravity and thereby generate funicular forms in addition to tensile membranes (I will be explaining the modifications made to the algorithm in another blog post shortly). The relaxed mesh was converted to a NURBS surface and the weaving script was applied to it. The script outputted the lengths of individual fibres and the points of intersection with other fibres along their length. The fabrication data was used to first build a 1:10 scale construction model where the students could test the fabrication process and the steps involved.

The 1:10 Construction Model

Once the construction process was developed and understood in the studio, the students proceeded to build the final installation. Since the college festival is student-run and student-managed, the direct role of the design faculty ended at the construction model stage. Comparing the construction model to the final installation, it is interesting to note that the percentage error in the linear measurements was more in the construction model and less in the final installation, meaning that the final installation was a closer match to the computer model than the construction model. The properties of the pipe used to make the final installation were different from the construction model in terms of their ability to resist compression, resulting in a small amount of creasing of the surface of the final installation. Overall, however, this installation appears to verify the feasibility of using weaving to manually fabricate computer generated 3D curved surfaces at a 1:1 scale.

December 21, 2011

The Hypar Solar Cooker

The Hypar Solar Cooker is a solar cooker with a hypar reflector developed by Kamath Design Studio about five years ago. The hypar surface is easily constructed using an old basket, bamboo and mud with embedded pieces of broken mirror (or any other reflective material). The curvature of the hypar surface helps to concentrate more sunlight on to the cooking food compared to a conventional flat reflector on a box solar cooker. The old basket gives shape to the base which holds a cooking pot with a glass lid. The mud acts as a cheap and readily available insulating material as well as an easily mouldable material to create the curved surface of the hypar on the bamboo framework. However, the exact shape of the hypar was, up to this point being found by trial and error.

I am now working on a digital tool that can customize the shape of the hypar based on the geographical location of the solar cooker, its orientation, and the time of the day it will be most used. The digital tool will give the lengths of the bamboo edge members and central members required to build the customized, optimal hypar shape. I hope to test the efficacy of this through physical prototypes as soon as the fog lifts off North India and we have more sun in Delhi. The main issue I want to test through the prototypes is how much the manual construction methods using bamboo, mud and mirrors deviate from the digitally derived hypar surface and the effect the deviation has on the performance of the reflector.

July 15, 2011

Ghosla: A Curvature Optimized Woven Bamboocrete Roof

“Ghosla” (meaning “nest” in Hindi) is a bamboocrete roof designed by Kamath Design Studio for a 150 square meter guest house unit at the Gnostic Centre in New Delhi, India.

Curvature optimized weaving: Surface paths with minimum cumulative curvature compared to a UV transformed hexagonal grid

The shape of the roof comes from a structural form-finding process dictated by the floor plan of the building and the resulting positions of the supporting columns. A RhinoScript was used to find optimized paths for woven members on this surface. The paths found using the script are those with minimum cumulative curvature passing through a given set of points on the surface. This enables the bamboo members used in the weaving to have as large a cross-sectional diameter as possible (and thus as high a load bearing capacity as possible) since they do not need to bend much and need not be extremely flexible. The advantage of using these optimized paths can be seen when comparing them (extreme right, above) to the simple UV transformed hexagonal grid (second from the right, above). The simple UV transformed grid has member paths with significantly higher curvature which will require more flexible (and thus thinner and weaker) bamboo members for its construction.

Stepping back in the design process, the design-computational reason for constructing this roof by weaving bamboo came from the need to devise a work-flow and construction methodology that would enable the construction of a digitally designed complex curved surface (the form-found roof shape) by simple manual construction techniques in a non-industrial setting. Weaving is an ancient process that is in the technological repertoire of most cultures. What makes weaving especially suited to the construction of curved surfaces is the fact that it can use linear, one-dimensional elements to produce a surface curving in three-dimensions and requires only linear measurements during construction. I have discussed the details of this in my earlier post on Weaving and Linear Measurement in Digitally Guided Construction.

The success of this digital-to-physical work-flow can be seen in the 1:25 scale model of the roof that was constructed by carpenter Ram Lakhan with the guidance of Inderjeet Singh Seera of Kamath Design Studio using linear dimensional information obtained from a 3D computer model of the woven roof. Here are some photographs of the model just before completion -

1:25 Scale Model of the Woven Bamboo Roof Under Construction

1:25 Scale Model of the Woven Bamboo Roof Under Construction

 

1:25 Scale Model of the Woven Bamboo Roof Under Construction

While there is no doubt that there will be numerous challenges that will have to be overcome during full-scale construction, the progress on this project so far shows the ability of weaving to be used for the construction of complex curved surfaces by manual means using linear dimensional information.

The bamboocrete roof that this woven structure will support will be similar to earlier bamboocrete roofs designed by Kamath Design Studio. The woven bamboo structure of the “Ghosla” roof will replace the steel and eucalyptus log trusses used to support these earlier roofs.

Exterior View of the Bamboocrete Roof at the Kamath Residence

Interior View of the Bamboocrete Roof at the Kamath Residence

July 11, 2011

Weaving and Linear Measurement in Digitally Guided Construction

Measuring the length of a straight line in the physical world is to test the geometric congruency of two one-dimensional objects – an object of standardized length against an object of unknown length. All one-dimensional objects share the property of similarity and can therefore be “placed against each other” as physical objects (strictly speaking there are no “real” one-dimensional objects but this statement will still apply to the one-dimensional edges of higher-dimensional objects). To make two one-dimensional objects congruent requires breaking/cutting the longer of the two at a single point or stretching the shorter of the two along a single direction.

While all this may seem painfully obvious, the uniqueness of the situation is highlighted when you think about how hard it is to make two non-similar objects of higher dimensions congruent or similar. For example, here is a device for replicating three-dimensional sculptures with the ability to change the size of the reproduction. (For more information about this device you can read this article). Now compare this device to using a ruler and pair of scissors to make two pieces of string the same length.

Source: http://www.thecarvingpath.net/forum/index.php?showtopic=1278

George Stiny shows how a boundary function is able to map algebras of different dimensions to each other (Shape: Talking About Seeing and Doing, p. 98).  In terms of construction, a boundary function can provide ‘templates’ or ‘jigs’ or ‘frameworks’ or ‘guides’ (depending on your method of construction) for objects of a higher dimension using objects of lower dimensions. To cite an example of a project I was personally involved in, the form-work of the Santa Monica Cradle project is an example of two-dimensional plywood ribs being used as a framework for creating a complex, curved, three-dimensional surface from strips of flexible ‘luaun’ ply. In fact, most approaches to constructing an architectural surface involves some kind of underlying linear framework.

The skinning of the plywood framework with strips of flexible luaun.

A Surface

A Divided Surface

The Boundaries Of The Divisions Form A Framework

If a complex three-dimensional shape can be built using a ‘framework’ of linear shapes, then it can be constructed through simple measurements of length. The most basic way to go from a one-dimensional boundary to a two-dimensional shape through linear measurement alone is through triangles. This method has been used since the time of ancient Egypt where it was used to measure the (two-dimensional) area of land holdings using (one-dimensional) rope as a measuring device.

The ‘Suspension’ series of installations by Ball-Nogues Studio (some of which I was fortunate to be a part of) consist of a series of threads cut to specific lengths, coloured at specific intervals and hung from specific points to form a series of catenaries. When seen together, the strings form complex, multi-coloured, three-dimensional “clouds” suspended in mid air.

“Suspensions: Feathered Edge by Ball-Nogues Studio”. MoCA PDC, Los Angeles, 2007.

A sturdier and more ancient way of combining linear elements into objects of higher dimensions is weaving. The weaving of cloth goes from one-dimensional thread to a two-dimensional cloth, and the weaving of baskets goes from one-dimension strips (of cane, bamboo, rattan or other materials) to a three-dimensional surface. Kenneth Snelson shows how a tensegrity structure can be thought of as a three-dimensional polyhedron woven out of linear elements.

A surface woven from digitally derived linear fabrication data.

The first bamboo Parametric Pavilion. Kamath Design Studio, New Delhi, 2010.

The process of weaving is therefore an ideal candidate for a manual construction process involving only linear measurement that can be used to construct a digitally designed, complex curved surface. I had woven a quick model based on this premise some months ago using linear fabrication data obtained by running this script on a test surface. After the successful construction of the first bamboo Parametric Pavilion I am now attempting the design and construction of a more complex woven bamboo roof structure for a 150 square meter guest house building. This project will be a test case for implementing the idea of using digitally derived linear construction data for the manual weaving of a complex curved surface.

April 11, 2011

The First Parametric Pavilion

This slideshow requires JavaScript.

Photographs: Kamath Design Studio

The first Parametric Pavilion was inaugurated as a part of the Anniversary Celebrations of the Gnostic Centre on the 28th of March. The pavilion forms an extention to the new conference centre also designed by Kamath Design Studio.

Below are links to earlier posts about the design and construction of this project -

February 21st, 2011: Parametric Pavilion Construction Update

January 3rd, 2011: Parametric Pavilion Construction Progress

November 21st, 2010: Parametric Pavilions

March 27, 2011

Physical-Digital Sphere Packing Experiment

In an earlier post I had discussed a script for packing a single layer of spheres on a complex curved surface. A script of this type that I developed was used in the Cradle project by Ball-Nogues Studio. However, in the Cradle project the script had been used only to generate possible simulations of the design for structural analysis (done by Buro Happold) and for estimating material quantities prior to the start of fabrication. The script was not used to generate the exact placement of spheres in the final project. A 3D model produced by the script was only used as an approximate guide for the placement of spheres during construction. The reason for this was that any small deviations between the physical construction and the digital model could cause large differences in the packing of the spheres. I had discussed this in detail in a post titled ‘Santa Monica Cradle: Reflections on Craft and Computation’.

The following script and physical experiment using the script bridges the gap between the digital model and the physical construction process by digitally simulating the packing of the spheres in parallel with their physical packing. This script allows for a digital tolerance in order to absorb imperfections in the physical model. This process does not allow the digital model to dictate the physical construction but instead allows the digital model to mimic the physical packing of imperfect spheres on an imperfect surface.

The physical experiment involved packing spherical ball-bearings (with rust on their surface creating imperfections) on a simple conical paper surface. The paper cone was made from regular letter paper by cutting out a circle with a scissors and folding it into a cone and taping it with sticky tape. The result was thus an imperfect conical surface. The following montage of screen shots from the running script and the steps in the physical sphere packing show how the script and physical construction run in parallel. The tolerance required here was 0.001″

The way in which I hope to make use of this script is to use the resulting 3D model of the physical sphere packing as a basis to design components that can be custom made to interface with a given physical configuration of spheres.

Below is the script used in this experiment:

Option Explicit
‘Script written by <Ayodh Kamath>
‘Script copyrighted by <Ayodh Kamath>
‘Script version Friday, March 25, 2011 10:15:38 PM

Call Main()
Sub Main()
 
 Dim arrSurf, arrSphere1, arrSphere2
 Dim arrBoundingBox, realRadius1, realRadius2, arrLine, arrCentre1, arrCentre2, binCarryOn, arrJoin, arrIntCrv, arrIntPt1, arrIntPt2, realDist1, realDist2, arrCentre
 Dim arrSphere, arrSurf1
 Dim realRadius, arrSidePt
 Dim arrIntSphere1, arrIntSphere2, arrInt
 Dim arrSpheres, intUnselect
 Dim i, j

 arrSurf = Rhino.GetObject(“Select surface to populate”)
 arrSphere1 = Rhino.GetObject(“Select first sphere”)
 arrSphere2 = Rhino.GetObject(“Select second sphere”)
 
 arrBoundingBox = Rhino.BoundingBox(arrSphere1)
 realRadius1 = (Rhino.Distance(arrBoundingBox(0), arrBoundingBox(1)))/2
 arrLine = Rhino.AddLine(arrBoundingBox(0), arrBoundingBox(6))
 arrCentre1 = Rhino.CurveMidPoint(arrLine)
 Rhino.DeleteObject arrLine
 
 arrBoundingBox = Rhino.BoundingBox(arrSphere2)
 realRadius2 = (Rhino.Distance(arrBoundingBox(0), arrBoundingBox(1)))/2
 arrLine = Rhino.AddLine(arrBoundingBox(0), arrBoundingBox(6))
 arrCentre2 = Rhino.CurveMidPoint(arrLine)
 Rhino.DeleteObject arrLine
 
 binCarryOn = 1
 
 Do While binCarryOn = 1
 
  realRadius = Rhino.GetReal(“Enter radius of tangent sphere:”)
  arrSidePt = Rhino.GetObject(“Select point in desired direction”)
 
  arrSphere1 = Rhino.AddSphere(arrCentre1, (realRadius1+realRadius))
  arrSphere2 = Rhino.AddSphere(arrCentre2, (realRadius2+realRadius))
 
  arrInt = Rhino.SurfaceSurfaceIntersection(arrSphere1, arrSphere2,, vbTrue)
  Rhino.DeleteObject arrSphere1
  Rhino.DeleteObject arrSphere2
  
  If UBound(arrInt)>0 Then
    
   ReDim arrSegments(UBound(arrInt))
    
   For j = 0 To UBound(arrInt)
     
    arrSegments(j) = arrInt(j,1)
     
   Next
    
   arrJoin = Rhino.JoinCurves(arrSegments, vbTrue)
     
   arrIntCrv = arrJoin(0)
    
  Else
    
   arrIntCrv = arrInt(0,1)
    
  End If
  
  arrSurf1 = Rhino.OffsetSurface(arrSurf, realRadius)
  arrInt = Rhino.CurveSurfaceIntersection(arrIntCrv, arrSurf1)
  Rhino.DeleteObject arrIntCrv
  Rhino.DeleteObject arrSurf1
  
  If IsArray(arrInt) Then
   
   If UBound(arrInt)>0 Then
    
    arrIntPt1 = arrInt(0,1)
    
    arrIntPt2 = arrInt(1,1)
    
    realDist1 = Rhino.Distance(arrIntPt1, Rhino.PointCoordinates(arrSidePt))
    
    realDist2 = Rhino.Distance(arrIntPt2, Rhino.PointCoordinates(arrSidePt))
    
    If realDist1>realDist2 Then arrCentre = arrInt(1,1)
    
    If realDist2>realDist1 Then arrCentre = arrInt(0,1)
    
   Else
    
    ’arrCentre = arrInt(0,1)
    
   End If
   
  End If
  
  arrSphere = Rhino.AddSphere(arrCentre, realRadius)
  
  Rhino.Command “SelClosedSrf”
  
  arrSpheres = Rhino.SelectedObjects
  
  For i = 0 To UBound(arrSpheres)
   
   arrInt = Rhino.SurfaceSurfaceIntersection(arrSphere, arrSpheres(i), 0.001, vbTrue)
   
   If IsArray(arrInt) Then
    
    If (arrInt(0,0) <> 4) And (arrInt(0,0) <> 5) Then
    
     Rhino.DeleteObject arrSphere
     intUnselect = Rhino.UnselectAllObjects
     Rhino.Command “SelCrv”
     Rhino.Command “Delete”
     
    End If
    
   End If
   
  Next
  
  Call Rhino.Command(“_ViewCaptureToFile”)
   
  arrSphere1 = Rhino.GetObject(“Select first sphere”)
  
  If Not IsNull(arrSphere1) Then
   
   arrSphere2 = Rhino.GetObject(“Select second sphere”)
   
   arrBoundingBox = Rhino.BoundingBox(arrSphere1)
   realRadius1 = (Rhino.Distance(arrBoundingBox(0), arrBoundingBox(1)))/2
   arrLine = Rhino.AddLine(arrBoundingBox(0), arrBoundingBox(6))
   arrCentre1 = Rhino.CurveMidPoint(arrLine)
   Rhino.DeleteObject arrLine
 
   arrBoundingBox = Rhino.BoundingBox(arrSphere2)
   realRadius2 = (Rhino.Distance(arrBoundingBox(0), arrBoundingBox(1)))/2
   arrLine = Rhino.AddLine(arrBoundingBox(0), arrBoundingBox(6))
   arrCentre2 = Rhino.CurveMidPoint(arrLine)
   Rhino.DeleteObject arrLine
   
  Else
   
   binCarryOn = 0
   
  End If
 
 Loop
 
End Sub

Follow

Get every new post delivered to your Inbox.