Possible bug: TextEntity.CreateExtrusions with custom plane

I’m encountering unexpected behavior in both Rhino 6 and 7 with TextEntity.CreateExtrusions.

What I observe: When I build text on the world XY plane, it extrudes the text as expected. When I change this to any other plane, the extrusions get scattered around in seemingly random orientations.

The documentation says that this method extrudes the text outlines. When I create the text outlines, they look correct in both the WorldXY and custom plane. Something seems to be happening when Rhino goes to extrude these curves such that the geometry gets transformed.

It’s possible this is a setup issue on my part. I’m attaching a Grasshopper script with a c# scriptable component that has a few lines of code in it to make the extrusions. I don’t fully understand what properties of the Text Entity and Dimension Style must be set to make this work, and there’s a 50% chance I missed something important here, so please have a look. For example, for some reason you have to set the text height in both the text entity and dimension style for this to work properly in the WorldXY plane. This fact leads me to believe I might have forgotten something. But if not, perhaps this is a bug.

Oriented3dText.gh (12.4 KB)

Hi @gruedisueli ,
Instead of TextEntity.CreateCurves and TextEntity.CreateExtrusions methods, I am using TextEntity.Explode one. TextEntity.Explode has the same bug you show with TextEntity.CreateCurves, since Rhino 5. I am not sure if it was fixed in Rhino 8.

How I managed to overcome the bug is:
Get TextEntity.Plane, and transform the TextEntity from that plane to XY plane. Call Explode() method on that TextEntity in XY plane. Retransform back the curves to TextEntity.Plane.

Thanks @djordje .

Your suggestion of transforming the 3d letters using a plane to plane operation inspired me to do something a little similar but not the same. It involved using the original 3d letters extruded in the WorldXY plane but then doing a plane-to-plane transform to put them in the correct orientation.

While this workaround will likely solve it for me, I think McNeel should be aware/fix this bug in the SDK, if it is indeed a bug and not user-error.

1 Like

Hi @gruedisueli ,
Yes, that was basically my suggestion: move TextEntity to XY_pln; do the “operation” in XY pln, and then move it back to 3D.
By “operation” I meant: exploding TextEntity to curves,
or making breps from those curves and extruding them.

Maybe the issue is solved in Rhino 8, I’ve never had a chance to test it.

I think rather than exploding curves, it is easier if you use the TextEntity.CreateExtrusions operation because you don’t need to get into weirdness with exploding a set of curves, then identifying inside and outside curves, etc. I’ve gone down that road before and it’s a lot more work to clean up the 3d objects, when the CreateExtrusions method itself seems to yield very clean geometry, minus the plane bug we are discussing.

1 Like

I wasn’t aware TextEntity.CreateExtrusions actually creates Extrusions objects (it’s in the name, I know).
Documentation states it creates Breps:

Thank you for pointing this out.