Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8524

BendSpaceMorph example in python

$
0
0

@Jack_Minardi wrote:

I am trying to bend some text in an arc with a given radius. I can accomplish this manually with the bend command inside of rhino, but my goal is to automate this task with python. Here is a snippet of my code that I am writing to accomplish this, but it does not work. (The text stays planar)

text_object = rs.AddText(text, rs.ViewCPlane("Front"), height=text_height, font=font, font_style=font_style, justification=131074)
text_curves = rs.ExplodeText(text_object)
text_surfaces = rs.AddPlanarSrf(text_curves)
line = rs.AddLine((0, 0, 0), (0, -1, 0))
text_solids = [rs.ExtrudeSurface(srf, line) for srf in text_surfaces]
rs.MoveObjects(text_solids, (0, radius, 0))
morph = Rhino.Geometry.Morphs.BendSpaceMorph(
        Rhino.Geometry.Point3d(0, radius, 0),
        Rhino.Geometry.Point3d(100, radius, 0),
        Rhino.Geometry.Point3d(radius, 0, 0),
        True,
        True)
[morph.Morph(rs.coercebrep(s)) for s in text_solids]

I do not get an error or crash, but the text in the scene remains uncurved.

Let me know if any more information is needed.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 8524

Trending Articles