designcoding
Search
About Table of Contents Keywords Support designcoding!

Binary Branching using Macro

April 15, 2013 | 3,321 views
Fractals | Rhino Macro
fractal | macro
2013_04_15-branch

Today’s design computing class was about fractals. In Rhino, writing macro statements are very easy to learn as it just mimics your behaviors in a sequential text. There are a few syntactic rules that we should know. First, you should watch the command line carefully to understand the steps of your design process. Each command in Rhino requires different inputs from the user. In macro, you may enter these values or tell the macro to ask the user by typing “_pause”. Blank spaces work as if you hit enter. Below is one of the examples we’ve discussed in class. It is running from the first line step by step down until the end. I’ll explain each step.

! ; fractal binary branching
_line 0,0,0 _pause
_sellast
_divide split=yes 2 _enter
_sellast
_arraypolar 0,0,0 3 360 _enter

; As there is not loop in macro
; copy four below rows again and again
; to enable feedback in the fractal tree

_selnone
_divide _pause split=yes 2 _enter
_sellast
_arraypolar _pause _pause 3 360 _enter

The first line, “!” is used to cancel any command that might be running when the macro starts. It is important because you can run a macro while another command is running in Rhino. “;” represents the start of a comment that should not be treated as a command. It is important to take notes on your macros in order to make them understandable. The next line starts with the macro commands. “_” at every command makes sure that you can run this command in any language version of Rhino. It now sends “_line” to the command line and hits enter by typing a blank space after it. Rhino is asking for the first coordinate of the line. “0,0,0” feeds this input automatically. Please be careful about “,”s, and “.”s in Rhino. “,” is always used in coordinates in the form of x,y, and z. While “.” is used in digits such as, “0.5” which means 1/2. After sending the first coordinate and hitting enter by a blank space, Rhino now asks for the second point. At this time, a macro lets the user define a point as usual by entering “_pause” there. Macro just pauses and waits for the input to be completed by the user. After this entry, I chose to continue from the next line because this makes the macro more readable. Note that getting to the next line is also hits “enter” in Rhino. “_sellast” is in fact a Rhino command we never use normally. It selects the output of the last command. The macro continues by sending the “_divide” command and changing a parameter of it. As you see, macro directly resembles the way you use command line inputs in a modeling process. No conditional statements or loops, in fact, nothing algorithmic here. However, you may use CTRL+C and CTRL+V to enable a kind of loop, making a part of the macro seemingly run recursively.

_fractal halfs
  • Search

  • Categories

    • Education
      • Basic Design
      • Design Geometry
      • Design Mathematics
      • Digital Fabrication
      • Parametric Modeling
      • Tutorials
    • Philosophy
      • Analytical Tradition
      • Phenomenology
    • Practice
      • 3D Models
      • Projects
      • Publications
      • Workshops
    • Research
      • 3D Printing
      • Building Facade
      • Calculus
      • Climate Analysis
      • Compass Constructions
      • Computational Geometry
      • Curves
      • Decorative Arts
      • Digital Fabrication
      • Evolutionary Solvers
      • Folding Structures
      • Fractals
      • Graph Theory
      • Interlocking Structures
      • Islamic Patterns
      • Linear Algebra
      • Minimal Surfaces
      • Muqarnas
      • Non-Euclidean Geometry
      • Paneling
      • Parametric Curves
      • Parametric Objects
      • Parametric Surfaces
      • Pattern Deformations
      • Patterns
      • Pavilions
      • Polyhedra
      • Rammed Earth Structures
      • Robotic Fabrication
      • Shape Grammars
      • Simulation
      • Space Syntax
      • Surface Constructions
      • Tessellations
      • Tools
      • Vector Fields
      • Virtual Reality
    • Tools and Languages
      • 3DS Max
      • 3DS Max Script
      • Grasshopper
      • Photoshop
      • Physical Prototyping
      • Revit
      • Rhino
      • Rhino Macro
      • Rhino Python
      • Rhino Script
      • Unity
  • Monthly Archive

    • August 2026 (1)
    • October 2025 (1)
    • June 2025 (2)
    • May 2025 (2)
    • April 2025 (5)
    • December 2024 (40)
    • August 2024 (5)
    • July 2024 (6)
    • April 2024 (4)
    • March 2024 (10)
    • February 2024 (10)
    • January 2024 (8)
    • December 2023 (10)
    • August 2023 (3)
    • July 2023 (3)
    • June 2023 (7)
    • May 2023 (8)
    • April 2023 (7)
    • March 2023 (2)
    • February 2023 (2)
    • January 2023 (3)
    • December 2022 (6)
    • November 2022 (7)
    • January 2022 (1)
    • December 2021 (1)
    • October 2021 (3)
    • September 2021 (4)
    • August 2021 (4)
    • May 2019 (2)
    • April 2019 (1)
    • March 2019 (5)
    • January 2019 (2)
    • December 2018 (1)
    • November 2018 (4)
    • October 2018 (9)
    • July 2018 (1)
    • June 2018 (3)
    • May 2018 (1)
    • April 2018 (4)
    • February 2018 (2)
    • January 2018 (7)
    • August 2017 (9)
    • July 2017 (6)
    • October 2016 (1)
    • May 2015 (5)
    • April 2015 (8)
    • March 2015 (12)
    • February 2015 (4)
    • January 2015 (11)
    • November 2014 (1)
    • August 2014 (1)
    • June 2014 (2)
    • May 2014 (12)
    • April 2014 (5)
    • March 2014 (3)
    • February 2014 (6)
    • January 2014 (4)
    • December 2013 (5)
    • November 2013 (11)
    • October 2013 (2)
    • September 2013 (9)
    • August 2013 (4)
    • July 2013 (2)
    • June 2013 (14)
    • May 2013 (4)
    • April 2013 (10)
    • March 2013 (11)
    • February 2013 (11)
    • January 2013 (10)
    • December 2012 (10)
    • November 2012 (6)
    • October 2012 (13)
    • September 2012 (2)
    • August 2012 (5)
    • July 2012 (14)
    • June 2012 (6)
    • May 2012 (17)
    • April 2012 (15)
    • March 2012 (9)
    • February 2012 (16)
    • January 2012 (18)
    • December 2011 (20)
    • November 2011 (2)
  • Support designcoding!

    Enjoying designcoding? Support its future with a small donation on Patreon. Thank you!

    Patreon


    copyright 2026 designcoding.net | about | table of contents | keywords | privacy policy | end user license agreement