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 / 3225
Subject: 
Re: Line in the Sand
Newsgroups: 
lugnet.cad.dev
Date: 
Fri, 12 Nov 1999 21:10:45 GMT
Viewed: 
3550 times
  
In lugnet.cad.dev, Jacob Sparre Andersen wrote:

[ Still discussing http://www.geocities.com/partsref/bfcspec.txt ]

0 WINDING CW
0 CERTIFY BFC

... the winding should be CW, right?

Maybe. It depends on the definition of "operational
command-line".

I understand why you sometimes use specialised "programming"
languages for writing specifications.

Did you mean you=Steve or you=anyone?

If the CERTIFY statement 'implied' the winding, then this
example would not be clear (at least to the human reader)
if the winding for this file is CW or CCW.
Does CERTIFY override the earlier WINDING or not?

If "0 WINDING CW" is an operational command-line, it doesn't
matter. Otherwise the result is somewhat unclear. I would
prefer that that sequence wasn't allowed.

I agree, the sequence should be illegal.

My point was, does CERTIFY BFC change the value of the internal local_clipping
variable, or not?  My intention was that it does not.  From a practical
viewpoint, it might as well, but it is not necessary for it to do so.

The default value is not for the WINDING _statement_, but
for the "winding" variable.

Good point.  I will incorporate this into the document.

I don't think so. If you could translate my explanation
above to proper English, then the problem should be solved,
with the effect I understand you intended.

How about some pseudo-code?  Skipping a few beside-the-point details:

Recursive Procedure RenderFile
Parameters:
   ModelFile string // File to render
   AccumClip boolean // global clipping value yes/no
   AccumInvert boolean // current inversion odd/even or normal/inverted

Declare
   LocalClip boolean = TRUE
   Winding trivalue(CCW, CW, UNKNOWN) = CCW
   Certified boolean = FALSE
   InvertNext boolean = FALSE

   OpenFile(ModelFile)
   Do Until EOF(ModelFile)
      Get Next Command
      Case Command.LineType
         CERTIFY
            Certified = (Command.Option = "BFC")
         CLIPPING
            LocalClip = (Command.Option = "ON")
         WINDING_CCW
            If AccumInvert Then
               Winding = CW
            Else
               Winding = CCW
         WINDING_CW
            If AccumInvert Then
               Winding = CCW
            Else
               Winding = CW
         WINDING_UNKNOWN
            Winding = UNKNOWN
         INVERTNEXT
            InvertNext = True
         SUBFILE
            RenderFile Command.Subfile,
                       (AccumClip and LocalClip),
                       (AccumInvert xor InvertNext)
         LINE, CONDITIONAL_LINE
            Deal with primitive command
         TRIANGLE, QUAD
            If AccumClip and LocalClip Then
               If BFC(Command, TransformMatrix, Winding) Then
                  Render Command
               Else
                  Don't render Command
            Else
               Render Command
            End If
      End Case

      If Command.LineType != INVERTNEXT Then
         InvertNext = FALSE
      End If
   Loop
End Procedure

Ick.  Longer than I thought.  Maybe I'll go back to plain English.

Steve


Subject: 
Re: Line in the Sand
Newsgroups: 
lugnet.cad.dev
Date: 
Sat, 13 Nov 1999 13:55:50 GMT
Viewed: 
3454 times
  
[ Still discussing http://www.geocities.com/partsref/bfcspec.txt ]

Steve:

In lugnet.cad.dev, Jacob Sparre Andersen wrote:

I understand why you sometimes use specialised "programming"
languages for writing specifications.

Did you mean you=Steve or you=anyone?

You=anyone (kind of - English is a very imprecise language - "on"
            in French, "man" in Danish, ...)

My point was, does CERTIFY BFC change the value of the
internal local_clipping variable, or not?  My intention
was that it does not.  From a practical viewpoint, it
might as well, but it is not necessary for it to do so.

That depends on how the program is written. You could
imagine that the variable "local_clipping" isn't defined
until it is verified that it is relevant.

I don't think so. If you could translate my explanation
above to proper English, then the problem should be solved,
with the effect I understand you intended.

How about some pseudo-code?  Skipping a few beside-the-point details:

[...]

Good. I think this clarifies a lot.

Ick.  Longer than I thought.  Maybe I'll go back to plain English.

I don't think you can make it shorter as plain English, but
I will not complain if you attempt.

Play well,

Jacob

      ------------------------------------------------
      --  E-mail:        sparre@cats.nbi.dk         --
      --  Web...:  <URL:http://www.ldraw.org/FAQ/>  --
      ------------------------------------------------


Subject: 
Re: Line in the Sand
Newsgroups: 
lugnet.cad.dev
Date: 
Sat, 13 Nov 1999 23:18:21 GMT
Viewed: 
3229 times
  
Steve Bliss wrote ...
How about some pseudo-code

I think your pseudo-code delivers a fine evidence why the CERTIFY
is unnecessary ;-)
/Lars


Subject: 
Re: Line in the Sand
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 15 Nov 1999 01:26:35 GMT
Viewed: 
3378 times
  
Oops!  Forget a few important details in the psuedo-code!

In lugnet.cad.dev, Steve Bliss writes:

  ModelFile string // File to render
  AccumClip boolean // global clipping value yes/no
  AccumInvert boolean // current inversion odd/even or normal/inverted

Declare
  LocalClip boolean = TRUE
  Winding trivalue(CCW, CW, UNKNOWN) = CCW
  Certified boolean = FALSE
  InvertNext boolean = FALSE

        SUBFILE
           RenderFile Command.Subfile,
                      (AccumClip and LocalClip),

The last line above should be:
                       (AccumClip and LocalClip and
                        (Winding != UNKNOWN) and Certified),

                      (AccumInvert xor InvertNext)
        LINE, CONDITIONAL_LINE
           Deal with primitive command
        TRIANGLE, QUAD
           If AccumClip and LocalClip Then

And the line above should be:
            If AccumClip and LocalClip
            And Certified Then

              If BFC(Command, TransformMatrix, Winding) Then
                 Render Command
              Else
                 Don't render Command
           Else
              Render Command
           End If


Subject: 
Re: Line in the Sand
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 15 Nov 1999 10:59:23 GMT
Viewed: 
3480 times
  
Steve Bliss wrote in message ...
Oops!  Forget a few important details in the psuedo-code!

In lugnet.cad.dev, Steve Bliss writes:

  ModelFile string // File to render
  AccumClip boolean // global clipping value yes/no
  AccumInvert boolean // current inversion odd/even or normal/inverted

Declare
  LocalClip boolean = TRUE
  Winding trivalue(CCW, CW, UNKNOWN) = CCW
  Certified boolean = FALSE
  InvertNext boolean = FALSE

        SUBFILE
           RenderFile Command.Subfile,
                      (AccumClip and LocalClip),

The last line above should be:
                      (AccumClip and LocalClip and
                       (Winding != UNKNOWN) and Certified),

No, WINDING is local! It does not affect subfiles, this is the very reason
why we have invented the CLIPPING command.
/Lars


Subject: 
Re: Line in the Sand
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 15 Nov 1999 14:54:38 GMT
Viewed: 
3497 times
  
In lugnet.cad.dev, Lars C. Hassing wrote:

No, WINDING is local! It does not affect subfiles, this is the very reason
why we have invented the CLIPPING command.

Argh.  You are correct, sir.  Serves me right, trying to post quickly.

Here's a correction:

        SUBFILE
           RenderFile Command.Subfile,
                      (AccumClip and LocalClip),

The last line above should be:
                      (AccumClip and LocalClip and Certified),

Steve


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