Arc Length Script

Does anyone have a script that returns the length of a MoveC? I could take the distance between start and via and add this to the distance between the via and the end, but this won’t be exact. I don’t think there’s a built-in function for this, but if I’ve missed it, I’d appreciate if someone could point it out. Otherwise I’ll try writing one myself.

@eric.feldmann Did you find the answer to this? :slight_smile:

def calculate_arc_length(p1, p2, p3):
  a = point_dist(p3, p2)
  b = point_dist(p3, p1)
  c = point_dist(p2, p1)
  r = (a*b*c) / (sqrt((2*pow(a,2)*pow(b,2))+(2*pow(b,2)*pow(c,2))+(2*pow(c,2)*pow(a,2))-pow(a,4)-pow(b,4)-pow(c,4)))
  theta1 = acos(1-(pow(c,2)/(2*pow(r,2))))
  theta2 = acos(1-(pow(a,2)/(2*pow(r,2))))
  arc_length1 = r*theta1
  arc_length2 = r*theta2
  return (arc_length1 + arc_length2)

This is what I’ve been using. No promises that this is very efficient, but it’s been working for me. Just need to pass it the Start, Via, and End positions.

1 Like

Thank you so much! it is really helpfull!