Monthly Archives: March 2014

DesignScript Curve Translation,Geometry.Curve.CreatePatchSurface#13– Code to Node to Code

 

Hi Everyone:

This is the thirteenth, in a series of forty-nine curve file translations. The file, Geometry.Curve.CreatePatchSurface.ds, is from the DesignScript Editor (DSE) Sample files.

Geometry.Curve.CreatePatchSurface.ds#13

Geometry.Curve.CreatePatchSurface.ds#13

Good time to mention that this translation was done with the Stand-Alone version of DesignScript, so it is NOT a plugin for AutoCAD.

Open the file CreatePatchSurface.ds in the DSE, copy and run DSS to paste it into the resulting blank canvas. Note the highlighted script in the initial translation below.

Geometry.Curve.CreatePatchSurface#13

Geometry.Curve.CreatePatchSurface#13

The “ import “ProtoGeometry. dll” “, will prevent the script from running, while “ /* ” and “// ” are measures that will ignore the script.” //will ignore the specific line its in front of and “ /*—-” */ “ will ignore the block of script it’s encompassing. This is being mentioned because having two versions of DesignScript running, both DSE and DSS can cause problems. (i.e. crashing)

After being satisfied with the translation, we progress to naming conventions and adding definition to the nodes properties.

Geometry.Curve.CreatePatchSurface#13a

Geometry.Curve.CreatePatchSurface#13a

Note that shown above the highlighted text has been edited to eliminate the commenting out symbols “/*—*/”. Next is the translation back to code as shown below.

Geometry.Curve.CreatePatchSurface#13b

Geometry.Curve.CreatePatchSurface#13b

A little editing is done.

Geometry.Curve.CreatePatchSurface#13b

Geometry.Curve.CreatePatchSurface#13b

The resulting Graphic from the files is shown below.

Geometry.Curve.CreatePatchSurface#13-Graphic Window

Geometry.Curve.CreatePatchSurface#13-Graphic Window

The translations are available for download from the links below

Geometry.Curve.CreatePatchSurface#13

Geometry.Curve.CreatePatchSurface#13a

Geometry.Curve.CreatePatchSurface#13b

Thanks for looking.

T!M

Advertisements

DesignScript Curve Translation,Geometry.Curve.CoordinateSystemAtEqualArcLength#12– Code to Node to Code

Hi Everyone:

This is the twelfth, in a series of forty-nine curve file translations. The file, Geometry.Curve.CoordinateSystemAtEqualArcLength.ds, is from the DesignScript Editor (DSE) Sample files.

Geometry.Curve.CoordinateSystemAtEqualArcLength.ds#12

Geometry.Curve.CoordinateSystemAtEqualArcLength.ds#12

This is similar to the last few previous files. Open it in the DSE, copy it to ones clipboard, then open DSS and paste the script into the blank canvas.

Geometry.Curve.CoordinateSystemAtEqualArcLength

Geometry.Curve.CoordinateSystemAtEqualArcLength

After the initial translation shown above, it’s developed into something like shown below.

Geometry.Curve.CoordinateSystemAtEqualArcLength#12a

Geometry.Curve.CoordinateSystemAtEqualArcLength#12a

Satisfied with the translation the “Node to Code” translation takes place as shown below.

Geometry.Curve.CoordinateSystemAtEqualArcLength#12b

Geometry.Curve.CoordinateSystemAtEqualArcLength#12b

The geometry that results from these translations can be viewed in the image below.

Geometry.Curve.CoordinateSystemAtEqualArcLength-Graphic Window

Geometry.Curve.CoordinateSystemAtEqualArcLength-Graphic Window

The files can be downloaded from the links below.

Geometry.Curve.CoordinateSystemAtEqualArcLength#12

Geometry.Curve.CoordinateSystemAtEqualArcLength#12a

Geometry.Curve.CoordinateSystemAtEqualArcLength#12b

Thanks for looking.

T!M

 

DesignScript Curve Translation, Geometry.Curve.CoordinateSystemAtParameter#11– Code to Node to Code

Hi Everyone:

This is the eleventh, in a series of forty-nine curve file translations. The file, Geometry.Curve.CoordinateSystemAtParameter.ds, is from the DesignScript Editor (DSE) Sample files.

Geometry.Curve.CoordinateSystemAtParameter.ds#11

Geometry.Curve.CoordinateSystemAtParameter.ds#11

After opening the file in the DSE, copy the script and paste it into a blank canvas in DSS. The initial translation looks something like shown below.

Geometry.Curve.CoordinateSystemAtParameter#11

Geometry.Curve.CoordinateSystemAtParameter#11

After it has been roughed out. it might be good to use some of the special nodes to further define and clarify the variables and personalize the nodes to aid in reading and translating them.

CodeBlock node

CodeBlock node

First off there is the CodeBlock Node which can be accessed in the Special Nodes category of the library, or more commonly activated by just double clicking in a blank space in the DesignScript canvas.

