Esempio n. 1
0
def drawFrame(_plane, _scale):

    # Annotation Layer

    layerName = "Annotation-Frame"
    rs.EnableRedraw(False)

    if not rs.IsLayer(layerName):

        rs.AddLayer(layerName)
        rs.LayerColor(layerName, Color.FromArgb(100, 100, 100))

    ptPointOnXAxe = GeometryOperations.movePoint(_plane[0], _plane[1])
    ptPointOnYAxe = GeometryOperations.movePoint(_plane[0], _plane[2])
    ptPointOnZAxe = GeometryOperations.movePoint(_plane[0], _plane[3])

    x = rs.AddLine(_plane[0], ptPointOnXAxe)
    rs.ScaleObject(x, _plane[0], (_scale, _scale, _scale))
    rs.CurveArrows(x, 2)

    y = rs.AddLine(_plane[0], ptPointOnYAxe)
    rs.ScaleObject(y, _plane[0], (_scale, _scale, _scale))
    rs.CurveArrows(y, 2)

    z = rs.AddLine(_plane[0], ptPointOnZAxe)
    rs.ScaleObject(z, _plane[0], (_scale, _scale, _scale))
    rs.CurveArrows(z, 2)

    rs.ObjectColor(x, (200, 100, 100))
    rs.ObjectColor(y, (100, 200, 100))
    rs.ObjectColor(z, (100, 100, 200))

    rs.ObjectLayer(x, layerName)
    rs.ObjectLayer(y, layerName)
    rs.ObjectLayer(z, layerName)

    rs.AddGroup("Annotation-Frame")
    rs.AddObjectsToGroup((x, y, z), "Annotation-Frame")
    rs.EnableRedraw(True)
Esempio n. 2
0
def drawVector(vector, origin):

    """
    this function draws vector in rhino
    
    """

    layerName = "Annotation-Vector"
    if not rs.IsLayer(layerName):

        rs.AddLayer(layerName)
        rs.LayerColor(layerName, Color.FromArgb(150, 50, 50))

    print(rs.VectorLength(vector))

    lineID = rs.AddLine(origin, GeometryOperations.movePoint(origin, vector))

    rs.CurveArrows(lineID, 2)
    rs.ObjectLayer(lineID, layerName)
    rs.ObjectColor(lineID, (150, 150, 150))

    return lineID