Subject:
|
Re: Detemining Polygon Winding (Was: New Plugin for LDDesignPad)
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Wed, 7 Aug 2002 22:19:09 GMT
|
Viewed:
|
605 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:
Message is in Reply To:
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
|
|
|
|