To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 9469
9468  |  9470
Subject: 
L3PPARTS (Was: Re: Change to existing policy on embedding POV-Ray code in Official Files)
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 29 Jan 2004 00:37:47 GMT
Viewed: 
2062 times
  
In lugnet.cad.dev, Don Heyse wrote:
In lugnet.cad.dev, Orion Pobursky wrote:
The LDraw.org Standards Committee (LSC) has recently discussed the
issue of embedded POV-Ray code in Official Parts Library files.
After careful consideration and with inputs from leading non-LSC
members, most notably Lars Hassing and Chris Dee, we have agreed
that the inclusion of this code is undesirable.

Yay!  The right place for POV code is in external libraries.  Does
this mean http://sourceforge.net/projects/ldrawpov/ is going to be
developed?  Is a new L3P release in the works?  It's been over a
year and a half since this tantalizing message was posted.  :^)

  http://news.lugnet.com/cad/ray/?n=1329

Don

Yeah, well, it's been three years since the last L3P release,
so I guess it's about time for another :-)
The current v1.3 release has proven to be quite stable,
so I have just collected and implemented a list of wishes from various users.
Nothing revolutionary, but many small nice features.
However, back in September 2003 I had a discussion with Orion regarding
his project with a library of POV parts. I had had similar thoughts
so I made this suggestion (much like Kevins thoughts):

Whenever L3P is going to generate POV code for a part/subpart/primitive
it first looks in %LDRAWDIR%\L3PPARTS for a file of the same name,
including path (eg. S\), but with an .inc extension.
If such a file exists, L3P simply generates this line:
#include "file.inc"
Otherwise it works as normal.

The .inc file must have a header like:
// 4286 Slope Brick 33  3 x  1
// Author: Lars C. Hassing 20030930
// DAT Author: James Jessiman
// L3PDATA: flag slope
// L3PDATA: uses stud3a.dat
// L3PDATA: uses 4-4cyli.dat
// L3PDATA: uses box5.dat
// L3PDATA: uses stud.dat

Currently there's only one flag: slope. It tells L3P to generate the special slope texture
handling code for that part.
The "uses" keyword tells L3P that the .inc file is not self-contained,
but wishes to reference the specified parts/subparts/primitives,
which L3P must then generate code for.

I like L3PPARTS because the parts will inevitably have some L3P dependencies:
I assume you would like to reference stud_dot_dat (to enable studlogo)
and patterned parts must reference e.g. L3Texture14.
Also a QUAL=0 mock-up should be made (you now have the option to
make a better mock-up than the usual box).

An example follows:
#ifndef (_4286_dot_dat)
#declare _4286_dot_dat = #if (L3Quality = 0)
difference {
box { <-10,0,-50>, <10,24,10> }
plane { <0,40,20>, -sqrt(20) }           // Nice mock-up!
}
#else
union {
// Slope Brick 33  3 x  1
#if (L3Studs)
  object { stud3a_dot_dat matrix <1,0,0,0,-1,0,0,0,1,0,20,-30> }
#end
object { _4_dash_4cyli_dot_dat matrix <4,0,0,0,8,0,0,2,-4,0,14,-30> }
object { box5_dot_dat matrix <6,0,0,0,-20,0,0,0,6,0,24,0> }
mesh {
  triangle { <10,24,10>, <6,24,6>, <-6,24,6> }
  triangle { <-6,24,6>, <-10,24,10>, <10,24,10> }
...snip...
  triangle { <-6,4,-10>, <-6,20,-42>, <6,20,-42> }
}
#if (L3Studs)
  object { stud_dot_dat matrix <1,0,0,0,1,0,0,0,1,0,0,0> }
#end
}
#end


#if (L3Quality > 0)
#declare _4286_dot_dat_slope = object {
mesh {
  triangle { <10,20,-50>, <10,0,-10>, <-10,0,-10> }
  triangle { <-10,0,-10>, <-10,20,-50>, <10,20,-50> }
}
}
#end

#end // ifndef (_4286_dot_dat)

As you can see the file was 98% made by L3P! Only the slope surface was manually
put into its own section.
Making 3297.inc would be even simpler because of the existence of 3297s01.dat.

So, it's relatively easy to make L3PPARTS, just let L3P do most of the work,
and then replace the tricky part (probably already in an IFPOV section)
by dedicated POV code.
You can also segment the original part into subparts with the tricky part in one subpart
and then only make an .inc file for that subpart.
But that discussion I'll leave open...

Note that I have chosen not to make P and PARTS subdirectories in L3PPARTS,
their raison d'être is only to decrease directory size and I don't think there will
many .inc files for primitives - most are already handled by L3P.
However a L3PPARTS\S will exist.

If someone feels uncomfortable with the name L3PPARTS, I'm open for discussion
if the .inc files can be parameterized in some "anonymous" way.
/Lars
PS. Regarding release of v1.4 I was hoping to include ldconfig support,
so you have to wait yet some time...



Message has 2 Replies:
  Re: L3PPARTS (Was: Re: Change to existing policy on embedding POV-Ray code in Official Files)
 
I Like it :) It is a great solution to a sticky problem. -Chuck (20 years ago, 29-Jan-04, to lugnet.cad.dev)
  Re: L3PPARTS (Was: Re: Change to existing policy on embedding POV-Ray code in Official Files)
 
(...) [snip] (...) I think it's a good idea! The only thing I think needs looking at is the naming - should it be dedicated to L3P or to the renderer, eg: RENDERPARTS\POVRAY RENDERPARTS\BRYCE etc. That way, people can provide their own program to do (...) (20 years ago, 30-Jan-04, to lugnet.cad.dev)

Message is in Reply To:
  Re: Change to existing policy on embedding POV-Ray code in Official Files
 
(...) Yay! The right place for POV code is in external libraries. Does this mean (URL) is going to be developed? Is a new L3P release in the works? It's been over a year and a half since this tantalizing message was posted. :^) (URL) Don (20 years ago, 19-Jan-04, to lugnet.cad.dev)

27 Messages in This Thread:












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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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