#DesignScript – Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndices.WithColor#2- Code to Node to Code

 Hi Everyone:

This is the second of six DesignScript SubDivisionMesh translations, from the Surface category of the DS Editor (DSE) Samples.

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor-ds#2

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor-ds#2

Open the file Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndices.WithColor.ds, in the DS Editor and run it. The script is shown below.

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor.ds#2

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor.ds#2

Again note the script is drawing errors in the DSE as shown in highlighted portion of the code. Practically all of the SubDivisionMeshes properties are not being generated in addition to surface Patches property. We will have to see if an improvement can be made in the translation from the DS Editor (*.ds) file to the DS Studio (*.Bin) version.

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#a2

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#a2

Now open DS Studio, copy & paste the DSE script, Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndices.WithColor.ds, into a blank canvas. Now comment out the “(import(ProGeometry.dll)” script as highlighted above.  It can now be run as a Code Block of script, before the translation to Nodes takes place

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#a2-edited

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#a2-edited

Note the highlighted commenting out which must be deleted in order to activate the code. Again this file draws the same errors. Taking a look a as the code Block is broken down, the error location is shown.

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#a2-continued

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#a2-continued

A work around is being explored through the nodes.

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2

The preliminary translation is shown above, while the developed translation is shown below.

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2a

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2a

The red and yellow highlighted areas match the description and properties layout that is given to the script in the initial DS Editor *.ds file. Developing the translation for further interest, the Surface Mesh is further broken down to show the various faces with different colors applied.

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2b

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2b

The “Node to Code” operation as shown above. As highlighted, editing is required in order to have a named identity to the variables.

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2b-edited

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2b-edited

The geometry that results from the various code translations is shown below.

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2-Graphic Window

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2-Graphic Window

Liberty was taken with making the color have some transparency as shown above in the graphic window.

DSS was run as a stand-alone application and the translation files are available to download from the DropBox links below.

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#a2

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2a

Geometry.Surface.SubDivisionMesh.ByVerticesFaceIndicesWithColor#2b

Thanks for looking.

T!M

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s