Special:
|
[DAT] (requires LDraw-compatible viewer)
|
Subject:
|
Re: L3P check: Row zero all Zeros ?
|
Newsgroups:
|
lugnet.cad
|
Date:
|
Fri, 7 Dec 2001 10:55:14 GMT
|
Viewed:
|
419 times
|
| |
| |
Jason S. Mantor wrote...
> I've got a part that I'd like to submit to the parts tracker so I ran
> l3p -check on it. I fixed all the poly's that had bad vertex orders, but
> I'm stumped as to how to fix the "row 0 all zeroes" errors. I did a search
> on lugnet and found a htread where people seem to agree that these aren't
> bad enough to reject a part, but I'd like to get it right it I can. Any
> hints would be appreciated : )
The "row 0 all zeroes" warning relates to the "Singular Matrix" problem.
Because PovRay is a ray tracer, it needs to calculate transformations
backwards and therefore it calculates inverse matrices. If a
matrix is singular it cannot be inverted, and PovRay will stop
parsing and reject the file.
The "Singular Matrix" problem typically arise from
referencing a flat primitive using a zero y-scale.
(It has nothing to do with the primitive itself.)
If you in stead of
1 16 4 0 0 0 1 0 0 0 4 1-4disc.dat
just write
1 16 4 0 0 0 0 0 0 0 4 1-4disc.dat
because the primitive is "flat", the transformation matrix is
4 0 0
0 0 0
0 0 4
This matrix has a zero determinant, i.e. it is a singular matrix,
and therefore it cannot be inverted.
L3P only generates valid POV code (knock on wood :-),
and will simply skip such a line, leaving holes in the rendering.
(You may also think of the problem as "it doesn't make sense
to scale anything by zero in PovRay's 3D world".)
However, renderers like LDraw, LEdit, MLCad and L3Lab will render
without problems, because they don't use inverse matrices.
And I guess this is why the problem has little attention.
But there are lots of singular matrices in our existing parts!
So many that it would be almost impossible to generate a decent
POV file, that could be parsed and rendered.
So, how does L3P manage to generate usable POV files without
singular matrices?
L3P has a list over flat xz-primitives (like 1-4disc.dat) and silently
fixes singular matrices for these primitives.
Typically one of the rows are all zeros, and it doesn't affect the
transformation to set the y value to 1.0 (what the part author
should have done).
Also the second column may be all zeros. Here we may set one of
the y values to 1.0 at a time. Setting all three y values to 1.0
at the same time may give two rows that are linear dependent.
You can see warnings for these fixes if you specify warning level 2
(-w2) either in a check run "l3p -check -w2 part" or in a
production run "l3p -w2 part povfile":
"WARNING \"%s\" Line %d: Row %d all zeros: %s"
"WARNING \"%s\" Line %d: Y column all zeros: %s"
If the referenced file is not a known flat xz-primitive,
then you simply get the "Singular matrix" error.
The list of flat xz-primitives is currently:
axlehol2.dat
axlehol3.dat
rect.dat
ringN.dat
rinN.dat
N-NringN.dat
N-NrinN.dat
N-Ndisc.dat
N-Nndis.dat
N-Nedge.dat
I don't like having this list (and having to keeping it up-to-date),
but without it, it would be impractical to generate a usable POV file,
because there are so many singular matrices in the existing parts base,
and new ones are still coming...
And the problem is unlikely to be fixed, since only PovRay has a problem,
all other renderers (I think) are OK.
However, it is easy to fix your DAT file, e.g.:
1 16 4 0 0 0 0 0 0 0 4 1-4disc.dat
should simply be changed into
1 16 4 0 0 0 1 0 0 0 4 1-4disc.dat
You may think it is unnecessary to specify a y-scale,
since the disc has no height, but OTOH nor does it harm :-)
(and PovRay needs it).
"l3p -check -w2 newpart" will help spot the problems.
/Lars
|
|
Message has 2 Replies: | | Re: L3P check: Row zero all Zeros ?
|
| (...) [see previous message for Lars' hints] (...) Submitting it to cad.dat.parts before the parts tracker may also help spot problems. Not always, but sometimes... Don (23 years ago, 7-Dec-01, to lugnet.cad)
| | | Re: L3P check: Row zero all Zeros ?
|
| Thanks, Now I understand the problem : ) Lars C. Hassing <lch@ccieurope.com> wrote in message news:Gnyzo2.Gqw@lugnet.com... (...) <SNIP> Much useful information deleted for simplicity's sake </SNIP> (23 years ago, 8-Dec-01, to lugnet.cad)
|
Message is in Reply To:
| | L3P check: Row zero all Zeros ?
|
| Hi, I've got a part that I'd like to submit to the parts tracker so I ran l3p -check on it. I fixed all the poly's that had bad vertex orders, but I'm stumped as to how to fix the "row 0 all zeroes" errors. I did a search on lugnet and found a (...) (23 years ago, 7-Dec-01, to lugnet.cad)
|
10 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
|
|
|
|