<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Niels Horn&#039;s Blog &#187; Lego</title>
	<atom:link href="http://blog.nielshorn.net/category/lego/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nielshorn.net</link>
	<description>Random thoughts, tips &#38; tricks about Slackware-Linux, Lego and Star Wars</description>
	<lastBuildDate>Thu, 05 Jan 2012 02:40:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Slackware packages for Lego parts updated</title>
		<link>http://blog.nielshorn.net/2011/07/slackware-packages-for-lego-parts-updated/</link>
		<comments>http://blog.nielshorn.net/2011/07/slackware-packages-for-lego-parts-updated/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 16:57:56 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[LDraw]]></category>
		<category><![CDATA[LeoCAD]]></category>
		<category><![CDATA[Slackware]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=1074</guid>
		<description><![CDATA[The official collection of Lego parts from LDraw was updated this week.
This collection of &#8220;virtual&#8221; pieces is used by programs as LDView, ldglite and l3p.
The leocad program uses its own &#8220;pieces&#8221; library, but is usually updated right after the LDraw parts library.
I updated the scripts for both packages and submitted the results to SlackBuilds.org, where [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/04/parts.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/04/parts.png" alt="parts" title="parts" width="94" height="66" class="alignleft size-full wp-image-288" /></a>The official collection of Lego parts from <a href="http://www.ldraw.org/">LDraw</a> was updated this week.</p>
<p>This collection of &#8220;virtual&#8221; pieces is used by programs as LDView, ldglite and l3p.<br />
The <a href="http://www.leocad.org/">leocad</a> program uses its own &#8220;pieces&#8221; library, but is usually updated right after the LDraw parts library.</p>
<p>I updated the scripts for both packages and submitted the results to SlackBuilds.org, where they are waiting for approval.<br />
In the mean time, you can get the script or the pre-built packages from <a href="http://www.nielshorn.net/slackware/slack_pkg.php">my site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2011/07/slackware-packages-for-lego-parts-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slackware packages for LeoCAD</title>
		<link>http://blog.nielshorn.net/2011/06/slackware-packages-for-leocad/</link>
		<comments>http://blog.nielshorn.net/2011/06/slackware-packages-for-leocad/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 02:24:33 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[LeoCAD]]></category>
		<category><![CDATA[Slackware]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=1045</guid>
		<description><![CDATA[Another update that was long over due&#8230; LeoCAD 0.75.2 is out, and the pieces library has grown from 3.934 to 4.351 pieces!
The 0.75.2 release mainly resolves some bugs and crashes, but it needs the newer pieces library to work, so do update both packages!
I already submitted the new SlackBuild scripts and the pre-built packages can [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.nielshorn.net/wp-content/uploads/2011/06/1-LeoCAD-150x150.png" alt="1 - LeoCAD" title="1 - LeoCAD" width="150" height="150" class="alignleft size-thumbnail wp-image-1046" />Another update that was long over due&#8230; <a href="http://www.leocad.org/">LeoCAD</a> 0.75.2 is out, and the pieces library has grown from 3.934 to 4.351 pieces!</p>
<p>The 0.75.2 release mainly resolves some bugs and crashes, but it needs the newer pieces library to work, so do update both packages!</p>
<p>I already submitted the new <a href="http://slackbuilds.org/">SlackBuild</a> scripts and the pre-built packages can be downloaded from <a href="http://www.nielshorn.net/slackware/slack_pkg.php">my site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2011/06/slackware-packages-for-leocad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Slackware packages for Lego data files and program</title>
		<link>http://blog.nielshorn.net/2010/07/new-slackware-packages-for-lego-data-files-and-program/</link>
		<comments>http://blog.nielshorn.net/2010/07/new-slackware-packages-for-lego-data-files-and-program/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 17:09:07 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[LDraw]]></category>
		<category><![CDATA[LeoCAD]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[Star Wars]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=487</guid>
		<description><![CDATA[New pieces libraries
LDraw.org released its second update for 2010 of the pieces library this month. As always, a short time afterwards the updated pieces library for LeoCAD was also released.
New LeoCAD version
A new version of LeoCAD (0.75.1) was also released, fixing the Minifig wizard that was broken in the previous Linux versions. With it, you [...]]]></description>
			<content:encoded><![CDATA[<p><strong>New pieces libraries</strong></p>
<p><a href="http://www.ldraw.org/">LDraw.org</a> released its second update for 2010 of the pieces library this month. As always, a short time afterwards the updated pieces library for <a href="http://www.leocad.org/">LeoCAD</a> was also released.</p>
<p><strong>New LeoCAD version</strong></p>
<p>A new version of LeoCAD (0.75.1) was also released, fixing the Minifig wizard that was broken in the previous Linux versions. With it, you can easily create minifigs using all possible combinations of arms, tools, etc. and insert the result in your model.</p>
<p>Here are some examples of what you can do with it:</p>
<p><em>Darth Vader</em></p>
<div id="attachment_508" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.nielshorn.net/wp-content/uploads/2010/07/Minifig_Wizard_011.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/07/Minifig_Wizard_011-300x191.png" alt="Creating the Darth Vader minifig in the wizard" title="Minifig_Wizard_01" width="300" height="191" class="size-medium wp-image-508" /></a><p class="wp-caption-text">Creating the Darth Vader minifig in the wizard</p></div>
<p>And after using <a href="http://blog.nielshorn.net/2009/12/lego-pov-ray-on-linux/">l3p and povray</a> to create a nice image:</p>
<div id="attachment_509" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.nielshorn.net/wp-content/uploads/2010/07/Darth_Vader.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/07/Darth_Vader-300x225.png" alt="After the l3p + povray combination" title="Darth_Vader" width="300" height="225" class="size-medium wp-image-509" /></a><p class="wp-caption-text">An impressive figure...</p></div>
<p><em>Han Solo</em></p>
<div id="attachment_511" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.nielshorn.net/wp-content/uploads/2010/07/Minifig_Wizard_02.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/07/Minifig_Wizard_02-300x191.png" alt="With a screwdriver, always fixing the Millenium Falcon..." title="Minifig_Wizard_02" width="300" height="191" class="size-medium wp-image-511" /></a><p class="wp-caption-text">With a screwdriver, always fixing the Millenium Falcon...</p></div>
<p>And with some basic ray-tracing:</p>
<div id="attachment_512" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.nielshorn.net/wp-content/uploads/2010/07/Han_Solo.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/07/Han_Solo-300x225.png" alt="Judging from his smile, he fixed it again ;)" title="Han_Solo" width="300" height="225" class="size-medium wp-image-512" /></a><p class="wp-caption-text">Judging from his smile, he fixed it again <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p></div>
<p><strong>Downloading</strong></p>
<p>The SlackBuilds have been submitted and are in the pending queue at <a href="http://slackbuilds.org/">SlackBuilds.org</a>.<br />
Pre-built packages can be found on my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2010/07/new-slackware-packages-for-lego-data-files-and-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New LDraw / LeoCad Library packages for Slackware</title>
		<link>http://blog.nielshorn.net/2010/04/new-ldraw-leocad-library-packages-for-slackware/</link>
		<comments>http://blog.nielshorn.net/2010/04/new-ldraw-leocad-library-packages-for-slackware/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 02:18:58 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[LDraw]]></category>
		<category><![CDATA[LeoCAD]]></category>
		<category><![CDATA[Slackware]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=287</guid>
		<description><![CDATA[Version 2010-01 of the LDraw parts library was released recently, so I created a new easy-to-install Slackware package for it.
As always, shortly after this release, the LeoCad pieces library was also updated, to version 3506.
Both packages can be downloaded from my site.
]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.nielshorn.net/wp-content/uploads/2010/04/parts.png" alt="parts" title="parts" width="94" height="66" class="alignleft size-full wp-image-288" />Version 2010-01 of the <a href="http://www.ldraw.org/">LDraw</a> parts library was released recently, so I created a new easy-to-install Slackware package for it.<br />
As always, shortly after this release, the <a href="http://www.leocad.org/">LeoCad</a> pieces library was also updated, to version 3506.</p>
<p>Both packages can be downloaded from my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2010/04/new-ldraw-leocad-library-packages-for-slackware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New package for ldglite</title>
		<link>http://blog.nielshorn.net/2010/01/new-package-for-ldglite/</link>
		<comments>http://blog.nielshorn.net/2010/01/new-package-for-ldglite/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 20:06:52 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[Lego]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[ldglite]]></category>
		<category><![CDATA[package]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=146</guid>
		<description><![CDATA[Another package has been updated, this time for ldglite version 1.2.4
It&#8217;s a simple version update that corrects some small bugs.
As always, packages can be downloaded from my site while the SlackBuild is in the pending queue.
]]></description>
			<content:encoded><![CDATA[<p>Another package has been updated, this time for <a href="http://ldglite.sourceforge.net/">ldglite</a> version 1.2.4</p>
<p>It&#8217;s a simple version update that corrects some small bugs.<br />
As always, packages can be downloaded from my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a> while the SlackBuild is in the pending queue.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2010/01/new-package-for-ldglite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New package for leocad_pieces</title>
		<link>http://blog.nielshorn.net/2010/01/new-package-for-leocad_pieces/</link>
		<comments>http://blog.nielshorn.net/2010/01/new-package-for-leocad_pieces/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 18:39:24 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[Lego]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[LeoCAD]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[pieces]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=141</guid>
		<description><![CDATA[The parts library for LeoCAD has been updated and now contains 3.299 pieces.
The updated Slackware package (~ 14MB) can be downloaded from my site.
]]></description>
			<content:encoded><![CDATA[<p>The parts library for <a href="http://www.leocad.org/">LeoCAD</a> has been updated and now contains 3.299 pieces.</p>
<p>The updated Slackware package (~ 14MB) can be downloaded from my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2010/01/new-package-for-leocad_pieces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New package for LDraw_data</title>
		<link>http://blog.nielshorn.net/2010/01/new-package-for-ldraw_data/</link>
		<comments>http://blog.nielshorn.net/2010/01/new-package-for-ldraw_data/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 23:45:28 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[LDraw]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[Lego]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=130</guid>
		<description><![CDATA[I built a new package with LDraw_data for Slackware, containing the latest (200903) library from ldraw.org. Check my site for the pre-built while the SlackBuild is in pending.
]]></description>
			<content:encoded><![CDATA[<p>I built a new package with LDraw_data for Slackware, containing the latest (200903) library from ldraw.org. Check my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a> for the pre-built while the SlackBuild is in pending.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2010/01/new-package-for-ldraw_data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&quot;lgeo&quot; Slackware package available</title>
		<link>http://blog.nielshorn.net/2009/12/lgeo-slackware-package-available/</link>
		<comments>http://blog.nielshorn.net/2009/12/lgeo-slackware-package-available/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 14:19:00 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[Lego]]></category>
		<category><![CDATA[POVRay]]></category>
		<category><![CDATA[Slackware]]></category>

		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=68</guid>
		<description><![CDATA[After some requests, I created a Slackware package with the lgeo parts library. It can be downloaded from my site.
If you prefer, you can download the library from the author&#8217;s website and use the SlackBuild to create your own package.
]]></description>
			<content:encoded><![CDATA[<p>After some requests, I created a Slackware package with the lgeo parts library. It can be downloaded from my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>.</p>
<p>If you prefer, you can download the library from the author&#8217;s <a href="http://www.digitalbricks.org/">website</a> and use the <a href="http://slackbuilds.org/repository/13.0/graphics/lgeo/">SlackBuild</a> to create your own package.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2009/12/lgeo-slackware-package-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated LDraw_data package available</title>
		<link>http://blog.nielshorn.net/2009/12/updated-ldraw_data-package-available/</link>
		<comments>http://blog.nielshorn.net/2009/12/updated-ldraw_data-package-available/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 14:40:00 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[Lego]]></category>
		<category><![CDATA[Slackware]]></category>

		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=67</guid>
		<description><![CDATA[I created an updated package with the LDRAW Library of Lego pieces that includes all parts up to September, 16th, 2009.
The &#8220;unix-complete&#8221; file from ldraw.org has not been updated for years, so this package was based on the Windows file &#8220;complete.zip&#8221; but can be used without any problems under Slackware.
As always, the package can be [...]]]></description>
			<content:encoded><![CDATA[<p>I created an updated package with the LDRAW Library of Lego pieces that includes all parts up to September, 16th, 2009.</p>
<p>The &#8220;unix-complete&#8221; file from ldraw.org has not been updated for years, so this package was based on the Windows file &#8220;complete.zip&#8221; but can be used without any problems under Slackware.</p>
<p>As always, the package can be downloaded from my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2009/12/updated-ldraw_data-package-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lego &amp; POV-Ray on Linux</title>
		<link>http://blog.nielshorn.net/2009/12/lego-pov-ray-on-linux/</link>
		<comments>http://blog.nielshorn.net/2009/12/lego-pov-ray-on-linux/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 18:58:00 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[Lego]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[POVRay]]></category>
		<category><![CDATA[Slackware]]></category>

		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=66</guid>
		<description><![CDATA[Some time ago I promised to give some basic instructions on how to create nice images of Lego constructions with POV-Ray on Linux. Now that Christmas is arriving, I finally found some time to convert my own instructions into something that can almost be called a &#8220;tutorial&#8221;  
What will you need:

LeoCAD &#8211; to &#8220;build&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago I promised to give some basic instructions on how to create nice images of Lego constructions with POV-Ray on Linux. Now that Christmas is arriving, I finally found some time to convert my own instructions into something that can almost be called a &#8220;tutorial&#8221; <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>What will you need:</strong></p>
<ol>
<li>LeoCAD &#8211; to &#8220;build&#8221; your constrution</li>
<li>(optional) a viewer program, like LDView or ldglite</li>
<li>l3p &#8211; to convert the .ldr (LDRaw) file to .pov (POV-Ray)</li>
<li>(optional) The &#8220;lgeo&#8221; parts collection</li>
<li>POV-Ray &#8211; the &#8220;Ray-Tracer program&#8221;</li>
</ol>
<p>If you use Slackware, you can find packages for all of these on my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a> and SlackBuilds for all except 3 on <a href="http://www.slackbuilds.org/">www.slackbuilds.org</a>. For many other Linux distributions packages are available in their repositories.</p>
<p><strong>First step &#8211; Build something!</strong></p>
<p>If you do not have any LDraw file yet with a Lego creation, then now is the time to make one.<br />
As an example for this tutorial, I built a little penguin, based on the instructions <a href="http://www.instructables.com/id/Build-a-lego-Penguin-Tux-the-linux-penguin-if-you/">here</a>, with LeoCAD:</p>
<p><a href="http://1.bp.blogspot.com/_q65cj3yCRO4/SzPDeS9OQAI/AAAAAAAAAVg/mh_CW8Tb1ok/s1600-h/1+-+LeoCAD.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5418889701908955138" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 249px;" src="http://1.bp.blogspot.com/_q65cj3yCRO4/SzPDeS9OQAI/AAAAAAAAAVg/mh_CW8Tb1ok/s320/1+-+LeoCAD.png" border="0" alt="" /></a><br />
Save your creation with LeoCAD as a &#8220;.ldr&#8221; file (&#8221;File&#8221; &#8211; &#8220;Save as&#8221; from the menu). The resulting file in my case was:</p>
<pre>0 Model exported from LeoCAD
0 Original name: Penguin.lcd

 1 14 -50.00 -0.00 -60.00 -0.00 0.00 1.00 -0.00 1.00 -0.00 -1.00 -0.00 -0.00 3002.DAT
 1 15 -50.00 -24.00 -60.00 -1.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 -1.00 3004.DAT
 1 15 -50.00 -48.00 -60.00 -1.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 -1.00 3004.DAT
 1 0 -50.00 -24.00 -40.00 -1.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 -1.00 3004.DAT
 1 0 -70.00 -48.00 -40.00 -1.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 -1.00 3004.DAT
 1 0 -30.00 -48.00 -40.00 -1.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 -1.00 3004.DAT
 1 0 -50.00 -72.00 -40.00 -1.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 -1.00 3004.DAT
 1 14 -50.00 -72.00 -70.00 -1.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 -1.00 3003.DAT
 1 0 -50.00 -96.00 -50.00 -1.00 0.00 -0.00 0.00 1.00 -0.00 0.00 -0.00 -1.00 3003.DAT
0</pre>
<p>The file can be downloaded from my <a href="http://www.nielshorn.net/_lib/download.php?cat=ldr">site</a> as well.</p>
<p><strong>Second step &#8211; View your model with ldglite or LDView</strong></p>
<p>This step can be skipped, but it is a nice test to check if the programs can find all the LDRAW parts on your computer. LeoCAD uses its own parts library, so being able to view it there does not necessarily mean that the LDRAW library is accessible.</p>
<p>This is how the penguin looks like in ldglite, a simple but very fast program to visualize your creations:</p>
<p><a href="http://1.bp.blogspot.com/_q65cj3yCRO4/SzPGHDm_D9I/AAAAAAAAAVo/z968ns3R930/s1600-h/2+-+ldglite.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5418892601187045330" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 252px; height: 320px;" src="http://1.bp.blogspot.com/_q65cj3yCRO4/SzPGHDm_D9I/AAAAAAAAAVo/z968ns3R930/s320/2+-+ldglite.png" border="0" alt="" /></a><br />
A second option is to use LDView, a very nice and very complete program to visualize your creations. It creates a more realistic view of the model, with some shading effects:</p>
<p><a href="http://2.bp.blogspot.com/_q65cj3yCRO4/SzPGnu6GxQI/AAAAAAAAAVw/18VQRU8MKCQ/s1600-h/3+-+LDView.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5418893162565780738" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 275px; height: 320px;" src="http://2.bp.blogspot.com/_q65cj3yCRO4/SzPGnu6GxQI/AAAAAAAAAVw/18VQRU8MKCQ/s320/3+-+LDView.png" border="0" alt="" /></a></p>
<p><strong>Third step &#8211; Ray-Tracing</strong></p>
<p>So the images created by LDView are nice. But we want something even better! Enter POV-Ray, a very professional Ray-Tracing program that is completely free.<br />
It &#8220;traces&#8221; light-rays, by tracing paths of &#8220;light particles&#8221; from one or more light sources, bouncing off surfaces and reflecting into the lens of a camera.</p>
<p>So we define the position and colors of the light sources, the position and angle of the camera, the types of surfaces (smooth, reflective, rough, etc.), etc.</p>
<p>Sounds complicated? Well, there is a very nice utility called l3p that tries to do most if it automatically to help us get started. l3p reads an &#8220;ldr&#8221; file, guesses the best position and angle for the camera so that the whole creation will fit in the image, and sets up three light sources around the model. Then it creates a .pov file that can be read by POV-Ray.</p>
<p>l3p needs to know where the LDRAW library is stored on your computer. This can be set by the LDRAWDIR environment variable like:<br />
<code>$ export LDRAWDIR=/usr/share/LDRAW</code></p>
<p>Put this in your start-up script like ~/.bash_profile (if you use bash for a shell).</p>
<p>Enough theory, let&#8217;s create our first .pov file:<br />
<code>$ l3p -o Penguin.ldr</code></p>
<p>This reads the &#8220;Penguin.ldr&#8221; file we created and writes a &#8220;Penguin.pov&#8221; file in the current directory.<br />
I used just one option &#8211; &#8220;-o&#8221; &#8211; which instructs l3p to overwrite Penguin.pov if it already exists, since we&#8217;ll perform various tests before we get the final result.</p>
<p>Now let&#8217;s run POV-Ray to transform the .pov file into an image:<br />
<code>$ povray +OPenguin.png +FN +P Penguin.pov</code></p>
<p>The options here mean:</p>
<ul>
<li>+OPenguin.png &#8211; Output will be Penguin.png</li>
<li>+FN &#8211; Format will be a PNG file</li>
<li>+P &#8211; Pause after creating the image, showing the result on the screen</li>
</ul>
<p>The result should look like this:</p>
<p><a href="http://2.bp.blogspot.com/_q65cj3yCRO4/SzPQBoxqonI/AAAAAAAAAV4/K1egUC_eETs/s1600-h/4a-Penguin.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5418903503201018482" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_q65cj3yCRO4/SzPQBoxqonI/AAAAAAAAAV4/K1egUC_eETs/s320/4a-Penguin.png" border="0" alt="" /></a><br />
For a first test, it&#8217;s just about &#8220;OK&#8221;&#8230; But we can do better than this!</p>
<p>Since in most tests we&#8217;ll run l3p and povray as a sequence, we&#8217;ll put both commands on one line like this:<br />
<code>$ l3p &lt;options&gt; &amp;&amp; povray &lt;options&gt;</code></p>
<p>The &#8220;&amp;&amp;&#8221; means that the next command is only executed if the previous terminated without error.</p>
<p>So let&#8217;s try:<br />
<code>$ l3p -b -o Penguin.ldr &amp;&amp; povray +OPenguin.png +FN +W640 +H480 +P Penguin.pov</code></p>
<p>What did we add:</p>
<ul>
<li>-b &#8211; add a standard blue background to replace the black void</li>
<li>+W640 &#8211; Create the image with a width of 640 pixels instead of the standard 320</li>
<li>+H480 &#8211; and a height of 480 pixels instead of 240</li>
</ul>
<p>The result should look like this:</p>
<p><a href="http://4.bp.blogspot.com/_q65cj3yCRO4/SzPR_gnQKSI/AAAAAAAAAWA/t2aaAUA2Jmk/s1600-h/4b-Penguin.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5418905665673373986" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_q65cj3yCRO4/SzPR_gnQKSI/AAAAAAAAAWA/t2aaAUA2Jmk/s320/4b-Penguin.png" border="0" alt="" /></a><br />
Let&#8217;s improve the image a bit more:<br />
<code>$ l3p -b -q4 -bu -o Penguin.ldr &amp;&amp; povray +OPenguin.png +FN +W640 +H480 +A +P Penguin.pov</code></p>
<p>The new options are:</p>
<ul>
<li>-q4 &#8211; Quality level 4, this includes the &#8220;Lego&#8221; name on the studs</li>
<li>-bu &#8211; Create &#8220;bumps&#8221;, this makes the surfaces more &#8220;uneven&#8221;, or more realistic</li>
<li>+A &#8211; Anti-aliasing, this prevents those &#8220;jagged edges&#8221;</li>
</ul>
<p>This should be the result:</p>
<p><a href="http://2.bp.blogspot.com/_q65cj3yCRO4/SzPUYpZC5hI/AAAAAAAAAWI/UeqkHuDvQnU/s1600-h/4d-Penguin.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5418908296549688850" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_q65cj3yCRO4/SzPUYpZC5hI/AAAAAAAAAWI/UeqkHuDvQnU/s320/4d-Penguin.png" border="0" alt="" /></a></p>
<p><strong>Advanced options</strong></p>
<p>As I wrote in the beginning, l3p automatically guesses the best position and angle for the camera and light sources. But we can change them as we please.<br />
Let&#8217;s try something:<br />
<code>$ l3p -b -q4 -bu -cg40,45 -cpct10 -f -o Penguin.ldr &amp;&amp; povray +OPenguin.png +FN +W640 +H480 +A +P Penguin.pov</code></p>
<p>I included two new options:</p>
<ul>
<li>-cg40,45 &#8211; Put the camera at &#8220;globe&#8221; positions 40° latitude and 45° longitude (the default is 30,45 so we put it a bit &#8220;higher&#8221;)</li>
<li>-cpct10 &#8211; move the camera back 10%, so that the object is not so close to the edges of the image</li>
<li>-f &#8211; put a &#8220;floor&#8221; under the penguin instead of letting it float in the sky, so that we can see the shadows of the light sources</li>
</ul>
<p>Here is the result:</p>
<p><a href="http://1.bp.blogspot.com/_q65cj3yCRO4/SzPWVTuOZ1I/AAAAAAAAAWQ/zwlRNtDbgM4/s1600-h/4e-Penguin.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5418910438216591186" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://1.bp.blogspot.com/_q65cj3yCRO4/SzPWVTuOZ1I/AAAAAAAAAWQ/zwlRNtDbgM4/s320/4e-Penguin.png" border="0" alt="" /></a><br />
You can play around with the position of the light sources using the &#8220;-lg&#8221; option. I&#8217;ll leave this as an exercise! <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>There are many more advanced options to try. Type &#8220;l3p&#8221; without any options to see the complete list! If you have a good tip, feel free to post a comment so that I can learn something new.</p>
<p><strong>Using the lgeo library</strong></p>
<p>The images we created with the standard l3p + povray combination look quite good, but when we enlarge the images, the pieces look a bit unrealistic, with edges that are too sharp, etc.</p>
<p>Enter the &#8220;lgeo&#8221; library of pieces&#8230;</p>
<p>The lgeo pieces are specially designed for use with POV-Ray, with more realistic edges, surfaces, etc. l3p can automatically replace all LDRAW pieces with lgeo pieces if a substitute is available (any many are available, at least for the more &#8220;standard&#8221; pieces).</p>
<p>We just need to include the &#8220;-lgeo&#8221; parameter (and have the lgeo library installed and &#8220;readable&#8221; by povray &#8211; this needs some configuration&#8230;).<br />
This created a nice image of our Penguin at a larger size:<br />
<code>$ l3p -b -q4 -bu -cg40,45 -cpct10 -f -lgeo -o Penguin.ldr &amp;&amp; povray +OPenguin.png +FN +W1280 +H960 +A +P Penguin.pov</code></p>
<p>And this is the result (click on the image to see the full-scale picture):</p>
<p><a href="http://1.bp.blogspot.com/_q65cj3yCRO4/SzPZmDFDEhI/AAAAAAAAAWY/H5uIOhIFde4/s1600-h/4f-Penguin.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5418914024341574162" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://1.bp.blogspot.com/_q65cj3yCRO4/SzPZmDFDEhI/AAAAAAAAAWY/H5uIOhIFde4/s320/4f-Penguin.png" border="0" alt="" /></a><br />
As you can see, the studs and the edges look more realistic in this picture.</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2009/12/lego-pov-ray-on-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

