Skip to content
July 22, 2010 / stevebaer

StarMaker – An advanced sample


Here’s a sample that demonstrates quite a few of the advanced features in Rhino.python. This sample was written and tested on Windows (I doubt it is going to work very well on OSX given that Windows.Forms are being used.) You are going to need to be running at least the July 20th build of Rhino 5 to test this.

StarMaker is composed of two script files; and Save these files to the same directory.

What does it do? StarMaker just creates a new curve based on points from a closed planar polyline and some input from a form. Run the Polygon command and create a polygon with something like 30 edges. Then run

Some python features demonstrated:

  1. Multiple Script Files – the python script is broken into two files. doesn’t do anything on it’s own and is imported into
  2. Direct use of RhinoCommon – the script uses some of the functionality provided by the rhinoscript python functions, but it really makes heavy use of .NET classes defined in RhinoCommon
  3. Custom Windows Form – This is pretty cool!!! is a custom Wnidows Form user interface. This file was actually created in SharpDevelop ( SharpDevelop has a nice user interface editor for creating custom forms which are written as python files. Try opening in SharpDevelop and click on the design button. (See the attached SharpDev image)
  4. Custom Display for Preview Geometry – The red curve, dotted lines, and points in the screenshot are not actual geometry in the rhino document but are drawn using display callbacks (also know as conduits)

Calling RhinoCommon from python hasn’t been covered too much on this site so much of the script may look foreign.

I want to thank Marc Fornes of for inspiring this sample.

The python scripts can be found here


Leave a Comment
  1. Bradley rothenberg / Oct 8 2014 5:15 pm


    I was going through the sliderform & starmaker script you posted here, & had a question about the variable “e” that you use in most of the functions that access the gui window. What is this variable for? I understand self & sender, but e is less apparent.



    • stevebaer / Oct 8 2014 5:20 pm

      Most events in .NET follow the pattern of

      Event(object sender, EventArgs e);

      The event args are custom to each type of event that occurs.

  2. Bradley rothenberg / Oct 8 2014 6:17 pm

    is this what I should be reading to understand this:

  3. Bradley rothenberg / Oct 8 2014 8:03 pm


    thanks for responding so quickly! Another question is what is the reasoning behind using the display conduit ?? Is it that much faster to use the display conduit vs. re-writing actual geometry?



    • stevebaer / Oct 16 2014 6:36 pm

      Yes, display conduits are typically what you use for previewing geometry before you actually go ahead and add it to the document

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: