Tag Archives: Coordinate System

DesignScript Curve Translation,Geometry.Curve.NormalAtDistance#18– Code to Node to Code

Hi Everyone:

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

Geometry.Curve.IsNormalAtDistance.ds-#18

Geometry.Curve.IsNormalAtDistance.ds-#18

This file is quite similar to the previous fourteenth file Geometry.Curve.DistanceAtParameter.ds., and after opening, copying the script from the DSE and pasting it into DSS, we see that this is the same short translation.

Geometry.Curve.IsNormalAtDistance#18

Geometry.Curve.IsNormalAtDistance#18

The initial translation is shown above.  The nodes properties and definitions contain the elements in the graphic shown below.

Geometry.Curve.IsNormalAtDistance#18a

Geometry.Curve.IsNormalAtDistance#18a

When satisfied with the translation, institute the “Code to Node” operation.

Geometry.Curve.IsNormalAtDistance#18b

Geometry.Curve.IsNormalAtDistance#18b

As highlighted a little editing might be desired.

013_04_03-Geometry.Curve.IsNormalAtDistance#18b

013_04_03-Geometry.Curve.IsNormalAtDistance#18b

The Geometry in the Graphic Window that the code generates is shown below.

Geometry.Curve.IsNormalAtDistance-Graphic Window

Geometry.Curve.IsNormalAtDistance-Graphic Window

And with that, the files are available to download from the links below.

Geometry.Curve.IsNormalAtDistance#18

Geometry.Curve.IsNormalAtDistance#18a

Geometry.Curve.IsNormalAtDistance#18b

Thanks for looking.

T!M

 

 

DesignScript Curve Translation,Geometry.Curve.IsPointOnCurve#17– Code to Node to Code

Hi Everyone:

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

Geometry.Curve.IsPointOnCurve.ds#17

Geometry.Curve.IsPointOnCurve.ds#17

This is a short translation. First open, then copy the script from the DSE. Then paste it into a blank DSS canvas. Starting the translation we get something like below.

Geometry.Curve.IsPointOnCurve#17

Geometry.Curve.IsPointOnCurve#17

Defining the translation further we get.

Geometry.Curve.IsPointOnCurve#17a

Geometry.Curve.IsPointOnCurve#17a

Once satisfied, translate the nodes to code.

Geometry.Curve.IsPointOnCurve#17b

Geometry.Curve.IsPointOnCurve#17b

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

Geometry.Curve.IsPointOnCurve-Graphic Window

Geometry.Curve.IsPointOnCurve-Graphic Window

The files can be downloaded from the links below.

Geometry.Curve.IsPointOnCurve#17

Geometry.Curve.IsPointOnCurve#17a

Geometry.Curve.IsPointOnCurve#17b

Thanks for looking.

T!M

 

 

DesignScript Curve Translation,Geometry.Curve.ExtrudeAtSurface#16– Code to Node to Code

 

Hi Everyone:

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

Geometry.Curve.ExtrudeAtSurface.ds#16

Geometry.Curve.ExtrudeAtSurface.ds#16

This translation brings one back to an earlier post on the Autodesk DesignScript Community Forum entitled “ Translating sample to DesignScript Studio “, actually it was the second translation post made and it is the same curve file as this one.

Noting that, a few things have change in terms of understanding what is important in DesignScript, and indeed probably in all scripting languages. That is having adequate description and naming to each piece of script, or nodes in our case. Something that was not clear to be important then, as it is now. Of course Sharad of Autodesk came to the rescue a few times in this process. Can’t thank him enough.

Geometry.Curve.ExtrudeAtSurface

Geometry.Curve.ExtrudeAtSurface

That was then, below is the initial translation.

Geometry.Curve.ExtrudeAtSurface#16

Geometry.Curve.ExtrudeAtSurface#16

Note that the previous translation was much more compact due to the bundling of coordinates, something that has not been used here to often. In fact the development looks something like below in the expansive interpretation that is being pursued.

Geometry.Curve.ExtrudeAtSurface#16a

Geometry.Curve.ExtrudeAtSurface#16a

