Large models

posted Jan 13, 2012, 2:37 PM by Jaco van der Molen   [ updated Jan 13, 2012, 2:40 PM ]
When working with large models it is likely that at one point your assembly images will get too big to fit on the page if you keep working at the same scale. You can scale down the assemblies while your model is getting bigger, but then you could lose some detail to see where to put new parts.
One option is not to scale and let LPub cut off the image at the page edge but there is a good chance that part of your model where you are building is cut off too.

Using some baseplates and bricks for scale you can find out what the maximum width, length and height of a model can be to fit on a page if you keep  all default LPub settings. Example:

Light grey baseplate 48 x 48
Blue baseplate 32 x 32
Tan baseplate 16 x 24
Green baseplate 24 x 16
White baseplate 16 x 16
Black/Yellow brick 1 x 1 x 5

The image on the right is generated with LPub using LDView as renderer on a landscape page with default settings. As you can see you can nicely fit a model of 32 x 32 studs and a height of 15 bricks. The page is 11 x 8.5 inch and resolution is set to 150 dpi. Please note that size and scale of generated images can vary on other computers with other screen resolutions. This particular image was create on a Windows PC with widescreen monitor at 1440x900 pixels.

However if you keep building higher you won’t be able to see beyond 15 bricks high.

You can position the assembly image lower on the pages (you can do this in LPub by dragging it). But it will never render more and just cut the fourth black 1 x 1 x 5 brick like shown here. The lower half of the images will be cut of the at the bottom of the page in the PDF.

The solution for this is rather complex and very work intensive. You need a bit more than basic computer skills for it, but we will try to explain.

The basic idea is to increase the actual page size and generate the instructions so LPub will be able make bigger images so it can fit more elements. You make a copy of these image files. Next you reset the page to the size that you want. Then rename and copy the assembly image files in to the right folder and fool LPub into thinking that the images you need are already generated so LPub won’t generate them again. You can then position the bigger images as you see fit.

Follow these steps:
  1. Make sure you have both LDView and LDGLite installed.
  2. Start LPub and set your preferred renderer to LDView using the menu Configuration > Preferences. LPub will crash with very large models and many parts using LDGLite as renderer. Using LDView can also give an error, but it will generate the images anyway.
  3. Open your model file.
  4. Increase the page size. You can best multiply both the original width and height by 2 or more so that your entire model fits on the page. For example if you want the final page size to be 11 x 8.5 inch set it now to 22 x 17 inch.
  5. Generate all assembly images by saving the PDF. Depending on the size of your model and how many steps it has this can take a while.
  6. Do not close LPub! Start the Windows File Explorer (by pressing +E) and find the folder where you saved your LDraw model file. For example “C:\LDraw\Models”. Note that there is a folder in the Models folder called “LPub”. In this folder there is a folder called “assem”. Select this folder and copy it. You can do this by pressing Ctrl+C and then Ctrl+V. A new folder will be created named “Copy of assem” containing all assembly image files.
  7. Return to LPub and reset the page size to the final size. LPub will redraw the page.
  8. Use the option “Tools > Clear assembly image” cache to clear the “assem” folder.
  9. Set the preferred renderer to LDGLite. LPub will redraw the page again.
  10. Close LPub. Do NOT save your file!
  11. Return to the File Explorer and open the “assem” folder. There should be one file there. Delete it.
  12. Copy all files in the “Copy of assem” folder to the “assem” folder and take a look at the file names. The format looks something like this: “filename_*_a_xxxx_yyy_DPI_*.png” where:

    filename = name of your LDraw file
    * = lots of 1 and 0 with underscores
    a= stepnumber
    xxxx = pagewidth multiplied by DPI
    yyy = DPI value

  13. Rename those files so that the value corresponding to xxxx is set to the width of the page multiplied by the DPI. For a page width of 11 inch and DPI of 150 this will be 11*150=1650. This can be done by hand or using a file rename tool.
  14. Start LPub and open your model again. The page is drawn with the large assembly image but will not be cut off at the edge of the page.
  15. You can now select the assembly image and by dragging position it so that the part of your model you want to see is visible within the page margins.
When you save the PDF, the images will be cut at the edge of the page.