#DesignScript LM – Chapter 13 Translation – Curves: Interpreted And Control Points – Part II

Hi Everyone:

This is the second part of the translation Curves: Interpreted And Control Points, from chapter thirteenth of the DesignScript Language Manual.

To reiterate, the manual can be found at DSLM , (pages 40-43) and is entitledThere also is a companion video tutorial on – Curves: Splines, BSplineCurves, Interpolation  (#10), which can be found in the DS website’s tutorials. Also the initial manual translation can be found at can be found at Chapter 13, Curves: Interpreted (part 2)  (Note that it can be not longer be found on the Autodesk Labs Website, as linked.)

“DesignScript generates curves through control points (vertices) by specifying  the amount and type of smoothing that takes place, which is called the “degree”.  B-Spline Curves can be smoothed to degree 11, while a 1-degree curve has no smoothing and is a polyline.”

Open the DS Editor and create a new file, lets copy and paste the second page of code from this chapter (chap-13, pages40) into the Editor.  Run it, and observe that their aren’t any errors generated, as illustrated and highlighted below.

chapter13_Curves_Interpreted&Control_Points.ds_part#2

chapter13_Curves_Interpreted&Control_Points.ds_part#2

The same can be pasted into a blank canvas of DesignScript Studio.

chapter13_Curves_Interpreted&Control_Points_part#a2

chapter13_Curves_Interpreted&Control_Points_part#a2

Edited out the commenting out so the script will be activated, but first make sure that the imported statements are commented out.

chapter13_Curves_Interpreted&Control_Points_part#a2-edited

chapter13_Curves_Interpreted&Control_Points_part#a2-edited

While a result can  be obtained from the first part of this script, the second part is not supported by the DS Studio version. “Class and function definitions are not supported”

As it is developed on the DS Studio canvas the nodes take the place of the script.  Below is what the DS Studio canvas looked like in the initial translation.

chapter13_Curves_Interpreted&Control_Points_part#2-alt+

chapter13_Curves_Interpreted&Control_Points_part#2-alt+

Going left to right, first breaking out the script from the initial canvases large code block in the center, then moving to the right, replacing the script with nodes from the library.

chapter13_Curves_Interpreted&Control_Points_part#2a

chapter13_Curves_Interpreted&Control_Points_part#2a

A more detailed and defined translation was done and involved naming the variables to identify and reference into them to their corresponding nodes. Then with the naming and identifying complete,  the “Node to Code” operation can take place.

chapter13_Curves_Interpreted&Control_Points_part#2b

chapter13_Curves_Interpreted&Control_Points_part#2b

A little editing is desired as highlighted above.

chapter13_Curves_Interpreted&Control_Points_part#2b-edited

chapter13_Curves_Interpreted&Control_Points_part#2b-edited

The Windows Graphic that is generated from the files.

chapter13_Curves_Interpreted&Control_Points_part#2-Graphic Window

chapter13_Curves_Interpreted&Control_Points_part#2-Graphic Window

Note that colors were added in this translation, to highlight the geometry in the Graphic view window. 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.

chp_13-curve_interpolated&control_pt-tutorial_part_a2

2015_01_23-chp_13-curve_interpolated&control_pt-tutorial_part_2

chp_13-curve_interpolated&control_pt-tutorial_part_2a

chp_13-curve_interpolated&control_pt-tutorial_part_2b

Thanks for looking.

T!M

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s