Alternative to MergeEdge

I recently realized that _RemoveKnot/_RemoveMultiKnot and their related RhinoCommon methods, e.g., NurbsCurveKnotList.RemoveKnots, can maintain the shape of the curve when the knots are removed at joints with parametric continuity. This can be used to return split geometry as close as possible to their previous state.

I applied this to a couple of scripts as a solution for when edges are _SplitEdge then _MergeEdge. After which, although the vertex no longer exist at the merged joint, the edge curves are merged to a polycurve and the relevant trim curves are merged to a single NURBS curve with a knot with fully multiplicity at the joint. _EndSnap and _IntersectionSnap recognize the joint on the polycurve.

Issue for the above scenario: https://mcneel.myjetbrains.com/youtrack/issue/RH-30014/Merging-edges-leaves-a-kink

rhinopython/spb_BrepTrim_removeInteriorKnots.py at master · CADacombs/rhinopython · GitHub
removes knots in the trim curve and rebuilds the relevant edge curve using the new trim curve.

rhinopython/spb_BrepEdge_merge.py at master · CADacombs/rhinopython · GitHub
merges the edge then calls the other script.

1 Like