FreeCAD Hack (Draft ShapeString: negative tracking)

A place to share learning material: written tutorials, videos, etc.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

FreeCAD Hack (Draft ShapeString: negative tracking)

Post by TheMarkster »

In this hack I show you how to use negative values for ShapeString tracking.

What is tracking? Tracking is the separation between the letters in the string. The bigger this number the more separation there is. In this image there are 3 shape strings. The top string has default Tracking (0.0 mm). The middle string has Tracking = 2.0 mm. The bottom string Tracking is -2.0 mm.
Snip macro screenshot-fbff9b.png
Snip macro screenshot-fbff9b.png (53.29 KiB) Viewed 1520 times
I noticed this when making a happy birthday sign to stick into a birthday cake. I used a balloon font and wanted all the letters to overlap so they would be a single object when printed. I tried scrolling the mouse wheel below zero, no dice. It stops at 0. I tried entering -1 into the property, still no dice, won't even let you enter such. This is because the Tracking property is of type App::PropertyLength, and a negative length is not a real world value, so it's disallowed.

So, how to do it, already!?!

Just enter it as a formula. Press = key or click the f(x) icon and enter the value you want for the tracking. Alternatively, this can also be done from the python console. Select the shape string in the tree, press Ctrl+Shift+P. In the python console enter:

Code: Select all

obj.setExpression("Tracking", "-2")
to clear the expression:

Code: Select all

obj.setExpression("Tracking", None)
You might try this and end up with invalid objects because extruding such a shape string with overlapping letters will result in self-intersections (never a good thing). How to avoid this calamity? Select the Extrude object with the self-intersections and perform Part workbench Union/Fusion on it. This works because the shape string is actually a compound. The fusion operation will resolve all the self-intersections.

There might also be times when you want to get at the individual letters and rearrange them / rotate them, etc. To do this, select the shape string in the tree, and in the part menu -> compounds -> explode compound. Expand the new group object to get at the individual child objects.
When you have them like you want them, with them all selected click the Extrude toolbar icon to extrude them all in one go. Select all the new extrude objects and use Part::Union to fuse them into a single object.
heron
Posts: 307
Joined: Mon Apr 20, 2020 5:32 pm

Re: FreeCAD Hack (Draft ShapeString: negative tracking)

Post by heron »

awesome.PNG
awesome.PNG (25.23 KiB) Viewed 1283 times
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD Hack (Draft ShapeString: negative tracking)

Post by Kunda1 »

Obligatory XKCD

Image
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply