Scene¶
- class marxs.visualization.x3d.Scene(children=None, **kwargs)[source]¶
Bases:
SceneX3D Scene with added _repr_html_ for notebook output
This function is ‘Keyword only’ for all args due to the ‘*’.
Attributes Summary
Dimension in pixels for default embedding in HTML.
Dictionary of metadata to add to the X3D header.
Methods Summary
Embed the scene in a full X3D element.
set_X3D_implementation(implementation)write_html_archive(base_name, format, *args, ...)Write to an HTML archive with local copies of js and css requirements.
Attributes Documentation
- dimension_px = (600, 400)¶
Dimension in pixels for default embedding in HTML.
Methods Documentation
- embed_in_X3D() X3D[source]¶
Embed the scene in a full X3D element.
The root element in an X3D file is the
X3Delement, but in marxs, we usually just manipulate the scene itself. This method creates the full X3D element with the appropriate header and embeds this scene into it using some sensible defaults. For example, it adds metadata such as the creation date and MARXS version. For more control, manually create thatx3d.headandx3d.X3Delements.Returns¶
- x3d_element
x3d.X3Dobject X3D element containing this scene.
- x3d_element
- write_html_archive(base_name: str, format: str, *args, **kwargs) None[source]¶
Write to an HTML archive with local copies of js and css requirements.
This zip file can be shared with others and opened in a web browser. In particular, it can be used for journal submission for journals that accept interactive js-based content such as ApJ or AJ.
Parameters¶
- base_namestr
Name of the file to create, including the path, minus any format-specific extension.
- format{“zip”, “tar”, “gztar”, “bztar”, “xztar”}
The archive format, see
shutil.make_archivefor details.- argstuple
Other arguments are passed to
shutil.make_archive.- kwargsdict, optional
Other keyword arguments are passed to
shutil.make_archive