# Minimum radius of a curve

I want to evaluate, if possible, the minimun radius of each curve element.

I know those curves are not circular ones, but it may exists a way to transform them.

Best regards and thanks in advance

Nobody?

This file contains just lines and polylines

Hi @Alfredo_Peña ,
You can use a custom python component.

import Rhino
import scriptcontext as sc
import rhinoscriptsyntax as rs
import System

def point_of_least_curvature(curve_id):
curve = rs.coercecurve(curve_id)
if not curve:
print("Invalid curve.")
return
tolerance = sc.doc.ModelAbsoluteTolerance
domain = curve.Domain
sample_count = 1000
min_curvature = float('inf')
point_of_min_curvature = None
for i in range(sample_count):
t = domain.ParameterAt(i / float(sample_count))
curvature_vector = curve.CurvatureAt(t)
if curvature_vector:
curvature = curvature_vector.Length
if curvature < min_curvature:
min_curvature = curvature
point_of_min_curvature = curve.PointAt(t)
print min_curvature
if point_of_min_curvature:
return point_of_min_curvature
else:
print("No point of minimum curvature found.")
return None

def main():
curve_id = rs.GetObject("Select a curve", 4, True, True)
if not curve_id: return

point = point_of_least_curvature(curve_id)
if point:
print("Point of least curvature added to the scene.")

if __name__ == "__main__":
main()

Hope this helps,
Farouk

Thanks, but due to the fact that the curves have vertices, those are the points it returns, so that’s not a valid solution.

In that case you should explode the curve and treat each one individually and keep the absolute min. among all curves.
Or in GH you could perform the curvature analysis as shown on gh link above “Evaluate Curve” for each curve and then calculate the “min” value among all.

Hope I helped,
Farouk