Hi, i’m trying to make a script for chamfer with sharp corner between two untouched curves (Linear Curve), so my thought is to first extend the curves with recursion until they touch and have the intersection parameter to split and keep the wanted curves.
So far i’m trying to get the CurveCurveIntersection() point with no luck, i’m a starter in python so maybe i’m doing something wrong with recursion, the code is this:
import rhinoscriptsyntax as rs
if crvA and crvB:
def extCrv(d): extCrvA = rs.ExtendCurveLength(crvA, 0, 2, d) extCrvB = rs.ExtendCurveLength(crvB, 0, 2, d) intPnt = rs.CurveCurveIntersection(extCrvA, extCrvB, tolerance=0) lenCrvA = rs.CurveLength(extCrvA) lenCrvB = rs.CurveLength(extCrvB) if intPnt == None: print(d) print(lenCrvA) print(lenCrvB) extCrv(d+1) res = [extCrvA, extCrvB, intPnt, lenCrvA, lenCrvB] return res crv = extCrv(0)
The problem is that the crv output give me the two correct extended curves but not the intersection point (“null”), and for demonstration purposes, the curve lengths are wrong to.
I’m not sure if recursion is the right way to do it because i try loops and if statements and can’t find the way.
It seems that the intersection point and lengths are not updating to the last recursion operation but why does the curves geometry are?
Can anyone help with the right way to code it?
ChamferTest.gh (10.1 KB)