LiveViewer

class photonforge.live_viewer.LiveViewer(port=5001, start=True)[source]

Live viewer for PhotonForge objects.

Parameters:
  • port (int) – Port number used by the viewer server.

  • start (bool) – If True, the viewer server is automatically started.

Example

>>> from photonforge.live_viewer import LiveViewer
>>> viewer = LiveViewer()
>>> component = pf.parametric.straight(port_spec="Strip", length=3)
>>> viewer(component)
>>> terminal = pf.Terminal("METAL", pf.Circle(2))
>>> viewer(terminal)

Methods

display(item)

Display an item with an SVG representation.

start()

Start the server.

stop()

Stop the server.

display(item)[source]

Display an item with an SVG representation.

Parameters:

item (Any) – Item to be displayed.

Returns:

‘item’.

Return type:

Any

start()[source]

Start the server.

Return type:

LiveViewer

stop()[source]

Stop the server.