Grasshopper

generative modeling for Rhino

I'm using Giulio Piacentino's Text Lines Definition (Thanks Giulio!!), in combination with another definition of my own, to create single stroke text for CNC uses. But coming out of the Text Lines VB component I am getting invalid curves in some letters, specifically "r", "i", "y", and "t". I am using a single stroke stroke font, "Machine Tool SanSerif" (from here) which I have attached below.

Does anyone know how I can fix these invalid curves?
Is it the font?
Why might they be invalid?

Any help is greatly appreciated.

Thanks!

Attachments:

Reply to This

Replies to This Discussion

Hi Benjamin,

I think there is somehow something strange with this font. Windows XP on my machine cannot deal with it and Vista shows the preview in a "closed curve" way. So far my attempts to import it as open curves have been unsuccessful, as the Rhino import is based on Windows font.

Here is what I am seeing:

Empty on XP 64 bit Closed on Vista


Do you have other single stroke fonts to test? Are single-stroke open-curves fonts even valid Windows fonts? When there is a discussion about these fonts, inevitably that page with that font pops up... Since the font actually seems so simple, one could write a script that creates these lines in Grasshopper, especially now that Grasshopper has so many string tools.

I'm attaching a simple Gh 0.7 script that creates open curves based on a string. I haven't made all the letters of the alphabet but I hope it can give an idea of how you could do it. Please feel free to improve it or add to it. If you do, it would be great if you post it back!


- Giulio
__________________
giulio@mcneel.com
McNeel Europe, Barcelona
Attachments:

Reply to This

Thanks Giulio!

In Rhino, if I use the command "Text", I cannot utilize any of the single line fonts, but if I use the "TextObject" command, and I click the "Allow single-stroke fonts" box, I am able to get a nice set of single stroke curves.

It seems like the "TextObject" command is able to make some translation from text to curves that the C# output is not able to do, because it will output invalid curves every time I try to use a single stroke font (but only on certain characters). I'm not sure what "TextObject" is able to do that the script is not, but I didn't notice anything promising in the SDK, and I'm guessing that the script is creating the same type of object as the "Text" command, before exploding.

In any case, later today I was planning to simply put a command line macro ("-TextObject") into a VB.NET component, and the finding a way to grab the results and bring the curves back into Grasshopper. It seems like it should work until a more precise solution can be found. I'll post the results later.

Reply to This

As I understand it, this method would work on your system, but it wouldn't generally (or on mine...) I will ask the developers and let you know more.
Thanks,

- Giulio
__________________
giulio@mcneel.com
McNeel Europe, Barcelona

Reply to This

Also, I'm not sure why you don't get a preview in XP. I'm using XP and it appears the same as your Vista preview.

machtgth.ttf
MACHTHSC.TTF

Reply to This

Hi Benjamin,

Steve Baer has confirmed that the current SDK is not exposing a way to retrieve single-stroke fonts curves given the font name. So the only way is to script the _-TextObject command in Rhino for now. This has consequences: the worst one is that it uses the undo stack of Rhino, so please keep this into account. However, you will be able to retrieve the curves with this script until the SDK will expose this method.

Hopefully this is at least partially good news.
Have a nice day,

- Giulio
_______________
giulio@mcneel.com
McNeel Europe, Barcelona
Attachments:

Reply to This

I wrote a little script that uses GDI methods to extract the font vectors. It might not do what you need, but it might be a step in the right direction. It only exports polylines (no bezier curves).

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Attachments:

Reply to This

Gulio, it is cool, but can you also do this for 0.6?
we a dealing a workshop with the old wersion...(

Reply to This

This definition has two scripts, one in RhinoCommon and the other in the .Net SDK 1. The second one should load in Gh 0.6, too.

- Giulio
____________
giulio@mcneel.com
McNeel Europe, Barcelona
Attachments:

Reply to This

RSS

Translate

Search Grasshopper

Members

  • Giulio Piacentino
  • Shawn Fernandez
  • Daniel Hernandez Canut
  • Jason Kelly Johnson
  • edrina dandini
  • David Rutten

© 2010   Created by Scott Davidson.   Powered by .

Badges  |  Report an Issue  |  Terms of Service