create3000 / x_ite

X_ITE X3D Browser, view and manipulate X3D and VRML scenes in HTML.
https://create3000.github.io/x_ite/
Other
67 stars 15 forks source link

Scientific data visualization #157

Closed spolanski closed 11 months ago

spolanski commented 1 year ago

Hello! First of all I would like to thank you for developing the x_ite framework. It looks great and I can see many applications of it in my own work. I would like to ask for some pointers. I exported the wrl file from Abaqus software, converted it x3d format with meshlab, but I can't find a way to visualise it with x_ite. I tried the DOM integration method, but when it loads the file the scene is empty. I have got a feeling it is something to do with the lights and colors. I have attached a test geometry and I am happy to share it as a test case for Abaqus users (there are plenty of people who would like to know how to visualise simulation results in Chrome or Firefox).
valve.zip

Thank you for any pointers! Slaw

create3000 commented 1 year ago

You can open the developer console of your browser, to look if there are some errors.

You can also use Sunrize https://www.npmjs.com/package/sunrize, a small editor based on X_ITE, to export a HTML page. That's what I have done, I additionally added an Appearance node with alphaMode="OPAQUE", and a Viewpoint node.

valve.x3d.html.zip

I think I figured it out what went wrong when you created the HTML page with DOM Integration, there must always be a closing tag to each tag, because it is HTML not XML.

create3000 commented 1 year ago

Sunrize can also open .wrl files, or you could convert it here https://create3000.github.io/x_ite/laboratory/x3d-file-converter online.

create3000 commented 1 year ago

I also now added an option to Online X3D File Format Converter to export an HTML page.

spolanski commented 1 year ago

This is great! Thank you a lot. Am I right that with the sunrise editor one can load file, edit the look of it and save it as x3d? If it works this way, is it possible to define a command line to convert a particular wrl file with a template that describes how the x3d file should look like?

create3000 commented 1 year ago

There is not option to convert with a template file, but it should be easy with a little effort to do this in Sunrize. What I have done only takes 2 Minutes. Sunrize can load all files supported by X_ITE https://create3000.github.io/x_ite/#supported-file-formats. You can then save it as .x3d, .x3dv, .x3dj or export it as .html.

To use Sunrize you only have to install Node and npm from https://nodejs.org/, then run npx sunrize.

create3000 commented 1 year ago

There is probably a way to automate your workflow:

  1. Use npx x3d-tidy ... to convert your .wrl file to .x3d
  2. Parse the .x3d as XML
  3. Perform your desired changes, i.e. add the nodes you like.
  4. Save the file.

Maybe this is an option for you.

See also https://www.npmjs.com/package/x3d-tidy.