Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 4171

Rhino 8 WIP - Python - Get Geometry From Model Object?

$
0
0

Hello,

I have a simple python script that returns the curve degree from the input curves.

I am primarily passing geometry as “Model Objects” throughout the script.

If I use the G output of the Model Objects node and feed that into python or put a geometry type node such as “Curve” between the Model Object O output and the Python input, the script functions as expected.

I am stuck on how to, inside python, extract the geometry from a Model Object so that I don’t need an intermediary node between the Model Object and the Python script.

Please see the snip below noting that the G output of the MO node, or a Curve node after the O, solves the input needs of the python component. (I would like to skip this step and feed the O straight into python)

Graph Space:

Thanks for your help!

Script:

import rhinoscriptsyntax as rs

if C is None:
    D = C
elif rs.IsCurve(C):
    degree = rs.CurveDegree(C)
    print "Curve degree:", degree

    D = degree

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4171

Latest Images

Trending Articles



Latest Images