MCPcopy
hub / github.com/CadQuery/cadquery / exportVTKJS

Function exportVTKJS

cadquery/occ_impl/exporters/assembly.py:408–421  ·  view source on GitHub ↗

Export an assembly to a zipped vtkjs. NB: .zip extensions is added to path.

(assy: AssemblyProtocol, path: str)

Source from the content-addressed store, hash-verified

406
407
408def exportVTKJS(assy: AssemblyProtocol, path: str):
409 """
410 Export an assembly to a zipped vtkjs. NB: .zip extensions is added to path.
411 """
412
413 renderWindow = _vtkRenderWindow(assy)
414
415 with TemporaryDirectory() as tmpdir:
416
417 exporter = vtkJSONSceneExporter()
418 exporter.SetFileName(tmpdir)
419 exporter.SetRenderWindow(renderWindow)
420 exporter.Write()
421 make_archive(path, "zip", tmpdir)
422
423
424def exportVRML(

Callers 2

test_vtkjs_exportFunction · 0.90
exportMethod · 0.85

Calls 2

_vtkRenderWindowFunction · 0.85
WriteMethod · 0.80

Tested by 1

test_vtkjs_exportFunction · 0.72