Monthly Archives: February 2014

DesignScript Curve Translation, BSplineCurve#5– Code to Node to Code

Hi Everyone:

This is the fifth and the last  BSplineCurve file in the series of five curve type translations.  The DSE shows the link to the file “Geometry.Curve.BSplineCurve.ByPoints.TangentVectors.ds.” Open it by clicking on it and copy the resulting code into a DSS blank canvas.

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors.ds#5

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors.ds#5

After the essential translation has been done we get a graph node canvas that has these connections. Arrangement of the nodes should suit ones sensibilities, so it most likely will be different.

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5a

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5a

Note the this scripts points are arranged differently than in the previous file.

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5_partial_graphic

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5_partial_graphic

While this code Block showing P1 is being referred to twice,  its not going to be used, as the “set union” node will be, but it is showing that the arrangement of points need to be circuitous.

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5_partial_graphic-1

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5_partial_graphic-1

This was checked, originally thinking it was an error, but it is correct in its intended definition.

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5_partial_graphic-2

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5_partial_graphic-2

If one uses the set union nodes in lieu of the code block ( i.e.. {p1,p2,p3,p4,p1} ), the “ Reorder node ” will be needed for the point indices to be in the correct order. The complete translation to graph node canvas is shown below.

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5a

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5a

Satisfied with the translation, the “Code to Node” operation is performed.

2014_02_19-Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5b_partial view

2014_02_19-Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5b_partial view

Because the file translation is really too long to be easily edited, it was decided to break it into two large Code Blocks.

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5b_partial view-2

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5b_partial view-2

It took a few attempts to get it broken into two blocks with the above partial view (2) being the first translation.

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5b_partial view_2

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5b_partial view_2

After they were translated into two code blocks, a little editing was needed.

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5b_partial view_3

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5b_partial view_3

The above shows the completed translation.

The resulting Graphic from these translations is shown below.

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors- Windows Graphic.

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors- Windows Graphic.

And the DSS files are available for downloading below.

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5a

Geometry.Curve.BSplineCurve.ByPoints.TangentVectors#5b

Thanks for looking

T!M

Advertisements

DesignScript Curve Translation, BSplineCurve#4– Code to Node to Code

Hi Everyone:

On to the fourth BSplineCurve file, “Geometry.Curve.BSplineCurve.ByPoints.Periodicin the series of five Curve translations.  First, open the DSE application and view the resulting first page.

Geometry.Curve.BSplineCurve.ByPoints.Periodic.ds #4

Geometry.Curve.BSplineCurve.ByPoints.Periodic.ds #4

It’s not fair for Geometry to be misspelt. Couldn’t resist.  The file “Geometry.Curve.BSplineCurve.ByPoints.Periodicis very similar to the last file, (with the misspelling), so one should be able to rapidly go through the translation using the previous.

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4a

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4

Of course the first file one might want to develop on its own, before using the previous file, but then maybe not.

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4a

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4a

After ones satisfied with the translation, do the “Code to Node” translation. See below.

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4b

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4b

A few items can be cleaned up.

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4b-Graphic

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4b-Graphic

2014_02_20-Geometry.Curve.BSplineCurve.ByPoints.Periodic#4b_Graphic script

2014_02_20-Geometry.Curve.BSplineCurve.ByPoints.Periodic#4b_Graphic script

Not much editing here, just a little housecleaning for a more compact file. The finished file is shown below.

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4c

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4c

The resulting Windows Graphic from the various file forms can be seen below.

Geometry.Curve.BSplineCurve.ByPoints.Periodic #4 Windows Graphic

Geometry.Curve.BSplineCurve.ByPoints.Periodic #4
Windows Graphic

 

The files are available for downloading below.

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4a

Geometry.Curve.BSplineCurve.ByPoints.Periodic#4b

Thanks for looking.

T!M

DesignScript Curve Translation, BSplineCurve#3– Code to Node to Code

Hi Everyone:

This is the third BSplineCurve file, “Geometry.Curve.BSplineCurve.ByPoints,” in a series of five Curve translations.  To access it, open the DSE application and on the first window it can be located as shown below.

Geometry.Curve.BSplineCurve.ByPoints.ds-graphic

Geometry.Curve.BSplineCurve.ByPoints.ds-graphic

