y3d(_pt,_v) length = Rhino.Geometry.Intersect.Intersection.MeshRay(_m,ray) print length if length < 0.0: lines=Rhino.Geometry.Line(_pt,_pt+(100*_v)) return lines
if Run == True: if parallel: meshVecTupleL = [] for pt in points: for v in vectors: meshVecTupleL.append((mesh, pt, v)) withNulls = ghpythonlib.parallel.run(intersect, meshVecTupleL, True) a = [item for item in withNulls if item != None]
1. How come we never defined length as an empty list and still it stored all the numbers?
2. If length < 0.0 , lines are being created. How does python/rhino knows which pt to make the line at since we are processing the entire list "length" ?
3. If I add another statement before return lines that would return the startpoint of the line instead of the line itself, it doesn't work. Why is that?
Thanks for your help. …
Added by Apoorv Goyal at 3:41pm on January 13, 2015
Watch out with your inputs to the contour component (One Srf to S;and 1 Pt to contour start pt)
See file (sorry I had to order it to my logic:-))
Best Regards
DeDackel
l Num As Integer)
Dim m_count As Int32
If( Not Bake ) Then
m_count = 0
Return
End If
'Iterate through points by row
Dim j As Int32 = 0
For i As Int32 = 0 To Points.Count() - 1
If( j > Num + 1 ) Then
j = 0
End If
Dim pt As On3dPoint
pt = Points(i)
'Name the point
Dim att As New On3dmObjectAttributes
doc.GetDefaultObjectAttributes(att)
att.m_name = GridName & "(" & m_count & ")(" & j & ")"
print(m_count)
'increment index
j += 1
'Add to document
doc.AddPointObject(pt, att)
Next
m_count += 1
A = m_count
End Sub…
-7c93d197ccc8")
2) a) A list or tuple, containing coordinates of a point (for example: "[2,6,0]")
b) An object of a certain type (in this case of a type Point3d). Basically under the hood of rhinoscript, your list or tuple will mostly be converted into a certain Rhino object type, but you do not have to worry about that. Doing it manually would look like this:
import rhinoscriptsyntax as rs import utility as rhutil pt = [2,6,0] #2)a) pt_id = rs.AddPoint(pt) #1) point = rhutil.coerce3dpoint(pt, True) #2)b) print type(pt) # will result in: list print type(pt_id) # will result in: guid print type(point) # will result in: Point3d
So just take care if you are supplying either guid, or list(tuple)/object.…