ut node recieves a data tree in the format:
4640 values inherited from 1 source...
{0} N=8
{1} N=8
{2} N=8
...
{165} N=4
If I flatten the 'Elem' input node, all is well BUT It is essential that I keep the data structure unflattened for when I subsequently disassemble the model to retrieve line lengths. (I assemble and dissassemble because I need the lengths of all lines remaining after Karamba has removed excessively small elements).
I'd like to give an I profile to my beams and a tubular profile to my columns.
I've checked and double checked that all Beam ID's have indeed been attributed one or the other.
Strangely, if I use only the tubular cross-section for both columns and beams, no problem, the components behave.
Solution should be quite straight-forward...am I perhaps flattening something that I shouldn't?
Would anyone have any tips for me to try out? Any feedback is greatly appreciated!
Nathan
ps: I am uploading the files but it's huge so will take a while! I have attached some screenshots below in the meantime.
UPDATE: Files: https://we.tl/y3ZzD7lS1x…
ells new products like the Firefly Interactive Prototyping Shield which mounts on top of your Arduino Uno and provides access to a number of useful input (ie. sensors) and output (ie. motors) devices. It includes features like:
Three linear slide potentiometers connected to analog pins 0, 1, and 2
Two-axis joystick connected to analog pins 3 and 4
Light sensor (photocell) connected to analog pin 5
Three push buttons connected to digital pins 2, 4, and 7
Red LED connected to digital pin 13
RGB LED connected to digital pins 3, 5, and 6
Two servo connections on digital pins 8 and 9
A connection to the Easy Stepper Driver (co-designed by Sparkfun Electronics and Brian Schmalz) to control stepper motors. The direction of the motor is controlled through digital pin 10 and the number of steps through digital pin 12
High-voltage MOSFET circuit capable of driving lights, valves, DC motors, solenoids, or anything else requiring higher voltage or current. The gate of the MOSFET is connected to digital pin 11 (PWM).
Some come take a look and let us know what you think!
…
bottom left and surface 9 is top right?
As it is now, selecting surface 8 from the list item will select surface bottom left (see picture 1) and selecting surface 1 will select the surface middle left (see picture 2)
Is there a solution?
Thnx!…
st work on lists? There may be a good reason for this, I just cuoldn't work it out while skimming the code.
2) I'd recommend declaring variables at the last possible moment, not all at the top of the file. It makes it very difficult to see what variable is used where that way. Also, if you change code, it's a lot of work figuring out what variables just became obsolete.
3) In VB.NET you can declare for loop iteration variables inside the loop, cleaning up the code: For t As Integer = 0 To X
4) If statements with conditionals should not be written like this: If (value = False) Then. There's nothing technically wrong with it, but the general rule is to write If (Not value) Then or If (value) Then.
5. Things like k = k+1 can be written shorter in VB.NET, namely k += 1. I just think that looks cooler :)
6. In VB.NET, Exit Sub is still legal (for legacy purposes) but the Return keyword is to be preferred.
7. I'm happy to see you're using sensible variable names and casing.
8. For a program like Grasshopper, one would expect to get the same results when the same setup is run at a later time. That means creating Random instances with a fixed seed value, not DateTime.Now.Millisecond. If your result depends in any way on the seed value, it should be kept constant.
On the whole pretty good work, code is quite self-documenting, properly commented and fast. Hats off.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
j.
if the item 0 is (16.76159) in the original list and in the reorderd list is the item n4 (16.76159) I want in a new list that integrates both indices of the number (16.76159) using the structure of the reordered list and replacing the decimal numbers for the corresponding index in the original list.
the new list would look like.
reordered index - original index
0. 11
1. 19
2. 8
etc.
as always, any help is useful.
thanks!
federico
argentina.…
imes. Your loop should go to y.Count - 1. Or, you could use a For...Each loop, circumventing the problem altogether:
Dim shortLines As New List(Of Line)
For Each segment As Line in y
If (segment.Length < x) Then
shortLines.Add(segment)
End If
Next
A = shortLines
--------------------------------
Another problem is this line of code:
New_Lines.Add(New_Line)
It is located inside the loop but outside the If statement, meaning it gets run every single iteration. This fills up the short line list with duplicates.
-------------------------------
Here's something else which is redundant:
Dim Input_Line As New Line
Apart from the fact that you don't need a special variable for this at all, you also don't need to add a New keyword. The type Line in RhinoCommon (just like Point3d, Vector3d, Plane, BoundingBox etc. etc.) are Structures, not Classes. Structures always exist when they are defined, whereas Classes can be null ("Nothing" in VB).
-------------------------------
Some more advice:
Dim i As Integer
For i = 0 To y.Count()
You can merge these two lines into one. VB.NET allows you to declare your iteration variable inside the loop:
For i As Integer = 0 To y.Count - 1
--------------------------------
If you don't like the For...Each approach at the top of this answer, here's how to write this using a For...To loop:
Dim shortLines As New List(Of Line)
For i As Integer = 0 To y.Count - 1
If (y(i).Length < x) Then
shortLines.Add(y(i))
End If
Next
A = shortLines
ps. A personal preference of mine is that I always encase the expressions inside If...Then statements in brackets. You technically don't need to do this, but I find it makes the code more readable.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
2.7.5 (2.7.5.0) on .NET 4.0.30319.42000 (64-bit))version info: sys.version_info(major=2, minor=7, micro=5, releaselevel='final', serial=0)Runtime error (ValueErrorException): time data does not match formatdata=JAN/30/2017, fmt=%m/%d/%Y, to: M'/'d'/'yyyyTraceback: line 8, in scriptds
The bottom one:
Runtime error (ValueErrorException): time data does not match formatdata=JAN/30/2017, fmt=%m/%d/%Y, to: M'/'d'/'yyyyTraceback: line 4, in script
Thanks,
-A.…
component I just used different components and GH tools to do the same - and this become part of my short paper submission for SimAUD 2016). My solution compares the height of the same points of different solar envelope and then chose the lowest one. I read about the improvement you are working on and it is good but I think it is not yet what I need (or how the solar envelope tool could be more complete).
What I need is a solar envelope that would guarantee on different facades with different orientations (the example I sent you) a certain amount of direct sunlight, say 4h per day in a given period for example all the month of June at 60°N. So to guarantee the south facing facade I should chose the vectors from 10 to 14. But these are not ok for all the other facades because in this timeframe the East and West facing facades get only 2 hours and the North get 0 hours.
So the fist step would be have the possibility to chose different sun vectors for different facades. For the example I did (the 4 hours in June at 60°N) the south facing facade would need from 10 to 14, the East facing for example from 8 to 12, the West facing facade from 12 to 16 and the North facing facade from 6 to 8 and from 18 to 20.
If I would chose a single longer time frame that could get all these hours, from 8 to 20 then the resulting solar envelope would result probably smaller than the sum of the four solar envelopes.
But this is not complete yet. I mean the use of different sun vectors on different facades. The reason is that for example when I chose the sun vectors from 8 to 12 for the four hours on the East facing facade how do I know that the sun hit on the facade in that time frame or maybe it is obstructed by surrounding buildings? Since the sun at 60°N (where I live) in June rise at around 3.15 then maybe for that specific facade the sun hit from 4 to 8 and not from 8 to 12.
I did an extreme case talking about 60°N and that maybe the sun hit on a facade at 4 instead than 12, but it is just to make understand the logic. My suggestion for a more advanced solar envelope it should be integrated with the Sunlight Hours tool of ladybug. So the input should not be the sun vectors because I don't know when the sun hit on the facade but the input should be just the desired number of hours and the possibility to specify different number of hours for each facade. Then this last component that sum different solar envelope (I didn't use it yet but I understood what it does) should be integrated yes so the result would be one single solar envelope more likely using the lowest points (the highest I don't understand what for).
Let me know what you think!
…
te one of the boxes (kind of). Now I'm trying to set up the pattern, but I would like it to be random. I'm having trouble coming up with the actual algorithm, though.
I'm able to generate a list of items, randomly select some of them, and rotate them. I can also select the item after a rotated one and move it to the right.
However, I'm having trouble selecting all of the items after an item that's been rotated, and moving all of them.
Let's say I have a list of 15 elements and numbers 3, 6, and 7 are rotated. I would need to move numbers 4 through 14 (since it starts at 0) to the right by an x amount; numbers 7 through 14 to the right by a 2x amount; and numbers 8 through 14 by a 3x amount.
How should I go about doing this?
I'll add my current non-working setup. I should note that since I'm new, it probably looks horribly disorganized. Sorry about that.
Thanks!…
nded from the centerline at a specified thickness, which may vary along the stent.Two parameters, tmid and tend, control thickness variation
along the segment’s longitudinal direction according to the kinematically admissible Hermitian
curve:
t (d) = tend + t(3d2 − 2d3) 0 ≤ d ≤ 1
t = tmid − tend
where d is the normalized distance along the segment’s
NURBS curve between its endpoint and midpoint. This
form ensures there are no discontinuities in thickness at
the segment midpoint or at the interface of segments in the
overall stent.
2)These normals are then checked and subject to a filleting
procedure to remove re-entrant corners, resulting in
two external sets of boundary coordinates defining the
external edges of the segment’s mid-plane.
3) This plane of nodes is then extruded at a specified angle
(see Section 2.3) to generate a 3-D set of nodes defining
the finite element mesh.
4) These nodes are then mapped to cylindrical coordinates.
5) Finally, 20-node brick elements are generated for finite
element analysis.
I have generated the centerline using 8 control points with degree 7 .
Would be great if anyone can help me with the drawing the normals from the centerline of specified length governed by Hermitian equation,so as to generate the 2D model of a stent (Please refer to the attached figure of a 2D stent and extruded figure) ,using Grasshopper.
The centerline of a single stent segment is representedas a NURBS curve.…