Interface Week

sketch

This week might be a lot of text and not a whole lot of images since I think most of the thinking has been ideation for how I am going to interact between cad and my final project. As much as I would like to switch to another cad program for my own learning, the architecture industry is so reliant on Rhino and Autocad (mostly Rhino) so I am going to stick to that for the way to transmit information to the pen plotter. I want the pen plotter to be real time interactive with a rhino document so I thought the best way to do that would be through grasshopper. I think the most generic form of 2D information in Rhino are nurbs curves and I am interested in their mathematical definitions which are a bit more complex than lines or arcs or circles so I wanted to use this week to try to find a way to transmit those to something that can be read by the micropython interface that I’ll be using with my motors and microcontrollers. Here's a sketch of the basic flow of information that I am hoping to transmit through this program:
gh
After a bit of research it looks like the best way to get real time data from rhino to grasshopper is through the Human plugin: https://www.food4rhino.com/en/app/human I usually work in layers that will translate to line weights or line types like dashes so I split the GH components into those to coordinate to different pen weights.
gh
I dont know too much about how g-code is generated, but I had to think of a way to reference each line and curve in a way that generalizes all data types of curves in rhino. I decided to write a program in grasshopper that extracts two things from rhino drawings and real time that serve as the basis for converting them to motor control: control points, and how they are stored (circle, line, rectangle)
I also wanted to find a way to have the grasshopper components and data speaking to a program outside rhino in real time. I found a json path converter which takes data trees from grasshopper and formats them for json and exports them. I could then use this in my machine to generate motion control for each shape in a python program.
json