<div dir="ltr"><div><div>STL and PLY files are commonly used ways to define mesh geometry, often for rendering or for additive manufacturing. These formats are described at</div><div><ul><li>Wikipedia: <a href="https://en.wikipedia.org/wiki/STL_(file_format)" title="STL (file format)" style="font-family:sans-serif;font-size:12.7px;background:none;text-decoration-line:none;color:rgb(0,43,184)">STL (file format)</a><span style="color:rgb(0,0,0);font-family:sans-serif;font-size:12.7px">, a file format for 3D CAD models</span></li><li><span style="color:rgb(0,0,0);font-family:sans-serif;font-size:12.7px"><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small">Wikipedia: </span></span><a href="https://en.wikipedia.org/wiki/PLY_(file_format)" title="PLY (file format)" style="font-family:sans-serif;font-size:12.7px;background:none;text-decoration-line:none;color:rgb(0,43,184)">PLY (file format)</a><span style="color:rgb(0,0,0);font-family:sans-serif;font-size:12.7px"> or Polygon File Format</span></li></ul></div><div>Typically if an X3D author wants to use such assets to load a mesh, they must be converted into an X3D graph. That is because the existing X3D Inline node results in an X3DChildNode rather than geometry. Pseudo-X3D example:</div><div><br></div><div><span style="background-color:rgb(255,242,204)">X3D</span></div><div><span style="background-color:rgb(255,242,204)"> Scene</span></div><div><span style="background-color:rgb(255,242,204)"> children [</span></div><div><span style="background-color:rgb(255,242,204)"> WorldInfo title="MyImportedMeshModel"</span></div><div><span style="background-color:rgb(255,242,204)"> Group (</span></div><div><span style="background-color:rgb(255,242,204)"> Shape </span></div><div><span style="background-color:rgb(255,242,204)"> </span><font color="#000000"><span style="background-color:rgb(255,242,204)">geometry</span> <b style="background-color:rgb(217,234,211)">I</b><b style="background-color:rgb(217,234,211)">ndexedFaceSet DEF="ConvertedFromStlOrPly"</b></font></div><div><b><font color="#000000"> <span style="background-color:rgb(217,234,211)">Coordinate etc.</span></font></b></div><div><br></div><div>All of these gyrations require the use of a converter. Incidentally here are two excellent converters:</div><div><ul><li>Castle Online Converter for 3D and 2D Models</li><li><a href="https://castle-engine.io/convert.php">https://castle-engine.io/convert.php</a></li></ul><div>and</div></div><div><ul><li>X_ITE Free Online X3D File Format Converter</li><li><a href="https://create3000.github.io/x_ite/laboratory/x3d-file-converter/">https://create3000.github.io/x_ite/laboratory/x3d-file-converter/</a></li></ul></div><div>Suggestion: why don't we define a new X3D node <b>InlineGeometry</b> that supports direct loading of STL or PLY geometry files, simplifying the current import process. Possible node interface would be something like</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><pre style="color:rgb(0,0,0);font-size:11.05px;margin-left:25px"><b>InlineGeometry</b> : X3DGeometryNode, X3DUrlObject {
SFTime [in,out] autoRefresh 0.0 [0,∞)
SFTime [in,out] autoRefreshTimeLimit 3600.0 [0,∞)\
SFString [in,out] description ""
SFBool [in,out] load TRUE
SFNode [in,out] metadata NULL [X3DMetadataObject]
MFString [in,out] url [] [URI]
}</pre></blockquote><div>Am thinking that implementers of such a node might use any internal representation that they like: IndexedFaceSet, TriangleSet, IndexedStripSet, etc. etc. How the geometry gets rendered doesn't much matter to an end user, they just want the mesh to show up from the STL or PLY file.</div><div><br></div><div>Example usage:</div><div><br></div><div> Shape</div> appearance Appearance (USE="FancyPaint")<div> geometry<b> <font color="#38761d" style="background-color:rgb(217,234,211)">InlineGeometry (url="MyFavoriteMesh.stl")</font></b> # direct loading eliminates need for conversion</div><div><br></div><div>One conceivable alternative is to create a Coordinate node, but that approach is insufficient since Coordinate only contains points and all connectivity information for the mesh gets lost. So that won't work, we should stick to X3DGeometryNode as the result of the inline geometry import.</div><div><br></div><div>Restriction: apparently a recent develop some people are extending PLY file format to store gaussian splat information... we likely want to exclude such atypical functionality, instead waiting to take advantage of emerging glTF support for gaussian splats.</div><div><br></div><div>Relevant X3D Architecture specification links:</div></div><div><ul><li>X3D Architecture draft 4.1, 11 Rendering component, <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/components/rendering.html#X3DGeometryNode">11.3.5 X3DGeometryNode</a></li><li>X3D Architecture draft 4.1, 9 Networking component, <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/components/networking.html#X3DUrlObject">9.3.2 X3DUrlObject</a></li></ul><div>I've started a Mantis issue to keep track of distilled commentary, to help ensure that we carefully and effectively consider such a powerful capability.</div></div><div><ul><li>Web3D Mantis issue tracker 1522: proposed X3D node: InlineGeometry</li><li><a href="https://mantis.web3d.org/view.php?id=1522">https://mantis.web3d.org/view.php?id=1522</a></li></ul></div><div>All feedback welcome. What do you think?</div><div><br></div><div>Have fun with X3D mesh interoperability! 😃 💠</div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="color:rgb(34,34,34)"><font face="monospace"><br></font></div><div style="color:rgb(34,34,34)"><font face="monospace">all the best, Don</font></div><div style="color:rgb(34,34,34)"><font face="monospace">-- </font></div><div style="color:rgb(34,34,34)"><font face="monospace">X3D Graphics, Maritime Robotics, Distributed Simulation</font></div><div style="color:rgb(34,34,34)"><font face="monospace">Relative Motion Consulting <a href="https://RelativeMotion.info" target="_blank">https://RelativeMotion.info</a></font></div></div></div></div></div>