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
3224  |  3226
Subject: 
Re: Line in the Sand
Newsgroups: 
lugnet.cad.dev
Date: 
Fri, 12 Nov 1999 21:10:45 GMT
Viewed: 
3783 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



Message has 3 Replies:
  Re: Line in the Sand
 
[ Still discussing (URL) ] Steve: (...) You=anyone (kind of - English is a very imprecise language - "on" in French, "man" in Danish, ...) (...) That depends on how the program is written. You could imagine that the variable "local_clipping" isn't (...) (25 years ago, 13-Nov-99, to lugnet.cad.dev)
  Re: Line in the Sand
 
Steve Bliss wrote ... (...) I think your pseudo-code delivers a fine evidence why the CERTIFY is unnecessary ;-) /Lars (25 years ago, 13-Nov-99, to lugnet.cad.dev)
  Re: Line in the Sand
 
Oops! Forget a few important details in the psuedo-code! (...) The last line above should be: (AccumClip and LocalClip and (Winding != UNKNOWN) and Certified), (...) And the line above should be: If AccumClip and LocalClip And Certified Then (...) (25 years ago, 15-Nov-99, to lugnet.cad.dev)

Message is in Reply To:
  Re: Line in the Sand
 
[ Still discussing (URL) ] Steve: (...) [...] (...) "INVERTNEXT" is good. It makes the effect much more clear. (...) It gets much too messy when you mix the states of a parameter and the setting of that parameter. CERTIFY BFC does imply CLIPPING ON, (...) (25 years ago, 11-Nov-99, to lugnet.cad.dev)

85 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