ntornos de trabajo, entre técnicas interactivas y soluciones algorítmicas, se examinan conceptos y casos de estudio que le permitirán al participante decidir como y en que momento estas tecnologías pueden ser utilizadas como aliadas en los procesos de diseño y fabricación. Tomando como plataforma básica Rhino, se explora y optimiza el diseño y fabricación de topologías complejas bajo los entornos de Grasshopper, RhinoNest y RhinoCam. Su duración será de 4 horas, cupo limitado.…
find more then one closest point). The array part was just an attempt in getting the list sorted... but without a result:Private Sub RunScript(ByVal inPts As List(Of On3dPoint), ByVal sPts2 As On3dPoint, ByRef A As Object) Dim d1 As Double = Double.MaxValue Dim min1 As Int32 = -1 Dim d As Double Dim arrS As New ArrayList() Dim arrS0 As New List(Of List(Of on3dPoint)) Dim arrS1 As New List(Of Double) Dim sList As New List(Of On3dPoint) //the last 4 lines were to check different options For i As Int32 = 1 To inPts.Count() - 1 d = sPts2.DistanceTo(inPts(i)) If (d < d1) Then d1 = d min1 = i End If Next arrS0.Add(inPts)
arrS1.Add(d) arrS.Add(arrS0) arrS.Add(arrS1) sList = arrS.Sort(inPts) //the last 5 lines were to check different options A = inPts(min1)I would appreciate any kind of hint/help on this one,Thanks in advance,Tudor…
t = tree
End Sub
#Region "Additional methods and Type declarations"
Sub nearTwo (ByVal ptsIn As List(Of On3dPoint), ByRef tree As DataTree(Of On3dPoint), ByRef pathNum As Int32, ByRef j As Int32)
While (j > 3)
Dim path As New EH_Path(pathNum)
Dim d1 As Double = Double.MaxValue
Dim d2 As Double = Double.MaxValue
Dim min1 As Int32 = -1
Dim min2 As Int32 = -1
For i As Int32 = 1 To j - 1
Dim d As Double = ptsIn(0).DistanceTo(ptsIn(i))
If (d < d1) Then
d1 = d
min1 = i
Else If (d < d2) Then
d2 = d
min2 = i
End If
Next
tree.Add(ptsIn(0), path)
tree.Add(ptsIn(min1), path)
tree.Add(ptsIn(min2), path)
ptsIn(0) = Nothing
ptsIn(min1) = Nothing
ptsIn(min2) = Nothing
Dim tList As New List(Of On3dPoint)
For i As Int32 = 0 To j - 1
If (ptsIn(i) <> Nothing) Then
tList.Add(ptsIn(i))
End If
Next
j = tList.Count()
pathNum += 1
'calls recursive routine
nearTwo(tList, tree, pathNum, j)
End While
End Sub…
How about this? Red group filters sub-surface sections by 'Srf CP' distance ('D'):
P.S. By trial and error, I determined that U=14 and V=60 to match the Rhino.
ses.
if (b != "Square" && b != "Circle") return -0.4;
// Handle final case.
if (d <= 1) return -0.5;
if (d == 2) return -0.3;
if (d >= 4) return -0.2;
return -0.4;
I think the problem might be that all your 'and' and 'or' keywords are on the same level. It think you need to combine the two statements on either side of the 'or' operator into a single block, probably using precedence brackets.
…
Added by David Rutten at 10:06am on September 10, 2017
e new grasshopper?
Private Sub RunScript(ByVal value As Object, ByVal minVal As Object, ByVal maxVal As Object, ByRef pattA As Object, ByRef pattB As Object, ByRef pattC As Object, ByRef pattD As Object, ByRef Test As Object) Dim dom As Double = maxVal - minVal Dim I As Integer Dim K As Double Dim A(value.count-1) As Integer Dim B(value.count-1) As Integer Dim C(value.count-1) As Integer Dim D(value.count-1) As Integer
For I = 0 To value.count - 1 K = (value(I) - minVal) / dom If K <= 0.25 Then A(I) = 1 B(I) = 0 C(I) = 0 D(I) = 0 End If If K <= 0.5 And K > 0.25 Then A(I) = 0 B(I) = 1 C(I) = 0 D(I) = 0 End If If K <= 0.75 And K > 0.5 Then A(I) = 0 B(I) = 0 C(I) = 1 D(I) = 0 End If If K <= 1.1 And K > 0.75 Then A(I) = 0 B(I) = 0 C(I) = 0 D(I) = 1 End If Next pattA = A pattB = B pattC = C pattD = D End Sub…