[X3D-Ecosystem] X3D (JSON) to PLY and STL (tessellation)
John Carlson
yottzumm at gmail.com
Sun Jul 27 04:53:38 PDT 2025
Very good example. I tried to load it into Sunrize, failed. Castle Model
Viewer reported 4 errors, fixed those. still wouldn't view in Sunrize.
Tried to convert to JSON with x3d-tidy. I used the wrong output file
extension, it's .x3dj. Tried to use X3DJSAIL's CommandLine to validate,
borked, typical containerField issues (this is hardcoded in the stylesheet,
I can probably fix X3DJSAIL for you, let me know. It's a very typical
error in X3DJSAIL: Note that this has nothing to do with
setContainerFieldOverride() in any other Java except X3DSAIL.
java -cp "../../../X3DJSAIL.4.0.full.jar" org.web3d.x3d.jsail.CommandLine
-validate ../data/mobius.x3d
CommandLine parameter: "-validate" for model validation
parameter: source file mobius.x3d filesize 42115 bytes
Parsing using Document Object Model (DOM) based X3DLoaderDOM...
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:
*** Invalid setContainerFieldOverride() value='controlPoint', legal values
for Coordinate are containerField_ALLOWED_VALUES='"coord" "skinCoord"
"skinBindingCoords"'
at
org.web3d.x3d.jsail.X3DConcreteNode.setContainerFieldOverride(X3DConcreteNode.java:424)
at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:633)
at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:621)
at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:621)
at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:621)
at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:492)
at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:455)
at
org.web3d.x3d.jsail.X3DLoaderDOM.loadModelFromFileX3D(X3DLoaderDOM.java:249)
at
org.web3d.x3d.jsail.X3DLoaderDOM.loadModelFromFileX3D(X3DLoaderDOM.java:233)
at
org.web3d.x3d.jsail.X3DLoaderDOM.loadModelFromFileX3D(X3DLoaderDOM.java:207)
at org.web3d.x3d.jsail.CommandLine.run(CommandLine.java:924)
at org.web3d.x3d.jsail.CommandLine.main(CommandLine.java:244)
So here's the two files. I will work with AI next.
Nice picture from X3DJSONLD (no AI yet).
[image: image.png]
On Sun, Jul 27, 2025 at 5:46 AM vmarchetti--- via X3D-Ecosystem <
x3d-ecosystem at web3d.org> wrote:
> In response to "What I really need are X3D examples with a variety of
> shapes" here's a doughnut constructed out of NurbsPatchSurface nodes, if
> you pay attention to the obvious faces and edges it's a mobius strip folded
> on itelf three times and the edge sewn together.
>
> Vince Marchetti
>
>
>
> On Jul 27, 2025, at 5:24 AM, John Carlson via X3D-Ecosystem <
> x3d-ecosystem at web3d.org> wrote:
>
> I've done some work with PLY and STL converting to and from X3D JSON with
> my simple examples on X3DJSONLD 12. I'd like to expand the geometry which
> I can convert from X3D JSON to STL and PLY. I've found https://ai.dev
> quite useful for tessellation in JavaScript, so I'm going to rely on it
> more. For example, it mostly figured out how to tessellate a Sphere.
>
> What I really need are X3D examples with a variety of shapes. I recently
> saw that Holger's Connectors.x3d did not translate to STL or PLY (probably
> no surprise). I have not tried the Castle Model Converter yet. If anyone
> has a scenegraph that presents an X3D Catalog, that would be useful!
>
> I'm guessing that X_ITE and X3DOM can tessellate to geometry render, so
> it's probably easy enough to extract the code from there and use it to
> output triangles and material to STL and PLY. An alternative is to convert
> Pascal code to JavaScript using Pas2Js and use Michalis' X3DNode to STL
> converter.
>
> If such code appears in my lap, I would be extremely happy.
>
> This is all for the "bake-off" I've been planning.
>
>
> John
> --
> X3D-Ecosystem mailing list
> X3D-Ecosystem at web3d.org
> http://web3d.org/mailman/listinfo/x3d-ecosystem_web3d.org
>
>
> --
> X3D-Ecosystem mailing list
> X3D-Ecosystem at web3d.org
> http://web3d.org/mailman/listinfo/x3d-ecosystem_web3d.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20250727/b85cbb29/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 160855 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20250727/b85cbb29/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mobius.x3d
Type: model/x3d+xml
Size: 42115 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20250727/b85cbb29/attachment-0001.x3d>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mobius.json
Type: application/json
Size: 72892 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20250727/b85cbb29/attachment-0001.json>
More information about the X3D-Ecosystem
mailing list