t be worth the effort. What I really wanted was a way to do the same thing without scripting.
After two days of experimenting, I finally got some results! I was able to recreate Piker's "growing line" script at the above post by putting the Kangaroo Solver inside an Anemone loop. During each iteration the underlying geometry changes, which is something I'd never seen before in a Kangaroo/gh script without writing code. To make it work, the trick is to attach a Boolean list with [True, False] to the Kangaroo Solver's "Reset" input, while keeping the "On" input set to True. That way at each iteration the solver resets itself and starts again with the new geometry provided by that iteration. Then you have to extract only the output from the second iteration to feed back to Anemone.
The only code I wrote was about 7 lines of Python to split line segments that get too long. That could have been done with only Grasshopper components, but doing it in Python was just too easy. …
utting a bounding box around the curve and using the two bottom vertices as the connecting points on the line although I can't seem to get the curve to array on the line.
Ultimately, I would like to revolve each instance around the longer curve (as the axis) and transform each instance (i.e. ones on the left will be longer and slightly bigger - ones toward the right get slightly shorter/smaller)... not sure how to accomplish this either although need to figure out how to array the profile crv first.
*I'm not sure if arraying is the right word because I don't think I want to actually use an array component so another way of explaining the main issue is that I can't map the profile curve to repeat itself on the longer curve.
Thanks!
…
eries of ramps with slopes =< 10%.
Here's my pseudo-code:
1. Populate brep with random points
2. Sort points by Z values
3. Draw line from point '0' of sorted points to all other sorted points
4. Project lines down to plane of first point and cull all lines =< 5.7 degrees (10% slope)
5. Sort remaining lines by length and return line with the largest length (what I want)
6. Cull all points used to create lines =< 5.7 (step 4)
7. ??? now, I want to somehow pass remaining points from step 6 back into the loop and return the next curve that is: the largest length curve from all curves =< 5.7 degrees
I've attached the script
Thanks ya'll!
…
al read” component in grasshopper.
But somehow it seems that the command line “TempSensor.requestTemperatures();” makes the firefly firmata somehow unstable. I have also connected 5 servo motor which move strangely irregular/wrong when the command line above is in the program. So, when I for example only control the "Digital Pin 12" in grasshopper it mainly moves the servo on Pin 11 (!) but also a bit time delayed the servo on Pin 12.
Do you have any ideas? It has to be something inside the “#include <DallasTemperature.h>” (Libary for the temperature sensor) which doesnt go together with the firefly firmata und gets something wrong in the "void WriteToPin" firmata command
Or do you may have any working codes for implementing a temperature sensor? Its doenst have to be the one i have, I could get another one.
here you can see the code: http://txt.do/drqao (a simplified version of the latest firmata including my TempSensor lines marked with "//...//TEST")
Thanks! Julian…
ed:
I'd like to achieve a script in Python that iteratively throws some inputs at a GH script and harvest its results saving them to an external file.Stripping down the issue to its bare bones this is what I would need to achieve:
Where the ultimate goal is obtaining a file containing, line by line, the results of all the possible multiplications of the first 5 natural numbers.
The problem is that the left component runs the entire loop internally before passing the x and y values to the multiplication component. I need the GH document to recompute every time the left Python Script reaches the end of the nested for loop.
As extensively explained by David in this discussion, I believe I need to use the ExpireSolution(True) method, but I'm not sure how to call it in my case. Could anyone please show me how?Thank you very much in advance.
Cheers,
Matteo…
way to get a line to swing towards an attractor point, and then swing randomly around another point? I've divided a line into points and tried to get it done that way, and an enormous amount of other methods. Nothing makes it at like a chain, and I've not done much with Kangaroo to know if that method would be best. This one instance would then be applied across a gird for a series of reactive chains, and I need this modeled to better understand the types of movements that are possible. Any information would be greatly appreciated.
Thanks,
Mel.
This is a rough diagram of what I am wanting to accomplish.…
, 2022
Dates PART II - ON-site at Controlmad / ON-line > June 27th – July 21st, 2022
Some instructors from previous editions:
Arturo Tedeschi (form-finding techniques), [UTo] (Geco developer), Moritz Heimrath (Karamba), Luis Fraguada (GHowl developer), Klemens Preisinger (Karamba developer), Sagrada Familia engineers, Andrés González (McNeel Miami), Daniel Nielsen (environmental analysis), Controlmad team…
Enroll now with earlybird discount!
Instruction Language: ENGLISH
Price: available at the webpage of the course.
Early bird registration special discounts. Ask us!…
even have an invalid Integer, unless you define what that means. You can have invalid doubles, namely:
Dim d As Double = Double.NaN
Similar types to this would be the Drawing.Point and Drawing.Rectangle structures. The second you declare one (or rather, the nano-second you declare one) it already exists and all the fields that define that structure have been set to zero.
So, let's have a look at some actual RhinoCommon code:
Dim ln As Line = GetLineFromSomewhere()
Dim pt As Point3d = GetPointFromSomewhereElse()
Dim pp As Point3d = ln.ClosestPointTo(pt, False)
Since both Line and Point3d are Value Types, neither of them can be null. If you cannot trust the GetLineFromSomewhere() and GetPointFromSomewhereElse() function to return valid data, you must check the returned data like so:
Dim ln As Line = GetLineFromSomewhere()
If (Not ln.IsValid) Then Return
Dim pt As Point3d = GetPointFromSomewhereElse()
If (Not pt.IsValid) Then Return
Dim pp As Point3d = ln.ClosestPointTo(pt, False)
If (Not pp.IsValid) Then Return
There are NaN-like constants for all these value types in RhinoCommon. So you can declare them like this:
Dim pt As Point3d = Point3d.Unset
Dim cr As Circle = Circle.Unset
If you pass a Value Type to a function as an argument, it will be copied, unless you specifically pass it by reference. Thus:
Public Sub LimitPoint(ByVal pt As Point3d, ByVal box As BoundingBox)
pt.X = Math.Max(pt.X, box.Min.X)
pt.X = Math.Min(pt.X, box.Max.X)
pt.Y = Math.Max(pt.Y, box.Min.Y)
pt.Y = Math.Min(pt.Y, box.Max.Y)
pt.Z = Math.Max(pt.Z, box.Min.Z)
pt.Z = Math.Min(pt.Z, box.Max.Z)
End Sub
Is no good. It copies the coordinates inside pt and modifies the copy.
You need to either:
Public Sub LimitPoint(ByRef pt As Point3d, ByVal box As BoundingBox)
pt.X = Math.Max(pt.X, box.Min.X)
pt.X = Math.Min(pt.X, box.Max.X)
pt.Y = Math.Max(pt.Y, box.Min.Y)
pt.Y = Math.Min(pt.Y, box.Max.Y)
pt.Z = Math.Max(pt.Z, box.Min.Z)
pt.Z = Math.Min(pt.Z, box.Max.Z)
End Sub
or,
Public Function LimitPoint(ByVal pt As Point3d, ByVal box As BoundingBox) As Point3d
pt.X = Math.Max(pt.X, box.Min.X)
pt.X = Math.Min(pt.X, box.Max.X)
pt.Y = Math.Max(pt.Y, box.Min.Y)
pt.Y = Math.Min(pt.Y, box.Max.Y)
pt.Z = Math.Max(pt.Z, box.Min.Z)
pt.Z = Math.Min(pt.Z, box.Max.Z)
Return pt
End Function
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
line and why it doesn't work:
Dim cv As Curve: This line declares a new variable of type Curve, but it doesn't actually create a curve. cv will be a null reference (Nothing in VB). You cannot call methods on this instance because it doesn't exist.
Dim d As IEnumerable(Of point3d) = CPoints: You don't need to do this. IEnumerable(Of T) is an interface which indicates that whoever implements it represents a collection of objects that can be iterated over. List(Of T) already implements this interface, as do almost all collection based types in the .NET framework. I.e. when a function wants an IEnumerable(Of Point3d), you can feed it List(Of Point3d) or a Point3d array and it will all work.
cv.createInterpolatedCurve(d, degree): CreateInterpolatedCurve() is a Shared method. "Shared" in this case means it is not tied to a specific instance of the Curve type, but shared amongst all of them. It's a bit of a misnomer in my opinion, I think it would have been better if they had used the word "Loose" or "Floating" or something to describe Shared methods. But, long story short, since Shared methods do not belong to particular instances of a type, they can (and should) be called on the typename. C# enforces this behaviour, VB is more slack about it. In this case, CreateInterpolatedCurve() ought to be called on the Curve type name, not on any variable that represents an instance of the Curve class.
Also, the CreateInterpolatedCurve() method returns the resulting curve, so you must assign it to something otherwise it will fall into a black hole. In my example it is assigned directly to A, but you could also assign it to cv first:
Dim cv As Curve = Curve.CreateInterpolatedCurve(points, degree)
Hope this helps.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…