Showing posts with label CAD. Show all posts
Showing posts with label CAD. Show all posts

Friday, 30 October 2009

Curso LDraw, 1ª entrega

Para los que no tienen experiencia con CAD o no sean muy hábiles con la informática LDraw y los programas de su entorno pueden parecer complicados, pero con unas explicaciones básicas y un poco de práctica se puede aprender a manejarlos bastante rápido.

Para muchos de nosotros es importante documentar nuestras creaciones e ideas. Tradicionalmente hemos tirado mucho de fotos, sobre todo desde la aparición de las cámaras digitales. Algunos también han intentado plasmarlos en dibujos. Con la creación de la librería de piezas Ldraw para una versión simplificada de CAD (dibujo asistido por ordenador) esa tarea se ha hecho mucho más sencilla, hasta el punto de que algunos incluso han hecho creaciones sin disponer de las piezas físicas

Para los que no tienen experiencia con CAD o no sean muy hábiles con la informática, LDraw y los programas de su entorno pueden parecer complicados, pero con unas explicaciones básicas y un poco de práctica se puede aprender a manejarlos bastante rápido. En esta primera entrega del curso LDraw daremos los primeros pasos con MLCad, un programa que nos permite usar la librería de piezas LDraw de una forma sencilla.

Primeros pasos con MLCad

Mike's LEGO CAD (MLCad) es un programa de diseño asistido por ordenador que emplea la librería de piezas de LDraw. Por lo tanto, para poder usarlo hace falta tener instalado ambos paquetes. En la web de LDraw hay un enlace con un paquete de instalación que engloba la librería de piezas Ldraw, el programa de diseño MLCad y algunos paquetes más en el que no hace falta más que aceptar todos los pasos para instalar los paquetes necesarios.

La primera vez que abras MLCad te preguntará donde se encuentra la librería de piezas MLCad (en la instalación por defecto se encuentra en C:\Ldraw). La fig. 1 muestra el aspecto que puede presentar MLCad si reorganizamos las barras de iconos a nuestro gusto.


  1. Barras de herramientas.
  2. Catálogo de piezas.
  3. El listado de piezas incorporadas.
  4. El área de construcción.

    Para crear nuestro primer diseño intentaremos copiar la pirámide de PYRAMID.ldr

    Después de mirar bien como está hecho la pirámide (usa el Modo visionado para verlo paso a paso) abre un fichero nuevo (Fichero > Nuevo, CTRL+N o el primer icono de la barra de tareas):


    La base está formada por bricks 2x4 así lo siguiente será localizar esa pieza. En el catálogo de piezas pincha en el '+' al lado de la palabra Brick. Ahora tienes dos maneras de localizar la pieza:
    1) baja por la lista de descripción hasta encontrar Brick 2 x 4
    2) pincha en cualquier descripción y a continuación baja en la ventana de imágenes de piezas hasta identificar la pieza que necesitas.

    Si no estás seguro de haber encontrado la descripción exacta de la pieza puedes usar una combinación de las dos maneras descritas para localizar cualquier pieza.

    Para introducir la pieza en el modelo también puedes usar varios métodos:
    1) Pincha en la descripción de la pieza y arrástrala al área de construcción
    2) Pincha en el dibujo de la pieza y arrástrala al área de construcción.
    3) Pincha en 'Editar > Añadir > Pieza...' o (más sencillo) en el primer icono de la barra de edición:

    En la ventana que se abre puedes seleccionar la pieza por su número.

    Suelta la pieza en cualquiera de las cuatro ventanas del área de construcción. Verás la pieza en cada ventana según el ángulo de vista seleccionado para cada una de ellas. También notarás que la pieza es de color negro. Para cambiarlo pincha en el azul oscuro de la barra de color. Coloca otro brick 2 x 4 al lado del primero para que queden en línea:



    Notarás que la segunda pieza ya es azul. MLCad recuerda el último color que has seleccionado. También verás que por mucho que te esfuerces es imposible hacer que las dos piezas estén perfectamente alineadas. Para conseguir alinear las piezas tendrás que usar las flechas de la barra de elementos o los atajos de teclado. Recomiendo que te familiarices con estos atajos de teclado porque de ese modo podrás trabajar mucho mas rápido:

    -x = flecha izquierda
    +x = flecha derecha
    -y = flecha arriba
    +y = flecha abajo
    -z = Inicio.
    +z = Fin

    Mientras la pieza esté seleccionada podrás moverla, pero también estará enmarcada por un borde. Esto a veces hace difícil ver si una pieza está correctamente alineada y por tanto tendrás que deseleccionarla (pinchando en cualquier parte vacía de la ventana) para comprobarlo.

    ¿No consigues que la pieza se ponga donde tu la quieres? Probablemente tenga que ver con la cuadrícula que usas. La cuadricula es un sistema de líneas imaginarias con cierta distancia entre líneas. Cuanto más fina la cuadrícula más precisos los movimientos de las piezas, pero también serán más lentas. Puedes cambiar la cuadrícula en la barra de visionado o con las teclas especiales F9, F10 y F11.

    La tercera pieza la tienes que introducir en la ventana con la vista desde arriba (TOP). Notarás que sigue alineada en las otras dos vistas (FRONT y RIGHT). También necesitarás girar la pieza. Para ello hay unos botones en la barra de elementos además de los siguientes atajos de teclado:

    giro -x = CTRL + flecha izquierda
    giro +x = CTRL + flecha derecha
    giro -y = CTRL + flecha arriba
    giro +y = CTRL + flecha abajo
    giro -z = CTRL + Inicio
    giro +z = CTRL + Fin

    Dependiendo de la cuadrícula que uses también cambiará el número de grados que giras la pieza en cada paso. Con la cuadrícula más grande serán 45º así que necesitas girarlo dos veces.

    Existe un cuarta manera de introducir piezas en un diseño: copiar y pegar (CTRL + C, CTRL + V). Si lo haces notarás que se añade una pieza en la lista de piezas pero no la verás en el diseño. Eso es porque se ha pegado exactamente en el mismo lugar que la pieza que se copió. Pero si mueves la pieza (flecha derecha) notarás que de 'dentro' de la pieza anterior sale la nueva.

    También puedes hacer eso con varias piezas a la vez. Para ello selecciona las dos primeras piezas (selecciona la primera, mantén pulsado CRL y selecciona la segunda). Cópialas, pégalas y muévelas hacía delante (flecha abajo, -z). Ya tenemos la base de la pirámide. Selecciona la última pieza en la lista de piezas del modelo. Ahora pincha en 'Editar > Añadir > Paso' o selecciona el tercer icono de la barra de edición. De este modo se inserta un paso, de modo que cuando visionas el modelo en modo visionado todos los elementos actuales formarán un paso y los posteriores otro.




    El siguiente paso consistirá en colocar 4 bricks 2 x 4 rojos encima de la base azul. Mientras que para la colocación de bricks en el mismo plano de altura es más fácil trabajar en la ventana Top, ahora para alinear los bricks rojos habrá que usar la ventana Front o Right. Ahora puedes completar la pirámide. Acuérdate de insertar un paso después de cada nivel.

    Nota
    En este artículo todas las referencias que se hacen a funciones de MLCad corresponden a la traducción para MLCad de Miguel Agullo. Para instalar esta traducción de menús y comandos tienes que ir a la página “MLCad habla español!” y descargarte el fichero para la versión 3.20. Descomprímelo y coloca el archivo en la misma carpeta donde está instalada MLCad (en una instalación estándar se encontrará en C:\LDraw\Apps\MLCad. Abre MLCad y haz clic en Settings > General > Change ... En el menú desplegable Language selecciona ESP y reinicia MLCad. Ahora los todos los menús, ventanas emergentes y tooltips estarán en español.

    Este artículo fue publicado por primera vez en HispaBrick Magzine 001. La revista completa está disponible en www.hispabrickmagazine.com

    LDraw Tutorial - Part 1

    For those without any CAD experience or who are not very handy with a computer, LDraw and the programs associated to it may appear quite complex. However, with some basic explanations and a bit of practice you can learn to use them quite quickly.

    For many of us it is important to be able to document our creations and ideas. Traditionally we have used photos, especially since the appearance of digital cameras. Some have also tried to make drawings of their designs. The creation of the LDraw parts library for a simplified version of CAD (Computer Aided Design) has made this task a lot easier, to the point where some have made MOCs without actually having the physical parts.

    For those who have no experience with CAD or who are not particularly handy with their computer, LDraw and the programs associated to it may appear quite complicated, but with a few basic explanations and some practice you can learn to use them quite quickly. In this first part of my LDraw tutorial you will learn to take your first few steps with MLCad, a program that allows you to use the LDraw library quite easily.

    First steps with MLCad

    Mike’s LEGO CAD (MLCad) is computer aided design software which uses the LDraw parts library. In order to be able to use it you will have to install both. The LDraw website has a link to an installation package that contains both MLCad and the LDraw library as well as a number of other useful applications. Download* the package and do a basic installation which will set up the LDraw parts library, MLCad and LDview. Simply accept every time the installer requires your input and you are ready to go**.

    The first time you open MLCad it will ask you where the LDraw parts library is. If you didn’t change anything in the installer it will be located at C:\LDraw. Once you get the MLCad interface you can change the position of the icon bars to your liking, for example like this:


    1. Tool bars
    2. Parts tree
    3. List of used parts
    4. Construction area

    Before you try to build anything let’s take a look at a construction that comes with the installer. You can find it at C:\LDraw\Models and the file is named PYRAMID.DAT. (In MLCad go to File>Open and browse to the location of the file, select and click ‘open’). Now take a good look at how the Pyramid has been built. You can see the building process step by step (or layer by layer) if you select “View” mode, the first icon on the Model bar:



    Click on the image of the pyramid to advance to the next step.

    Once you are familiar with the way the pyramid is built it is time to try to copy the design. Open a new document (File > New or Ctrl+N). Now go to the parts tree and click on the + to the left of ‘bricks’. The tree will expand and you can scroll down to select a ‘Brick 2 x 4’. Alternatively you can select ‘Brick’ in the drop down menu in the lower part of parts tree (just above the images) and use the scrollbar to visually identify the part you need. Click on either the description or the image of the part and drag it into the construction area. You can drop it in any of the four panes, although it is usually better not to use the 3D pane for this.

    In order to change the colour of the part, click on the colour of your choice in the Color bar. In this case you will need to make it Blue.

    Drag another Brick 2 x 4 into the pane of your choice and drop it next to the first brick. You will notice it is blue (the last colour you used).




    The third brick needs to be placed at an angle of 90 degrees, which means you will have to use the Transformation bar to rotate the part:



    You will find that it is not always easy or reliable to move a part using the mouse. However, using the Transformation bar isn’t always that comfortable either, so you may want to learn a few short-cuts to help you work more easily:

    For moving parts the following short-cuts apply



    For turning you use the same keys in combination with the Control key



    You can only move or turn a part while it is selected, but when a part is selected it is outlined with a thin line that sometimes makes it difficult to see if you aligned it properly. You will have to unselect the part /e.g. by clicking on an empty part of the workspace) to see if the part is correctly placed. If you are still having trouble placing the part correctly you may need to change the grid size. You can do this in the Model bar (there are three greyed out icons in the image of the bar above, representing the three available grid sizes) or using the short-cuts F9, F10 and F11 for those same three grid sizes. When you change grid size you also change the angle steps with which a part rotates. Typically you will rotate a part 90 degrees per step in the large grid and 45 degrees per step in the medium grid.

    When you add the next part you will notice it has again acquired all the characteristics of the part that was selected when you added it: the colour and rotation will be the same. There is another way of adding the same part again which is using copy (Ctrl+C) and paste (Ctrl+V) If you do that you will notice a new entry is added to the parts list, but the part doesn’t show up in the construction area. This is because the part takes up the exact same space as the part you copied it from! But if you move the part using the arrows or the short-cuts you will see it come out of that part. This means that you need to be very careful when building something in MLCad, because it is possible to put parts entirely or partially inside other parts. You can also select several parts (holding down Ctrl while you select them either in the construction area or in the parts list) and copy and paste them at the same time.

    When you have finished the first layer of the pyramid it is time to indicate you have finished the first step. Go to Edit > Add > Step or use the third icon on the object bar:



    This way, when you select view mode, all the parts added between one step and the next are shown at the same time.

    Whereas you will probably have used only the top view up to this point, you will now have to use the Front or Right views to be able to place the next layer of bricks on top of the first one. You should now be able to finish the pyramid. Don’t forget to insert a Step every time you finish a layer.

    *) You will have to type in the contents of the Captcha image which has been added to avoid automated downloads

    **) This installation process is for Windows users. If you use Mac you will have to learn to use Bricksmith instead of MLCad. If you use Linux you are supposed to know what you are doing , MLCad will run fine on a basic Wine installation.