How to use the rhino3dm.ArcCurve function in rhino3dm

To help you get started, we’ve selected a few rhino3dm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jesterKing / import_3dm / import_3dm / converters / curve.py View on Github external
arc.points[3].co = (ept.x, ept.y, ept.z, 1)

    '''
    print("ARC")
    print("    StartPoint:", rcurve.Arc.StartPoint)
    print("      EndPoint:", rcurve.Arc.EndPoint)
    print("        Center:", rcurve.Arc.Center)
    print("        Radius:", rcurve.Radius)
    '''

    arc.use_endpoint_u = True
    arc.order_u = 3    

    return arc

CONVERT[r3d.ArcCurve] = import_arc

def import_polycurve(rcurve, bcurve, scale):

    for seg in range(rcurve.SegmentCount):
        segcurve = rcurve.SegmentCurve(seg)
        if type(segcurve) in CONVERT.keys():
            CONVERT[type(segcurve)](segcurve, bcurve, scale)

CONVERT[r3d.PolyCurve] = import_polycurve

def import_curve(context, ob, name, scale, options):
    og = ob.Geometry
    oa = ob.Attributes

    curve_data = context.blend_data.curves.new(name, type="CURVE")