Monthly Archives: March 2014

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

Advertisements

DesignScript Curve Translation,Geometry.Curve.Trim.UsingArrayOfParameters#5– Code to Node to Code

 

Hi Everyone:

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

Geometry.Curve.Trim.UsingArrayOfParameters.ds#5

Geometry.Curve.Trim.UsingArrayOfParameters.ds#5

This is another file that is not functioning. The operator “Trim” for curves draws an Exception. First lets take a look at the DSE.

Geometry.Curve.Trim.UsingArrayOfParameters.DSE-error

Geometry.Curve.Trim.UsingArrayOfParameters.DSE-error

The “Index was outside the bounds of the array” is the error.

Geometry.Curve.Trim.UsingArrayOfParameters.ds-Exception_Window

Geometry.Curve.Trim.UsingArrayOfParameters.ds-Exception_Window

With that lets do some pretending till the powers that be fix this in DesignScript.

Geometry.Curve.Trim.UsingArrayOfParameters.

Geometry.Curve.Trim.UsingArrayOfParameters.

Above the essential graph nodes are laid out.

Geometry.Curve.Trim.UsingArrayOfParameters#5a

Geometry.Curve.Trim.UsingArrayOfParameters#5a

Above we see the properties extracted from the Trim node and actualized so that the error is drawn, but the definition is complete.

Geometry.Curve.Trim.UsingArrayOfParameters#5b

Geometry.Curve.Trim.UsingArrayOfParameters#5b

And above the “Node to Code” operation was enacted.

Geometry.Curve.Trim.UsingArrayOfParameters#5_graphic-a

Geometry.Curve.Trim.UsingArrayOfParameters#5_graphic-a

As the file loads initially one gets the Windows Graphic as shown above.  Then one gets the

view as shown below as the file completes its operation.

2013_12_21-Geometry.Curve.Trim.UsingArrayOfParameters#5_graphic-b

2013_12_21-Geometry.Curve.Trim.UsingArrayOfParameters#5_graphic-b

Of course one might think that the operation was successful, given the extent of the trim command, but unfortunately not.

Regardless, the files are available to download below. Anyone want to fix it?

Geometry.Curve.Trim.UsingArrayOfParameters#5

Geometry.Curve.Trim.UsingArrayOfParameters#5a

Geometry.Curve.Trim.UsingArrayOfParameters#5b

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

DesignScript Curve Translation, Curve.CoordinateSystemAtParameter.UpVector #2 – Code to Node to Code

Hi Everyone:

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

Geometry.Curve.CoordinateSystemAtParameter.UpVector.ds#2

Geometry.Curve.CoordinateSystemAtParameter.UpVector.ds#2

This file, other than word “Geoemtry“,  which we have decided is not a new Math, is fine with no anomalies. After copying the sample file from the DSE and moving it into DSS, we can quickly get a canvas looking similar to the one below.

Geometry.Curve.CoordinateSystemAtParameter.UpVector#2

Geometry.Curve.CoordinateSystemAtParameter.UpVector#2

After which the graph nodes can be further defined and their properties developed.

Geometry.Curve.CoordinateSystemAtParameter.UpVector#2

Geometry.Curve.CoordinateSystemAtParameter.UpVector#2

As shown above, the various types of properties of the nodes are shown in their respective groupings. Satisfied with the translation the “Node to Code” operation is executed.

Geometry.Curve.CoordinateSystemAtParameter.UpVector#2

Geometry.Curve.CoordinateSystemAtParameter.UpVector#2

Again this file was quite straightforward without any editing required. The resulting Windows Graphic from the files is shown below.

Geometry.Curve.CoordinateSystemAtParameter.UpVector#2

Geometry.Curve.CoordinateSystemAtParameter.UpVector#2

The files can be downloaded from the links below.

Geometry.Curve.CoordinateSystemAtParameter.UpVector#2

Geometry.Curve.CoordinateSystemAtParameter.UpVector#2a