Driver Node

Driver Node

The Driver Node can be used in lieu of the CodeBlock node to add naming a definition to a variable, in this case 0.1234 is being shown.

Identifier Node

Identifier Node

Then there is the Identifier Node, which adds naming to a node that can serve as a link between a CodeBlock Node and another graph node. As one continues the translation, its usage will provide adequate identification to all the script that was in the DSE sample file.

Geometry.Curve.CoordinateSystemAtParameter#11a

Geometry.Curve.CoordinateSystemAtParameter#11a

Satisfied with the translation, then the “Node to Code” operation follows.

Geometry.Curve.CoordinateSystemAtParameter#11b

Geometry.Curve.CoordinateSystemAtParameter#11b

And the Graphic Window that results from these translations is shown below.

Geometry.Curve.CoordinateSystemAtParameter-Graphic Window

Geometry.Curve.CoordinateSystemAtParameter-Graphic Window

As a reminder to all, again, this translation was done with the Stand-Alone version of DesignScript, yet it still will work as a AutoCAD plugin.

The files can be downloaded from the links below.

Geometry.Curve.CoordinateSystemAtParameter#11

Geometry.Curve.CoordinateSystemAtParameter#11a

Geometry.Curve.CoordinateSystemAtParameter#11b

Thanks for looking.

T!M

 

 

 

DesignScript Curve Translation, Geometry.Curve.CoordinateSystemAtDistance.UpVector#10 – Code to Node to Code

Hi Everyone:

This is the tenth, in a series of forty-nine curve file translations. The file, Geometry.Curve.CoordinateSystemAtDistance.UpVector.ds, is from the DesignScript Editor (DSE) Sample files. Also, this translation was done with the Stand-Alone version of DesignScript, so it is NOT a plugin for AutoCAD.

Geometry.Curve.CoordinateSystemAtDistance.UpVector.ds

Geometry.Curve.CoordinateSystemAtDistance.UpVector.ds

Another Curve – Coordinate system file that is rather straight forward.

Geometry.Curve.CoordinateSystemAtDistance.UpVector#10

Geometry.Curve.CoordinateSystemAtDistance.UpVector#10

After this initial translation, we begin to define the variables with the driver node from the DSS library. This replaces the CodeBlock node to augment it with a  variable description.

Driver Node

Driver Node

Likewise is the identifier node that can be used as needed.

identifier node

identifier node

Then continue with the node properties.

Geometry.Curve.CoordinateSystemAtDistance

Geometry.Curve.CoordinateSystemAtDistance#10a

After which the “Node to Code” translation is performed.

Geometry.Curve.CoordinateSystemAtDistance10b

Geometry.Curve.CoordinateSystemAtDistance#10b

A little editing is in order as highlighted above.

Geometry.Curve.CoordinateSystemAtDistance10b-edited

Geometry.Curve.CoordinateSystemAtDistance10b-edited

After editing as shown above, using the word “distance” in place of Var75, the translation is complete. The resulting graphic window below shows the geometry ofCoordinateSystemAtDistance.UpVector.ds.

Geometry.Curve.CoordinateSystemAtDistance.UpVector.ds

Geometry.Curve.CoordinateSystemAtDistance.UpVector.ds

The files are available for downloading from the links below.

Geometry.Curve.CoordinateSystemAtDistance.UpVector#10

Geometry.Curve.CoordinateSystemAtDistance.UpVector#10a

Geometry.Curve.CoordinateSystemAtDistance.UpVector#10b

Thanks for looking

T!M

DesignScript Curve Translation, Geometry.Curve.CoordinateSystemAtDistance#9 – Code to Node to Code

Hi Everyone:

This is the ninth, in a series of forty-nine curve file translations. The file,Geometry.Curve.CoordinateSystemAtDistance.ds, is from the DesignScript Editor (DSE) Sample files.

Geometry.Curve.CoordinateSystemAtDistance.ds#9

Geometry.Curve.CoordinateSystemAtDistance.ds#9

Load the file into the DS Editor, copy and paste it into a blank canvas in DS Studio. The initial translation is shown below.

Geometry.Curve.CoordinateSystemAtDistance#9

Geometry.Curve.CoordinateSystemAtDistance#9

This file is similar to the Geometry. Curve.ClosestPointTo.ds#7 translation.  We will layout the curve node properties and definition a little differently as shown below.

2013_12_21-Geometry.Curve.CoordinateSystemAtDistance#9a

2013_12_21-Geometry.Curve.CoordinateSystemAtDistance#9a

Its important that the nodes are named in some meaningful way. Clarity is important. The “Node to Code” translation is next.

Geometry.Curve.CoordinateSystemAtDistance#9b-edit

Geometry.Curve.CoordinateSystemAtDistance#9b-edit

Node the highlighted code. Some editing is warranted.

Geometry.Curve.CoordinateSystemAtDistance#9b-edited

