Arraying circles with varying radii along a curve

Why not posting your script with the curve internalized ?
I am sure someone will provide you a working script.
I did that by code


disanceOnCurves_LEGACY.gh (9.4 KB)

  private void RunScript(Curve curve, List<double> radiuses, ref object A)
  {

    //Calculate the center of circles with specified radius on a curve
    List<Point3d> lst_points = new List<Point3d>();
    Point3d pointOnCurve = CurveCircleIntersection(curve, curve.PointAtStart, radiuses[0]);
    lst_points.Add(pointOnCurve);

    for (int i = 1; i < radiuses.Count; i++)
    {
      double radius = (radiuses[i - 1] + radiuses[i] );
      Point3d pointOnCurveNew = CurveCircleIntersection(curve, pointOnCurve, radius);
      if (pointOnCurveNew != Point3d.Unset)
      {
        pointOnCurve = pointOnCurveNew;
        lst_points.Add(pointOnCurve);
      }
      else
      {
        break;
      }
    }

    A = lst_points;
  }

  // <Custom additional code> 

  /// <summary>
  /// Calculate the point on a curve that is at a certain radius from a point
  /// this point must be after the previous point
  /// </summary>
  /// <param name="curve">The curve</param>
  /// <param name="point">The point on the curve</param>
  /// <param name="radius">The radius at which the new pointt must be from previous point</param>
  /// <returns>Next point, Point3d.Unset if no point found</returns>
  Point3d CurveCircleIntersection(Curve curve, Point3d point, double radius)
  {
    double tolerance = 0.0001;
    double overlapTolerance = 0.0001;

    Point3d output = Point3d.Unset;
    double t = double.NaN;
    curve.ClosestPoint(point, out t);

    if (t != double.NaN)
    {
      Circle circle = new Circle(Plane.WorldXY, point, radius);
      CurveIntersections ci = Rhino.Geometry.Intersect.Intersection.CurveCurve(curve, new ArcCurve(circle), tolerance, overlapTolerance);

      double tMinOK = double.NaN;



      foreach (IntersectionEvent ie in ci)
      {
        if (ie.ParameterA > t)
        {
          //First parameter that is OK
          if (Double.IsNaN(tMinOK))
          {
            tMinOK = ie.ParameterA;
            output = ie.PointA;
          }
          else
          {
            //If a parameter is nearer
            if (ie.ParameterA < tMinOK)
            {
              tMinOK = ie.ParameterA;
              output = ie.PointA;
            }
          }
        }
      }
    }
    return output;
  }

Look at plugins for Jewels, Peacock, …
See these threads

6 Likes