How to use the vedo.load function in vedo

To help you get started, we’ve selected a few vedo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BrancoLab / BrainRender / brainrender / atlases / custom_atlases / insects_brains_db.py View on Github external
def download_and_write_mesh(self, acronym, obj_path):
        print(f"Downloading mesh data for {acronym}")
        path = self.structures.loc[
            self.structures.acronym == acronym
        ].obj_path.values[0]
        url = f"{self._url_paths['data']}/{path}"

        # download and write .obj
        mesh_data = request(url).content.decode("utf-8").split("\n")
        with open(obj_path, "w") as f:
            for md in mesh_data:
                f.write(f"{md}\n")
            f.close()

        # return the vtk actor
        return load(obj_path)
github BrancoLab / BrainRender / brainrender / Utils / data_io.py View on Github external
def load_mesh_from_file(filepath, *args, **kwargs):
    """	
    Load a a mesh or volume from files like .obj, .stl, ...

    :param filepath: path to file
    :param **kwargs: 

    """
    actor = load(str(filepath))
    color = kwargs.pop("color", None)
    alpha = kwargs.pop("alpha", None)

    if color is not None:
        actor.c(color)
    if alpha is not None:
        actor.alpha(alpha)

    return actor
github BrancoLab / BrainRender / brainrender / atlases / celegans.py View on Github external
def _get_structure_mesh(self, acronym, **kwargs):
        """
            Get's the mesh for a brainregion, for this atlas it's just for
            getting/making the root mesh

        """
        if acronym != "root":
            raise ValueError(
                f"The atlas {self.atlas_name} only has one structure mesh: root. Argument {acronym} is not valid"
            )

        objpath = os.path.join(self.data_folder, "objs_smoothed", "root2.obj")
        if not os.path.isfile(objpath):
            root = self._make_root(objpath)
        else:
            root = load(objpath)

        root.c(ROOT_COLOR).alpha(ROOT_ALPHA)

        return root

vedo

A python module for scientific analysis and visualization of 3D objects and point clouds based on VTK and Numpy.

MIT
Latest version published 3 months ago

Package Health Score

78 / 100
Full package analysis