示例#1
0
def get_frame_on_mesh(mesh_location, myMesh):
    '''DEPRICATED FUNCTION, moved to mesh methods '''
    faceIdx, edgeIdx, vertIdx = mesh_location
    face_edges = myMesh.getFaceEdges(faceIdx)
    assert (edgeIdx
            in face_edges), "edge {} not in face {}".format(edgeIdx, faceIdx)
    faceTopoVerts = myMesh.getTVertsForFace(faceIdx)
    assert (vertIdx in faceTopoVerts
            ), "prblm in getBasisOnMesh():tVert not in faceTopoVerts "
    edgeTVerts = myMesh.getTVertsForEdge(edgeIdx)
    assert (vertIdx in edgeTVerts
            ), "prblm in getBasisOnMesh():tVert not part of given edge"

    def getOther(vertIdx, edgeTVerts):
        if (edgeTVerts[0] == vertIdx):
            return edgeTVerts[1]
        elif (edgeTVerts[1] == vertIdx):
            return edgeTVerts[0]
        else:
            print "ERROR: edgeTVerts does not contain vertIdx"
            return None

    pntA = myMesh.get_point_for_tVert(vertIdx)
    pntB = myMesh.get_point_for_tVert(getOther(vertIdx, edgeTVerts))
    x = helper.getVectorForPoints(pntA, pntB)
    normal = geom.Vector3d(myMesh.mesh.FaceNormals.Item[faceIdx])
    return Frame.create_frame_from_normal_and_x(pntA, normal, x)
示例#2
0
def get_frame_on_mesh(mesh_location,myMesh):
    '''DEPRICATED FUNCTION, moved to mesh methods '''
    faceIdx,edgeIdx,vertIdx = mesh_location
    face_edges = myMesh.getFaceEdges(faceIdx)
    assert (edgeIdx in face_edges), "edge {} not in face {}".format(edgeIdx,faceIdx)
    faceTopoVerts = myMesh.getTVertsForFace(faceIdx)
    assert(vertIdx in faceTopoVerts), "prblm in getBasisOnMesh():tVert not in faceTopoVerts "
    edgeTVerts = myMesh.getTVertsForEdge(edgeIdx) 
    assert(vertIdx in edgeTVerts), "prblm in getBasisOnMesh():tVert not part of given edge"
    def getOther(vertIdx, edgeTVerts):
        if(edgeTVerts[0] == vertIdx):
            return edgeTVerts[1]
        elif(edgeTVerts[1] == vertIdx):
            return edgeTVerts[0]
        else:
            print "ERROR: edgeTVerts does not contain vertIdx"
            return None
    pntA = myMesh.get_point_for_tVert(vertIdx)
    pntB = myMesh.get_point_for_tVert(getOther(vertIdx, edgeTVerts))
    x = helper.getVectorForPoints(pntA,pntB)
    normal = geom.Vector3d(myMesh.mesh.FaceNormals.Item[faceIdx])
    return Frame.create_frame_from_normal_and_x(pntA,normal,x)
示例#3
0
 def get_edge_vec(self, island):
     pntA, pntB = self.get_coordinates(island)
     return rhino_helpers.getVectorForPoints(pntA, pntB)
示例#4
0
 def get_edge_vec(self,island):
     pntA,pntB = self.get_coordinates(island)
     return rhino_helpers.getVectorForPoints(pntA,pntB)