How to use the vedo.Text 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 / tests / test_scene.py View on Github external
# Text to add
    s = "BRAINRENDER"

    # Specify a color for each letter
    colors = makePalette(len(s), "salmon", "powderblue")

    x = 0  # use to specify the position of each letter
    # Add letters one at the time to color them individually
    for n, letter in enumerate("BRAINRENDER"):
        if "I" == letter or "N" == letter and n < 5:  # make the spacing right
            x += 0.6
        else:
            x += 1

        # Add letter and silhouette to the scne
        act = Text(
            letter, depth=0.5, c=colors[n], pos=(x, 0, 0), justify="centered"
        )
        sil = act.silhouette().lw(3).color("k")
        scene.add_actor(act, sil)

    scene.render(interactive=False)
    scene.close()
github BrancoLab / BrainRender / Examples / basic / add_text_3d.py View on Github external
# Specify a color for each letter
colors = makePalette(len(s), "salmon", "powderblue")

x = 0  # use to specify the position of each letter

# Add letters one at the time to color them individually
for n, letter in enumerate("BRAINRENDER"):
    if "I" == letter or "N" == letter and n < 5:  # make the spacing right
        x += 0.6
    else:
        x += 1

    # Add letter and silhouette to the scene
    print(colors[n])
    act = Text(
        letter,
        depth=0.5,
        c=colors[n],
        pos=(x, 0, 0),
        justify="centered",
        alpha=1,
    )

    scene.add_silhouette(act, lw=3)


scene.render()
github BrancoLab / BrainRender / brainrender / Utils / scene_utils.py View on Github external
elif isinstance(color, (list, tuple)):
            color = color[n]

        # Get mesh's highest point
        points = actor.points().copy()
        point = points[np.argmin(points[:, 1]), :]
        point += np.array(offset) + default_offset

        try:
            if atlas.hemisphere_from_coords(point, as_string=True) == "left":
                point = atlas.mirror_point_across_hemispheres(point)
        except IndexError:
            pass

        # Create label
        txt = Text(label, point, s=size, c=color)
        new_actors.append(txt)

        # Mark a point on Mesh that corresponds to the label location
        if radius is not None:
            pt = actor.closestPoint(point)
            new_actors.append(Sphere(pt, r=radius, c=color))

    return new_actors

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