RogerBW's Blog

OpenSCAD as a non-linear editor 01 December 2017

I use OpenSCAD as my primary tool when I'm designing objects for 3D printing. But it's also remarkably useful as a non-linear editor for existing 3D objects.

For those who aren't familiar with the term: a non-linear editing system, usually used for video or audio editing, is one that, rather than modifying the original recording, stores that original and a list of things to do to it, as it might be "reduce noise", "play this bit followed by that bit", etc. The process of editing becomes much faster, and even decisions made early in the process can easily be un-done later.

The same concept applies to 3D modelling. I can take a mesh file and load it into Blender, and muck about with it as much as I like, but while I can undo changes in the reverse of the order in which I did them, if I messed up something early in the process everything I did later is wasted.

But OpenSCAD can import mesh files. So I can import a model (without changing the original), select bits of it and remove or modify them, and export the result as a new mesh.

For example, I was working on a mailbag token for the Colt Express boardgame. (Other people had already uploaded three-dimensional replacements for all the other tokens to Thingiverse, and I wanted to complete the set.)

I didn't fancy trying to make the whole thing, but there was already a set of dungeon loot markers on Thingiverse, and I started by extracting one of those. (In Blender, because that was easiest.)

Then it was OpenSCAD time to reshape the bag (to be more "mailbag" and less "generic sack"), and to bring in the debossed text:

epsilon=0.001;
difference() {
  scale([4,2,4]) import("mailbag.stl");
  translate([0,0,-epsilon]) linear_extrude(height=0.6+epsilon) rotate([180,0,0]) text(text="$1200",size=5,halign="center",valign="center");
}

with the result:

Now, sure, I could have done that in Blender. But then I'd have had to re-do it each time I wanted a new bit of text, or to change the size or the font. This way I can have any text I like.

I did a similar thing with the existing loot markers to make Cursed Loot, which looks identical to normal loot but has a much lower value. That's just a matter of putting in new material to remove the existing debossed text (with the union() operator), then carving away at the composite object (with difference(), just as above) to put in the new text label.

There are drawbacks to this. Models are often set up far away from the coordinate origin, and need to be moved back into it. Some models are too degenerate for OpenSCAD to render, even if the original can be fed to a slicer with no problems. And, as OpenSCAD users will already know, complex models often look odd in preview mode, with missing front faces.

That's solved by not relying on preview mode, but checking that the final render comes out in one piece.

Add A Comment

Your Name
Your Email
Your Comment

Your submission will be ignored if any field is left blank, but your email address will not be displayed. Comments will be processed through markdown.

Search
Archive
Tags 1920s 1930s 1940s 1950s 1960s 1970s 1980s 1990s 2000s 2010s 3d printing action aeronautics aikakirja anecdote animation anime army astronomy audio tech base commerce battletech beer boardgaming bookmonth chain of command children chronicle church of no redeeming virtues cold war comedy computing contemporary cornish smuggler cosmic encounter coup cycling dead of winter doctor who documentary drama driving drone ecchi espionage essen 2015 essen 2016 essen 2017 existential risk falklands war fandom fantasy film firefly first world war flash point food garmin drive gazebo geodata gurps gurps 101 harpoon historical history horror hugo 2014 hugo 2015 hugo 2016 hugo 2017 hugo-nebula reread in brief avoid instrumented life kickstarter learn to play leaving earth linux mecha museum mystery naval non-fiction one for the brow opera perl photography podcast politics powers prediction privacy project woolsack pyracantha quantum rail ranting raspberry pi reading reading boardgames social real life restaurant reviews romance rpg a day rpgs science fiction scythe second world war security shipwreck simutrans south atlantic war squaddies stationery steampunk stuarts suburbia superheroes suspense television the resistance thirsty meeples thriller tin soldier torg toys trailers travel vietnam war war wargaming weather wives and sweethearts writing about writing x-wing young adult
Special All book reviews, All film reviews
Produced by aikakirja v0.1