Lets take a look at what would happen looking at the more compact method that coders would typically opt for. (I’m guessing about that )

Geometry.Curve.ExtrudeAtSurface#16a_alt

Geometry.Curve.ExtrudeAtSurface#16a_alt

What follows is the conversion back to code and taking a look at the two developed translations.

Geometry.Curve.ExtrudeAtSurface#16b-alt

Geometry.Curve.ExtrudeAtSurface#16b-alt

Then a little editing is in order as highlighted above.

Geometry.Curve.ExtrudeAtSurface#16b-alt-edited

Geometry.Curve.ExtrudeAtSurface#16b-alt-edited

Now compare the more compact version as shown above to the long translation shown in the “code to node” below.

Geometry.Curve.ExtrudeAtSurface#16b

Geometry.Curve.ExtrudeAtSurface#16b

Which is preferable?

And the resulting graphic is shown below.

Geometry.Curve.ExtrudeAtSurfac3-Graphic Window

Geometry.Curve.ExtrudeAtSurfac3-Graphic Window

For information purposes only, the more compact version shows a yellow extrusion, but it’s not being shown. (lol)

The files are available for downloading below.

Geometry.Curve.ExtrudeAtSurface#16

Geometry.Curve.ExtrudeAtSurface#16a

Geometry.Curve.ExtrudeAtSurface#16b

The more compact version is linked below.

Geo_curve_extrude_as_surface#16a

Geo_curve_extrude_as_surface#16b

Thanks for looking.

T!M

 

 

DesignScript Curve Translation,Geometry.Curve.DistanceAtPoint#15– Code to Node to Code

Hi Everyone:

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

Geometry.Curve.DistanceAtPoint.ds#15

Geometry.Curve.DistanceAtPoint.ds#15

After opening, copying the script from the DSE and pasting it into DSS, we see that this will again be a short translation.

Geometry.Curve.DistanceAtPoint#15

Geometry.Curve.DistanceAtPoint#15

Quickly, the translation looks like the graph node canvas that is shown above. After developing the nodes properties and definitions further, it will look similar to the layout below.

Geometry.Curve.DistanceAtPoint#15a

Geometry.Curve.DistanceAtPoint#15a

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

Geometry.Curve.DistanceAtPoint#15b

Geometry.Curve.DistanceAtPoint#15b

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

Geometry.Curve.DistanceAtPoint_Graphic Window

Geometry.Curve.DistanceAtPoint_Graphic Window

The files can be downloaded from the links below.

Geometry.Curve.DistanceAtPoint#15

Geometry.Curve.DistanceAtPoint#15a

Geometry.Curve.DistanceAtPoint#15b

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#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.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

DesignScript Curve Translation,Geometry.Curve.Trim.UsingPoints#6– Code to Node to Code

Hi Everyone:

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

Geometry.Curve.Trim.UsingPoints.ds

Geometry.Curve.Trim.UsingPoints.ds

Like the previous DesignScript file,  the operator Trim for curves,  draws an exception. It should be pointed out that the vast majority of the Sample files work perfectly, so as not to get the wrong idea. DesignScript is a very elegant program, it simply needs (Alpha) development attention. Also, one need to know that these translations are done with the Stand-Alone version of DesignScript, so the functionality of it being a plugin for AutoCAD is not being reviewed.

With that said, lets take a look at the DesignScript Editor.

Geometry.Curve.Trim.UsingPoints.ds

Geometry.Curve.Trim.UsingPoints.ds

With the exception drawn, we get the error.

exception

exception

Continuing on with the initial translation.

Geometry.Curve.Trim.UsingPoints#6-Exception

Geometry.Curve.Trim.UsingPoints#6-Exception

Looking closer we see the Trim node and defined it as myTrimmedCurve.  At this point it’s best to disconnect one of the inputs in order to prevent the program from crashing.

Geometry.Curve.Trim.UsingPoints#6-Index, Out of Bounds

Geometry.Curve.Trim.UsingPoints#6-Index, Out of Bounds

So the “discardBetweenPoints” input of False is disconnected and one imagines the Trim command functions so as to develop the translation.

