Answers.Body: <p>I found a few ways to convert a 3D model into a Lego sculpture. The first is a program called <a href="http://lgg.epfl.ch/publications/2013/lego/" rel="nofollow noreferrer"><strike>Dolphin</strike> Brickr</a>. It works very well, as you can see in this image of Yoshi:</p>
  
  <p><img src="https://i.sstatic.net/fZ6FD.png" alt="Yoshi Lego Sculpture"></p>
  
  <p><strike>The downside to this program is that it only runs on Macs,</strike> This runs on both Windows and Macs now and the output format is a series of images, one for each layer. So you can't import it into MLCAD or your favorite Lego building software. I was looking for something that uses the <a href="http://en.wikipedia.org/wiki/LDraw" rel="nofollow noreferrer">.ldr format</a>.</p>
  
  <p>Another program is <a href="https://code.google.com/p/lsculpt/" rel="nofollow noreferrer">LSculpt</a>. This worked okay but I couldn't seem to get great results.
  I'll been using a 3D model of <a href="http://www.lolking.net/models/?champion=111&amp;skin=0" rel="nofollow noreferrer">Nautilus</a> for my examples. Here is a picture of the LSculpt results:</p>
  
  <p><img src="https://i.sstatic.net/R9zTo.png" alt="Nautilus Lego Sculpture"></p>
  
  <p>The <strong>black</strong> version was created from <a href="https://code.google.com/p/lsculpt/" rel="nofollow noreferrer"><strong>LSculpt</strong></a> and the <strong>blue</strong> version was creating using my <strong>alternate method</strong>. It is also worth mentioning there is another technique, a <a href="http://www.autodesk.com/education/free-software/3ds-max" rel="nofollow noreferrer">3ds Max</a> script called <a href="http://www.scriptspot.com/3ds-max/scripts/legolizer" rel="nofollow noreferrer">Legolizer</a>. Unfortunately, I don't have 3ds Max so that wasn't an option for me. I wanted to do this using only open source software on Windows. Here is how you do it:</p>
  
  <hr>
  
  <h2>Step 1 - Scale your 3D model</h2>
  
  <p>You need to scale your model down by a factor of <code>.833</code>. I used MeshLab and the process that it described in the <a href="http://lgg.epfl.ch/projects/Lego_data/software/Manual.pdf" rel="nofollow noreferrer">Dolphin manual</a>.</p>
  
  <h2>Step 2 - Convert a 3D model into a binvox file</h2>
  
  <p>This is done using a program called <code>binvox.exe</code>. You can read about it and find the download link on this <a href="http://minecraft.gamepedia.com/Programs_and_editors/Binvox" rel="nofollow noreferrer">minecraft wiki</a>. All you need to do is to download <code>binvox.exe</code> and then copy your 3D model into that folder. Open command prompt, <code>cd</code> into that folder, and run a command that looks something like this:</p>
  
  <pre><code>binvox nautilus.obj -d 128 -rotz -rotz
  </code></pre>
  
  <p><code>nautilus.obj</code> is the name of my 3D model, <code>-d 128</code> specifies the size (128 x 128 x 128 voxels), and <code>-rotz</code> and <code>-rotx</code> will rotate the model. <strong>You will have to experiment to get the right rotation, or your bricks won't face up at the end.</strong> You might want to start with <code>-d 32</code> to speed up the process until you get the orientation right, which you won't find out until the end. The output from this is a file with the name <code>nautilus.binvox</code>.</p>
  
  <h2>Step 3 - Install Cygwin (optional if you know what you're doing)</h2>
  
  <p>I would recommend installing <a href="http://www.cygwin.com/" rel="nofollow noreferrer">cygwin</a> for the following steps, since that is what I used, but you don't necessarily need it. You just need a way to run <code>c++</code> and <code>Perl</code> programs. When you install it you can select packages, make sure you install the package named <code>perl</code> and the package named <code>gcc-g++</code>.</p>
  
  <h2>Step 4 - Convert the binvox file to a readable txt file using <code>read_binvox</code></h2>
  
  <p>Download <a href="http://www.patrickmin.com/binvox/read_binvox.cc" rel="nofollow noreferrer">this</a> program called <a href="http://www.patrickmin.com/binvox/binvox.html" rel="nofollow noreferrer">read_binvox</a>. Make sure it is saved as <code>read_binvox.cc</code>. Then copy your <code>.binvox</code> file into the same folder. Open Cygwin and <code>cd</code> into that folder. Then run</p>
  
  <pre><code>g++ read_binvox.cc -o read_binvox
  </code></pre>
  
  <p>to compile the program. Next, you can run it with</p>
  
  <pre><code>read_binvox nautilus.binvox
  </code></pre>
  
  <p>This will create an output file called <code>voxels.txt</code>.</p>
  
  <h2>Step 5 - Convert <code>voxels.txt</code> into your .ldr file</h2>
  
  <p>I wrote a program in <code>Perl</code> that will convert the <code>voxels.txt</code> into a <code>.ldr</code> file. Create a new file named <code>binvox2ldr.pl</code> in the same directory as your <code>voxels.txt</code> file. File it with the contents from <a href="http://pastebin.com/359iPB5M" rel="nofollow noreferrer">this pastebin</a>.</p>
  
  <p>Then go back to that directory in cygwin and run the command:</p>
  
  <pre><code>perl binvox2ldr.pl voxels.txt &gt; nautilus.ldr
  </code></pre>
  
  <p>This may take a while to run, depending on what size you made the sculpture. The program uses a very basic algorithm for combining bricks together. It may have floating bricks, so I wouldn't recommend just using the parts list from that and expecting a secure, perfect model. But I think it could be a good way to start a design for a sculpture. The script could definitely use some more improvements, but it's a basic start.</p>
  
  <h2>Step 6 - Editing and Render</h2>
  
  <p>You can use <a href="http://www.ldraw.org/article/104.html" rel="nofollow noreferrer">these instructions</a> from <a href="http://www.ldraw.org/" rel="nofollow noreferrer">ldraw.org</a> installing some tools for editing and rendering the sculpture. I used MLCAD to change the color and then rendered it using POV-RAY. Here's what it looks like:</p>
  
  <p><img src="https://i.sstatic.net/4pfGE.png" alt="Nautilus Lego render"></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-05-06T23:57:16.563Z
Answers.Text: I have had much success with LSculpt and it can create models in great detail unlike your sculpture (although, it runs slower when you do that).
Answers.UserDisplayName: rioforce
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-29T08:21:55.960Z
Answers.Text: Do you know where Dolphin resides these days?
Answers.UserDisplayName: tommy.carstensen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-30T02:44:34.643Z
Answers.Text: @tommy.carstensen It appears they changed the name of it. Here's the new link http://lgg.epfl.ch/publications/2013/lego/
Answers.UserDisplayName: hmatt1
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-31T09:27:44.000Z
Answers.Text: I know this answer was written and edited a long time ago, but could you suggest an app, preferably OS X, for creating the 3D model files?
Answers.UserDisplayName: Craig
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-03T01:47:06.767Z
Answers.Text: @Craig I haven't done very much 3d modelling, but I think Blender might be a good one to try: https://www.blender.org/download/
Answers.UserDisplayName: hmatt1
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-04-07T18:35:33.127Z
Answers.LastActivityDate: 2017-06-19T23:41:53.567Z
Answers.LastEditDate: 2017-06-19T23:41:53.567Z
Answers.UserDisplayName: hmatt1
Answers.Body: <p>You can use <a href="https://brickify.it">Brickify</a> for that. You just upload an STL file and it is converted to LEGO bricks. You don't need the 3D printing part and can go ahead to download the building instructions.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-29T14:06:08.393Z
Answers.LastActivityDate: 2016-01-29T14:06:08.393Z
Answers.UserDisplayName: dahoo
Body: <p>After researching this question for a few days, I want to post it here so I can share what I learned in an answer, and hopefully learn some new techniques too.</p>
  
  <p>If anyone has found another way to do this, please share! If anyone has used Legolizer for 3ds Max, an answer explaining that process or that has examples of it being used would be useful too.</p>
  
Tags: <software><tools>
Title: Is there a way to convert a 3D model into a lego sculpture?
UserDisplayName: hmatt1
ThreadText: # Is there a way to convert a 3D model into a lego sculpture?
  
  (Asked by: username_0 on 2014-04-07)
  
  After researching this question for a few days, I want to post it here so I can share what I learned in an answer, and hopefully learn some new techniques too.
  
  If anyone has found another way to do this, please share! If anyone has used Legolizer for 3ds Max, an answer explaining that process or that has examples of it being used would be useful too.
  
  **Tags:** software, tools
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_4 on 2016-01-29. Score: 7 | Accepted answer
  
  You can use [Brickify](https://brickify.it) for that. You just upload an STL file and it is converted to LEGO bricks. You don't need the 3D printing part and can go ahead to download the building instructions.
  
  
  ---
  
  ### Answer by username_0 on 2014-04-07. Score: 14
  
  I found a few ways to convert a 3D model into a Lego sculpture. The first is a program called [Dolphin Brickr](http://lgg.epfl.ch/publications/2013/lego/). It works very well, as you can see in this image of Yoshi:
  
  ![Yoshi Lego Sculpture](https://i.sstatic.net/fZ6FD.png)
  
  The downside to this program is that it only runs on Macs, This runs on both Windows and Macs now and the output format is a series of images, one for each layer. So you can't import it into MLCAD or your favorite Lego building software. I was looking for something that uses the [.ldr format](http://en.wikipedia.org/wiki/LDraw).
  
  Another program is [LSculpt](https://code.google.com/p/lsculpt/). This worked okay but I couldn't seem to get great results.
  I'll been using a 3D model of [Nautilus](http://www.lolking.net/models/?champion=111&skin=0) for my examples. Here is a picture of the LSculpt results:
  
  ![Nautilus Lego Sculpture](https://i.sstatic.net/R9zTo.png)
  
  The **black** version was created from [**LSculpt**](https://code.google.com/p/lsculpt/) and the **blue** version was creating using my **alternate method**. It is also worth mentioning there is another technique, a [3ds Max](http://www.autodesk.com/education/free-software/3ds-max) script called [Legolizer](http://www.scriptspot.com/3ds-max/scripts/legolizer). Unfortunately, I don't have 3ds Max so that wasn't an option for me. I wanted to do this using only open source software on Windows. Here is how you do it:
  
  ---
  
  ## Step 1 - Scale your 3D model
  
  You need to scale your model down by a factor of `.833`. I used MeshLab and the process that it described in the [Dolphin manual](http://lgg.epfl.ch/projects/Lego_data/software/Manual.pdf).
  
  ## Step 2 - Convert a 3D model into a binvox file
  
  This is done using a program called `binvox.exe`. You can read about it and find the download link on this [minecraft wiki](http://minecraft.gamepedia.com/Programs_and_editors/Binvox). All you need to do is to download `binvox.exe` and then copy your 3D model into that folder. Open command prompt, `cd` into that folder, and run a command that looks something like this:
  
  ```
  binvox nautilus.obj -d 128 -rotz -rotz
  
  ```
  
  `nautilus.obj` is the name of my 3D model, `-d 128` specifies the size (128 x 128 x 128 voxels), and `-rotz` and `-rotx` will rotate the model. **You will have to experiment to get the right rotation, or your bricks won't face up at the end.** You might want to start with `-d 32` to speed up the process until you get the orientation right, which you won't find out until the end. The output from this is a file with the name `nautilus.binvox`.
  
  ## Step 3 - Install Cygwin (optional if you know what you're doing)
  
  I would recommend installing [cygwin](http://www.cygwin.com/) for the following steps, since that is what I used, but you don't necessarily need it. You just need a way to run `c++` and `Perl` programs. When you install it you can select packages, make sure you install the package named `perl` and the package named `gcc-g++`.
  
  ## Step 4 - Convert the binvox file to a readable txt file using `read_binvox`
  
  Download [this](http://www.patrickmin.com/binvox/read_binvox.cc) program called [read\_binvox](http://www.patrickmin.com/binvox/binvox.html). Make sure it is saved as `read_binvox.cc`. Then copy your `.binvox` file into the same folder. Open Cygwin and `cd` into that folder. Then run
  
  ```
  g++ read_binvox.cc -o read_binvox
  
  ```
  
  to compile the program. Next, you can run it with
  
  ```
  read_binvox nautilus.binvox
  
  ```
  
  This will create an output file called `voxels.txt`.
  
  ## Step 5 - Convert `voxels.txt` into your .ldr file
  
  I wrote a program in `Perl` that will convert the `voxels.txt` into a `.ldr` file. Create a new file named `binvox2ldr.pl` in the same directory as your `voxels.txt` file. File it with the contents from [this pastebin](http://pastebin.com/359iPB5M).
  
  Then go back to that directory in cygwin and run the command:
  
  ```
  perl binvox2ldr.pl voxels.txt > nautilus.ldr
  
  ```
  
  This may take a while to run, depending on what size you made the sculpture. The program uses a very basic algorithm for combining bricks together. It may have floating bricks, so I wouldn't recommend just using the parts list from that and expecting a secure, perfect model. But I think it could be a good way to start a design for a sculpture. The script could definitely use some more improvements, but it's a basic start.
  
  ## Step 6 - Editing and Render
  
  You can use [these instructions](http://www.ldraw.org/article/104.html) from [ldraw.org](http://www.ldraw.org/) installing some tools for editing and rendering the sculpture. I used MLCAD to change the color and then rendered it using POV-RAY. Here's what it looks like:
  
  ![Nautilus Lego render](https://i.sstatic.net/4pfGE.png)
  
  > **Comments:**
  > **username_1**: I have had much success with LSculpt and it can create models in great detail unlike your sculpture (although, it runs slower when you do that).  
  > **username_2**: Do you know where Dolphin resides these days?  
  > **username_0**: @username_2 It appears they changed the name of it. Here's the new link http://lgg.epfl.ch/publications/2013/lego/  
  > **username_3**: I know this answer was written and edited a long time ago, but could you suggest an app, preferably OS X, for creating the 3D model files?  
  > **username_0**: @username_3 I haven't done very much 3d modelling, but I think Blender might be a good one to try: https://www.blender.org/download/  
  
  ---
  
  