Help max size of closed curver

i want looking for max size of closed curve by code rhinopython script but i don’t know how can do that. Do you have solutions?

Hi @xiix.xoox,

What to you mean by “max size?” Perhaps we need more information on what you are trying to do?

– Dale

1 Like

i have 2 curve, The one is rectangle with size permanent and one size changed. how can i know curve with size change be bigger than rectangle

Hi @xiix.xoox,

In this case, it looks like a simple bounding box comparison might be all you need.

– Dale

1 Like

Yup! i want compare the curve that is in the curve (don’t change size) by python script but i don’t know solution?

Hi @xiix.xoox,

For closed curves that lie on the world x-y plane, this should work:

import rhinoscriptsyntax as rs
import Rhino

def SampleCompareCurves():
    
    crv0_id = rs.GetObject("Select first curve", rs.filter.curve)
    if not crv0_id:
        return
        
    crv1_id = rs.GetObject("Select second curve", rs.filter.curve)
    if not crv0_id:
        return
        
    crv0 = rs.coercecurve(crv0_id)
    crv1 = rs.coercecurve(crv1_id)
    
    crv0_bbox = crv0.GetBoundingBox(True)
    crv1_bbox = crv1.GetBoundingBox(True)
    
    rc = crv0_bbox.Contains(crv1_bbox) 
    if rc:
        print 'Second curve is inside the first curve.'
    else:
        print 'Second curve is not inside the first curve.'
    
SampleCompareCurves()

– Dale

1 Like

Thank you!