[x3d-public] UNIT statement syntax?

Alekseyev, Vsevolod (NIH/NIAID) [E] VAlekseyev at niaid.nih.gov
Mon Aug 8 08:41:11 PDT 2016


Neither X3D standard (ISO 19775:2013), nor the X3D XML encoding standard (ISO 19776-1:2015) seem to contain the syntax of the UNIT statement.

In the X3D standard, under Core component, section 7.2.5.5 talks about the UNIT statement. The wording goes

"A change in a base unit is specified by UNIT statements at the top of the file preceding any element content but in the statement order specified in 7.2.5.1 Organization. The form of the UNIT statement is:

UNIT <category> <name> <conversionFactor>"

The specified string is clearly not how it's supposed to go in an XML document. Especially if you consider the following section, 7.2.5.6, which specifies the syntax for META as "META <key> <data>". If you look at the XML encoding standard, there's no explicit syntax for neither of those statements, but there's an example for meta in section 4.2.3: "<meta name='description' content='X3D scene header and prototype syntax examples. '/>" As you can see, neither "key" nor "data" parameter names translate directly into XML attribute names. For all we know, the "category", "name", and "conversionFactor" parameters of UNIT might as well correspond to XML attributes "type", "alias", and "coefficient".

In general, the expected format of the X3D <head> element is practically undocumented. Section 4.3.2 of the XML Encoding standard mentions that an XML file may contain a "single optional head element which can contain component, unit, and metadata information (as described 4.3.1 XML encoding)", but section 4.3.1 doesn't mention neither meta, nor component, nor unit.

In my specific case, UNIT became relevant because I'm working on an X3D implementation for a piece of 3D printing software. In a Web browser context, absolute values of coordinates are practically meaningless, because the display scale factor is transient and can be changed by the user any moment. Meanwhile, in a 3D printing context, retaining the intended object size is extremely relevant.






More information about the x3d-public mailing list