Category Archives: Coordinate System

Designscript Coordinate Translation # 21st, Code to Node +

Hi Everyone:

This is the twenty-first Coordinate translation from the DSE, and is the third in a series of three files on rotation. The file, CoordinateSystem.Rotate.RotationAnglesSequence.ds, can be found in the sample files of the opening window of the DSE (lite) program.

CoordinateSystem.Rotate.RotationAnglesSequence.ds#21_graphic

CoordinateSystem.Rotate.RotationAnglesSequence.ds#21_graphic

Doing the usual translation procedure one gets the code into the DSS canvas.

CoordinateSystem.Rotate.RotationAnglesSequence#21

CoordinateSystem.Rotate.RotationAnglesSequence#21

Use the previous file to edit would be a expedient way to finish the graph node translation.

CoordinateSystem.Rotate.RotationAnglesSequence-a#21

CoordinateSystem.Rotate.RotationAnglesSequence-a#21

Note the values that are the variables that will need to be edited in the “Node to Code” translation.

coordinatesystem-rotate-rotationanglessequence#21b

Note the highlighted code in the large Code Block above. Edit out the extraneous Variables, as shown below.

Edit the Code Block in the canvas

Edit the Code Block in the canvas

The edited translation looks like below.

CoordinateSystem.Rotate.RotationAnglesSequence#21b

CoordinateSystem.Rotate.RotationAnglesSequence#21b

And the accompanying window graphic is shown below.

CoordinateSystem.Rotate.RotationAnglesSequence#21b-Graphic

CoordinateSystem.Rotate.RotationAnglesSequence#21b-Graphic

The Coordinate Rotation files are available for downloading below.

CoordinateSystem.Rotate.RotationAnglesSequence#21

CoordinateSystem.Rotate.RotationAnglesSequence#21a

CoordinateSystem.Rotate.RotationAnglesSequence#21b

Thanks for looking.

T!M

 

Advertisements

DesignScript Coordinate Translation #16, Code to Node +

Hi Everyone:

This is the sixteenth DSS translation of sample files to be found on the opening window of the DSE (lite) standalone program.

CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence

CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence

This in the 2nd Transform file in the series of 3 and is entitled, CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence

CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence

CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence

Again, very similar to the previous file translation. Note that some of the properties of the Coordinate System , e.g. scale, rotation angle, rotation sequence, have identifier nodes linked to them in anticipation of how to adequately identify values that are in code block form.

CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence

CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence
Continuing on and translating with the  guaranteed properties of the coordinate system, one translates the graph nodes by creating a bounding box around them, then uses the menu that’s generated in the upper right hand corner of the box to complete the transformation.
For a detailed description of this operation go to  DSS-3 Node to Code, Code to Node on page 81 of the DesignScript Language manual.
CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence#16

CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence#16

Now one see’s how the translation interpreted the code block identifier nodes that were done on the coordinate system properties. Note the Variables. Now for some further editing.

edited DesignScript canvas, large  Code Block.

edited DesignScript canvas, large Code Block.

By eliminating the Var#’s and substituting the identities of the nodes a more compact translation is achieved.

edited DesignScript canvas, large  Code Block

edited DesignScript canvas, large Code Block

CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence#16- Graphic Window

CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence#16- Graphic Window

And with that, the files are available for download below.

CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence#16

CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence#16a

CoordinateSystem.ByUniversalTransform.TranslationVectorAndSequence16b

Thanks for looking.

T!M

DesignScript Coordinate Translation #7, Code to Node

Hi Everyone:

Here is the seventh translation of the DesignScript Editor (DSE) file “CoordinateSystem.ByOriginVectors.IsSheared.”

DesignScript Editor Lite

DesignScript Editor Lite

After loading it, running it in the editor, copy it to the clipboard and open DesignScript Studio (DSS) and paste it on the blank canvas as a large Code Block. (double click on the canvas to access a code block)

DesignScript Studio

DesignScript Studio

To the right on the canvas is the pasted code from the DSE file (it’s a *.ds file). To the left is a translation of the top part of the code. As previously mentioned, working with the graph nodes and with the original code is desirable for access in ones translation however it can lead to a crash, at least on a system running windows on a mac. When working out the whole file regardless of what method that is used. Save the file frequently.

DesignScript Studio Translation

DesignScript Studio Translation

After running this it was noticed that a few improvement could be made, slight as they may be.

Capture#1

What’s missing is a description of the value 1.  Another item that is still under debate,  is whether or not further definition of true and false is desirable.

Boolean condition

Boolean condition

The updated DesignScript Studio graph is updated below.

Screenshot 2014-01-27 11.38.37

DesignScript Studio Translation updated

The original Node to Code translation is below.

Screenshot 2014-01-20 13.51.29

Now lets do the Node to Code Translation and take a look at the changes to see whether they represent an improvement.

 Partial original Node to Code view

Partial original Node to Code view

New Node to Code view

New Node to Code view

One can simply substitute a Variable number, in this case it was 40 and changed to the number 1.

Here is the whole file updated.

Node to Code DSS translation

Node to Code DSS translation

Only one Variable that is named a number. Obviously excessive at this point.

Wonder how this issue will play out with some complex files. We will see.

And below we has the Coordinate Graphic that is generated.

DesignScript Graphic Window. Standalone version.

DesignScript Graphic Window.
Standalone version.

Here are the files available for download.

CoordinateSystem.ByOriginVectors.IsSheared#7

CoordinateSystem.ByOriginVectors.IsSheared#7a

CoordinateSystem.ByOriginVectors.IsSheared#7b

Thanks for looking

T!M

 

DesignScript Coordinate Translation #5, Code to Node

Hi Everyone:

If these posts seem redundant then you know your learning… LOL.  The next DSS example from the DSE  is “CoordinateSystem.ByOriginVectors”, the fifth file on the list.

Capture#5d

DesignScript Coordinate Translation #5, Code to Node

After opening the file,  copy it, then open DSS to a blank canvas and paste the code into a code block on the canvas.

Again note, if one wants to run the file in DSS then after pasting it into the canvas be sure to delete “import(“ProtoGeometry.dll”) from the canvas. As mentioned previously, commenting out either the whole code with” /* “at the beginning of code & at the end of the code ” */ ” to render it invisible to the program. Another method is to use “//” at the front end of each line of code.

Capture#5e

Screenshot 2014-01-20 12.24.37

This portion of the script can be quickly translated using the Library on the DSS canvas. It’s pretty short and straightforward. (see below)

Capture#5f

What one can do accomplishing this portion of the translation is save the file and then do a “saveas”…in this case CoordinateSystem.ByOriginVectors#5a. Then generate the additional code various properties.

Screenshot 2014-01-22 16.10.58

Now lets take a look at some of the changes that can be made to make the script more legible both in graph node form and especially in code form.

Capture#5c

Access the Library and search for driver node. Double click on it and place it in the canvas. In this case we have Var41… (variable 41) with a value of 0. Edit it to look something like below.

Capture#5b

The reason for doing this is to eliminate the Var41 name to something more informative. Note also that the WCS coordinate system identity was added to the opening node. This was done for the same reason.

Capture#5a

This may seem pretty tedious, which it is at the moment but it might very well be worthwhile in a large and more complex file.

Screenshot 2014-01-22 16.10.23

Notice above how the Graph node file reads now when translated back into Code form. See “Node to Code” in the  DesignScript Language Manual . (page 83) Much more informative than a bunch of Var41..38..01..etc. Still one can edit a Var41 to another identity as long as there is consistency in the code.

Screen Shot 2014-01-15 at 5.48.00 PM

CoordinateSystem.ByOriginVectors#5b

CoordinateSystem.ByOriginVectors#5a

CoordinateSystem.ByOriginVectors

Not much of a Graphic…but the question is about learning something.

Hopefully.

Thanks for looking

T!M

 

 

DesignScript Coordinate Translation #4, Code to Node

Hi Everyone:

On to the fourth file, find it in the DesignScript Editors (DSE) opening program window, Coordinate System. By Cylindrical Coordinates.

CoordinateFile#4

Just click on it and it will load the file in the Editor. After it’s loaded the file look like this.

(partial screen view below)

CoordinateFile#4a

It might be best to first run the file and see the resulting Graphic window. (Note that this is being done without AutoCAD, it is being used in it’s standalone capacity.) Also, one might want to see if the file has any anomalies or errors which will show up, so run the program in debug mode.

After running it, copy it and run the DesignScript Studio(DSS) program and open a new blank canvas. Double click on the canvas and paste the code text on the resulting Block node.

