oning behind using the equality component to test for even numbers is flawed because of the data matching used by gh. It is testing like this:
0==0 True
2==1 False
4==2 False
6==3 False
etc
.............
Where as a Modulo 2 would work like this
0%2 = 0
1%2 = 1
2%2 = 0
3%2 = 1
4%2 = 0
5%2 = 1
6%2 = 0
7%2 = 1
8%2 = 0
9%2 = 1
......
Also I notice you have some errors in your expressions producing Nulls.
If you want it to be twice the value then you should have 2*D in the Expression and 10*D in the other
....
I attach a working version.…
ect, ByRef B As Object, ByRef C As Object, ByRef D As Object)
Dim tree1, tree2, tree3, tree4 As New datatree(Of System.Object)
Dim path1 As New GH_Path(0, 3) Dim path2 As New GH_Path(0, 4) Dim path3 As New GH_Path(0, 5) Dim path4 As New GH_Path(0, 6)
For i As Integer = 0 To x.Branch(0).count - 1 tree1.Add(x.Branch(0).item(i), path1) tree2.Add(x.Branch(1).item(i), path2) tree3.Add(x.Branch(2).item(i), path3) tree4.Add(x.Branch(3).item(i), path4) Next
a = tree1 b = tree2 c = tree3 d = tree4
This works I guess I'm just wondering if there is a better way.
Thanks again,
-Brian…
a number between 0 and 1.
5. Generate random number for each of the points.
So each point have 2 numbers - distance D (remapped to 0 to 1), and random R (0-1).
X = D-R
If X is smaller than 0 then delete the point with cull pattern.
Should work.…
o Vb.net.Can you help me?
What would I need to do?
Thanks ,
Phillip
Private Sub RunScript(ByVal S As Brep, ByVal D As Double, ByRef B As Object) Dim tol As Double = doc.ModelAbsoluteTolerance
Dim breplist As New list(Of brep)
breplist.add(s)
breplist.add(brep.CreateTrimmedSurface(s.Faces(0), s.faces(0).Offset(d, tol)))
Dim edgelist As New list(Of curve)
For Each brp As brep In breplist
For i As Integer = 0 To brp.Edges.Count - 1
edgelist.add(brp.Edges(i).tonurbscurve)
Next
Next brp
Dim lft(0) As brep
lft = brep.CreateFromLoft(curve.JoinCurves(edgelist), Point3d.Unset, Point3d.Unset, 3, False)
breplist.add(lft(0))
b = brep.JoinBreps(breplist, tol)
…
Hi Mohammad, sr.Rotate(Math.Pi/6, D, P) returns a boolean. If it's a True value, then the rotation was succesfull and you can asign the rotated geometry. (30 radians seems to be wrong in your script)