Geometry.Curve.CoordinateSystemAtDistance#9b-edited

Note the Variable substitute names. Are they appropriate?

2014_03_24-Geometry.Curve.CoordinateSystemAtDistance#9b-Graphic Window

2014_03_24-Geometry.Curve.CoordinateSystemAtDistance#9b-Graphic Window

The resulting graphic is shown above and the files are available to download from the links below.

Geometry.Curve.CoordinateSystemAtDistance#9

Geometry.Curve.CoordinateSystemAtDistance#9a

Geometry.Curve.CoordinateSystemAtDistance#9b

Thanks for looking.

T!M

 

DesignScript Curve Translation, Geometry.Curve.Composite.WithTolerence#8 – Code to Node to Code

 

Hi Everyone:

This is the eighth, in a series of forty-nine curve file translations. The file, Geometry.Curve.Composite.WithTolerence.ds, is from the DesignScript Editor (DSE) Sample files.

Geometry.Curve.Composite.WithTolerence#8

Geometry.Curve.Composite.WithTolerence#8

Some may notice that a previous Composite file, Geometry.Curve.Composite.ds#1 has an error which was not only the misspelling of “Geometry,” which is correct in this case, but that the Composite  command did not fully function.

Geometry.Curve.Composite.WithTolerence#8-error

Geometry.Curve.Composite.WithTolerence#8-error

Like in the previous case Composite Curve fails while a single curve doesn’t. So like the previous translations we will make due with what we have and use one of the curves to illustrate the complete translation. Lets take a look at what we have.

Geometry.Curve.Composite.WithTolerence#8

Geometry.Curve.Composite.WithTolerence#8

Here is the general translation above while the specifics of the error and the alternative method is shown below.

Geometry.Curve.Composite.WithTolerence#8-error2

Geometry.Curve.Composite.WithTolerence#8-error2

Note the Block Node that has the implicit leads from the curves. Normally,  because we are trying to use library graph nodes, the alternative “Set Union” for the curves is not shown. In any case the error is quite plainly seen. The alternative is shown below.

Geometry.Curve.Composite.WithTolerence#8a-edited

Geometry.Curve.Composite.WithTolerence#8a-edited

The “BSplineCurve” node was used as the “contextCurve”(s) to develop the properties of the “myCompositeCurve”.

Geometry.Curve.Composite.WithTolerence#8a

Geometry.Curve.Composite.WithTolerence#8a

The completed Node Graph DSS canvas is shown above. (rather, as complete as can be at this time)

On to the “Node to Code” conversion.

Geometry.Curve.Composite.WithTolerence#8b-edit

Geometry.Curve.Composite.WithTolerence#8b-edit

A little editing is in order as highlighted.

Geometry.Curve.Composite.WithTolerence#8b-edited

Geometry.Curve.Composite.WithTolerence#8b-edited

The graphic that is generated from the code is shown below.

Geometry.Curve.Composite.WithTolerence#8-Graphic Window

Geometry.Curve.Composite.WithTolerence#8-Graphic Window

As usual, liberty was taken with adding color and this was done with the stand alone version of DesignScript. The files are available for downloading from the links (DropBox) below.

Geometry.Curve.Composite.WithTolerence#8

Geometry.Curve.Composite.WithTolerence#8a

Geometry.Curve.Composite.WithTolerence#8b

Thanks for looking.

T!M

DesignScript Curve Translation,Geometry.Curve.ClosestPointTo#7– Code to Node to Code

Hi Everyone:

This the seventh DesignScript file in a series of forty-nine curve translations. The file, Geometry. Curve.ClosestPointTo.ds is from the DesignScript Editor (DSE) Sample files.

Geometry.Curve.ClosestPointTo.ds#7

Geometry.Curve.ClosestPointTo.ds#7

After loading it in the Editor (DSE), copying it to ones clipboard, open DesignScript Studio (DSS)and paste it into the blank canvas.

Geometry.Curve.ClosestPointTo#7

Geometry.Curve.ClosestPointTo#7

Roughed out the translation looks something like the above screenshot. Then the definitions and properties were defined, as shown below.

Geometry.Curve.ClosestPointTo#7a

Geometry.Curve.ClosestPointTo#7a

Some liberty was taken in adding color and exploring the nodes further, after witch the “Node to Code” translation was done.

Geometry.Curve.ClosestPointTo#7b

Geometry.Curve.ClosestPointTo#7b

Parts of the code and the counterpart node graph translation were independent of each other, hence the two columns. The resulting Graphic Window is shown below.

Geometry.Curve.ClosestPointTo_Graphic Window

Geometry.Curve.ClosestPointTo_Graphic Window

The files are available for download from the links below.

Geometry.Curve.ClosestPointTo#7

Geometry.Curve.ClosestPointTo#7a

Geometry.Curve.ClosestPointTo#7b

Thanks for looking.

T!M