ns. but first allow me to explain what i'm trying to do: i have a serial device i want to talk to, but i have to do it using some sort of handshaking. for instance, when i send a command/data, i need to wait for an appropriate response before sending another. i have used andy payne's general serial components from firefly, but i don't think they'll work for what i want to do, and in general, i want to know how to do this from scratch. i'm using the pyserial library to do the comm, and i can get it to work within one script. here's an example of a working (mostly) port open/close script (x=input param for baud, y=input param for port name, z=boolean input param for open/close):
import serialmyPort=serial.Serial()myPort.baudrate = xmyPort.port = yif z == True: try: myPort.open() except: print "Something went wrong. Cannot open port." if myPort.isOpen() == True: print myPort.name + " is open" if z != True: try: myPort.close() except: print "Something went wrong. Cannot close port." if myPort.isOpen != True: print myPort.name + " is closed"
this all works well and good. here are my questions:
1) I can open the port and then close it. however, if i try to re-open it, i get an access denied error. it seems rhino is holding the port open, as i have to re-start rhino to get it working again. i read through the discussions and didn't see any definitive answers to this problem. any advice?
2) I'd like to share this port with other components (or at least break up the functions of opening/closing the port and read/write, not unlike how the firefly components are organized), but i have no idea how to share an object instance between components. i did see that there is a sticky dict and tried to add myPort to it, but i kept getting errors in the other component when i try to use the object's methods. for instance:
Component 1 Script:
import serial
import scriptcontext
myPort=serial.Serial("COM4", 9600)
scriptcontext.sticky['myPort']=myPort
Component 2 Script:
import serial
import scriptcontext
myPort=scriptcontext.sticky['myPort']
print myPort.read()
but i get messages like:
Runtime error (MissingMemberException): 'Serial' object has no attribute '_port_handle'
any assistance would be greatly appreciated!!
best,
~BB~…
evel] are required. No specific Processing skills are required (although an introductory knowledge of programming logic is welcome). Participants should bring their own laptop with pre-installed software (software download links will be given after subscription).
[.]Tutors:
Alessio Erioli + Andrea Graziano + Alessandro Zomparelli – Co-de-iT.
[.] Brief
The workshop explores the manifold relations of creativity and control in computational design. The availability of increasingly complex and sophisticated tools shifts how control and sensibility are exerted and deployed within the design process. A new computational craft is required, one that allows the embedding in computational simulation of matter and agency so that ideas propagate in a deeper ecology with degrees of autonomy that provide complex feedbacks. Objects and systems are not anymore simple assemblages of static parts but are generated from the interrelations of other complex objects within ecologies. The designer is not just merely using tools rather establishing a loop dialogue with their creative and autonomous possibilities: questioning their capacity and extension, evaluating and empathizing with the result that in turn allow configuring and being configured by them continuously.
We will explore matter and agency behaviors through Grasshopper (with Millipede plugin) and Processing, interrogating the aesthetic potential of Topology Optimization and Multi-Agent Systems.
more info here:
http://www.co-de-it.com/wordpress/ctrl-shift-grasshopper-processing-workshop-vienna.html…
picture:
... and on a PC without anything attached to the serial port. When you open the port, start the read component and its timer, do you then get a stream of <empty> values in the log output? (hmmm... I suppose that's only reasonable - but still, you are also seeing this?)
I suppose that, because of the mutually exclusive behavior of both the spider and grasshopper (i.e. only one at a time can access the COM port), we can deduce that we are listening on the correct port.
Am I listening on the correct pin (if such a notion makes sense at all)? If I look back to the spider software, I see that 9 channels are listed and that it's only the measured value on channel 0 that changes when I press the load cell. Channels 1, 2, and 3 report OVERFLOW; 4, 5, 6, and 7 are pretty much constant at 0.000 to 0.005 V; and channel 8 says FFFF. I do not know how things like that work so I do not know if they reflect reading from the 9 pins on the D-sub 9 connector.
As for your BTW question: no, I don't need to record all of the sensor values. I suppose that the Out value on the Read component will always reflect the most current value and that's all that I need to get on with life. In the end, the idea is that we have 4 load cells in the 4 corners of a plate onto which a vertical pipe is fixed. Loads are then put on the top end of the pipe and we'll have to visualize both direction and magnitude of the bending moment that is calculated from the compression - tension readings from the load cells... We've done this on a scaled model and streamed load cell information into MatLab. Now we'll have to use a different datalogger and I was hoping to be able to do the post processing in Rhino.
wim…
new components, and the Firefly Firmata has changed since the 1.003 version. However, the problem still exists in that there is not a super smooth workflow for integrating Steppers with Firefly (yet)... but it's not impossible. There is a post on the Firefly website that has some instructions on how to drive a stepper motor using the Generic Serial Write component and the Easy Stepper Driver. You can find a link here for more information: http://www.fireflyexperiments.com/discussions/post/1438445
It's quite possible that if you already have a sketch that is working using a set Arduino variable (say 100, which makes the servo move to 180 degrees) that you're very close to getting it to work with Firefly. You'll want to use the Generic Serial Write component (instead of the Uno Write component... as the Uno Write component has been setup specifically for use with the Firefly Firmata... and you'll be using you're custom script). You'll likely need to modify your Arduino script in some small way to read in the serial information being sent over from Grasshopper. Basically, in Grasshopper, you'll first need to open the port (using the Open/Close Port component). Make sure the baud rate matches the speed that you use in your Arduino sketch (and that the port number matches your board number). Then, on the Generic Write component, you'll set the port number (same as the COM number in the Open/Close Port component) and set the start input to True. Then, all you need to do is connect some data to send over the serial port... If you wanted to send a numeric value (like 100), then just connect an integer slider. As I said, you need to modify your Arduino code so that it knows how to read in the data from Grasshopper and then what to do with that data. Without seeing you're code, it's hard to tell you exactly how to do this... But, perhaps if you upload a file (or send us a file at info[at]fireflyexperiments.com) then we can help you get your file modified so it will work. Once that's done, it should be really straight forward to drive a stepper through Firefly.
HTH,
Andy
PS, integrating steppers into the Firefly firmata is on my wishlist of things to implement into Firefly very soon. Thank you again for bringing it up.…
at sky type you choose. See images below.
A Tregenza sky discretizes the skydome into 145 patches to simplify the calculation process. This skydome approximates the smoother Perez sky shown below. Both the Tregenza 145-patch sky and the Perez sky use climate data to create realistic skies that react to hourly solar and weather data. So there may be some differences between the two runs. Also, every unique run will have some error based on how the calc process works and what your presets are.
Tregenza 145-patch sky-…
oller, the internet and beyond. This release adds a few new components the toolbar, including the new Ports Available component which polls your device manager and returns the COM number assigned to Arduino board, as well as a new Wave component. We're also excited to release the new reacTIVision component, which enables real-time camera tracking of fiducial markers. If you're new to reacTIVision, take a look at their website and download their engine (and printable fiducial markers) for free: http://reactivision.sourceforge.net/. We've also improved the efficiency of several of the existing components and updated everything for the latest Arduino UNO board.
In addition, we have also released an update to the Firefly Primer - a manual which provides an in-depth look at each individual component and walks you through the entire process of using this powerful new tool (from installation to final output). It also includes some basic tutorials, links and references to get you up and running quickly.
This build requires Rhino 4.0 SR8 (or Rhino 5.0 beta) and Grasshopper 0.8. The installation for this build has changed slightly from previous versions (given the new special roaming folder created for Grasshopper 0.8) and the fact that the reacTIVision component requires the installation (copy/paste) of an additional library (libTUIO.dll). The installation instructions can be found here and should be easy to follow if you are familiar with the Grasshopper interface.
To download the latest build, check out our website at: www.fireflyexperiments.com
As always, we'd love to hear your feedback so feel free to contact us as: info@fireflyexperiments.com Or sign up for our mailing list and find out about all the new Firefly features and events.…
rth. Current components include:
Format_GPS: Takes NMEA Formatted GPS Latitude and Longitude values and converts them to Decimal Degrees. Will add further converters.
GPS->XYZ: Maps Longitude, Latitude, and Altitude to XYZ.
XYZ->GPS: Maps XYZ to Longitude, Latitude, and Altitude.
KML_Export: Exports imported geometry to KML format. Currently implemented for points, curves, and meshes. Any Breps should be meshed before. Will be adding conditions for other geometry as well as render styles.
Look forward to a WIP release next week.
…
s not matching the behavior I experience when I call the methods via the com interface outside of Rhino. Specifically, the OpenDocument method causes a "Grasshopper display error".
(Error Message)
(Resulting Canvas)
I know I am not initializing the GUI correctly but not sure where to go. I can dig deeper into the SDK (ie all the way to GH_DocumentIO.Open()) but honestly much of what I want to do is exposed in GH_RhinoScriptInterface.
My code right now is as follows:
protected override Result RunCommand(RhinoDoc doc, RunMode mode) {bool flag1 = false;bool flag2 = false;
flag1 = Grasshopper.Plugin.Commands.Run_Grasshopper();
Grasshopper.Plugin.GH_RhinoScriptInterface GH_Rhscript = new Grasshopper.Plugin.GH_RhinoScriptInterface();
flag2 = RScript.OpenDocument(@"C:\Temp\Grasshopper\Fins.gh"); //fail
return Result.Success; }
I have also tried:
var GH_DocEditor = new Grasshopper.GUI.GH_DocumentEditor();GH_DocEditor = Instances.DocumentEditor;
flag2 = Instances.DocumentEditor.ScriptAccess_OpenDocument(@"C:\Temp\Grasshopper\Fins.gh"); //fail
The SDK docs says "You are unlikely to need any of this." so here I am.
…
nter the programming world and tinker more complex, interactive solutions. We will also explore advanced programming paradigms. There is no class official programming language, as both C# and Vb.Net are possible on the participant’s side, and all examples will be provided in both C# and Vb.Net. Additionally, we will see how to get started writing full .Net plug-ins. Finally, we will have time to explore user’s own proposals on the third day.
Day 1 Morning: programming introduction in .Net
• The Grasshopper scripting components. Choosing a .Net language. Language developments
• Variables declaration, assignment and utilization. Operators. Methods [functions]. Calls
• Classes: declaration and instancing. Constructors. Importing a namespace. On3dPoints, OnLines
• Arrays declaration and usage. Lists. Adding to arrays and lists, advantages and opportunities.
Afternoon: patterns
• About OOP (object oriented programming) as opposed to procedural programming. Discussion
• Example of OOP good code reuse: sorting points by coordinates using the .Net SDK classes
• Lists as input parameters. Trees as input parameters. Usage and limitations
• Finding resources: on the net with website that can help getting started and troubleshoot. And books
Day 2 Morning: extending Grasshopper functionality with our definitions
• Store data between updates. The use of fields [globals, or static locals]
• Examples on how to use stored data between updates: a simple agents simulation
• Baking geometry with scripting directly into the Rhino document. Baking with names
• Passing custom types from a scripted component to another one. Our own code reusability
• Rendering an animation from Grasshopper. How to get started and final results
Afternoon: customizing our tools
• Our Rhino plug-in with Visual Studio C# [Vb.Net] Express Edition & wizard. Parametric mesher
• Writing a custom Grasshopper component: hacking an exporter for our data to Excel
Day 3 All day: personal project
• Rehearsal on any example from the first two days. A project that you want to start on your own, being it a Rhinoceros plug-in, a Grasshopper assembly or a script. Example might be to send data through network with UDP to Processing
MINIMUM REQUIREMENTS
A good foundation of Grasshopper visual programming is mandatory. You will need a level which corresponds to the Grasshopper 101 course outline. Examples of things that will not be covered in this course are: sorting document spheres by diameter, paneling of a surface with grasshopper components. You are expected to already know these from the Grasshopper course.…
creating the structural frame, finding the endpoints, linking these endpoints with curves and afterwards lofting the surfaces between the curves.
The results were quite nice, however, the procedure is very time consuming and inefficient. There is just too much copy-pasting involved.
(see attached file: "Old Attempts.zip" )
Mesh relaxation:
I have later on used Daniel Piker's tutorials on Mesh Relaxation and realized that this might be the way to go.
The link to these online tutorials on wewanttolearn.net is:
https://wewanttolearn.wordpress.com/2011/10/22/mesh-relaxation-kangaroo-tutorial/
His tutorials, however, only deal with mesh boxes which are ideal cubes. He then joins them together in various directions, but it is under 90 degrees angle.
( see attached file: "Daniel Pikers Examples" )
What I would like to achieve:
I want my bridges to go in all directions and angles, not just under 90 degree angle.
Ideally I would like to make a square (polygon) follow a curve (which moves in all axis) at certain number of division points. I would then loft these squares into a mesh and use that shape as a mesh box. I would later use this mesh box and relax it the same way as Daniel Piker used the cubes in his tutorial. The anchor points are only the vertices of the squares which create the lofted mesh box.
( see attached file: "New Attempts" )
As you can see below this procedure works even if the curve is moving in all directions not only along xy axis. There are, however, many problems connected to it.
The problem:
Despite all the effort I cannot seem to come up with a design where I would be able to draw a random curve which would be the guideline for my mesh box and then apply this box to one definition in order to relax the mesh and create the shape that I want. Without this I am again forced into a lot of copy pasting as the final mesh box is made out of several sections.
Also is there any way I could make the final resulting mesh a bit smoother? Increasing the number of mesh faces is probably the only way, right?
Thank you guys so much for any potential help.
All best,
Luka
…