POV-Ray : Newsgroups : povray.general : about #debug Server Time
6 Apr 2026 15:17:37 EDT (-0400)
  about #debug (Message 16 to 20 of 20)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bald Eagle
Subject: Re: about #debug
Date: 6 Apr 2026 12:00:00
Message: <web.69d3d839f5eb3fcdda82d88b25979125@news.povray.org>
"GioSeregni" <gms### [at] hotmailcom> wrote:
> ok, thanks to all
> my trouble was about the format of vertex only on ####.####

Is there a way to filter out those triangles from the start?
Are they even necessary / visible?

You can probably test just the fractional portion of your double/float by using
modulo.

#if (mod(Number, 1) < threshold) then ignore triangle #else keep it #end

- BE


Post a reply to this message

From: GioSeregni
Subject: Re: about #debug
Date: 6 Apr 2026 12:30:00
Message: <web.69d3de5ef5eb3fcdb9ac97ab59126100@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "GioSeregni" <gms### [at] hotmailcom> wrote:
> > ok, thanks to all
> > my trouble was about the format of vertex only on ####.####
>
> Is there a way to filter out those triangles from the start?
> Are they even necessary / visible?
>
> You can probably test just the fractional portion of your double/float by using
> modulo.
>
> #if (mod(Number, 1) < threshold) then ignore triangle #else keep it #end
>
> - BE

Unfortunately, it's more complicated. If the mod exists beyond a certain decimal
point, the parser must first clean up the vertex by the small part of float,
then check if a twin face exists.
I'll have to create a twin face search loop after writing the mesh with
formatting that trims small decimal points... that is, a loop nested within
another loop... a lot of runtime.
povray forgives a duplicate face, but the other formats I use do not (for an STL
this is a serious mistake)


Post a reply to this message

From: GioSeregni
Subject: Re: about #debug
Date: 6 Apr 2026 13:35:00
Message: <web.69d3eda3f5eb3fcdb9ac97ab59126100@news.povray.org>
Nothing, I think the most efficient solution is to ignore float comparisons,
much less divisions.
But create the pov file as a temporary one, and reprocess it by comparing
vertices with string functions. If a triangle has two equal vertices, it should
be removed.


Post a reply to this message

From: ingo
Subject: Re: about #debug
Date: 6 Apr 2026 14:05:00
Message: <web.69d3f5bff5eb3fcd17bac71e8ffb8ce3@news.povray.org>
"GioSeregni" <gms### [at] hotmailcom> wrote:
> Nothing, I think the most efficient solution is to ignore float comparisons,
> much less divisions.

something like:

##for floats:
## Almost equal.
proc ae(a, b): bool
const Epsilon = 0.000001
return abs(a - b) <= Epsilon


#for tw vac's a & b
proc ae(a,b): bool
return ae(a.x, b.x) and ae(a.y, b.y) and ae(a.z, b.z)


depending on the lang.


ingo


Post a reply to this message

From: GioSeregni
Subject: Re: about #debug
Date: 6 Apr 2026 14:55:00
Message: <web.69d4015df5eb3fcdb9ac97ab59126100@news.povray.org>
"ingo" <nomail@nomail> wrote:
> "GioSeregni" <gms### [at] hotmailcom> wrote:
> > Nothing, I think the most efficient solution is to ignore float comparisons,
> > much less divisions.
>
> something like:
>
> ##for floats:
> ## Almost equal.
> proc ae(a, b): bool
> const Epsilon = 0.000001
> return abs(a - b) <= Epsilon
>
>
> #for tw vac's a & b
> proc ae(a,b): bool
> return ae(a.x, b.x) and ae(a.y, b.y) and ae(a.z, b.z)
>
>
> depending on the lang.
>
>
> ingo

does not works
the triangles can to be
a.x - a.y - a.z
VS
b.y . b.z - b.a

and other cases ....


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.