To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.announceOpen lugnet.announce in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Announcements / 930
929  |  931
Subject: 
L3P v1.3 20010120
Newsgroups: 
lugnet.announce, lugnet.cad, lugnet.cad.ray
Followup-To: 
lugnet.cad
Date: 
Sun, 21 Jan 2001 05:41:29 GMT
Highlighted: 
!! (details)
Viewed: 
5258 times
  
As you can read in "The motive to L3P" it was Lutz Uhlmann's LGEO
library (or rather its incompleteness) that inspired me to get started
in the LDRAW business. It resulted in my L3 (Lego+Ldraw+Lars) project,
which has spun off L3P and L3Lab. The whole idea of L3P was to generate
the MISSING parts on the fly. However, as it turned out that L3P could
generate ALL parts with a reasonable result, I decided to release it
before taking the next natural step of using the LGEO parts.

Back in August 1999 Lutz Uhlmann agreed that L3P could reference his
high quality LGEO POV parts. He promised to send some info regarding
the binary format of the element table files. However, I have not heard
from him since then, despite several mails.

But since he did consent that L3P could reference the LGEO parts,
and since many users have requested it, I've decided to update L3P
now anyway. So, with a little hacking I've managed to tweak L3P
to use LGEO parts whenever possible. The missing parts are generated
on the fly like today.

You now get the best of both worlds: high quality POV parts and
L3P's support for automatic camera positioning, primitive substitution,
MPD files, TRANSLATE, ROTATE, SCALE, TRANSFORM meta commands,
extended colors (direct colors), etc.

Besides the LGEO support several nice features have been added, read on:

Support of LGEO parts
---------------------
To use the LGEO parts you must do three things:
1) download the LGEO parts,
2) tell L3P where they are located, and
3) tell PovRay where they are located.

Like LDRAW, LGEO also has a set of primitives. Non-LGEO parts generated
on the fly will use some of the LGEO primitives rather than the L3P
primitives (POV equivalents).
Currently the following are used:
   stud.dat    lg_knob
   stud2.dat   lg_tech_knob
   stud4.dat   lg_plate_cylinder
Additionally the L3P studlogo is dynamically added to lg_knob, so it
appears on LGEO parts too when rendering with -q3 (QUAL=3),
see the -q<n> Quality option.

I found out that we (mis)use stud4.dat by scaling its height by 5 in
bricks! (and other factors in other parts). LGEO uses lg_plate_cylinder
and lg_brick_cylinder and we should use two different studs in LDraw too.

Primitive primitives (grin) like cylinders and discs are OK to be scaled,
but studs should never be scaled - or they cannot be substituted correctly...
The stud4.dat's in 3001.DAT (Brick 2 x 4) look funny now, because the
rounded corner gets scaled by 5...


1) You can download the LGEO parts library here:
http://www.el-lutzo.de/lego/lgeo.html
The latest part seems to be from September 23 1999, but there are 842 parts.
Install (extract) the LGEO files to your harddisk in e.g. c:\L2P.
There will be a subdirectory named LGEO containing the POV .inc files
(include files) and some table files .tab meant for L2P.

2) L3P needs to know where it can find the three files, L2P_ELMT.TAB,
L2P_COLR.TAB and L2P_PTRN.TAB, which contain info on the LGEO elements,
colors and patterns. The three files are typically located in the
directory named LGEO.
You can tell L3P where the LGEO directory is located either by setting
the environment variable LGEODIR or by adding a line to ldraw.ini.
If LGEODIR is not set, L3P looks for ldraw.ini in C:\Windows (or the
directory specified by the environment variable WINDIR). If found,
L3P uses the LgeoDirectory setting in the [LDraw] section.
L3PAO can handle this for you.

3) You must also tell PovRay where to find the LGEO include files:
in POV-Ray for Windows v3.1 select "Edit Settings/Render" in the
"Render" menu. Then type +Lc:\L2P\LGEO in the "Command line options"
box and click the "Set but don't Render" button.

Now you should be all set to take advantage of the high quality
LGEO parts. I've tried to overcome some of the bugs in L2P and
in the LGEO parts. Also transparent LGEO parts are scaled a little
bit to avoid coincident surfaces. The QUAL flag is supported to
substantially speed up test renderings, see the -q<n> Quality option.
The LGEO colors are darker than L3P's colors.
You can add extra light sources if you want.


