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

Hi Everyone:

This is the second part of the translation from the twenty-first chapter.

This second section won’t be as long as the previous interpretation but will be broken into three separate parts. But first lets do the usual housekeeping giving the following references:

These translations are from 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 Chapter 22: Surfaces: Part #2, Interpreted, Control Points, Loft, Revolve (Note that it can be not longer be found on the Autodesk Labs Website, as linked)

Lets begin with the first three scripts  from (page 64 &65), copy and paste the scripts into the Design Script Editor.

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve-ds#1of3

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve-ds#1of3

Knowing that the Translate Node is insufficient in collection manipulation, we reached out to one of Autodesk’s thinkers.

Shared wrote;

” You can do one of the two things, a) Put all the three statements that modifies ‘pts’ collection in the same codeblock or b) Define a function that takes the collection as input and return the modified collection as follows:

def TranslatePoints : Point[ ][ ] (points : Point[ ][ ])

{

points[5][5] = points[5][5].Translate(0,0,1);

points[8][2] = points[8][2].Translate(0,0,1);

return = points;

}”

So as we have previously seen, taking the script and inserting it into a DSS blank canvas yields the result as a Code Block as referred to in the first option.

2015_03_09-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#a1

2015_03_09-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#a1

By removing the Commenting out notation, in this case just ” /*” & ” */” the code is activated.

2015_03_09-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#a1-edited

2015_03_09-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#a1-edited

As we break it out of code blocks we need the custom node loaded into the Library.

Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1-edited

Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1-edited

The Node we named “TranslatePoints” as shown above.

Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1-revised

Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1-revised

As we can see this works. Then the development of the various variable properties identifying each node as desired takes place.

Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1a

Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1a

Notice that this Node translation mirrors the brevity and compactness of the original script. Next is the back to Code translation.

Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1b

Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1b

And with that the Graphic Window that results from these examples.

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#1a-Graphic Window

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#1a-Graphic Window

Finally just a reminder that color was introduced for interest and that these files were generated using the Standalone versions of DesignScript. (DSE & DSS)

The files are available to download from the Drop Box links below.

2015_03_12-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve#1

2014_03_07-Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#1a

2015_03_13-Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#1b

TranslatePoints

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