#DesignScript LM – Chapter 22, Part 1- Surfaces: Interpreted, Control Points, Loft, Revolve

Hi Everyone:

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.

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

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

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

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

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

Chapter22Surfaces_Interpreted_Control Points_Loft_Revolve#1-insert

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

2015_03_09-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1-insert2

2015_03_09-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1-insert2

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.

2015_03_09-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1-insert3

2015_03_09-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1-insert3

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

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

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

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.

2015_03_03-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve_ds#1a-insert

2015_03_03-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve_ds#1a-insert

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

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

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

Chp-22Surfaces_Interpreted_Control Points_Loft_Revolve#1a-Graphic Window1

Chp-22Surfaces_Interpreted_Control Points_Loft_Revolve#1a-Graphic Window1

 

Chp-22Surfaces_Interpreted_Control Points_Loft_Revolve#1a-Graphic Window2

Chp-22Surfaces_Interpreted_Control Points_Loft_Revolve#1a-Graphic Window2

Chp-22Surfaces_Interpreted_Control Points_Loft_Revolve#1a-Graphic Window3

Chp-22Surfaces_Interpreted_Control Points_Loft_Revolve#1a-Graphic Window3

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.

2015_03_09-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#a1

2015_03_09-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#a1a

2013_11_21-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1

2014_03_03-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1a

2014_03_03-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1b

2014_03_03-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1b-modified

2015_03_03-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve_ds#1a

The next and second post on this chapter will show the custom node creation to successfully complete the translations.

Thanks for looking.

T!M

 

 

 

 

 

Advertisements

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