ate it in GhPython
In Python I tried to use For loop, but it divides all the curves 10 times. Seems that there is a problem in data matching.
Here is the code:
import rhinoscriptsyntax as rs
ptList = []
for i in range(1,10): pt = rs.DivideCurve(crv, i)
print (i)
ptList.append(pt)
a = pt
Here is the screenshot of GH scrypt and the result I want.
Thanks!…
Hi Dackel,
Not sure that the Pathmapper is the right tool in this case.
Pass the Pt list into a Flatten component and have the Optional Path set to {4}
l around the original surface, so I am not sure about how the new panels will fit to each other, I am worried about a gap between the panels... Any idea of how to approach this issue? Thanks! Amir…
:
#1) Sample grid of points on surface (use a nested loop)
# 2) Go through the points created using a nested loop, use a counter for points #k = 0
# Each time in the inner loop: # Create a local frame(plane) using 3 points # Find point that lies in the plane which is closest to the last corner point
# 3) Create rectangle outlines as polylines (add 4 corners and first one at the end to close the polyline) # 4) Transform each frame, cen_pt from surface frame to world XY, # then translate them according to the dx and dy spacing. (Hint: remember the order of multiplying matrices) # 5) Create new rect polyline and transform it, find centre of transformed rect polylines
If I remove the transform and translate, everything aligns perfectly ><
Please help, thank you in advance!…
Added by Althea Chan at 3:08pm on November 5, 2017
am not sure what it does)
3. What is a component index and what is it doing?
4. s and t are doubles. but What are they doing?
6. The normal. First you dim the normal as a vector (does the .unset clear the default value?) Are you setting a new value to normal by placing it within the .closestpoint?
Sorry. But still learning.
Thanks,
M…
ector, a Point, or Lists of 3 numbers in Grasshopper? It's probably just wiser to keep tuples like this (they are a special Python construct after all).
The fix in the script, however, is very simple. Change curvepointlist.append(pt) to curvepointlist.append(rs.AddPoint(pt)) on line 24.
This will make RhinoPython tranform the tuple into a Guid, and the object will marshal nicely and quickly as the type that you expect it to be.
I hope this helps,
- Giulio________________giulio@mcneel.comMcNeel Europe…
).
- Make sure all 3 PT files (rhp + dlls) are in the sub folder together (I have it set up the same on my computer).
- Open new session of Rhino
- Go to Plugin manager to load PanelingTools.rhp and mark the check box now (so you get it load next time).
- Open GH.
Let me know if this works for you now.
-Rajaa…
untime error:
Runtime error (PythonException): unable to add point to document Traceback: line 97, in AddPoint, "C:\Users\AKIDRIBM\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\geometry.py" line 136, in Point, "" line 47, in toGH, "" line 187, in RunScript, ""
Could anyone help me figure out what's causing it? The code for adding the point is below:
# Plots points/text dots def Point(self, pointSource): print pointSource, type(pointSource) pt = rs.AddPoint(float(pointSource.value.x.value), float(pointSource.value.y.value), float(pointSource.value.z.value)) return pt
pointSource is a custom object that stores information about the point. Its only relevance here is to obtain the point coordinates. I do not get this error all the time, so I'm having trouble figuring out what is exactly causing it.…