コード例 #1
0
def update_coordinate_system_box(coordinate_system, cube_surface, arrows, labels, offset=0.5, scale=1.0):
    cube_points, dims = generators.generate_cuboid(
        scale, scale, scale, origin=np.array([scale / 2, scale / 2, scale / 2])
    )
    color = euler_color(coordinate_system.euler_angles)
    cube_surface.parent.parent.data.set(points=coordinate_system.to_parent(cube_points))
    cube_surface.actor.property.edge_visibility = 1
    cube_surface.actor.property.edge_color = color
    cube_surface.actor.property.color = color
    if arrows is None:
        return cube_surface, arrows, labels
    else:
        arrows, labels = update_coordinate_system_axes(coordinate_system, arrows, labels, offset=offset, scale=scale)
    return cube_surface, arrows, labels
コード例 #2
0
def draw_coordinate_system_box(fig, coordinate_system, offset=0.5, scale=1.0, draw_axes=True, draw_labels=True):
    mlab.figure(fig, bgcolor=fig.scene.background)
    cube_points, dims = generators.generate_cuboid(
        scale, scale, scale, origin=np.array([scale / 2, scale / 2, scale / 2])
    )
    cube = tvtk.StructuredGrid(dimensions=dims)
    cube.points = coordinate_system.to_parent(cube_points)
    color = euler_color(coordinate_system.euler_angles)
    cube_surface = mlab.pipeline.surface(cube, color=color)
    cube_surface.parent.parent.name = "Euler colored box: " + coordinate_system.name
    cube_surface.actor.property.edge_visibility = 1
    cube_surface.actor.property.edge_color = color
    arrows, labels = None, None
    if draw_axes:
        arrows, labels = draw_coordinate_system_axes(
            fig, coordinate_system, offset=offset, scale=scale, draw_labels=draw_labels
        )
    return cube_surface, arrows, labels