LSynth Service

LSynth is a program by Kevin Clague that synthesizes flexible LDraw parts.

lsynthtest.ldr lsynthtest-output.ldr

I’ve fiddled with the 2.0 source code to produce a variant that adds some minor features (and probably breaks some others). Most notably, I’ve also packaged this version as a Mac OS X Service, a text-processing filter you can use to run LSynth anywhere you can edit text.

Install the service in ~/Library/Services/ and double-click it to register its availability. To run LSynth, select some LDraw text and select “LSynth” from the “Services” submenu of your current application:

The selected text will be replaced with LSynth’s output. You can use Service Scrubber to add a global keyboard shortcut or to weed out any services you don’t use.

Editor Compatibility

The LSynth Service works great with any conventional Mac OS X text fields. However, some popular editors implement their own text fields that interact with services a little differently. Ideally, the service would recognize these cases and cater to them accordingly, but for the time being workarounds are needed.

Towards that end, I’ve added an LSynth.tcl filter to my TextWrangler LDraw Kit (adaptable for BBEdit users, too) that acts as a compatibility wrapper for the LSynth Service. TextMate users may need to use the Text bundle’s “Remove Unprintable Characters from Selection” command to clean up misinterpreted line endings after running the service.

LSynth Service Tool

I call my modified version of the LSynth program lsynthst (for “LSynth Service Tool”) to avoid confusion with the official version. It builds on Mac OS X and Linux, but I haven’t tested it with any other platforms.

The primary difference between lsynthst and LSynth 2.0 is the addition of a “filter” mode. Run with no arguments, lsynthst reads standard input and writes to standard output. Other changes include:

For more detailed information about the changes made, see my comments in the main.c source code file. No additions or functional modifications to the actual part synthesis code have been made. The program is packaged as a system service with ThisService.

Development

I cannot support this version of LSynth, nor can the original author. However, I would be glad to receive your feedback, and the source code is, of course, available for your perusal or repair. Eventually, service integration with the next official version of LSynth would be nice.

Posted on Tuesday, April 10th, 2007. Tags: .

2 Responses to “LSynth Service”

Posted by Jim on Sunday, April 22nd, 2007 at 5:32 PM.

The the example models seen in the screenshots are rendered with Bricksmith, a superb LDraw editor by Allen Smith.

Posted by Jim on Sunday, November 22nd, 2009 at 11:06 AM.

Note that LSynth 3.1 has been released, and I’ve compiled a Mac version.