Hi,
I’m working on a Rhino program that creates 2 rings of individual line segments around a cone-like polygonal prism. I’m computing this with the following inputs:
1. Cone Edges (baseCrvs)
2. Z-Plane Top Ring Position (topRing)
3. Z-Plane Bottom Ring Position (bottomRing)
Here is a drawing showing what the final product should look like:
I compute this in a GHPython block by solving for the positions of the vertices according to a numerical input slider ranging from 1 to 10. Since I need to compute the vertices and make a polyline outside of GHPython block, I set up my code like this, using CurveDomain to get the point from EvaluateCurve for each ring:
#Top Ring Vertices
for curveNow in baseCrvs: topPts.append(ghcomp.EvaluateCurve(ghcomp.CurveDomain(curveNow,[0,10]).curve[1],topRing).point)#Bottom Ring Vertices
for curveNow in baseCrvs: bottomPts.append(ghcomp.EvaluateCurve(ghcomp.CurveDomain(curveNow,[0,10]).curve[1],bottomRing).point)
However, when I execute the script, the bottom ring get constructed fine, but the top ring doesn’t, and a panel showing the topPts list’s contents are totally incorrect:
I suspect the Cone Edges (baseCrvs) input being shared between both command lines throws off the code, but I can’t find a place where the two for loops would interfere. Furthermore, printing topPts and bottomPts at the end of the code outside the for loops both gives consistent list outputs with points.
Here is the file for further reference:
Errorfile.gh (24.5 KB)
Thanks.