Module:
sdynpy.fileio.sdynpy_pdf3DSource: GitHub
Signature¶
def sdynpy.fileio.sdynpy_pdf3D.create_animated_modeshape_content(geometry, shapes=None, u3d_name='geometry', js_name='mode_shapes.js', one_js=True, node_size=5, line_width=2, opacity=1, show_edges=False, debug_js=False, displacement_scale=1.0)Creates files that can be embedded into a PDF to create interactive content
This function produces a Universal3D model containing Geometry information. This function also produces one or more JavaScript programs that are used by the PDF to animate the model data. The model and programs can be embedded into a PDF either by using Adobe Acrobat Professional, or by using LaTeX with the media9 package to build a PDF document.
Parameters¶
geometry : Geometry A SDynPy Geometry object that will be exported to Universal3D format.
shapes : ShapeArray, optional A SDynPy ShapeArray object that contains the mode shapes that will be used to animate the model in the final PDF. If not specified, only the geometry will be exported.
u3d_name : str, optional The file path and name of the Universal3D file that will be created from the SDynPy Geometry. Note that the .u3d extension will be automatically appended to the file path. The default is ‘geometry’.
js_name : str, optional The file path and name of the JavaScript file(s) that will be created from the geometry and shape information. The final file name will be constructed from the code
js_name.format(i+1)whereiis the shape index. This allows for a different file name to be produced for each mode ifone_jsisFalse. The default is ‘mode_shapes.js’.one_js : bool, optional If True, only one JavaScript file will be produced containing all mode shape information. If False, one JavaScript file will be produced per mode in the
shapesargument, with each script having that shape as shape that is plotted first. Even ifone_jsis False, all JavaScript programs will have all modes in them. The default is True.node_size : int, optional The size of the rendered node in pixels. The default is 5.
line_width : int, optional The width of lines rendered in the model. The default is 2. Note that lines with a width of 1 may not show their color well in the final PDF.
opacity : float, optional The opacity of the model, from 0 (transparent) to 1 (opaque). The default is 1.
show_edges : bool, optional If True, edges will be drawn on element faces. The default is False.
debug_js : bool or str, optional If True, the JavaScript programs will have various print statements enabled to help users debug. If False, these will be commented out. String values of ‘map’, ‘point’, ‘line’, or ‘face’ can also be specified to only print debug text for those operations. The default is False.
displacement_scale : float, optional A scale factor applied to the shape displacements to achieve a reasonable deflection size. The default is 1.0.
Returns¶
None.
Notes¶
There is no support currently for Solid elements (e.g. tets or hexes). Only surface elements (tris and quads), lines (beam elements or tracelines), and points (nodes) are currently supported.