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 / 10120
10119  |  10121
Subject: 
BFCFixer
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 3 Feb 2005 05:58:11 GMT
Viewed: 
2315 times
  
Don Heyse wrote:
But wait, If you can make a program to fix winding on the fly then make
a tool for ldraw.org so it can be added to the part submission process.
Then we can run it on all the parts so nobody ever has to fix them on
the fly again.  That'll make *all* the renderers faster.

Well, I had some spare time today... so I wrote one.

It goes through a single LDraw part file and reorients all the polygons
in it to have the same winding.  It comprehends the notion of subfiles
and already BFC compliant parts, and puts the following lines:
   0 Processed by BFCFixer
   0 BFC CERTIFY <winding>
immediately after any leading type 0 lines which may already be in the
part file being processed.  <winding> is, of course, replaced by either
CW or CCW, depending on the orientation.

I wrote it in Java, so it'll work anywhere that Java works.   I
developed it inside netbeans, which generated a nice ant buildfile
automagically for me.

It's an admittedly crude hack but it seems to work for every case I've
thrown at it so far  For any part which is effectively self-intersecting
part, however, it could theoretically generate a bogus result, depending
on the order that the polygons are described.  As I'm not an LDraw part
designer, I don't know how serious a problem this could be.

Anyone want it?  I could put it up on my website and post a link to it
tomorrow if people are interested.

>> Mark



Message has 2 Replies:
  Re: BFCFixer
 
(...) I may be being dense here, but I dont understand how this can be done programatically. The point of BFC is to allow renderers to understand if a particular polygon is facing the camera or facing away from it. If all polygons are wound (...) (20 years ago, 3-Feb-05, to lugnet.cad.dev)
  Re: BFCFixer
 
(...) Oh yeah! Let me at it. :) Steve (20 years ago, 3-Feb-05, to lugnet.cad.dev)

Message is in Reply To:
  Re: Rendering implementation details
 
(...) Ok, I drew a better picture (2 planes in space and a floating eye) and I'm starting to see. Maybe you're onto something. It takes 2 surface normals and one point on the edgeline to divide space into 4 quadrants. Then you only need to figure (...) (20 years ago, 29-Jan-05, to lugnet.cad.dev)

22 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