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

Hi Everyone:

Continuing on in the second part of Chapter 22, this is the third post, but first in review;

This translation is from (page 65) the DesignScript Language Manual, and can be found at DSLM  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)

The first three scripts from (page 64 &65, copied & pasted) the Design Script Editor are shown below with the second script & image being the subject of this post.

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve-ds#3

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve-ds#3

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 shown above in the third script.

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#a3

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#a3

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

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#a3-edited

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#a3-edited

As the Translate Node is insufficient in collection manipulation a custom node is needed and developed as follows;

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;

}”

The Node we named “TranslatePoints” as shown above.

Chapter 22-Surfaces-Interpreted-Control-Points-Loft-Revolve#2-insert3

Chapter 22-Surfaces-Interpreted-Control-Points-Loft-Revolve#2-insert3

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

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#3

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#3

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

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#3a

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#3a

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

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#3b

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#3b

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

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#3-Graphic Window

Chp_22-Surfaces-Interpreted-Control-Points-Loft-Revolve#3-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_16_Chp-22-Pt-2_Surfaces-Interpreted-Control-Points-Loft-Revolve#a3

2013_11_25-Chp-22-Pt-2_Surfaces-Interpreted-Control-Points-Loft-Revolve#3

2014_03_07_Chp-22-Pt-2_Surfaces-Interpreted-Control-Points-Loft-Revolve#3a

2015_03_17_Chp-22-Pt-2_Surfaces-Interpreted-Control-Points-Loft-Revolve#3b

2015_03_12-Chapter-22Surfaces_Interpreted_Control Points_Loft_Revolve_ds#3

TranslatePoints

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