[x3d-public] UNIT statement syntax?

Don Brutzman brutzman at nps.edu
Mon Aug 8 12:53:08 PDT 2016


A number of UNIT statements are included in the following examples:

	http://www.web3d.org/x3d/content/examples/Basic/Units/

For instance

========================================================
http://www.web3d.org/x3d/content/examples/Basic/Units/UnitBacteria.x3d

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "http://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Interchange' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.3.xsd'>
   <head>
     <unit category='length' conversionFactor='0.000001' name='micro'/>
     <meta content='UnitBacteria.x3d' name='title'/>
     [...]
========================================================

According to abstract specification syntax, proper form for VRML/ClassicVRML should be

	UNIT length micro 0.000001

Found that the previous conversion for .x3dv and .wrl from .x3d was incorrect:

unit {
   category length
   conversionFactor 0.000001
   name micro
}

Satisfactorily tested a conversion-stylesheet fix for this, and also correcting some old meta tags in those examples.  Scene corrections uploaded.

========================================================
http://www.web3d.org/x3d/content/examples/Basic/Units/UnitBacteria.x3dv

#X3D V3.3 utf8
# X3D-to-ClassicVRML XSL translation autogenerated by X3dToVrml97.xslt
# http://www.web3d.org/x3d/content/X3dToVrml97.xslt
# Generated using XSLT processor: SAXON 9.1.0.2 from Saxonica

PROFILE Interchange
# [X3D] version=3.3
# [X3D] noNamespaceSchemaLocation=http://www.web3d.org/specifications/x3d-3.3.xsd
# [head]

UNIT length micro 0.000001
META "title" "UnitBacteria.x3d"
     [...]
========================================================

X3D-Edit includes support for authoring UNIT statements.

Again thanks for reporting the problem.


On 8/8/2016 10:29 AM, Alekseyev, Vsevolod (NIH/NIAID) [E] wrote:
> Yes, I would like to ask. For a UNIT statement, what would be the XML, please?
>
> -----Original Message-----
> From: Roy Walmsley [mailto:roy.walmsley at ntlworld.com]
> Sent: Monday, August 08, 2016 1:15 PM
> To: Alekseyev, Vsevolod (NIH/NIAID) [E] <VAlekseyev at niaid.nih.gov>
> Cc: x3d-public at web3d.org
> Subject: RE: [x3d-public] UNIT statement syntax?
>
> Seva,
>
> Your observations mirror those previously reported on this topic. There is an existing Mantis issue for this - Issue 851. During a working group meeting held 14th October 2015 it was agreed that there should be a new clause "Encoding of statements" inserted after clause 6 "Encoding of nodes"
> in ISO/IEC 19776-1 for the next version. This will cover all the points you raised.
>
> If there is anything specific we can help you with in the meantime, please do not hesitate to ask.
>
> Thanks for the comments - keep them coming!!
>
> Regards,
>
> Roy
>
> -----Original Message-----
> From: x3d-public [mailto:x3d-public-bounces at web3d.org] On Behalf Of Alekseyev, Vsevolod (NIH/NIAID) [E]
> Sent: 08 August 2016 16:41
> To: x3d-public at web3d.org
> Subject: [x3d-public] UNIT statement syntax?
>
> 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.

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list