Subject:
|
Re: Colinear Vertices
|
Newsgroups:
|
lugnet.cad
|
Date:
|
Tue, 9 Dec 2008 23:00:45 GMT
|
Viewed:
|
7059 times
|
| |
| |
In lugnet.cad, Travis Cobbs wrote:
> In lugnet.cad, Timothy Gould wrote:
> > --snip--
> >
> > > Actually, LDView pretends that the three points are a triangle, then calculates
> > > the surface normal for that triangle. If that normal comes out with a 0 length,
> > > it declares the vertices to be co-linear. So its threshold is based on floating
> > > point round-off while calculating the surface normal.
> > >
> > > --Travis
> >
> > I assume that you divide by the vector lengths first (as in normalise them
> > before taking the cross-product) but if you don't then you should.
>
> No, I just take the cross product, and if the length (squared) is 0, I give an
> error. I don't see how normalizing the length of the two vectors that I feed
> into the cross product would improve things much here. Sure, it might mean that
> my detection rate would be slightly different, but given that I'm relying on
> floating point precision in the first place, I don't see how it would make a big
> difference.
>
> --Travis
It depends on what your threshold is but taking the difference (as you do in a
cross product) of two big numbers is less accurate (very much so sometimes) than
taking the difference of two smaller numbers. Even without this issue it
means that your threshold covers both the size and co-linearity of the triangles
so a tiny non-colinear square may be flashed as co-linear while a huge one that
isn't in a practical sense may falsely register as erroneous. Whether or not
this would ever be an issue in an LDraw file is a different matter.
Tim
|
|
Message is in Reply To:
| | Re: Colinear Vertices
|
| (...) No, I just take the cross product, and if the length (squared) is 0, I give an error. I don't see how normalizing the length of the two vectors that I feed into the cross product would improve things much here. Sure, it might mean that my (...) (16 years ago, 9-Dec-08, to lugnet.cad)
|
39 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|