Geometry.Curve.CoordinateSystemAtParameter.UpVector#2b

Thanks for looking.

T!M

DesignScript Curve Translation, Curve.Composite#1 – Code to Node to Code

Hi Everyone:

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

Geometry.Curve.Composite.ds#1

Geometry.Curve.Composite.ds#1

The first thing to note is that Geoemtry” is not really a new branch of Math, just a misspelling, which at some point hopefully gets corrected. More importantly though is the error this file generates when run in the DSE.

Geometry.Curve.Composite.ds_error

Geometry.Curve.Composite.ds_error

The problem turns out to be, when executing the (“Create composite curve using method : Composite” ) Composite command.

Geometry.Curve.Composite.ds- Error highlighted

Geometry.Curve.Composite.ds- Error highlighted

Note the highlighted “Composite curve operation failed” statement after which the “Deferencing a non-pointer  warning is given for the remainder of the script.

One can investigate this error in node form, but first the preliminary translation to DesignScript Studio is required.

Geometry.Curve.Composite.ds#1

Geometry.Curve.Composite.ds#1

After the initial nodes have been laid out the composite node is gotten from the library and linked into position.

Geometry.Curve.Composite#1-error

Geometry.Curve.Composite#1-error

As can be seen, we get a failure. However if one just takes one of the elements, a successful result can be obtained.

Geometry.Curve.Composite#1-error_solution

Geometry.Curve.Composite#1-error_solution

We can work with this to finish developing this translation, although this need some coding attention from the powers that be. (hint Autodesk)

Geometry.Curve.Composite#1a

Geometry.Curve.Composite#1a

Sticking with just the mySpline node as the operator for the Curve.Composite node we are able to extract the other specified properties. Satisfied, as much as possible with the translation thus far, the “Node to Code” translation can be initiated.

Geometry.Curve.Composite#1b

Geometry.Curve.Composite#1b

The script being rather long, can also be broken up to be more manageable.

Geometry.Curve.Composite#1b

Geometry.Curve.Composite#1b

Among all the anomalies in the script, the above middle stand-alone coordinate Point2 doesn’t figure to really have a purpose. With that said the relatively simple Window Graphic that is generated from this visual code is shown below.

Geometry.Curve.Composite_Windows Graphic

Geometry.Curve.Composite_Windows Graphic

As usual, liberty was taken with color for visual interest. The files are available for downloading below.

Geometry.Curve.Composite#1

Geometry.Curve.Composite#1a

Geometry.Curve.Composite#1b

Thanks for looking.

T!M

DesignScript Curve Translation, Curve.Line.IsParallel#4 – Code to Node to Code

Hi Everyone:

This is the last of the Line file, Geometry.Curve.Line.IsParallel#4, in a series of four curve- line translations, from the DesignScript Editor Sample files.

Geometry.Curve.Line.IsParallel.ds#4

Geometry.Curve.Line.IsParallel.ds#4

The highlighted line file is shown in the DesignScript Editor. Open the Editor and copy the code.

Geometry.Curve.Line.IsParallel#4

Geometry.Curve.Line.IsParallel#4

Open DesignScript Studio, then paste the code into the canvas. The initial  translation will look something like below.

Geometry.Curve.Line.IsParallel#4a

Geometry.Curve.Line.IsParallel#4a

The properties are highlighted for their attributes. TheNode to Code translation can now take place.

Geometry.Curve.Line.IsParallel#4b

Geometry.Curve.Line.IsParallel#4b

The graphic from the file(s) is shown below.

Geometry.Curve.Line.IsParallel#4 Graphic Window

Geometry.Curve.Line.IsParallel#4 Graphic Window

The files can be downloaded from the links below.

Geometry.Curve.Line.IsParallel#4

Geometry.Curve.Line.IsParallel#4a

Geometry.Curve.Line.IsParallel#4b

Thanks for looking.

T!M