I have some spirals that I created with python around rail curves, with the spirals using t0/t1 values to go partially up and down the rail, taking about 20% off each end. I then want to do a soft edit of the spiral curves to meet the end points of the original rails. See below image.
Below is the result. I have been able to do one end fine. Now I need to do the remaining segment in green, softly editing from that end to the end of the rail curve.
The other end, done as an additional soft edit, doesnāt to behave the same. This is even with fix ends = false. Main things I have been checking carefully are the domain being reparametrized of course. But I think my use of the arguments for the soft edit method might be out of whack. Is the length parameter, some kind of āabsoluteā length? So, if Iām editing from t = 1, does Rhino know that it needs to do the distance back along the curveās parameter toward zero? Or is it like a sphere of influence? Below it refers to āalongā. Is it a measure distance, or parameter distance?
length
Type: System.Double
The distance along the curve from the editing point over which the strength of the editing falls off smoothly.
Below is the issue, although this looks like a basic vector swap, the problem here I see is that the end of the curve is fixing in place when I have fix ends as False.
If the length of falloff is very small, 2mm ish, for a curve that is aroud 300mm long, it works okay. But, that means itās not a soft edit at all, itās really harsh. Tried rebuilding and refitting, made no difference.
My code is below, done in the Grasshopper component
import Rhino.Geometry as rg
#declare lists
spirals = []
soft_edit_start = []
soft_edit_both = []
turn = railCurve.GetLength() / turnFactor
spiral = rg.NurbsCurve.CreateSpiral(railCurve, t0,t1, rp, pitch, turn, r0, r1,pointsPerTurn)
spiral.Domain = intv
rail_end = railCurve.PointAt(1)
rail_start = railCurve.PointAt(0)
spiral_end = spiral.PointAt(1)
spiral_start = spiral.PointAt(0)
#spiral_end_vector =rg.Vector3d.Multiply(-1, rg.Vector3d(spiral_end))
vector0 = rg.Vector3d.Subtract(rg.Vector3d(rail_start), rg.Vector3d(spiral_start))
vector1 = rg.Vector3d.Add(rg.Vector3d(spiral_end_vector), rg.Vector3d(rail_end))
soft_edited = rg.Curve.CreateSoftEditCurve(spiral, 0, vector0, softEditLength, False)
soft_edited_1 = rg.Curve.CreateSoftEditCurve(soft_edited, 1, vector1, soft_edit_length_2, False)
spirals.append(spiral) # check in gh
soft_edit_start.append(soft_edited) # check in gh
soft_edit_both.append(soft_edited_1) # check in gh