This translation is from the twenty-first chapter of the DesignScript Language Manual and can be found atDSLM(pages 64-66) and is entitled; Surfaces: Interpreted, Control Points, Loft, Revolve. There is a previous video tutorial on Surfaces (#16) which may help with this chapter and can be found on the DS website’s tutorials.

The initial manual translation was made on the Autodesk DesignScript Community Forum and DesignScript.org. Now it can be found at can be found at Surfaces: Interpreted, Control Points, Loft, Revolve . (Note that it can be not longer be found on the Autodesk Labs Website, as linked)

This chapter was broken down into two main sections, with various posts. The first post struggles to come up with a translation with Design Script Studio due to the “Translate” command not being quite compatible with moving a point, it rather copies them, thereby playing havoc with the generation of surfaces from a field of points. The second post will use a custom node to respond to the “Translate command problem”.

But first lets copy and paste the code from the manual and run it in the DS Editor for reference. Open the DS Editor and create a new file, lets copy and paste the code from Chapter 22 (pages 64 &66) into the editor. Run the code in Debug mode and step-in and step-out.

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve_ds

The above illustration is of the DS Editor and shows the results of the code being run, the resulting window graphics are inserted alongside for reference, with the corresponding scripts being noted as 1,2,3,4 & 5.

So lets start with the first translation, on page 64 and paste the script into a blank canvas in DS Studio.

Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#a1

The location in the manual was added, so that needs to be commented out as well as the import statement.

Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#a1-edited

The script is then run, with the editing as shown above. All seems well.

Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1

Continuing with the translation though, as the script is broken off from it’s main code block and translated into nodes we see the BSplineSurfaceByPoints node fails to execute.

Chapter22Surfaces_Interpreted_Control Points_Loft_Revolve#1-insert

Exploring a possible alternative and usingBSplineSurfaceByVertices instead of BSplineSurfaceByPoints the following result can be achieved.

Reiterating the previous post, from surfaces pt.II, on the DesignScript site; “The Translate command in graph node form is effective in copying a point and moving it to the designated coordinates, but it’s insufficient in collection manipulation.”

Generating a work-around to get a semblance of the bumped surface, it was decided to lay out a field of points, then create an outline which could be used as guidelines for lofting a similar surface. The initial DS canvas is shown below.

Chp-22Surfaces_Interpreted_Control Points_Loft_Revolve#1

Continuing on with the more detailed and defined translation with the naming of the variables to identify and reference into them to their corresponding nodes.

Chp-22Surfaces_Interpreted_Control Points_Loft_Revolve#1a

This is quite long and arduous, especially in light of the initial few lines of code that is the subject for translation into Nodes. As a reminder, a click on the graphics will produce a enlarged view of each snapshot.

Continuing on to the “Node to Code” operation completes the translation circle. The results a shown below.

Chp-22Surfaces_Interpreted_Control Points_Loft_Revolve#1b

To aid in editing the highlighted Variables in this long “Code Block“, the code is copied and pasted into the DS Editor. This will make the editing easier.

After identifying the unnamed variables and giving them a suitable identity, the editor is run in Debug mode in order to copy and paste the various graphic illustrations as they are generated along side the various stages of script.

Chp-22Surfaces_Interpreted_Control Points_Loft_Revolve#1b-edited-alt

A selection of Graphics Windows that result from the script are shown below.