This translation is from the twenty-first chapter of the DesignScript Language Manual and can be found at DSLM (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.
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.
The location in the manual was added, so that needs to be commented out as well as the import statement.
The script is then run, with the editing as shown above. All seems well.
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.
Exploring a possible alternative and using BSplineSurfaceByVertices instead of BSplineSurfaceByPoints the following result can be achieved.
Note that by adding a value for u & v Degree a result is achieved, but not one that is workable as the graphic below shows.
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.
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.
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.
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.
A selection of Graphics Windows that result from the script are shown below.
Reiterating, this was done on the stand-alone version of DesignScript, rather than as a plugin for AutoCAD. The files are available for downloading from the Drop-Box links below.
The next and second post on this chapter will show the custom node creation to successfully complete the translations.
Thanks for looking.