-cla<x>,<y>,<z>  Camera look_at Coordinates
-------------------------------------------
The camera will look at <x>,<y>,<z> rather than at the center of the
model's bounding box. This option only works if you also specify the
camera's location, either by an absolute position using -cc<x>,<y>,<z>
or by a relative position (relative to the new look_at position)
using -cg<la>,<lo>,<r> where r > 0.
The -cla option doesn't affect light sources.

-pov  Launch PovRay upon successful writing of POV file
-------------------------------------------------------
If you add the -pov option L3P will try to launch PovRay with the POV
file just generated. L3P simply runs "start povfile.pov" which works
on at least Windows 98 and NT, I haven't tested others.
This also works for other extensions than .pov; if you run
"l3p model result.txt -pov" L3P will launch Notepad with result.txt.

-upd  Check L3P's homepage for newer version
--------------------------------------------
If you run "l3p -upd" it will launch your Internet Browser with a
special page, where you can read if you have the latest version.
No automatic update takes place, you'll have to download a newer
version manually, but of course you'll find links to the newest version.

Vast number of new primitives
-----------------------------
Additional POV equivalents for primitive substitution: stud6.dat,
And for any N: ringN.dat, rinN.dat, 1-4ringN.dat, 1-4rinN.dat,
2-4ringN.dat, 2-4rinN.dat, 1-4conN.dat

New search path
---------------
The search path for DAT files has been changed from
  1. Inside the document if it is an MPD
  2. The current directory (from where L3P is started)
  3. %LDRAWDIR%\P
  4. %LDRAWDIR%\PARTS
  5. %LDRAWDIR%\MODELS
  6. The document's directory (the directory of the main model)
to
  1. Inside the document if it is an MPD
  2. The document's directory (the directory of the main model)
  3. %LDRAWDIR%\P
  4. %LDRAWDIR%\PARTS
  5. %LDRAWDIR%\MODELS
where LDRAWDIR is the LDraw directory.
See the thread in lugnet.cad.dev "Searching for parts"
http://news.lugnet.com/cad/dev/?n=5504

