algorithmic modeling for Rhino
Hello,
I am in the course of learning script example from Rhino 5 Python Primer regarding recursion.
I have a function written as below:
```python
def AddArcDir(ptStart, ptEnd, vecDir):
vecBase = rs.PointSubtract(ptEnd, ptStart)
if rs.VectorLength(vecBase)==0.0: return
if rs.IsVectorParallelTo(vecBase, vecDir): return
vecBase = rs.VectorUnitize(vecBase)
vecDir = rs.VectorUnitize(vecDir)
vecBisector = rs.VectorAdd(vecDir, vecBase)
vecBisector = rs.VectorUnitize(vecBisector)
dotProd = rs.VectorDotProduct(vecBisector, vecDir)
midLength = (0.5*rs.Distance(ptStart, ptEnd)/dotProd
vecBisector = rs.VectorScale(vecBisector,midLength)
return rs.AddArc3Pt(ptStart, rs.PointAdd(ptStart, vecBisector), ptEnd)
```
In the line :
```python
vecBisector = rs.VectorScale(vecBisector,midLength)
```
I get an error message "SyntaxError: unexpected token 'vecBisector' ". Why do I get this message?
Tags:
I tlooks like you need to close your parenthesis on the line above:
midLength = ( 0.5*rs.Distance(ptStart, ptEnd) / dotProd )
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by