On the left one sees the subject code. It’s been commented out  (/* code */ ) so that it doesn’t actualize and run. Also note that the “ import (“ProtoGeometry.dll“);”  at the top of the text must be deleted if one wants to run the code in DSS.

 

Screenshot 2014-01-20 11.41.05

As seen here, only the top part of the code is translated into DSS graph node form on the canvas. The” Guaranteed properties for Coordinate System” were not translated here due to a possible OS instability.   Not sure what others are experiencing running these files because this was done running a Mac with Windows 7  (64 bit) running VMware fusion and it was necessary to create a new file to complete the translation.

Screenshot 2014-01-20 11.36.09

The file then was selected by a bounding box on the DSS canvas and translated back again to Code. (Node to Code)

Screenshot 2014-01-20 11.35.10

Note the absence  of unnamed variables, thus making the code more legible.

Screenshot 2014-01-15 16.52.36

And there we have it  CoordinateSystem.ByCylindricalCoordinates.

CoordinateSystem.ByCylindrical.Coordinates#4a

CoordinateSystem.ByCylindrical.Coordinates#4b

CoordinateSystem.ByCylindrical.Coordinates#4

Thanks for looking,

T!M

DesignScript Coordinate Translation #3, Code To Node

Hi Everyone:

Once again,  here is the next  DesignScript Translation which can be found from the DS Editor program opening window when the program is run. DesignScript, a Autodesk standalone free program (or can be run as  plugin for AutoCAD), can be downloaded from  DesignScripts new home.

After posting these past two example translations and further climbing into the nuances of the example files,  one begins to see the intent which wasn’t quite previously understood.

CoordinateSystem.AtParameter.UpVector#3

To the left on the image of the Graph Node window one can see inserted code notation (commented out) from the DesignScript Editor (DSE). It’s commented out because if it executes it will execute and the Graph Node version will run as well…this inevitably will cause a unstable environment and consequential crashes.

Capture2

Notice the variable names; startPoint, pointOnCurve, endpoint, if one doesn’t have some sort of identifiable name then one will get names like Var10 or Var21 etc. It then will become difficult to identify what one is doing code wise. Looking at the original DS Editor file one notices this naming convention (see below)

Screenshot 2014-01-23 14.07.36

This is what it looks like after copying and pasting it into the DS Studio Graph Window. (below)

Capture1

So this is what the “myCSOrigin”…”myCSx”…”myCS”…y etc. is about, without it one tends to get lost in identifying and associating the bits of code (and node).

So consequently, this is what the DSS file  “CoordinateSystem.AtParameter.UpVector.bin looks like when played out in a faithful translation (see below).

Screenshot 2014-01-22 15.46.19

Here is the file in yet another form…the infamous (just joking) “Node to Code” form (see below).

Screenshot 2014-01-22 15.44.43

Finally here is the image from the Graphic Window. (Note  please that this is generated from the standalone version) (see below)

Screenshot 2014-01-14 17.49.12

Here are the links to the files for download.

CoordinateSystem.AtParameter.UpVector#3, 3a & 3b.

https://www.dropbox.com/s/1ly6ob0k3cztp8f/2013_12_16-CoordinateSystem.AtParameter.UpVector%233.bin

https://www.dropbox.com/s/5i6strw2rsu5ckq/2014_01_13-CoordinateSystem.AtParameter.UpVector%233b.bin

https://www.dropbox.com/s/vfln2zhqhc5zptp/2014_01_13-CoordinateSystem.AtParameter.UpVector%233a.bin

More later,

Thanks for Looking

T!M

DSS Coordinate Translation #2

Here is the next  DesignScript Translation which can be found from the DS Editor program opening page. If you haven’t started to run DesignScript and wish to follow along you will have to go and get it from  DesignScripts new home , then open DS Editor and find the “Coordinate .At Parameter.Surface” file on the opening page (2nd file in the Sample section) of the Editor and run it.

The translation that was done to the DS Editor (*.ds) file to the DS Studio (*.bin) file can be found below, it’s located in a dropbox folder (so you know when you click on it you will open a new page).

(BTW both DS programs are in the in the same package that one downloads)

This is same file that was used in the DesignScript Language Manual for a couple of the tutorials. http://designscript.org/manual.pdf  Some deviations were used to get the desired results.

Thanks for looking

T!M

-CoordinateSystem.AtParameter.Surface#2a

 

Screen Shot 2014-01-12 at 5.22.20 PM

Screen Shot 2014-01-12 at 5.23.16 PM