-sc  StepClock, add "#if (clock > n)" at steps
----------------------------------------------
The -sc option is for those who want raytraced instruction images.
L3P can support POV-Ray's built-in animation capability by testing
the clock variable at steps in the model: L3P will identify "0 STEP"
lines and insert conditionals like this:

      object { _3001_dot_dat ...
      object { _3297_dot_dat ... // [DAT lines in step 1]
      object { _6015_dot_dat ...
   // 0 STEP
   #if (clock > 1)
      object { _3001_dot_dat ...
      object { _3297_dot_dat ... // [DAT lines in step 2]
      object { _6015_dot_dat ...
   #end
   // 0 STEP
   #if (clock > 2)
      object { _3001_dot_dat ...
      object { _3297_dot_dat ... // [DAT lines in step 3]
      object { _6015_dot_dat ...
   #end
   // 0 STEP
   #if (clock > 3)
      object { _3001_dot_dat ...
      object { _3297_dot_dat ... // [DAT lines in step 4]
      object { _6015_dot_dat ...
   #end
   :
   :
L3P will print out the number of steps in the model, e.g. 8.
You can now generate the instruction images by:

   wine -- L3P.EXE -sc -o car.dat
   povray +I car.pov +O car.png +FN +W400 +H300 -J +KFI1 +KFF8 +KI1 +KF8 +D +A

The output images will be named car1.png, car2.png, ..., car8.png.

The StepClock option was added on suggestion from Fredrik Glöckner,
who supplied the command lines above. He said:
"These are UNIX style command line options. I really have no idea
what this looks like in the Windows world. Check the manual."

New rubber color
----------------
While awaiting the discussion about "0 TEXTURE RUBBER" another rubber
color has been added: color 375 (256+16*7+7) is used for grey rubber.
Color 256 (256+16*0+0) is still used for black rubber.

l3p -check
----------
Model title (first comment in DAT file) and Author now printed when
in check mode.

Color 24
--------
The only instance of a linetype 1 with color 24 was the neck-mark of
the minifig torso. POV has no notion of a "reverse" color when you
reference another object. Or when you inherit a color (linetype 3 and 4).
And neither have other programs that you export DAT files to.
The mark has now been removed and added in the correct color to each
decorated torso.
So, color 24 is now considered illegal for linetypes 1,3 and 4, see the
thread in lugnet.cad.dev "Colour 24 in non type-2 lines (was Updated
S\973S01.DAT)"  http://news.lugnet.com/cad/?n=4950

Conditional POV code generation
-------------------------------
I have taken the liberty to introduce 4 new keywords to the DAT file format:
   0 L3P IFPOV
   0 L3P IFNOTPOV
   0 L3P ELSEPOV
   0 L3P ENDPOV
I had been playing with the idea of embedding POV code in the DAT files
since 1998. It was triggered by the 2473 Brush Car Wash, which
unfortunately uses lines. This is poor design, it should have used
cylinders, which will look correctly if you zoom in.
For rendering the 6649 Street Sweeper I converted the lines to POV
cylinders and put the above conditionals around.

You can have a look at the POV-friendly 2473 Brush Car Wash in the thread
in lugnet.cad.ray "Re: Is there some pov-ray friendly version of car wash
brush part?"  http://news.lugnet.com/cad/ray/?n=656

However, I was reluctant to put it into L3P, because I believed LGEO was
the proper solution to this kind of problem. But after several mails,
Chuck Sommerville made me put into L3P v1.2 - unofficially though.

The POV code embedding can however supplement LGEO and find use in many
cases, so I hereby announce it. I think Chuck Somerville has explained
it rather well in a lugnet.cad.ray posting, so with kind permission from
him I'll quote him on the subject:

From the thread in lugnet.cad.ray "L3P user primitive substitution"
http://news.lugnet.com/cad/ray/?n=596

<quote begin>
Awhile back, I persuaded Lars Hassing to add a feature to L3P.
I wanted the ability to substutite POV language commands in the
comments of a .DAT file that could be used in place of the DAT
primitives when rendering through POV. This would allow users to
add native POV commands that could render better than the triangles
and polygons defined in DAT files. Since the commands are inbedded
in comment fields, and only recognized by L3P, they have no effect
of any other tools. Lars was waiting untill I tested the commands
to announce the feature. The good news, is you probably already
have the ability to use these features. He built them into
Version 1.2 20000616.

The commands are
0 L3P IFPOV
  Conditional section begin
  Begin POV statements in comment statement fields

0 L3P IFNOTPOV
  Conditional section begin
  Begin DAT statements

0 L3P ELSEPOV
  Switch between above section modes

0 L3P ENDPOV
  Terminate conditional section

After running L3P, you can see in the POV file conditionals like if(0)
or if(1)
To see the alternate version for comparison, just change the constant
in these conditionals.

If you don't understand any of this, don't worry, I am following this
post up with some examples. Remember to get L3P V1.2 or latter to use thse.

-Chuck
<quote end>

L3P still produces the normal object references and meshes in an IFNOTPOV
section, but puts a conditional around it.

-enp  exclude non-POV code generation (L3P IFNOTPOV)
----------------------------------------------------
Chuck Sommerville requested another option to suppress the unused .dat
commands when using the L3P IFPOV commands. He likes the idea of his
POV files getting smaller as well as better ;-)
So, the -enp option will leave out the normal object references and
meshes in an IFNOTPOV section, as well as the conditionals.

Bug fix
-------
Only make seams if part is not scaled. If a part was exceptionally
scaled the seams became too large.


Please enjoy and play well:
http://home16.inet.tele.dk/hassing/l3p.html

Thanks to Bram Lambrecht and Fredrik Glöckner for beta testing.
And to Jeff Boen for updating L3PAdd-On (coming shortly :-)
/Lars
PS. Linux version to follow, as well as an L3Lab update.



Message has 4 Replies:
  RE: L3P v1.3 20010120
 
First of all, thanks for the new version! You've really worked hard to make this a wonderful utility! (...) For anyone who plans on making raytraced instructions, may I suggest the following: 1) Uncomment the "orthographic" keyword in the camera {} (...) (23 years ago, 21-Jan-01, to lugnet.cad, lugnet.cad.ray)
  Re: L3P v1.3 20010120
 
Ummm ... that's good news, isn't it? However, my head is spinning already. Could you please re-explain? ;) Primus BuS ComStar LEGO Mechcommander: www.go.to/LegoMC (23 years ago, 21-Jan-01, to lugnet.cad)
  Re: L3P v1.3 20010120
 
First off thanks for the great utility... Is anyone else having trouble using this? Maybe I'm too dumb to figure all the text out... I have downloaded V1.3 and have downloaded the LGEO files needed as well but I'm wondeirng where do I put the LGEo (...) (23 years ago, 22-Jan-01, to lugnet.cad)
  Re: L3P v1.3 20010120
 
Lars, Awesome. I tip my hat to you and Lutz. :-, I don't mean to complain, in fact I am currently trying to figure out a solution anyways, but I thought I'd raise these issues and see if anyone else has figured it out already. Basically, some LGEO (...) (23 years ago, 16-Feb-01, to lugnet.cad, lugnet.cad.dev)

11 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR