complicated than it seems as I have an event and a subscriber method receiving data from a serial port.
In the code below, the strings received within myReceivedLines appear when connecting with the serial port (when connecttodevice is true). However they disapear when I launch another command (when homeallis true).
As you recommended in your reply, I have added the field called myReceivedLineswithin the class so that I could use the method String.Add() to all the feedback received and commands sent.
Why does the feedback dispear when a command is sent? Is the string going to myReceivedLine disappearing because they happen within a subscriber method or is it related to the DA.SetDataList() method used to assign myReceivedLinesto the output?
Many thanks!
public class SendToPrintComponent : GH_Component { //Fields List<string> myReceivedLines = new List<string>(); SerialPort port; //subscriber method for the port.DataReceived Event private void DataReceivedHandler(object sender, System.IO.Ports.SerialDataReceivedEventArgs e) { SerialPort sp = (SerialPort)sender; while (sp.BytesToRead > 0) { try { myReceivedLines.Add(sp.ReadLine()); } catch (TimeoutException) { break; } } } protected override void SolveInstance(IGH_DataAccess DA) { //Opening the port if (port == null) { string selectedportname = default(string); DA.GetData(1, ref selectedportname); int selectedbaudrate = default(int); DA.GetData(2, ref selectedbaudrate); //Assigning an object to the field within the SolveInstance method() port = new SerialPort(selectedportname, selectedbaudrate, Parity.None, 8, StopBits.One); //Enables the data terminal ready (dtr) signal during serial communication (handshaking) port.DtrEnable = true; port.WriteTimeout = 500; port.ReadTimeout = 500; } //Event Handling Method bool connecttodevice = default(bool); DA.GetData(3, ref connecttodevice); if (connecttodevice == true) { if (!port.IsOpen) { port.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler); DA.SetDataList(0, myReceivedLines); port.Open(); } } else if (port.IsOpen) { port.DataReceived -= new SerialDataReceivedEventHandler(DataReceivedHandler); port.Close(); } if (port.IsOpen) { DA.SetData(1, "Port Open"); } //If the port is open do all the rest if (port.IsOpen) { bool homeall = default(bool); DA.GetData(5, ref homeall); //Home all sends all the axis to the origin if (homeall == true) { port.Write("G28" + "\n"); myReceivedLines.Add("G28" + "\n"); DA.SetDataList(2, myReceivedLines); } } else { DA.SetData(1, "Port Closed"); } }}…
WIP Anemone loop that builds gradually variable membrane modules) as a generic guideline related with the hot spot N1: how to feed Kangaroo with a proper "minimum" mesh.
By "minimum" I mean a mesh that "approximates" what are you doing PRIOR the kangaroo engagement. I'll post in some days the real case (a very complex one I confess) in order to understand why this is urgently required.
Add ons used: Starling, Paneling tools, MinSurf (Cerver.org), LunchBox, Weaverbird, Anemone, Kangaroo
Notes::
1. Use Stored Views.
2. A variety of gates is used in order to exploit all available (I believe) ways in order to deal with a mesh. The fact that the reduce mesh is not exposed in SDK ... well you understand.
3. Kangaroo is deactivated. Prior activation (see equivalent Stored View) choose some mesh "method" that you rate best for feeding Kangaroo. Of course real-time design is out of the question (see FormFinder).
4. LunchBox can't operate with trimmed nurbs .... thus the "equal" tri/quad mesh dream is a wishful thinking.
5. MinSurf (dealing with nurbs instead of meshes) can't work in a 1:1 basis (we have one membrane "base" and 2 rings or more).
6.For comparison the Rhino file has 2 outputs (depending on the fabric stress conditions) from FormFinder. Notice the way that FF builds up the mesh (MUCH simpler and this is the reason that FF is real-time).
7. Anemone loop is not complete yet (not all data tress required for creating a series of membrane variations are linked). Anemone is temperamental as well (lot's of crashes).
8. Plan Z is WIP.
All in all : a far better way is urgently required in order to feed Kangaroo with some reasonably minimum mesh (like a mini Evolute Tools pro preparing the mesh)..
best, Peter…
.com/-MitiJAK78Yc/T4uKNVhsDTI/AAAAAAAAAJU/jahRRNOP-Hk/s1600/spatial+deform+copy.jpg). I'm trying to incorporate a script which will incrementally change the value of some parameters and render each change. The quality at the moment is the least important issue.
Currently:
I'm perusing this forum and the web to accomplish this. So far, this is what I'm using to help be achieve my goal:
http://www.grasshopper3d.com/forum/topics/batch-rendering-in-python-using-vray :: yet it uses vray (a possible option, but avoided for now due to costs).
http://www.grasshopper3d.com/forum/topics/renderanimation-by-giulio-piacentino-updated?id=2985220%3ATopic%3A518560&page=3#comments :: I've just downloaded the centipede plugin, but this seems to use 3D studio max
Motivation for posting:
I've never engaged with a forum before. Perhaps I'm searching the wrong terminology to find pre-existing help on this matter. If anyone could help, or point me in a probably helpful direction, I'd appreciate it.
If you're curious, I'm trying to generate a set of stimuli (3D objects) that will be incorporated into a visual perception experiment (research at a university).
Thank you.
…
Added by Aaron Kurosu at 2:27pm on October 29, 2014
ld fabrication process for 1:1 components and assemblies. The event will be held in London at the RoboFold factory/studio from June 9th-12th. Workshop participants will investigate the design of facade forms in paper and card, and transfer these to Rhino's Grasshopper plugin to simulate folding and robotics. Using the in-house CNC vinyl cutter and CNC router, various scale prototypes will be folded by hand and by robot. The final 1:1 facade will be formed using 6-axis industrial robots.
Details:
-Tutors: Gregory Epps, RoboFold founder and Florent Michel, RoboFold software developer.-See previous workshops here. -Download Poster here.-Bring your own laptop. -Please install Rhino and Grasshopper before you arrive.-No previous experience with Grasshopper necessary.-Daily 10am-5pm. Location details here. -Drinks reception Tuesday evening.
Registration:
http://www.robofold.com/index.php?WEBYEP_DI=18
Professional: £600 inc VAT
Student: £500 inc VAT
Enquiries: info@robofold.com…
Added by Gregory Epps at 10:02am on April 17, 2012
Data – how it’s stored, accessed, and associated – is the threshold that separates you from fluid execution and powerful routines in Grasshopper. Beginning with a presentation on the main principles of working with Data Trees, this webinar will incrementally unpack a diverse set of Data-related techniques through a series of“live” exercises. With two instructors offering guided curriculum and continuous support it is our goal to provide you with an in-depth and personal learning experience. Additional topics covered will include: what is a Data Structure, why Data Trees look the way they do, and how to navigate, manipulate, and grow your Data Tree in an organized way.
This Webinar will last 2.5 hours including a 30 minute Q & A session. Registration can be found below. We look forward to your participation!
Topics:
What are Data Trees? What do all of those index values mean?
If I have a Data Tree, How can I precisely navigate through it?
My Data Tree is wild! How can I tame it and make its structure clear?
What else are Trees good for? How can I use my Data Tree to create unique labels?
Registration and details can be found here:
http://modelab.nu/?p=7233…
Added by GIL AKOS at 10:22am on September 25, 2012
and the degree of your periodic curve is 3, then start picking one point to the left. If the degree is 5, start pickin 2 points to the left, etc.
Every curve has a domain. A domain is a numeric range defined by two numbers (a lower and an upper bound). Within the domain, the curve exists and the equations which govern the geometry of the curve yield decent answers. The lower limit represents the start of the curve, the upper limit the end of the curve. Everywhere in between you can evaluate curve properties (position, tangency, curvature and any other derivatives, tension, torsion etc. etc.).
There is no significance attached to the actual numbers in a domain. All that is required is that the lower limit is smaller than the upper limit. When we create curves in Rhino we tend to pick domains that represent the length of a curve, but if you scale a curve afterwards you change the length, but not the domain.
Curve parameters are numbers inside this domain. Basically, think of all curves as finite line segments which can be bend, kinked and stretched in 3D space. Curve parameters are locations on the 1-dimensional space that is defined by the line. The curve equations are all about converting those one-dimensional parameters into three-dimensional points and vectors.
Like I said, the mathematics are pretty involved and periodic curves are more difficult still.
--
David Rutten
david@mcneel.com
Tirol, Austria…
Added by David Rutten at 4:23am on September 13, 2013
r.
Jon has already done some very interesting stuff with regard decomposing matters using IFC schema (I'm not a strong admirer of any schema policy mind - for a variety of reasons).
Now the chaotic case:
1. This is deliberately fuzzy, faulty and chaotic in order to indicate the need (at least IMHO) for a next step with regard handling and visualizing (on a per individual data item basis, not on a per branch basis) data trees.
2. Why this Tree Manager future thing could boost GH up to an unseen level? Exploit the PDF attached - use Saved views and/or the Model Tree "decomposer" (file is greatly reduced in detail - only 1 out of 5 floors shown, no envelope stuff, stripped out of everything actually etc etc etc). Among a variety of things observe that there's transformations that are "selectively" applied whilst various components remain intact (in other words: invite existed "static" objects into the smart chaos) - this means that we need a far better control VS the series (of various type of data) that outline the solution of similar things.
3. What could/should do such a "visual" Tree Manager? Could he function within the existed "one Canvas for all things" environment? Do we need N "sub-canvas" (kinda the Views in any CAD app these days) to handle and visualize complex tree operations? Do we need control on a per data item basis? Do we need a re-mapper of a totally different kind? Do we need a Bake Manager? Do we need a Scenario (parameter combos stored etc) Manager?
Let's the debate begin
Best, Peter
…
ents will react to sensors, creating a range of different lighting and spatial effects that will trigger further movement and produce a feedback loop of behaviour and response. To accommodate this responsiveness, the design will be developed using parametric associative modeling, processing, arduino, and digital fabrication using the CNC and Laser Cutters. Students can both develop completely new designs, and/or work on the evolution of the Workshop 1 Supple Pavilion project.
The Visiting School will return to Barracão Escola de Carnaval to evolve the design of the migrating Pavilions, their contents and their context, exploring a design philosophy of interactive event design and the production of a creative fusion of high-tech design generation and fabrication with low-tech redefinition of Carnival-float artisan techniques, paraphernalia, and materials. We will work in the immense and creative Pimpolhos warehouse, collaborating with local artisans of several Samba Schools in the post-industrial, partly-derelict Porto do Rio area, (the birthplace of the Carnival and Samba), introducing digital fabrication techniques. The goal is to create interventions for micro-venues and cultural events that express the identity of the Samba culture within the `Porto Maravilha` planning.
Instruction for the Supple Pavilions workshop series will be led by Rob Stuart-Smith of Kokkugia, Lawrence Friesen of Generative Geometry, Ivan Ivanoff of Interactive Art Estado Lateral Media Lab, Toru Hasegawa of Proxy, with Anne Save de Beaurecueil and Franklin Lee of SUBdV, along with other AA tutors, the Pimpolhos Artistic Directors, and Carnival float-fabricators. Each workshop will provide an introduction to computational design (Grasshopper, Processing and Arduino) and digital fabrication, no previous computational experience is required. Students taking part in multiple workshops will have access to advanced computation instruction. This workshop will produce 1:1 prototyping, exploring the structure and transformations of the pavilions. Final fabrication and assemblage will occur in July.
The workshop is open to architecture and design students and professionals worldwide. Participants can take part in one or more workshops, with fee discounts offered to those interested in multiple workshops.
…
hat offer an even spacing of 11 gems from 0.0 to 1.0, and though the Anenome script works it is not as robust to various shapes and sometimes just stops at some point even on mellow curves:
The Hoopsnake script in the other thread: Hoopsnake doesn't want to appear multiple times in a document since resetting one resets them all and it only runs the first instance when I pasted two more copies of the whole script in, so I'll do them separately, and instead of an input reset wire, there is a right click Reset All item in the pop-up menu.
I understand now how the two looping components work, in having a geometry input for the first item, then they accept a second item input as new geometry that then gets looped as the new geometry replaces the original. What a great hack, so I was wrong above about only being able to loop numerical values.
Since I really like Anenome better due to its nice interface, I've converted the old thread Hoopsnake program to Anenome. It still won't handle multiple curve pairs, so I made copies of the whole script.
I learned a lot today. Thanks guys. Given how well these straightforward scripts can work, I'll bet there's a much shorter Python version possible, one that most anybody could understand and thus adapt. If I have time I can start again this time from scratch. Converting the long one taught me about the problem though. Grasshopper makes it easier though, since Circle TTT only needs one center point hint whereas Rhinocommon TryFitCircleTTT needs three.…
o my python component returning null despite running fine in the standalone python editor (i.e.: not through grasshopper).The original python script is as follows:
import randomimport rhinoscriptsyntax as rsrs.EnableRedraw(False)
def placeBuildings(curve, distance): pts=rs.DivideCurveLength(curve,5) counter=0 for myPoint in pts: counter=counter+1 #get the parmeter f current positision param=rs.CurveClosestPoint(curve,myPoint) #get teh tangent of this parameter tangent=rs.CurveTangent(curve,param) #calculate the angle of the tangent angle=rs.Angle((0,0,0),tangent) randomNumber=random.uniform(1,5) heightOfBuilding=random.uniform(4,40) rect=rs.AddRectangle(rs.WorldXYPlane(),randomNumber,2) rs.MoveObject(rect,(0,randomNumber,0)) hull=rs.ExtrudeCurveStraight(rect,(0,0,0),(0,0,heightOfBuilding)) rs.RotateObject(hull,(0,0,0),angle[0]) rs.MoveObject(hull,myPoint) #if counter%4: #rs.AddCircle(myPoint,3) #selection of curve#curveParameter=rs.GetCurveObject("sel curve")#curve=curveParameter[0]
curves=rs.GetCurveObject("select streets",4)distance=rs.GetInteger("distance?",4)for curve in curves: placeBuildings(curve,distance) rs.ReverseCurve(curve) placeBuildings(curve,distance)
When placed in grasshopper it is the following:
import randomimport rhinoscriptsyntax as rs
#randomNumber=random.uniform(1,5)#rs.AddCircle((0,randomNumber,0), 2)
def placeBuildings(curve, distance): pts=rs.DivideCurveLength(curve, 5) counter=0 for myPoint in pts: counter=counter+1 #get the parmeter f current positision param=rs.CurveClosestPoint(curve,myPoint) #get teh tangent of this parameter tangent=rs.CurveTangent(curve,param) #calculate the angle of the tangent angle=rs.Angle((0,0,0),tangent) randomNumber=random.uniform(1,5) heightOfBuilding=random.uniform(4,40) rect=rs.AddRectangle(rs.WorldXYPlane(),randomNumber,2) rs.MoveObject(rect,(0,randomNumber,0)) hull=rs.ExtrudeCurveStraight(rect,(0,0,0),(0,0,heightOfBuilding)) rs.RotateObject(hull,(0,0,0),angle[0]) rs.MoveObject(hull,myPoint)
#selection of curve#curveParameter=rs.GetCurveObject("sel curve")#curve=curveParameter[0]
curves=xdistance=y
for curve in curves: placeBuildings(curve,distance) rs.ReverseCurve(curve) placeBuildings(curve,distance)
I am unsure why there is no error being returned yet I cannot achieve any result other than null. Maybe someone could look at the script and tell me what is going wrong? I'm hoping to solve this before next Thursday so I might be asking for too much.
Much Appreciated.-A…
Added by Adem O'Byrne at 11:45am on October 9, 2014