コード例 #1
0
    x = intersection_line_plane(line, plane)
    points.append(x)

    rhinopoints.append({
        'pos'   : x,
        'color' : (0, 0, 255),
        'name'  : "{}.{}.anchor".format(shell.name, key)
    })

box = bounding_box(points)

lines = []
for i, j in [(0, 1), (1, 5), (5, 4), (4, 0)]:
    a = box[i]
    b = box[j]
    d = distance_point_point(a, b)
    if d < 0.01:
        continue
    lines.append({
        'start' : a,
        'end'   : b,
        'color' : (0, 255, 255),
        'name'  : "box"
    })

artist = ShellArtist(shell, layer="Scaffolding::Points")
artist.clear_layer()
artist.draw_points(rhinopoints)
artist.draw_lines(lines)
artist.redraw()
コード例 #2
0
    LINES += framelines(origin, xaxis, yaxis, zaxis, 'frame')

    normal = yaxis
    origin = add_vectors(origin, scale_vector(normal, OFFSET))
    plane = (origin, normal)

    points = []
    for key in keys:
        a = SHELL.vertex_coordinates(key)
        r = SHELL.get_vertex_attributes(key, ['rx', 'ry', 'rz'])
        b = add_vectors(a, r)

        line = a, b
        x = intersection_line_plane(line, plane)

        points.append(x)
        POINTS.append({
            'pos'   : x,
            'color' : (0, 0, 255),
            'name'  : "{}.{}.extensions".format(SHELL.name, key)})

# ==============================================================================
# Visualize
# ==============================================================================

ARTIST = ShellArtist(SHELL, layer="Scaffolding::Clamps")
ARTIST.clear_layer()
ARTIST.draw_points(POINTS)
ARTIST.draw_lines(LINES)
ARTIST.redraw()