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

Hi Everyone:

This translation is from the fifteenth chapter of the DesignScript Language Manual and 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 1;  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 first and second page of code from Chapter 15 (pages 47 & 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_Pt1_Translation_Rotation& other_Trans.ds#1_2

chp_15_Pt1_Translation_Rotation& other_Trans.ds#1_2

The bit of code shows moving a point by the translate method, with the graphic generated pasted into the illustration. The second bit from the bottom of the page shows the transform method by moving the Coordinate System of the subject.

Lets stop here and copy and paste just this amount of script into a blank canvas in the DesignScript Studio program.

chp_15_Pt1_Translation_Rotation& other_Trans.ds#a1_a2

chp_15_Pt1_Translation_Rotation& other_Trans.ds#a1_a2

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#a1_a2-edited

chp_15_Pt1_Translation_Rotation& other_Trans.ds#a1_a2-edited

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_Translation_Rotation_Other_Transformations-7#1

chp_15_Translation_Rotation_Other_Transformations-7#1

A more detailed and defined translation was done and involved naming the variables to identify and reference into them to their corresponding nodes.

chp_15_Translation_Rotation_Other_Transformations-7#1a

chp_15_Translation_Rotation_Other_Transformations-7#1a

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

chp15_Translation_Rotation_Other_Transformations-pg47#1b

chp15_Translation_Rotation_Other_Transformations-pg47#1b

A little editing is desired.

chp15_Translation_Rotation_Other_Transformations-pg47#1b-edited

chp15_Translation_Rotation_Other_Transformations-pg47#1b-edited

The Windows Graphic that is generated from the files.

chp_15_Translation_Rotation_Other_Transformations-7#1_Graphic Window

chp_15_Translation_Rotation_Other_Transformations-7#1_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.

2014_02_13-chapter15_Translation_Rotation_Other_Transformations-pge47#1

2014_02_13-chapter15_Translation_Rotation_Other_Transformations-pge47#1a

2015_02_02-chapter15_Translation_Rotation_Other_Transformations-pg47#1a

2015_02_02-chapter15_Translation_Rotation_Other_Transformations-pg47#1b

The second part of Chapter 15 will be next.

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