[x3d-public] VRML97 and ClassicVRML model validation from command line using view3dscene

Michalis Kamburelis michalis.kambi at gmail.com
Mon Aug 14 05:39:35 PDT 2023


Don,

In short: I added now --validate option to tovrmlx3d :)

Example usage on a valid model:

```
$ ./tovrmlx3d ../demo-models/x3d/axis.x3d --validate
$ echo $?
0
```

So empty output, and exit status 0, as expected from most tools. You
can use this with Ant, Make or anything else.

Example usage on a model with problems:

```
$ ./tovrmlx3d ../demo-models/x3d/warnings/invalid_statement_omitted_1.x3dv
--validate
tovrmlx3d: Warning: VRML/X3D: Error when reading, will skip the rest
of X3D file: Error at line 15 column 2: Expected node type or DEF or
USE, got "}"
Exception "Exception":
Validation failed (consult the warnings above), exiting with non-zero status

$ echo $?
1
```

So you get output on stderr, and non-zero exit status.

Please give ~1 hour for Jenkins to process it, and this new version of
tovrmlx3d will be part of "snapshot" version on
https://castle-engine.io/view3dscene.php .

I used above test models from https://github.com/castle-engine/demo-models .

Details:

So far, we did validation just by converting and piping output to
/dev/null, so "tovrmlx3d xxxx.x3d > /dev/null". But I agree this was
unoptimal:

- Explicit "--validate" means we don't needlessly waste time
converting to /dev/null if you actually just want to validate. We also
don't produce eventual warnings when writing, that would sometimes
appear and duplicate warnings we already did when reading.

- In the future, maybe, explicit "--validate" may allow to run some
additional tasks dedicated to validation (maybe because they are
time-consuming and not necessary for just usual opening). We don't
have such tasks right now, but it would be nice to have such option
available.

- With explicit "--validate", any warning or error causes non-zero
exit status. Makes sense, since a warning (even if we can continue
working) still means validation failed.

So ... I added "--validate" option to tovrmlx3d.

Of note: A rename is on the horizon, for a few reasons (glTF export,
consistency with other CGE tools). Most likely:
- tovrmlx3d -> caste-scene-process
- view3dscene -> castle-scene-view
I haven't made up my mind 100% yet, if rename happens I will of course
announce it prominently everywhere :)

Regards,
Michalis

niedz., 13 sie 2023 o 17:53 Brutzman, Donald (Don) (CIV)
<brutzman at nps.edu> napisał(a):
>
> Hi Michalis.  Thanks for all of your immense, continuing work.
>
>
>
> I am hoping to add validation of converted .wrl and .x3dv files to the regression test suite for X3D Example Archives.  This will check the quality of output from the X3dToVrml.xslt stylesheets, and improve the quality assurance (QA) of all VRML models offered there – over 4000 in each case. In each case I’ll create and commit a build.log text file so that we can keep track of compliance and progress.
>
>
>
> X3D Resources, Examples: Scene Archives for X3D
> https://www.web3d.org/x3d/content/examples/X3dResources.html#Examples
>
>
>
> To do so, am thinking that command-line invocation (CLI) of your view3dscene or tovrmlx3d executable tools can be accomplished through addition to the existing Ant build.xml scripts.  Am keen to proceed with that task.
>
>
>
> Am looking through the view3dscene CLI documentation, but am not exactly sure how to accomplish this.
>
>
>
> view3dscene, 4. Command-line options
> https://castle-engine.io/view3dscene.php#section_command_line_options
>
>
>
> view3dscene, 4.2. Converting to X3D
> https://castle-engine.io/view3dscene.php#section_converting
>
>
>
> Additional options needed, or not seen:
>
>
>
> Validation report only, plain text via console.  (Perhaps a -validate switch is a variation on your ---write switches.)
> Avoid creation of additional files, if possible.  (I might send each output to a single temp file, but all that file writing will likely slow down the already-long overall process.)
>
>
>
> Please advise if there is a way to invoke one of your tools to accomplish this.  CLI example will be helpful.  Thanks in advance for all guidance.
>
>
>
> Have fun with VRML!   8)
>
>
>
> 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 https://faculty.nps.edu/brutzman
>
>



More information about the x3d-public mailing list