(Please note that this translation was done with the standalone version of the DesignScript Editor (DSE) and the DesignScript Studio (DSS).

Geometry.Curve.BSplineCurve.ByPoints.ds#3

Geometry.Curve.BSplineCurve.ByPoints.ds#3

One can still use the previous file to expedite the translation even though the file is a curve by points rather than vertices.

Select the Graph node

Select the Graph node

Locate the node's context menu.

Locate the node’s context menu.

Select by  on the Graph Node

Select ByPoints on the Graph Node

The nodes output is retained

The nodes output is retained

As seen above, the Graph nodes context menu provides the appropriate Points link in the upper center of the node, where the three dots show the location for access. While the input to the BSplineCurveByPoints node is lost, the more extensive outputs are retained. A great time saver.

Geometry.Curve.BSplineCurve.ByPoints#3a

Geometry.Curve.BSplineCurve.ByPoints#3a

After making adjustments to the translations and being satisfied with the level of node descriptions, the “Node to Code”  operation can be enacted.

Geometry.Curve.BSplineCurve.ByPoints#3b

Geometry.Curve.BSplineCurve.ByPoints#3b

The resulting graphic from the files can be seen below.

Geometry.Curve.BSplineCurve.ByPoints#3_Windows Graphic

Geometry.Curve.BSplineCurve.ByPoints#3_Windows Graphic

The files can be downloaded from the links below.

Geometry.Curve.BSplineCurve.ByPoints#3

Geometry.Curve.BSplineCurve.ByPoints#3a

Geometry.Curve.BSplineCurve.ByPoints#3b

Thanks for looking.

T!M

 

DesignScript Curve Translation, BSplineCurve#2– Code to Node to Code

Hi Everyone:

The second of five BSplineCurve files, in a series of Curve translations, is entitled “Geometry.Curve.BSplineCurve.ByControlVertices.Periodic#2,” and is referenced below. To access it, open the DSE and it will be visible on the opening page. (Please note that this translation was done with the standalone version of the DesignScript Editor (DSE) and the DesignScript Studio (DSS).

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic.ds

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic.ds

Please note the misspelt “Geoemtry“, instead of Geometry. We are going to have to bear with this till Autodesk updates the Editor. (Hint)

After doing the usual translation, one get a Graph Node canvas looking similar to below.

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic#2a

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic#2a

Note that the previous file was a BSplineCurveByVertices, without the Periodic property. So it’s recommended to edit the first file’s developed translation node and change the central node to  BSplineCurveByVertices.Periodic, thereby eliminating a lot of duplication of the various property nodes. See the full translation below.

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic#2a

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic#2a

When satisfied that the translation is complete enough, the Node to Code operation is enacted.

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic#2b-Script on the Canvas

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic#2b-Script on the Canvas

The resulting Graph Window can be seen below.

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic#2-Graph Window

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic#2-Graph Window

 

The BSplineCurve.ByControlVertices.Periodic#2 files are available for download below.

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic#2

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic#2a

Geometry.Curve.BSplineCurve.ByControlVertices.Periodic#2b

Thanks for looking.

T!M

DesignScript Curve Translation, BSplineCurve#1– Code to Node to Code

Hi Everyone:

Continuing on with Curve translations, this is the first in a series of five BSplineCurve files. The first of these, Geometry.Curve.BSplineCurve.ByControlVertices.Degree”, is referenced below. To access it, open the DSE and it will be visible on the opening page.

(Please note that this translation was done with the standalone version of the DesignScript Editor (DSE) and the DesignScript Studio (DSS).

DSE (Design Script Editor) Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1

DSE (Design Script Editor)
Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1

Note that so far we have not witnessed any mistakes in the program files, but here are the first series with “Geometry” being spelt “Geoemtry” which most likely is incorrect. We are know that copying is a big tedium and time saver, but sometimes copying can lead to problems.

The first run at the translation is shown below. The translation is on the left side and the original script is pasted in on the right side.

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1

After translating the remainder of my”properties”,  one should have a node graph that identifies each of the lines of script, similar to what is shown below.

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1a

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1a

It might be mentioned that in Lieu of the “Set Union” graph nodes that are being used that one may use a code block which will serve the same purpose. However, since this blog is about Translations, using “Graph Node’s” in lieu of lines of code, hence the Set Union graph nodes.

In lieu of the Set Union Node, use a code block.

In lieu of the Set Union Node, use a code block.

On to the translation back to script. (“Node to Code”)

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1b

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1b

Note the highlighted lines of script. Taking a closer look.

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1b-Partial graphic

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1b-Partial graphic

The first line can be deleted because in this case we used the “Set Union Nodes”.

The second line can be combined into one line like in previous examples. And for those of you that notice there still is a highlighted Variable further down the list, note that that was an error whereby a translation was overlooked.

Here is the full translation after editing.

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1b

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1b

And below find the Windows Graphic for this Translation.

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1_Windows Graphic

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1_Windows Graphic

Now find the files available for download below.

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1a

Geometry.Curve.BSplineCurve.ByControlVertices.Degree#1b

Thanks for looking

T!M

DesignScript Curve Translation #5, Arc – Code to Node to Code

Hi Everyone:

Here is the fifth curve translation and the last of the series of five Arc files. To access it, open the DSE and on it’s opening page the sample files will be visible. (Please note that this translation was done with the standalone version of the DesignScript Editor (DSE) and the DesignScript Studio (DSS).

Geometry.Curve.Arc.ByPointOnCurve.ds-Graphic

Geometry.Curve.Arc.ByPointOnCurve.ds-Graphic

After opening the file, Geometry.Curve.Arc.ByPointOnCurve.ds in the Editor, copy and paste it into the DSS canvas.

Geometry.Curve.Arc.ByPointOnCurve#5

Geometry.Curve.Arc.ByPointOnCurve#5

The essential part of the arc translation can be done quickly by accessing the nodes from the Library, while the color can be set from the arc node context menu “set color”. Go back to the conventional Library for the color “Green” node.

Geometry.Curve.Arc.ByPointOnCurve#5a

Geometry.Curve.Arc.ByPointOnCurve#5a

From this point on most all the properties can be set from the node context menu. To clarify a nodes properties use the Special Node section in the Library, specifically the  Driver and Identifier Nodes.

Set Visibility needs to be clarified in the translation.

Set Visibility needs to be clarified in the translation.

After translating the Graph nodes (code to node), one must again as in the previous translations attend to consolidating the visibility settings.

Consolidate to two code lines to one

Consolidate to two code lines to one

Find the full Large Code Block translation below.

Geometry.Curve.Arc.ByPointOnCurve#5b

Geometry.Curve.Arc.ByPointOnCurve#5b

The accompanying Windows Graphic is shown below.

2014_01_24-Geometry.Curve.Arc.ByPointOnCurve-Windows Graphic

2014_01_24-Geometry.Curve.Arc.ByPointOnCurve-Windows Graphic

The Arc files are available for download below.

Geometry.Curve.Arc.ByPointOnCurve#5

Geometry.Curve.Arc.ByPointOnCurve#5a

Geometry.Curve.Arc.ByPointOnCurve#5b

Thanks for looking

TIM

DesignScript Curve Translation #4, Arc – Code to Node to Code

Hi Everyone:

Here is the fourth curve translation in a series of five Arc files, access it through the DSE sample files, as shown below. (Note the standalone version of DesignScript Editor / Studio is being used for these samples.)

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint.ds#4

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint.ds#4

After opening the file, Curve.Arc.ByCenterPointStartPointSweepPoint in the Editor, copy and paste it into the DSS canvas to make a new file.

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint#4

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint#4

After the initial translation, begin to generate the additional properties, for the curve, arc,  with both guaranteed and unguaranteed properties.

partial view-Curve.Arc.ByCenterPointStartPointSweepPoint#4a

partial view-Curve.Arc.ByCenterPointStartPointSweepPoint#4a

Laying out and identifying the graph nodes its best to attempt to not ignore naming nodes appropriately. For example in the graphic above the set visibility note should have it’s variable identified further, to avoid confusion in further translations.

Partial view of graphic node

Partial view of graphic node

For the “true”  code block one might use the Identifier Node, place it in the canvas  (see Var70 above) and move it into position while editing it sufficiently. (see below)

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint#4a

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint#4a

The full translation is shown below.

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint#4a

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint#4a

After being satisfied that all the nodes are attended to,  on to the “Node to Code” translation.

Partial view of DesignScript Translation "Node to Code"

Partial view of DesignScript Translation
“Node to Code”

The code that could use a little clarifying is still the Visibility Node translation. Make it a one line statement by substituting “true” for ” Var71″ on the second highlighted line, while deleting the first highlighted statement.

Partial view of Large Code Block in the DSS canvas

Partial view of Large Code Block in the DSS canvas

The Edited translation in one large code block is shown below.

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint#4b

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint#4b

The resulting Windows Graphic of the Arc is shown below.

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint_Windows Graphic

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint_Windows Graphic

The Arc files are available for download below.

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint#4

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint#4a

Geometry.Curve.Arc.ByCenterPointStartPointSweepPoint#4b

Thanks for looking.

T!M