コード例 #1
0
ファイル: util.py プロジェクト: applekey/wizard
def get_selected_bounding_box(remote):
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetBoundingBox(key1, fMin, fMax)
    return ((fMin[0], fMin[1], fMin[2]), (fMax[0], fMax[1], fMax[2]))
コード例 #2
0
ファイル: util.py プロジェクト: applekey/wizard
def get_selected_bounding_box(remote):
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetBoundingBox(key1, fMin, fMax)
    return ( (fMin[0],fMin[1],fMin[2]), (fMax[0],fMax[1],fMax[2]) )
コード例 #3
0
ファイル: util.py プロジェクト: dmalpica/meshmixer-api
def get_selected_bounding_box(remote):
    """return the axis-aligned bounding box of the selected objects as two 3-tuples (min, max)"""
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetBoundingBox(key1, fMin, fMax)
    return ( (fMin[0],fMin[1],fMin[2]), (fMax[0],fMax[1],fMax[2]) )
コード例 #4
0
ファイル: util.py プロジェクト: applekey/mm-api
def get_selected_bounding_box(remote):
    """return the axis-aligned bounding box of the selected objects as two 3-tuples (min, max)"""
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetBoundingBox(key1, fMin, fMax)
    return ( (fMin[0],fMin[1],fMin[2]), (fMax[0],fMax[1],fMax[2]) )
コード例 #5
0
def to_world_xyz(remote, x, y, z):
    """convert point from scene to world coords"""
    vScene = mmapi.floatArray(3)
    vScene[0] = x
    vScene[1] = y
    vScene[2] = z
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertPointToWorld(vScene)
    remote.runCommand(cmd2)
    vWorld = mmapi.floatArray(3)
    cmd2.GetQueryResult_ConvertPointToWorld(ckey, vWorld)
    return (vWorld[0], vWorld[1], vWorld[2])
コード例 #6
0
ファイル: convert.py プロジェクト: applekey/wizard
def to_world_xyz(remote, x,y,z):
    """convert point from scene to world coords"""
    vScene = mmapi.floatArray(3)
    vScene[0] = x
    vScene[1] = y
    vScene[2] = z
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertPointToWorld(vScene)
    remote.runCommand(cmd2);
    vWorld = mmapi.floatArray(3)
    cmd2.GetQueryResult_ConvertPointToWorld(ckey, vWorld)
    return (vWorld[0],vWorld[1],vWorld[2])
コード例 #7
0
ファイル: convert.py プロジェクト: jiapei100/mm-api
def to_scene_xyz(remote, x,y,z):
    """convert a 3D point from World space to Scene space"""
    vWorld = mmapi.floatArray(3)
    vWorld[0] = x
    vWorld[1] = y
    vWorld[2] = z
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertPointToScene(vWorld)
    remote.runCommand(cmd2);
    vScene = mmapi.floatArray(3)
    cmd2.GetQueryResult_ConvertPointToScene(ckey, vScene)
    return (vScene[0],vScene[1],vScene[2])
コード例 #8
0
ファイル: util.py プロジェクト: applekey/wizard
def get_face_selection_bounding_box(remote):
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesBoundingBox(key1, fMin, fMax)
    if bOK:
        return ( (fMin[0],fMin[1],fMin[2]), (fMax[0],fMax[1],fMax[2]) )
    else:
        return ( (0,0,0), (0,0,0) )
コード例 #9
0
ファイル: convert.py プロジェクト: strandedcity/e-nableRnD
def to_scene_xyz(remote, x, y, z):
    """convert a 3D point from World space to Scene space"""
    vWorld = mmapi.floatArray(3)
    vWorld[0] = x
    vWorld[1] = y
    vWorld[2] = z
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertPointToScene(vWorld)
    remote.runCommand(cmd2)
    vScene = mmapi.floatArray(3)
    cmd2.GetQueryResult_ConvertPointToScene(ckey, vScene)
    return (vScene[0], vScene[1], vScene[2])
コード例 #10
0
ファイル: util.py プロジェクト: applekey/wizard
def get_face_selection_bounding_box(remote):
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesBoundingBox(key1, fMin, fMax)
    if bOK:
        return ((fMin[0], fMin[1], fMin[2]), (fMax[0], fMax[1], fMax[2]))
    else:
        return ((0, 0, 0), (0, 0, 0))
コード例 #11
0
ファイル: util.py プロジェクト: applekey/mm-api
def get_face_selection_bounding_box(remote):
    """return the axis-aligned bounding box of the selected faces as two 3-tuples (min, max). Requires active face selection."""
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesBoundingBox(key1, fMin, fMax)
    if bOK:
        return ( (fMin[0],fMin[1],fMin[2]), (fMax[0],fMax[1],fMax[2]) )
    else:
        return ( (0,0,0), (0,0,0) )
