I recently came up with the idea for an automatic chair generation program for Rhinoceros because I always had to import and then copy furniture models from web when fitting out layouts after drawing. However the chairs I stumbled upon over the web were containing a high number of polygons. In fact, for some chair types, even my Quadro 4000 graphics card couldn’t handle the situation when there were about 10 chairs in the view. Outrageous. So at first I managed to reduce the models to more manageable sizes without losing too much detail using the Reduce Mesh feature. However, last week I decided I didn’t want the unnecessary excess and wanted to do it properly. Therefore, I decided I wanted to use the simplest possible chair and table, material-free, with a single keystroke within Rhinoceros, much like using a toolset in AutoCAD.

I began my research with Rhinoscript and, after looking into Python scripts and comparing them with C++ and Java, I decided to continue with Rhinoscript. Without going into too much detail, in a way that architecture students would understand, Rhinoscript seemed suitable, but since my program needed more time than I could devote, I resorted to using a macro. Macros are the simplest form of programming, though calling it programming might already be too generous. They are a series of commands that automatically execute a series of operations with a single activation.

Chair Macro:
Here are the source codes:
! _noecho _rectangle _pause r0.05,0.05 _sellast -_extrudecrv _cap=yes 0.5 _sellast _array 2 2 1 0.5 0.5
_enter _rectangle r-0.05,-0.05,0.5 0.55 0.55 _sellast -_extrudecrv _cap=yes 0.03 _rectangle r0,0,0.03 0.55 0.03 _sellast
-_extrudecrv _cap=yes 0.5 _echo _exit h _enter
Table Macro:
! noecho _rectangle _pause r0.05,0.05 _sellast -_extrudecrv _cap=yes 0.8 _sellast _array 2 2 1 2 1
_enter _rectangle r-0.05,-0.05,0.8 2.05 1.05 _sellast -_extrudecrv _cap=yes 0.03 echo _exit h _enter
This is how my automatic chair and table creation system works. If you’re interested, give it a try!
Leave a Reply