SporphSpaceMorph: Different sizes

Hi everbody:

My python program is more or less doing what I want. It’s mainly about putting some text on surfaces using SporphSpaceMorph. The problem is: When I morph the same text onto different surfaces it changes its size. Basically, what I do for every surface is:

  • CreateUVCrv from original surface
  • Create a PlanarSrf from those curves
  • Create some text curves
  • Sporph text curves onto original surface

Problem: Sporph-ing (a copy of) ) the same text onto different surfaces gives different font sizes. Very annoying.
I suppose it has something to do with the parametrization of the UV-curves used for the PlanarSrf, but I have no idea how to fix it.
Any suggestions would be highly appreciated.

Kind regards,
B.

Files?

1 Like

Here’s a simple example file.

CreatText_cmd.py (2.9 KB)

Ok, since the reply rate has been really high, let me put a Rhino file with two example surfaces and an adjusted version of the CreateText.py command. So, too see what I mean, just select Layer 01 and run the script and confirm the selection (enter). You’ll see “TestText” on both surfaces, but as indicated in different sizes.
So, the 100 billion dollar question now is: Why have the texts different sizes?
CreateText_cmd.py (2.8 KB) TextTest.3dm (414.1 KB)

Hi @junk,

I’m not getting very far, as you script generates the following error in Rhino 6:

Message: iteration over non-sequence of type NoneType

Traceback:
  line 26, in RunCommand, "C:\Users\Dale\Downloads\CreateText_cmd.py"
  line 83, in <module>, "C:\Users\Dale\Downloads\CreateText_cmd.py"

What am I missing?

– Dale

Hi Dale,

thanks for looking into my problem.

The reason why line 26 crashes is that the variable rhobjs is empty.
(Sorry, I know I should catch such a thing, but it’s just for demo.)

To fix that problem you need to use the script together with the Rhino
file I uploaded.
This file contains two surfaces in Layer 01.

In order to make the skript work, you need to select Layer 01 before
starting the script or enter the layer name “Layer 01” manually when
asked for it.

That should do it.

Kind regards,
B.

P.S. Rhino 6 is the version I am using as well.

Well, the reason is you don’t have text - you have curves.

textcurves = texttainer.CreateCurves(texttainer.DimensionStyle , True)

SporphSpaceMorph is a morphing, or deformation, tool. If you don’t want your (text) curves deformed, perhaps you should transform the curves.

– Dale

Hi Dale,

thank you for your answer.

I still don’t believe that the morphing should change the width/height ratio of the curves depending on the slanting angle of the target surface, having its minimum height at 45 degrees slanting angle. I would consider that a bug.

And yes, of course I tried to use a transformation by using the method that gives a transformation matrix when you provide two surface normals. For some reason this matrix produces a 90 degree rotation of the coordinate axes, but only sometimes. I have to investigate that further, but the preliminary results didn’t look too promising. I’ll keep you posted.

Kind regards,
B.

Hi @junk,

The FlowAlongSrf command has a Rigid option. When set to Yes the command basically does something like this:

for member in members:
    geo = member.Geometry
    bbox = geo.GetBoundingBox(Rhino.Geometry.Transform(1.0))
    plane0 = Rhino.Geometry.Plane.WorldXY
    plane0.Origin = bbox.Center
    plane1 = clr.Reference[Rhino.Geometry.Plane]()
    plane1 = plane0
    rc, plane1 = morph.Morph(plane1)
    if rc:
        xform = Rhino.Geometry.Transform.PlaneToPlane(plane0, plane1)
        geo.Transform(xform)
        member.CommitChanges()

– Dale