Is this allowed?

92 views
Skip to first unread message

Reinoud Zandijk

unread,
Sep 26, 2015, 5:20:06 AM9/26/15
to st...@googlegroups.com
Hi folks,

when playing with the new AMF files I found in the last iteration of the AMF
Utils, I came upon the 3_bananas and in the first few vertices my program
started to complain:

<vertices>
<vertex>
<coordinates>
<x>-64.3746</x>
<y>91.23477</y>
<z>2.29504</z>
</coordinates>
<normal>
<nx>0.02045336</nx>
<ny>0.1365764</ny>
<nz>-0.9904184</nz>
</normal>
</vertex>
<vertex>
<coordinates>
<x>-64.3746</x>
<y>91.23477</y>
<z>2.29504</z>
</coordinates>
<normal>
<nx>0.02045336</nx>
<ny>0.1365764</ny>
<nz>-0.9904184</nz>
</normal>
</vertex>

Vertex 0 and vertex 1 are equal! This means all kinds of nasty things can
happen like needles with width 0, T-edges etc. What if only the normals are
not equal? Then what?

Aren't the vertices supposed to be unique? Is this file really up-to-the-spec?
Or is my parser too picky?

With regards,
Reinoud

Markus Hitter

unread,
Sep 26, 2015, 5:44:31 AM9/26/15
to st...@googlegroups.com
Am 26.09.2015 um 11:20 schrieb Reinoud Zandijk:
> Aren't the vertices supposed to be unique? Is this file really up-to-the-spec?

A more general answer: AMF is a file format, not a sanity insurance. One
can do dumb things while still meeting the format specification
perfectly. Duplicate entities are one such example.

That said, duplicate entities might be seen as dumb from one
perspective, others might add them intentional for specific purposes.

> Or is my parser too picky?

Parsers should never be picky.


Markus

--
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. (FH) Markus Hitter
http://www.jump-ing.de/

Reinoud Zandijk

unread,
Sep 26, 2015, 6:12:11 AM9/26/15
to st...@googlegroups.com
Hi Markus,

On Sat, Sep 26, 2015 at 11:44:29AM +0200, Markus Hitter wrote:
> Am 26.09.2015 um 11:20 schrieb Reinoud Zandijk:
> > Aren't the vertices supposed to be unique? Is this file really up-to-the-spec?
>
> A more general answer: AMF is a file format, not a sanity insurance. One
> can do dumb things while still meeting the format specification
> perfectly. Duplicate entities are one such example.

Yeah it is a file format, regretfully not inherently sanitised, if only as
much as is possible.

Hence my persuit earlier for a stricter format in the `early days' of AMF. It
is one of the major PITAs of STLs that I tried to prevent in AMF in whatever
way; things like missing triangles resulting in non closed objects, needles,
ambiguous normals etc.

> That said, duplicate entities might be seen as dumb from one
> perspective, others might add them intentional for specific purposes.
>
> > Or is my parser too picky?
>
> Parsers should never be picky.

Its not really that picky, it only automatically reuses added vertices since
it can also handle STL files. Apparently it needs a translation table from AMF
vertice numbers to internal numbers :-/ Hopefully this will solve the issue.

I presume the files provided are translations from STL or somehow created by
some 3d scanner software that apparently sees no problem in having needles and
triangles with size 0.

With regards,
Reinoud

Reply all
Reply to author
Forward
0 new messages