#DesignScript LM – Chapter 15-Part II: Translation, Rotation, and Other Transformations

Hi Everyone:

This is the second part of the translation from the fifteenth chapter of the DesignScript Language Manual. It can be found at DSLM  (pages 47-49) and is entitled; Translation, Rotation, and Other Transformations. There also is a companion video tutorial entitled, Transform method (#11), which can be found in 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 15: Part 2;  Translation, Rotation, and Other Transformations (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, lets copy and paste the second page of code from Chapter 15 (page 48) into the Editor. Separate the code by commenting out the “import” statements to avoid a editor malfunction. By activating the code in separate parts we can see the first page with the graphic window results as shown below.

chp_15_Pt2_Translation_Rotation& other_Trans.ds#3_4

chp_15_Pt2_Translation_Rotation& other_Trans.ds#3_4

This page shows at first the translation of the subject cube thru it’s coordinate identity to create a new scale. The bottom of the page shows how Sheared Coordinate systems created and it’s effect on the subject. One can note the error that is being drawn by the unsupported subdivision Mesh command.

Nonetheless copy and paste the script into a blank canvas in the DesignScript Studio program. Edited out the commenting out so the script will be activated, but first make sure that the “import” statements are commented out.

chp_15_Pt1_Translation_Rotation& other_Trans.ds#a2

chp_15_Pt1_Translation_Rotation& other_Trans.ds#a2

After commenting out the last bit of code then, the code-block is activated, and a result is obtained for the first portion of code. Developing and breaking out the script into code blocks is shown in the DS Studio canvas in it’s initial translation.

chp_15_Pt1_Translation_Rotation& other_Trans.ds#a2edited

chp_15_Pt1_Translation_Rotation& other_Trans.ds#a2edited

Here we are reminded that the SubDivisionMesh command failed, therefore a workaround is used thru specifying the faceIndices.

2015_02_05Part2-chapter15_Translation_Rotation_Other_Trans#2

2015_02_05Part2-chapter15_Translation_Rotation_Other_Trans#2

The more detailed and defined translation naming the variables illustrates this and also shows the development of the nodes identification.

chp_15_Translation_Rotation_Other_Transformations#2a

chp_15_Translation_Rotation_Other_Transformations#2a

Then with the naming and identifying complete,  the “Node to Code” operation can take place.

chp_15_Translation_Rotation_Other_Transformations_#2b

chp_15_Translation_Rotation_Other_Transformations_#2b

A little editing is desired.

chp_15_Translation_Rotation_Other_Transformations_#2b-edited

chp_15_Translation_Rotation_Other_Transformations_#2b-edited

The Windows Graphic that is generated from the files.

chp_15_Translation_Rotation_Other_Transformations-48#2a-feature Image2

chp_15_Translation_Rotation_Other_Transformations-48#2a-feature Image2

The method that was used to derive the indices of the cube operations in this chapter is shown below.

chapter 15Translation_Rotation& other_Trans_4_indices

chapter 15Translation_Rotation& other_Trans_4_indices

This is what was posted on the original translation that can still be viewed over at the original designscript.ning.com website. We are going to go over this in the next posting, to clarify it further.

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.

2015_02_02-chapter15_Translation_Rotation_Other_Transformations-48#a2

2015_02_04-chapter15_Translation_Rotation_Other_Transformations-48#2

2015_02_02-chapter15_Translation_Rotation_Other_Transformations-48#a2

2015_02_03-chapter15_Translation_Rotation_Other_Transformations-48#2b

The third part of Chapter 15 will follow.

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