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 / 7633
7632  |  7634
Subject: 
Re: Detemining Polygon Winding (Was: New Plugin for LDDesignPad)
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 7 Aug 2002 22:19:09 GMT
Viewed: 
494 times
  
The simple algorithm:

Project a normal from any vertex of the polygon to some point far beyond the
object. Count how many polygons this line segment intersects. If odd, the
normal was pointing in, if even, the normal was pointing out.

This assumes that all polygons have one inside face and one outside face. I
don't know if you can take this for granted with LDRAW. You should be able
to imagine some possible exceptions; a cube with one face missing is a
trivial example where this algorithm will fail.


In lugnet.cad.dev, Orion Pobursky writes:

In lugnet.cad.dev, Carsten Schmitz write • s:
Hello Orion,

to program a plugin like that isn't too easy.

Tell me about it.

I wish i could help but I am
an math idiot ;)
Maybe someone else can help in this matter?

I think have the math right for determining polygon winding. The problem is
this, how do can I traverse the polygonal faces of a convex or concave
polyhedron(a part) and know that I'm looking at said polygon from the
outside of the part (as opposed to the inside).  My plugin works great for
convex parts not so great for parts with concave portions.


-Orion



Message has 2 Replies:
  Re: Detemining Polygon Winding (Was: New Plugin for LDDesignPad)
 
Error: read: Count how many *other* polygons this line segment intersects. for Count how many polygons this line segment intersects. Or, if counting your own polygon, switch even and odd. (22 years ago, 7-Aug-02, to lugnet.cad.dev)
  Re: Detemining Polygon Winding (Was: New Plugin for LDDesignPad)
 
(...) Thanks for the info, but it's easier written than applied. It'll take an entire revamp of my code. -Orion (22 years ago, 7-Aug-02, to lugnet.cad.dev)

Message is in Reply To:
  Detemining Polygon Winding (Was: New Plugin for LDDesignPad)
 
(...) Tell me about it. (...) I think have the math right for determining polygon winding. The problem is this, how do can I traverse the polygonal faces of a convex or concave polyhedron(a part) and know that I'm looking at said polygon from the (...) (22 years ago, 7-Aug-02, to lugnet.cad.dev)

18 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