- dupl: duplicate - make copies of an object or parts of an object
- modf: modify - change the object in some way
- eval: evaluate - evaluate an object for a given parameter
- trfm: transform - transform an object, for example move or rotate
- defm: deform - deform an object, for example shear
- test: test - perform various test on an object
- prop: properties - get or set object properties
- stat: state - the state of the object, for example locking and hiding object
- func: function - various other functions that can be performed with the object
import py2rhino as p2r
points = ((0,-10,0), (0,0,0),(2,0,0),(3,4,0),(7,9,0))
crv = p2r.obj.NurbsCurve.create_by_pnts(points, degree=3)
Here is a duplication example - rebuilding the curve. Note that the method returns a boolean indicating if it worked or not.
success = crv.dupl.rebuild(4, 20)
Here is a transformation example- moving the curve. Note that the method returns a boolean indicating if it worked or not.
success = crv.trfm.move((0,0,0),(0,0,20))
Here is an evaluation example - getting the tanget at a particular parameter along the curve:
tangent = crv.eval.tangent(0.5)
Here is a deformation example - shearing the object.
tangent = crv.defm.shear((0,0,0), (0,10,0), 45, True)
Here is a test example - testing is a curve is planar - i.e. lies on a plane. All these methods return a boolean value.
tangent = crv.test.is_planar()
Here is a properties example - getting the start point of the curve.
start_point = crv.prop.start_pnt()
Here is a state example - locking the curve.
success = crv.stat.lock(30)
Here is a functions example - dividing a curve to create a series of point along the curve.
points = crv.func.divide_crv(30)
No comments:
Post a Comment