Translating maths to DesignScript Graph-Node
This translation is from the twelfth chapter of the DesignScript Language Manual and can be found at DSLM (pages 38-39) and is entitled; Math. There also is a companion video tutorial on Functions (#9), which can be found in the DS website’s tutorials.
The initial translation was made on the Autodesk DesignScript Community Forum and DesignScript.org. Now it can be found at can be found at Chapter 12 Math, Translating maths to DesignScript Graph-Node. (Note that it can be not longer be found on the Autodesk Labs Website, as linked.)
Open the DS Editor and create a new file and copy and paste the code from Chapter 12 (pages 38-39) into the Editor. Run it, and observe that their aren’t any errors generated, as illustrated and highlighted below. The same can be pasted into a blank canvas of DesignScript Studio.
Below is what the DS Studio canvas looked like in that initial posting.
Edited out the commenting out so the script will be activated, but first make sure that the imported statements are commented out.
As it is developed on the DS Studio canvas the nodes take the place of the script. As noted previously there are a number of functions in the Math Library, such as Floor Ceiling Round as well as standard trigonometric functions i.e.; Sin, Cos etc. to help in manipulating data and to produce algorithms.
A more detailed and defined translation was done and involved naming the variables to identify and reference into them to their corresponding nodes.
Also it might be noted that variations of the circle example were produced through adding additional coordinates and accordingly were not part of the original tutorial, more of that is shown below.
Then with the naming and identifying complete, the “Node to Code” operation can take place.
The Windows Graphic that is generated from the files.
The alternate maths DS Studio canvas produces the Graphic Window as shown below. Color was added to highlight the various graphical reiterations.
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.
Thanks for looking.