bluemira.codes._polyscope ========================= .. py:module:: bluemira.codes._polyscope Classes ------- .. autoapisummary:: bluemira.codes._polyscope.DefaultDisplayOptions Functions --------- .. autoapisummary:: bluemira.codes._polyscope.show_cad bluemira.codes._polyscope.polyscope_setup bluemira.codes._polyscope._init_polyscope bluemira.codes._polyscope.add_features bluemira.codes._polyscope.clean_name Module Contents --------------- .. py:class:: DefaultDisplayOptions Polyscope default display options .. py:attribute:: colour :type: bluemira.utilities.tools.ColourDescriptor .. py:attribute:: transparency :type: float :value: 0.0 .. py:attribute:: material :type: str :value: 'wax' .. py:attribute:: tesselation :type: float :value: 0.05 .. py:attribute:: wires_on :type: bool :value: False .. py:attribute:: wire_radius :type: float :value: 0.001 .. py:attribute:: smooth :type: bool :value: True .. py:property:: color :type: str See colour .. py:function:: show_cad(parts: bluemira.codes._freecadapi.apiShape | list[bluemira.codes._freecadapi.apiShape], part_options: list[dict], labels: list[str], **kwargs) The implementation of the display API for FreeCAD parts. :param parts: The parts to display. :param part_options: The options to use to display the parts. :param labels: Labels to use for each part object :param \*\*kwargs: options passed to polyscope .. py:function:: polyscope_setup(up_direction: str = 'z_up', fps: int = 60, aa: int = 1, transparency: str = 'pretty', render_passes: int = 2, gplane: str = 'none') Setup Polyscope default scene :param up_direction: 'x_up' The positive X-axis is up. 'neg_x_up' The negative X-axis is up. 'y_up' The positive Y-axis is up. 'neg_y_up' The negative Y-axis is up. 'z_up' The positive Z-axis is up. 'neg_z_up' The negative Z-axis is up. :param fps: maximum frames per second of viewer (-1 == infinite) :param aa: anti aliasing amount, 1 is off, 2 is usually enough :param transparency: the transparency mode (none, simple, pretty) :param render_passes: for transparent shapes how many render passes to undertake :param gplane: the ground plane mode (none, tile, tile_reflection, shadon_only) .. py:function:: _init_polyscope() Initialise polyscope (just once) .. py:function:: add_features(labels: list[str], parts: bluemira.codes._freecadapi.apiShape | list[bluemira.codes._freecadapi.apiShape], options: dict | list[dict]) -> tuple[list[polyscope.SurfaceMesh], list[polyscope.CurveNetwork]] Grab meshes of all parts to be displayed by Polyscope :param parts: parts to be displayed :param options: display options :rtype: Registered Polyspline surface meshes .. py:function:: clean_name(label: str, index_label: str) -> str Cleans or creates name. Polyscope doesn't like hashes in names, repeat names overwrite existing component. :param label: name to be cleaned :param index_label: if name is empty -> {index_label}: NO LABEL :rtype: name