Grasshopper

algorithmic 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!

Views: 9118

Attachments:

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:
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.

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
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
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:
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:
For CNC uses, this is extremely useful. Thank you.
and it's a neat window into fonts.
I edited the definition a little.

FontParser_edited.ghx
and now you can input planes to orient the text on.

some characters in some fonts don't quite work. I'm guessing it's because they don't flatten nicely. Maybe instead of flattening into a polyline there should just be a way of filtering each path segment into an appropriate type of curve?
But this can already make some really nice text curves for CNC.
Attachments:
Thanks Giulio. This can easily be used to deal with all the situations I need.

It works great : I achieveved my taging script with rhinonest, I'll post it when the whole thing will be completed.

But I have blinking number in rhino windows, The VBscript is OLD it must come from here, is someone could update it ?

Thanks

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

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service