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

RC MakeDeformable() question

$
0
0

I assumed that MakeDeformablewould be able to be applied to any kind of geometry - as that is its purpose and it inherits from GeometryBase:

https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.geometrybase/makedeformable#()

However, that does not appear to be the case for objects such as arcs, circles and ellipses. Running this simple code on the circle object in the file below does not make it deformable.

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino

crv_id=rs.GetObject("Select curve",4,preselect=True)
if crv_id:
    crv=rs.coercecurve(crv_id)
    plane=Rhino.Geometry.Plane.WorldXY
    xform=Rhino.Geometry.Transform.PlanarProjection(plane)
    check=crv.MakeDeformable()
    crv.Transform(xform)
    sc.doc.Objects.AddCurve(crv)
    sc.doc.Views.Redraw()
    print("Result of MakeDeformable={}".format(check))

MakeDeformable-Not.3dm (2.8 MB)

I can of course convert the circle ToNurbsCurve or use some other workaround, but that defeats the purpose. I then have to special-case arcs, circles, ellipses etc. in my code - which should run on any curve. Why isn’t MakeDeformable designed to work correctly in this case?

Plus, of course, MakeDeformable is listed as a method under ArcCurve

6 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles