lenge 3 is the most important. Why you get (occasionally) this:
instead of that?
2. The HAC ... well is an abstract and very slow thingy, he he.
may the Force (the dark option) be with us all…
rof Sigrid Adriaenssen's dissertation that you might find helpful.
The basic idea is for the system in the attached jpg, the equilibrium is P-Ky=0. P is load, K is stiffness and y is displacement/nodal locations, usual Finite Elements stuff. DR models this dynamically so that P - Ky = Fictional Mass x Acceleration + Artificial Damping Coefficient x Velocity. When the right hand side (the Residual Force) of this equation = 0, vibrations have stopped and the corresponding y values represent the equilibrium position.
You iterate by
1) Starting from some y (the initial geometry),
2) Calculate P-Ky by summing all internal forces(prestress) + external applied loads
3) If P - Ky=0, terminate,
4) Calculate velocity and acceleration [you don't really need to know the details of this bit unless you are coding up an algorithm..Sigrid's paper explains it anyways]
5) Find new y based on the given time step and repeat from step 2, first resetting the velocities and accelerations to zero
There are some other specifics, but in plain words this the general idea: apply external forces, calculate the displacement, velocity and acceleration, reset these to zero, reapply external force, recalculate displacement, velocity and acceleration, etc until system has stopped displacing under external force application. Sam Joyce has posted some source code in Processing if you want to see how to program it. http://people.bath.ac.uk/scj21/…
u have to put it back specifically.
I didn't get the translation exactly right, but it's something along these lines:
If (C.Count < 2) Then Return
' Declare output collections. Dim circles As Circle() = C.ToArray() Dim lines As New List(Of Line)
' Populate collections with first data. Dim circle0 As Circle = circles(0) Dim circle1 As Circle = circles(1) circle1.Translate(New Vector3d(circle0.Radius + circle0.Radius, 0, 0)) circles(1) = circle1 ' Put the modified circle back into the array. lines.Add(New Line(circle0.Center, circle1.Center))
' Iterate over remaining circles. For i As Int32 = 2 To circles.Length - 1 Dim pivot As Circle = circles(0) Dim current As Circle = circles(i) Dim previous As Circle = circles(i - 1)
Dim chickenInt As Int32 = 0 Do While (chickenInt < 1000) chickenInt += 1
Dim side0 As Double = pivot.Center.DistanceTo(previous.Center) Dim side1 As Double = pivot.Radius + current.Radius Dim side2 As Double = previous.Radius + current.Radius
Dim enumerator As Double = (side0 * side0) + (side1 * side1) - (side2 * side2) Dim denominator As Double = 2 * side0 * side1 Dim angle As Double = Math.Acos(enumerator / denominator)
' Update current circle. Dim vector1 As New Vector3d(pivot.Center) Dim vector2 As New Vector3d(previous.Center) Dim vector3 As New Vector3d(vector2 - vector1) vector3.Unitize() vector3 *= side1 vector3.Rotate(angle, Vector3d.ZAxis) vector3 += vector1
current.Translate(vector3 - New Vector3d(current.Center)) 'circles(i) = current
' Check for intersections For k As Int32 = 1 To i - 1 Dim distance As Double = current.Center.DistanceTo(circles(k).Center) Dim radii As Double = current.Radius + circles(k).Radius
If ((distance + 0.001) < radii) Then pivot = circles(k) Continue Do End If Next
' draw a line to the new center if there are no intersections Dim line As New Line(pivot.Center, current.Center) lines.Add(line) Exit Do Loop
circles(i) = current ' Put the modified circle back into the array. Next
A = circles B = lines…
Added by David Rutten at 5:49am on November 18, 2014
easy - outline of code.
x=0
j=0
k=0
For i=0 to (A.count()+B.Count()-2)
if (xmod2)=0 then
arrNew(i) = A(j)
j=j+1
else
arrNew(i) = B(k)
k=k+1
endif
Next
But I can't seem to get a count of the number of elements in the first dimension of the array(The getLength() vb.net method doesn't seem to be implemented and I can't even seem to access a particular element such as A(0)(1) which seems to suggest that the data I am getting from grasshopper is not acting like a 2-dim array.
Any help would be appreciated. thanks.
…
retrieve the first item:
maximum.
4 A bunch of sliders (L) in [0, 1], ReMap to get values in
[0, max].
4 - 5 k values in [0, max] set the boundaries of (k - 1) domains.
6 & 7 Test belongness of every distance (point) to every domain
(interval of distances): classify distances (points).
Every branch (7) is a class (interval of distances) so radius or colour or whatever can be set by branch (by class).
Distance (1) belongs to [0, max]. Domains (5) should be a partition —classes— covering [0, max], but a partition covering a subinterval of [0, max] is set if the first and last L sliders —boundaries— aren't 0 and 1: nearest and furthest circles will be culled.
Keeping radii under half Cell Size, circles won't overlap.
…
gy is very small and we can "safely" substitute "finest structural solution ever" with "gimme the next size tube" : crude but it's working, he he. But if it collapses ... we can use the next next size tube (trial and error , he he).
PS: Of course a "thick" MERO could yield a LBS capable to withstand Katrina^2.
Provide your def/data and I'll try some freaky ideas.…
ece and get the precise flat piece of the bent sheet.. You would work off 2 planar surfaces With a hinge connection and define the flattened radius.. I know inventor and solid works do it but you have to manually build flanges while I want the flanges to be deducted from the original surface model so that the overall bounding measurements remain the same.. Thanks a lot
…
s. Thx for ur help!
import random as rnd
import Rhino.Geometry as rg
uinc = 1/unum
vinc = 1/vnum
panels = []
for i in range(unum):
for j in range(vnum):
vlen = rnd.randint(1,10)
if j + vlen > vnum:
vlen = vnum - j
cpts = []
depth = rnd.randint(0,1)
for k in range(vlen+1):
cpts.append(srf.PointAt(i*uinc, (j + k)*vinc)) cpts.append(srf.PointAt((i+1)*uinc, (j + k)*vinc))
vnum2=int(len(cpts)/2)
panel = rg.NurbsSurface.CreateFromPoints(cpts,2,vnum2,2,2) panels.append(panel) a = panels
a = panels…
the mesh and 2 curves which represent the problem vector intersections. The VB script:
Dim cell_tot As New List(Of Integer) Dim ray_int As New list(Of line) For i As Integer = 0 To cells.Count - 1 Dim intx As Integer = 0 For j As Integer = 0 To pts.Count - 1 For k As Integer = 0 To sample_V.Count - 1 Dim r As Ray3d = (New Ray3d(pts(j), sample_V(k))) Dim cell_intx As Double = Rhino.Geometry.Intersect.Intersection.MeshRay(cells(i), r) If cell_intx > 0 Then intx = intx + 1 Dim l As New line(pts(j), sample_V(k), 100) ray_int.add(l) End If Next Next cell_tot.Add(intx) Next A = cell_tot B = ray_int
This works with 99% of the vectors but seems to systematically miss some. Wondering if it is a tolerance issue or if I am messing up the code. Screenshot of the geometry, rhino model, and GH defn attached.
Thanks,
Jeff…
list of lines.
My issue is sometimes I try to create a line between two points, and I get a line between the last parent node and 0,0,0. ( I have attached an image of the output to show the error. Nodes, 2, 10, and 9 connect to 0,0,0 but they shouldn't.
I am assuming that if the line constructor doesn't receive a valid point, it assumes the world origin as a point?
If so, what is the syntax for checking to see whether a point3d variable is not valid?
Below was my attempt at checking it but I recieved this error.
Error: 'IsNot' requires operands that have reference types, but this operand has the value type 'Rhino.Geometry.Point3d'. (line 139)
------------------------------------ If ptChildBelow IsNot Nothing Then ' this what I wan't done
Dim lineA As New Line(ptParent, ptChildBelow) listLines.Add(lineA) End If
-------------------------------------
Thanks in advance for the help, and I uploaded my definition in case it's useful for anyone.…
Added by Faiyaz Khan at 9:58pm on February 22, 2012