Tag Archives: Composite

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

Advertisements

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