#DesignScript LM – Chapter 24 -Part II: Intersection, Trim, and Select Trim

Hi Everyone:

Continuing on from the last post, using the custom node that we created, this translation will show the surface trimmed from the intersections, for this very efficient compact DSS translation.

Once again starting with the usual introduction for a frame of reference.

This translation is from the twenty-fourth chapter of the DesignScript Language Manual and can be found at DSLM  (pages 70-73) and is entitled;  Intersection, Trim, and Select Trim. There is a companion video tutorial on Trim & Intersection(#17) which can be found on the DS website’s tutorials.

The initial manual translation was made on the Autodesk DesignScript Community Forum and DesignScript.org. Now it can be found at can be found at  Chapter 24: Intersection, Trim, and Select Trim, Part #2(Note that it can be not longer be found on the Autodesk Labs Website, as linked)

Copy and paste the script from (page 72) the Design Script Language Manual into the DesignScript Editor.  Below shows the script in the  DS  Editor with the results of the code being run, and the window graphics inserted alongside for reference.

Chp-24_intersection_trim_selectTrim_ds#2

Chp-24_intersection_trim_selectTrim_ds#2

Now open DesignScript Studio and paste this same script into the canvas.

Chp-24_intersection_trim_selectTrim#a2

Chp-24_intersection_trim_selectTrim#a2

Note script is inactive as it has been commented out.

Chp-24_intersection_trim_selectTrim#a2-edited

Chp-24_intersection_trim_selectTrim#a2-edited

The script is then run, with the editing as shown above.

As in the previous translation, the custom node is required.

Chp-24_intersection_trim_selectTrim_ds#2-insert2

Chp-24_ Point Transporter

Once again it’s script is as follows.

def PointTransporter : Point[][](points : Point[][])
{

points[1][1] = points[1][1].Translate(0, 0, 2);
points[
8][1] = points[8][1].Translate(0, 0, 2);
points[
2][6] = points[2][6].Translate(0, 0, 2);
return = points;

}

Enter & Save the above code in the Design Script Editor, which was named PointTransporterand added to the DSS library.”

The initial DSS translation is shown below.

Chp-24_intersection_trim_selectTrim#2

Chp-24_intersection_trim_selectTrim#2

Continuing on with the more detailed and defined translation with the renaming of the variables, identifying and referencing them with their corresponding nodes.

Chp-24_intersection_trim_selectTrim#2a

Chp-24_intersection_trim_selectTrim#2a

As a reminder, selecting the graphic window one can get an enlarged view of each snapshot.

Next is the “Node to Code” operation.

Chp-24_intersection_trim_selectTrim#2b

Chp-24_intersection_trim_selectTrim#2b

A little editing is desired.

Chp-24_intersection_trim_selectTrim#2b-edited

Chp-24_intersection_trim_selectTrim#2b-edite

The Graphic Window(s) that result from the script is shown below.

Chp-24_intersection_trim_selectTrim#2a-Graphic Window

Chp-24_intersection_trim_selectTrim#2a-Graphic Window

Reiterating, this was done on the stand-alone version of DesignScript, rather than as a plugin for AutoCad. The files are available for downloading from the Drop-Box links below.

2015_03_27-Chp-24_intersection_trim_selectTrim#a2

2013_11_25-Chp-24_intersection_trim_selectTrim#2

2014_03_22-Chp-24_intersection_trim_selectTrim#2a

2015_03_28-Chp-24_intersection_trim_selectTrim#2b

2015_03_27-Chp-24_intersection_trim_selectTrim.ds#2

The final post on this chapter is next.

Thanks for looking.

T!M

 

 

 

 

 

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