2013_12_21-Geometry.Curve.Trim.UsingPoints#6a

2013_12_21-Geometry.Curve.Trim.UsingPoints#6a

Above we see the properties extracted from the Trim node to complete the definition. Then the Node to Code operation takes place.

Geometry.Curve.Trim.UsingPoints#6b-edit

Geometry.Curve.Trim.UsingPoints#6b-edit

A few house keeping edits are done.

Geometry.Curve.Trim.UsingPoints#6b

Geometry.Curve.Trim.UsingPoints#6b

The graphic windows that accompanies the running of the file is shown below.

Geometry.Curve.Trim.UsingPoints-Graphic Window.

Geometry.Curve.Trim.UsingPoints-Graphic Window.

The operation ends with the Graphic window below.

Geometry.Curve.Trim.UsingPoints-Graphic Window-error drawn

Geometry.Curve.Trim.UsingPoints-Graphic Window-error drawn

This file is now ready to be corrected. (Thanks in advance lol.)

The files are available for downloading with the links below.

Geometry.Curve.Trim.UsingPoints#6

Geometry.Curve.Trim.UsingPoints#6a

Geometry.Curve.Trim.UsingPoints#6b

Thanks for looking.

T!M

DesignScript Curve Translation,Geometry.Curve.Offset#4 – Code to Node to Code

Hi Everyone:

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

Geometry.Curve.Offset.ds#4

Geometry.Curve.Offset.ds#4

This file has an error which required a work around. Unsatisfactory as that may be, one is still able to imagine it’s purpose and performance. Rather more serious than the misspelling of “Geoemtry , hopefully this will be fixed on the next DesignScript update.

Geometry.Curve.Offset.ds#4-error

Geometry.Curve.Offset.ds#4-error

The offset node was extracted from the lines onboard context menu. In order to complete this exercise the offset node for points was used.

Geometry.Curve.Offset.ds#4-point alt

Geometry.Curve.Offset.ds#4-point alt

Not the most elegant solution but one gets the idea.

Offset.ds#4-point alt_1

Offset.ds#4-point alt_1

The properties of the offset node were taken from the line node. One has to imagine them originating from the Offset node.

Geometry.Curve.Offset#4a

Geometry.Curve.Offset#4a

After completing the translation from code,  the nodes then are again transformed back into code, but first the  editing of the Variable 68 was performed as shown below.

Geometry.Curve.Offset#4b-edit

Geometry.Curve.Offset#4b-edit

The full translation then is shown below.

Geometry.Curve.Offset#4b-error_edit

Geometry.Curve.Offset#4b-error_edit

The highlighted curve operation failure is noted, with  the successful edit as well.

The results of this translation are shown in the Graphic below.

Geometry.Curve.Offset#4-Windows Graphic

Geometry.Curve.Offset#4-Windows Graphic

The files are available to download from the links below.

Geometry.Curve.Offset#4

Geometry.Curve.Offset#4a

Geometry.Curve.Offset#4b

Thanks for looking.

T!M

DesignScript Curve Translation, Curve.CoordinateSystemAtEqualArcLength.UpVector#3 – Code to Node to Code

Hi Everyone:

This the third curve file in a series of forty-nine DS translations. The file, “Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector”  can be accessed from the DesignScript Editor (DSE) Sample files, which are shown below and are on the DSE opening page.

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector.ds

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector.ds

After copying the sample file from the DSE and moving it into DesignScript Studio (DSS), it will have a similar node layout as shown below. This is very similar to the previous DSE file.

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector#3

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector#3

Once again the graph nodes are translated further from the script.

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector#3a

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector#3a

After the translation is complete the “Node to Code” operation is executed.

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector#3b

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector#3b

Again this file was straightforward and not requiring further editing. The resulting Graphic is generated from the file.

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector#3-Graphic Window

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector#3-Graphic Window

The files can be downloaded from the links below.

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector#3

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector#3a

Geometry.Curve.CoordinateSystemAtEqualArcLength.UpVector#3b

Thanks for looking.

T!M