コード例 #12
0
ファイル: util.py プロジェクト: dmalpica/meshmixer-api
def get_face_selection_bounding_box(remote):
    """return the axis-aligned bounding box of the selected faces as two 3-tuples (min, max). Requires active face selection."""
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesBoundingBox()
    remote.runCommand(cmd)

    fMin = mmapi.floatArray(3)
    fMax = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesBoundingBox(key1, fMin, fMax)
    if bOK:
        return ( (fMin[0],fMin[1],fMin[2]), (fMax[0],fMax[1],fMax[2]) )
    else:
        return ( (0,0,0), (0,0,0) )
コード例 #13
0
ファイル: convert.py プロジェクト: strandedcity/e-nableRnD
def to_scene_f(remote, f):
    """convert a scalar dimension from World space to Scene space"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToScene(f)
    remote.runCommand(cmd2)
    vScene = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToScene(ckey, vScene)
    return vScene[0]
コード例 #14
0
ファイル: convert.py プロジェクト: applekey/wizard
def to_world_f(remote, f):
    """convert scalar from scene to world coords"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToWorld(f)
    remote.runCommand(cmd2);
    vWorld = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToWorld(ckey, vWorld)
    return vWorld[0]
コード例 #15
0
def to_scene_f(remote, f):
    """convert scalar from world to scene coords"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToScene(f)
    remote.runCommand(cmd2)
    vScene = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToScene(ckey, vScene)
    return vScene[0]
コード例 #16
0
ファイル: convert.py プロジェクト: jiapei100/mm-api
def to_scene_f(remote, f):
    """convert a scalar dimension from World space to Scene space"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToScene(f)
    remote.runCommand(cmd2);
    vScene = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToScene(ckey, vScene)
    return vScene[0]
コード例 #17
0
def to_world_f(remote, f):
    """convert scalar from scene to world coords"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToWorld(f)
    remote.runCommand(cmd2)
    vWorld = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToWorld(ckey, vWorld)
    return vWorld[0]
コード例 #18
0
ファイル: convert.py プロジェクト: strandedcity/e-nableRnD
def to_world_f(remote, f):
    """convert a scalar dimension from Scene space to World space"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToWorld(f)
    remote.runCommand(cmd2)
    vWorld = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToWorld(ckey, vWorld)
    return vWorld[0]
コード例 #19
0
ファイル: convert.py プロジェクト: jiapei100/mm-api
def to_world_f(remote, f):
    """convert a scalar dimension from Scene space to World space"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToWorld(f)
    remote.runCommand(cmd2);
    vWorld = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToWorld(ckey, vWorld)
    return vWorld[0]
コード例 #20
0
ファイル: convert.py プロジェクト: applekey/wizard
def to_scene_f(remote, f):
    """convert scalar from world to scene coords"""
    cmd2 = mmapi.StoredCommands()
    ckey = cmd2.AppendQueryCommand_ConvertScalarToScene(f)
    remote.runCommand(cmd2);
    vScene = mmapi.floatArray(1)
    cmd2.GetQueryResult_ConvertScalarToScene(ckey, vScene)
    return vScene[0]
コード例 #21
0
ファイル: util.py プロジェクト: applekey/wizard
def get_face_selection_centroid(remote):
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesCentroid()
    remote.runCommand(cmd)

    vCentroid = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesCentroid(key1, vCentroid)
    if bOK:
        return ( vCentroid[0], vCentroid[1], vCentroid[2] )
    else:
        return ( 0,0,0 )
コード例 #22
0
ファイル: util.py プロジェクト: applekey/wizard
def get_face_selection_centroid(remote):
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesCentroid()
    remote.runCommand(cmd)

    vCentroid = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesCentroid(key1, vCentroid)
    if bOK:
        return (vCentroid[0], vCentroid[1], vCentroid[2])
    else:
        return (0, 0, 0)
コード例 #23
0
ファイル: util.py プロジェクト: applekey/mm-api
def get_face_selection_centroid(remote):
    """return the geometric centroid of the selected faces as a 3-tuple. Requires active face selection."""
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesCentroid()
    remote.runCommand(cmd)

    vCentroid = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesCentroid(key1, vCentroid)
    if bOK:
        return ( vCentroid[0], vCentroid[1], vCentroid[2] )
    else:
        return ( 0,0,0 )
コード例 #24
0
ファイル: util.py プロジェクト: dmalpica/meshmixer-api
def get_face_selection_centroid(remote):
    """return the geometric centroid of the selected faces as a 3-tuple. Requires active face selection."""
    cmd = mmapi.StoredCommands()
    key1 = cmd.AppendQueryCommand_GetSelectedFacesCentroid()
    remote.runCommand(cmd)

    vCentroid = mmapi.floatArray(3)
    bOK = cmd.GetQueryResult_GetSelectedFacesCentroid(key1, vCentroid)
    if bOK:
        return ( vCentroid[0], vCentroid[1], vCentroid[2] )
    else:
        return ( 0,0,0 )