Beispiel #1
0
def draw_edge_rhino(edge):
    # ==============================================================================
    # Use a frame artist to visualize the boundary frame.
    # ==============================================================================
    artist = FrameArtist(edge['frames'][0],
                         layer=edge['layer'] + "::Frame",
                         scale=0.3)
    artist.clear_layer()
    artist.draw()
    # ==============================================================================
    # Use a frame artist to visualize the frame of the intersection points.
    # ==============================================================================
    artist = FrameArtist(edge['frames'][1],
                         layer=edge['layer'] + "::Frame",
                         scale=0.3)
    artist.clear_layer()
    artist.draw()
    # ==============================================================================
    # Use a point artist to visualize the intersection points.
    # ==============================================================================
    PointArtist.draw_collection(edge['intersections'],
                                layer=edge['layer'] + "::Intersections",
                                clear=True)
    # ==============================================================================
    # Use a mesh artist to visualize beams
    # ==============================================================================
    artist = MeshArtist(None, layer=edge['layer'] + "::BBox")
    artist.clear_layer()
    for mesh in edge['meshes']:
        artist = MeshArtist(mesh, layer=edge['layer'] + "::BBox")
        artist.draw_mesh()
Beispiel #2
0
    for joint in joints:
        frame = joint.origin.transformed(transformations[joint.name])
        frame.name = joint.name
        frames.append(frame)

        axis = joint.axis.transformed(transformations[joint.name])
        axis.name = joint.name
        axes.append(axis)

    # Visualization

    for frame in frames:
        artist = FrameArtist(frame,
                             scale=0.3,
                             layer="Frames::{}".format(frame.name))
        artist.clear_layer()
        artist.draw()

    for a, b in pairwise(frames):
        line = Line(a.point, b.point)
        artist = LineArtist(line, layer="Links::{}".format(a.name))
        artist.draw()

    tpl = Cylinder(Circle(Plane(Point(0, 0, 0), Vector(0, 0, 1)), 0.05), 0.2)
    for frame, axis in zip(frames, axes):
        point = frame.point
        normal = Vector(axis.x, axis.y, axis.z)
        plane = Plane(point, normal)
        frame = Frame.from_plane(plane)
        X = Transformation.from_frame(frame)
        cylinder = tpl.transformed(X)