Getting Started - Linux: Difference between revisions

From LDraw.org Wiki
Jump to navigation Jump to search
(Created page with " '''Before You Start...''' These instructions assume you have some tools installed on your system. Here is a list: <dl> <dt>[http://wget.sunsite.dk/ <co...")
 
No edit summary
Line 1: Line 1:
    '''Before You Start...'''
'''Before You Start...'''


    These instructions assume you have some tools installed on your
These instructions assume you have some tools installed on your
    system. Here is a list:
system. Here is a list:


    <dl>
<dl>
      <dt>[http://wget.sunsite.dk/ <code>wget</code>]</dt>
<dt>[http://wget.sunsite.dk/ <code>wget</code>]</dt>


      <dd>
<dd>
        You can check if you have <code>wget</code> installed with the
You can check if you have <code>wget</code> installed with the
        command:
command:
<pre>
<pre>
wget --version
wget --version
</pre>
</pre>
        If you don't have it, you may download it from <a href="http://wget.sunsite.dk/">http://wget.sunsite.dk/</a>.
If you don't have it, you may download it from <a href="http://wget.sunsite.dk/">http://wget.sunsite.dk/</a>.
      </dd>
</dd>


      <dt><a href="http://www.perl.org/">Perl</a></dt>
<dt><a href="http://www.perl.org/">Perl</a></dt>


      <dd>
<dd>
        You can check if you have Perl installed with the command:
You can check if you have Perl installed with the command:
<pre>
<pre>
perl --version
perl --version
</pre>
</pre>
        If you don't have it, you may download it from <a href="http://www.perl.org/">http://www.perl.org/</a>.
If you don't have it, you may download it from <a href="http://www.perl.org/">http://www.perl.org/</a>.
      </dd>
</dd>


      <dt><a href="http://sources.redhat.com/bzip2/"><code>bzip2</code></a></dt>
<dt><a href="http://sources.redhat.com/bzip2/"><code>bzip2</code></a></dt>


      <dd>
<dd>
        You can check if you have <code>bzip2</code> installed with the
You can check if you have <code>bzip2</code> installed with the
        command:
command:
<pre>
<pre>
bzip2 --version
bzip2 --version
</pre>
</pre>
        If you don't have it, you may download it from <a href="http://sources.redhat.com/bzip2/">http://sources.redhat.com/bzip2/</a>.
If you don't have it, you may download it from <a href="http://sources.redhat.com/bzip2/">http://sources.redhat.com/bzip2/</a>.
      </dd>
</dd>


      <dt><a href="http://gcc.gnu.org/">GNU Compiler Collection</a></dt>
<dt><a href="http://gcc.gnu.org/">GNU Compiler Collection</a></dt>


      <dd>LDraw tools for Linux come in source code form, so you need the GNU
<dd>LDraw tools for Linux come in source code form, so you need the GNU
      Compiler collection (at least <code>gcc</code> and <code>make</code>)
Compiler collection (at least <code>gcc</code> and <code>make</code>)
      to translate the programs to executable form. These tools usually come
to translate the programs to executable form. These tools usually come
      in the &quot;development&quot; section of your Linux distribution.</dd>
in the &quot;development&quot; section of your Linux distribution.</dd>
    </dl>
</dl>


    '''Step 1 (latest update 2006-01-06):'''
'''Step 1 (latest update 2006-01-06):'''


    Download and install the LDraw Parts Library.
Download and install the LDraw Parts Library.
<pre>
<pre>
user$ <strong>cd /tmp</strong>
user$ <strong>cd /tmp</strong>
Line 66: Line 66:
</pre>
</pre>


    '''Step 2 (latest update 2006-01-06):'''
'''Step 2 (latest update 2006-01-06):'''


To view ldraw model use <a href=http://ldview.sf.net target=_top>LDView</a>.
To view ldraw model use <a href=http://ldview.sf.net target=_top>LDView</a>.
You can install RPM or tar.gz version (available on
You can install RPM or tar.gz version (available on
<a href=http://sourceforge.net/project/showfiles.php?group_id=120592&package_id=131411 target=_top>sf.net</a>),
<a href=http://sourceforge.net/project/showfiles.php?group_id=120592&package_id=131411 target=_top>sf.net</a>),
or build from source.
or build from source.
To install LDView3.tgz (root permission is not required):
To install LDView3.tgz (root permission is not required):
<pre>
<pre>
user$ <strong>tar zxvf LDView3.tgz</strong>
user$ <strong>tar zxvf LDView3.tgz</strong>
Line 78: Line 78:
user$ <strong>./LDView</strong>
user$ <strong>./LDView</strong>
</pre>
</pre>
To install from RPM (root privilege is required):
To install from RPM (root privilege is required):
<pre>
<pre>
root# <strong>rpm -i ldview-3.0-1.i386.rpm</strong>
root# <strong>rpm -i ldview-3.0-1.i386.rpm</strong>
</pre>
</pre>
To build from source:
To build from source:
<pre>
<pre>
user$ <strong>su -</strong>
user$ <strong>su -</strong>
Line 93: Line 93:
</pre>
</pre>


    '''Step 3 (latest update 2002-05-23):'''
'''Step 3 (latest update 2002-05-23):'''


    Install LDGLite. LDGLite is a rather
Install LDGLite. LDGLite is a rather
    efficient tool for showing building instructions &quot;on the fly&quot;, when you
efficient tool for showing building instructions &quot;on the fly&quot;, when you
    download them as &quot;<code>.dat</code>&quot;, &quot;<code>.ldr</code>&quot; or
download them as &quot;<code>.dat</code>&quot;, &quot;<code>.ldr</code>&quot; or
    &quot;<code>.mpd</code>&quot; files from the web.
&quot;<code>.mpd</code>&quot; files from the web.
<pre>
<pre>
user$ <strong>cd /tmp</strong>
user$ <strong>cd /tmp</strong>
Line 111: Line 111:
</pre>
</pre>


    There is a small risk that you may run into errors at this point, if
There is a small risk that you may run into errors at this point, if
    your system lacks some libraries. These errors will probably be of the
your system lacks some libraries. These errors will probably be of the
    form <code>.../bin/ld: cannot find -lX11</code>. If you don't know how to
form <code>.../bin/ld: cannot find -lX11</code>. If you don't know how to
    handle this, please contact an experienced Linux system
handle this, please contact an experienced Linux system
    administrator.
administrator.
<pre>
<pre>
user$ <strong>su</strong>
user$ <strong>su</strong>
Line 128: Line 128:
</pre>
</pre>


    Now you should be ready to run LDGLite - as the command ldglite - but
Now you should be ready to run LDGLite - as the command ldglite - but
    since the LDraw library has been placed differently from what LDGLite
since the LDraw library has been placed differently from what LDGLite
    expects, you have to set the environment variable LDRAWDIR to that
expects, you have to set the environment variable LDRAWDIR to that
    directory (/usr/local/share/ldraw). You can do that in your runtime
directory (/usr/local/share/ldraw). You can do that in your runtime
    configuration scripts, just before you run ldglite, or you can create a
configuration scripts, just before you run ldglite, or you can create a
    script that sets LDRAWDIR and then calls ldglite. I have chosen the last
script that sets LDRAWDIR and then calls ldglite. I have chosen the last
    of these three solutions (where I also make sure that there is no limits
of these three solutions (where I also make sure that there is no limits
    on the stack size):
on the stack size):
<pre>
<pre>
user$ <strong>su</strong>
user$ <strong>su</strong>
Line 155: Line 155:
</pre>
</pre>


    '''Step 4 (latest update 2002-05-23):'''
'''Step 4 (latest update 2002-05-23):'''


    Now your browser should be ready to open LEGO building instructions
Now your browser should be ready to open LEGO building instructions
    directly in LDGLite, when you click on links to them on the internet. You
directly in LDGLite, when you click on links to them on the internet. You
    can test it by clicking on <a href="http://jacob.sparre.dk/LEGO/Byggevejledninger/Tux/tux.dat">tux.dat</a>,
can test it by clicking on <a href="http://jacob.sparre.dk/LEGO/Byggevejledninger/Tux/tux.dat">tux.dat</a>,
    which should open a window with building instructions for a penguin (Tux,
which should open a window with building instructions for a penguin (Tux,
    the mascot of Linux). You may have to restart your browser to make it
the mascot of Linux). You may have to restart your browser to make it
    recognise the existence of LDGLite.
recognise the existence of LDGLite.


    '''Step 5:'''
'''Step 5:'''


    There are currently two ways to create LEGO building instructions on
There are currently two ways to create LEGO building instructions on
    your computer. You can either write/edit the raw text LDraw files or you
your computer. You can either write/edit the raw text LDraw files or you
    can use an interactive drawing program, where you can move pieces around
can use an interactive drawing program, where you can move pieces around
    on the screen. If you chose the former method, you should just use your
on the screen. If you chose the former method, you should just use your
    usual text editor and skip this step. If you would like to try the latter
usual text editor and skip this step. If you would like to try the latter
    method, you should install the program LeoCAD.
method, you should install the program LeoCAD.


    '''
'''
<a href="http://www.leocad.org/" target="_top">
<a href="http://www.leocad.org/" target="_top">
<img src="/gallery/album47/leocad.png" width="150" height="128" alt="" border="0" align="right">LeoCAD
<img src="/gallery/album47/leocad.png" width="150" height="128" alt="" border="0" align="right">LeoCAD
</a>'''
</a>'''


    LeoCAD is a great 3D editor for Linux (and Windows) which has offered
LeoCAD is a great 3D editor for Linux (and Windows) which has offered
    several improvements to the straight LDraw .dat format. It supports some
several improvements to the straight LDraw .dat format. It supports some
    basic animation (via keyframing) and can also export to 3DStudioMax,
basic animation (via keyframing) and can also export to 3DStudioMax,
    POV-Ray, and Alias Wavefront.
POV-Ray, and Alias Wavefront.


    To compile: (last update 2006-01-06)
To compile: (last update 2006-01-06)
<pre>
<pre>
user$ <strong>svn co http://svn.gerf.org/svn/leocad/tags/leocad-0-74 leocad</strong>
user$ <strong>svn co http://svn.gerf.org/svn/leocad/tags/leocad-0-74 leocad</strong>
Line 194: Line 194:
</pre>
</pre>


LeoCAD has different part database, what is available at <a href=http://www.leocad.org/files target="_top">http://www.leocad.org/files</a>
LeoCAD has different part database, what is available at <a href=http://www.leocad.org/files target="_top">http://www.leocad.org/files</a>
<pre>
<pre>
root# <strong>cd /tmp</strong>
root# <strong>cd /tmp</strong>
Line 209: Line 209:




    '''Step 6:'''
'''Step 6:'''


    '''Dive In!'''<br>
'''Dive In!'''<br>
    Learning how to use your new editor or understanding the LDraw file
Learning how to use your new editor or understanding the LDraw file
    format may be a challenge, but with a little practice you will get the
format may be a challenge, but with a little practice you will get the
    hang of it. The <a href="http://www.leocad.org/manual/index.htm">LeoCAD
hang of it. The <a href="http://www.leocad.org/manual/index.htm">LeoCAD
    Manual</a> by Leonardo Zide will help you getting started.
Manual</a> by Leonardo Zide will help you getting started.


    '''Step 7:'''
'''Step 7:'''


    '''<a href="/article/140">Introduction to LDraw
'''<a href="/article/140">Introduction to LDraw
    Utilities</a>'''
Utilities</a>'''


    There is a lot you can do with LDraw files beyond just creating LEGO
There is a lot you can do with LDraw files beyond just creating LEGO
    models! Many contributors have developed utilities to make the most of
models! Many contributors have developed utilities to make the most of
    the LDraw file format. Check out a brief introduction to a few utilities,
the LDraw file format. Check out a brief introduction to a few utilities,
    and then move on to download them.
and then move on to download them.


    '''Step 8:'''
'''Step 8:'''


    '''<a href="/modules.php?op=modload&amp;name=Downloads&amp;file=index">Download Software</a>'''
'''<a href="/modules.php?op=modload&amp;name=Downloads&amp;file=index">Download Software</a>'''


    Check out LDraw.org's (incomplete) list of software packages to
Check out LDraw.org's (incomplete) list of software packages to
    download which supplement the standard editors. Download programs like
download which supplement the standard editors. Download programs like
    L3P, POV-Ray, various file format converters and rendering tools.
L3P, POV-Ray, various file format converters and rendering tools.


    '''Help!'''
'''Help!'''


    Need help with any of this? Check out <a href="/article/7">LDraw.org's Help Section</a>,
Need help with any of this? Check out <a href="/article/7">LDraw.org's Help Section</a>, pr check out the <a href="http://news.lugnet.com/cad/" target="_top">Lugnet CAD</a>
or check out the <a href="http://news.lugnet.com/cad/" target="_top">Lugnet CAD</a>
discussion groups and ask a large group of users for help.
    discussion groups and ask a large group of users for help.

Revision as of 20:55, 18 December 2011

Before You Start...

These instructions assume you have some tools installed on your system. Here is a list:

wget
You can check if you have wget installed with the command:
wget --version

If you don't have it, you may download it from <a href="http://wget.sunsite.dk/">http://wget.sunsite.dk/</a>.

<a href="http://www.perl.org/">Perl</a>
You can check if you have Perl installed with the command:
perl --version

If you don't have it, you may download it from <a href="http://www.perl.org/">http://www.perl.org/</a>.

<a href="http://sources.redhat.com/bzip2/">bzip2</a>
You can check if you have bzip2 installed with the command:
bzip2 --version

If you don't have it, you may download it from <a href="http://sources.redhat.com/bzip2/">http://sources.redhat.com/bzip2/</a>.

<a href="http://gcc.gnu.org/">GNU Compiler Collection</a>
LDraw tools for Linux come in source code form, so you need the GNU Compiler collection (at least gcc and make) to translate the programs to executable form. These tools usually come in the "development" section of your Linux distribution.

Step 1 (latest update 2006-01-06):

Download and install the LDraw Parts Library.

user$ <strong>cd /tmp</strong>
user$ <strong>wget <a href="/files/unix-complete.tgz">http://www.ldraw.org/files/unix-complete.tgz</a></strong>
...
user$ <strong>su -</strong>
Password:
root# <strong>cd /usr/local/share/</strong>
root# <strong>tar xzf /tmp/unix-complete.tgz && echo OK</strong>
...
OK
root# <strong>mkdir -p ldraw/bitmap</strong>
root# <strong>chmod a+w ldraw/bitmap</strong>
root# <strong>chown -R root.root ldraw</strong>
root# <strong>exit</strong>
exit
user$

Step 2 (latest update 2006-01-06):

To view ldraw model use <a href=http://ldview.sf.net target=_top>LDView</a>. You can install RPM or tar.gz version (available on <a href=http://sourceforge.net/project/showfiles.php?group_id=120592&package_id=131411 target=_top>sf.net</a>), or build from source. To install LDView3.tgz (root permission is not required):

user$ <strong>tar zxvf LDView3.tgz</strong>
user$ <strong>cd LDView3</strong>
user$ <strong>./LDView</strong>

To install from RPM (root privilege is required):

root# <strong>rpm -i ldview-3.0-1.i386.rpm</strong>

To build from source:

user$ <strong>su -</strong>
root# <strong>cvs -z3 -d:pserver:[email protected]/cvsroot/ldview co LDView</strong>
root# <strong>cd LDView/QT</strong>
root# <strong>./makeall</strong>
root# <strong>make install</strong>
root# <strong>exit</strong>
user$ <strong>LDView</strong>

Step 3 (latest update 2002-05-23):

Install LDGLite. LDGLite is a rather efficient tool for showing building instructions "on the fly", when you download them as ".dat", ".ldr" or ".mpd" files from the web.

user$ <strong>cd /tmp</strong>
user$ <strong>wget <a href="http://ldglite.sourceforge.net/ldglitesrc0_9_5.zip">http://ldglite.sourceforge.net/ldglitesrc0_9_5.zip</a></strong>
...
user$ <strong>unzip -uoa ldglitesrc0_9_5.zip</strong>
...
user$ <strong>cd ldglite</strong>
user$ <strong>make -f makefile.linux && echo OK</strong>
...
OK

There is a small risk that you may run into errors at this point, if your system lacks some libraries. These errors will probably be of the form .../bin/ld: cannot find -lX11. If you don't know how to handle this, please contact an experienced Linux system administrator.

user$ <strong>su</strong>
Password:
root# <strong>chown root.root l3glite l3gledit ldglite readme.txt</strong>
root# <strong>mv l3glite l3gledit ldglite /usr/local/bin</strong>
root# <strong>mv readme.txt /usr/local/share/ldraw/ldglite.readme</strong>
root# <strong>exit</strong>
exit
user$ <strong>cd ..</strong>
user$ <strong>rm -rf ldglite</strong>

Now you should be ready to run LDGLite - as the command ldglite - but since the LDraw library has been placed differently from what LDGLite expects, you have to set the environment variable LDRAWDIR to that directory (/usr/local/share/ldraw). You can do that in your runtime configuration scripts, just before you run ldglite, or you can create a script that sets LDRAWDIR and then calls ldglite. I have chosen the last of these three solutions (where I also make sure that there is no limits on the stack size):

user$ <strong>su</strong>
Password:
root# <strong>cat > /usr/local/bin/ldglite-run << THE-END</strong>
? <strong>#!/bin/tcsh</strong>
? <strong>setenv LDRAWDIR /usr/local/share/ldraw</strong>
? <strong>limit stacksize unlimited</strong>
? <strong>/usr/local/bin/ldglite \$*</strong>
? <strong>THE-END</strong>
root# <strong>chmod a+x /usr/local/bin/ldglite-run</strong>
root# <strong>cat >> /etc/mailcap << THE-END</strong>
? <strong>application/x-ldraw;/usr/local/bin/ldglite-run -mc %s</strong>
? <strong>application/x-multi-part-ldraw;/usr/local/bin/ldglite-run -mc %s</strong>
? <strong>THE-END</strong>
root# <strong>exit</strong>
exit
user$

Step 4 (latest update 2002-05-23):

Now your browser should be ready to open LEGO building instructions directly in LDGLite, when you click on links to them on the internet. You can test it by clicking on <a href="http://jacob.sparre.dk/LEGO/Byggevejledninger/Tux/tux.dat">tux.dat</a>, which should open a window with building instructions for a penguin (Tux, the mascot of Linux). You may have to restart your browser to make it recognise the existence of LDGLite.

Step 5:

There are currently two ways to create LEGO building instructions on your computer. You can either write/edit the raw text LDraw files or you can use an interactive drawing program, where you can move pieces around on the screen. If you chose the former method, you should just use your usual text editor and skip this step. If you would like to try the latter method, you should install the program LeoCAD.

<a href="http://www.leocad.org/" target="_top"> <img src="/gallery/album47/leocad.png" width="150" height="128" alt="" border="0" align="right">LeoCAD </a>

LeoCAD is a great 3D editor for Linux (and Windows) which has offered several improvements to the straight LDraw .dat format. It supports some basic animation (via keyframing) and can also export to 3DStudioMax, POV-Ray, and Alias Wavefront.

To compile: (last update 2006-01-06)

user$ <strong>svn co http://svn.gerf.org/svn/leocad/tags/leocad-0-74 leocad</strong>
user$ <strong>cd leocad</strong>
user$ <strong>make</strong>
user# <strong>strip bin/leocad</strong>
user$ <strong>su -</strong>
Password:
root# <strong>cp bin/leocad /usr/local/bin/</strong>

LeoCAD has different part database, what is available at <a href=http://www.leocad.org/files target="_top">http://www.leocad.org/files</a>

root# <strong>cd /tmp</strong>
root# <strong>wget <a href=http://www.leocad.org/files/pieces.zip>http://www.leocad.org/files/pieces.zip</a></strong>
root# <strong>wget <a href=http://www.leocad.org/files/update18.zip>http://www.leocad.org/files/update18.zip</a></strong>
root# <strong>mkdir /usr/local/share/leocad</strong>
root# <strong>cd /usr/local/share/leocad</strong>
root# <strong>unzip /tmp/pieces.zip</strong>
root# <strong>unzip /tmp/update18.zip</strong>
root# <strong></strong>
root# <strong>leocad -l /usr/local/share/leocad</strong>


Step 6:

Dive In!

Learning how to use your new editor or understanding the LDraw file

format may be a challenge, but with a little practice you will get the hang of it. The <a href="http://www.leocad.org/manual/index.htm">LeoCAD Manual</a> by Leonardo Zide will help you getting started.

Step 7:

<a href="/article/140">Introduction to LDraw Utilities</a>

There is a lot you can do with LDraw files beyond just creating LEGO models! Many contributors have developed utilities to make the most of the LDraw file format. Check out a brief introduction to a few utilities, and then move on to download them.

Step 8:

<a href="/modules.php?op=modload&name=Downloads&file=index">Download Software</a>

Check out LDraw.org's (incomplete) list of software packages to download which supplement the standard editors. Download programs like L3P, POV-Ray, various file format converters and rendering tools.

Help!

Need help with any of this? Check out <a href="/article/7">LDraw.org's Help Section</a>, pr check out the <a href="http://news.lugnet.com/cad/" target="_top">Lugnet CAD</a> discussion groups and ask a large group of users for help.