コード例 #1
0
ファイル: calculate.py プロジェクト: Linwal/pyliburo
def point_in_solid(occ_solid, pypt):
    gp_pnt = gp_Pnt(pypt[0], pypt[1], pypt[2])
    if Common.point_in_solid(occ_solid, gp_pnt)[0]:
        return True
    elif Common.point_in_solid(occ_solid, gp_pnt)[0] == None:
        return None  #means its on the solid
    else:
        return False
コード例 #2
0
ファイル: calculate.py プロジェクト: chenkianwee/envuo
def point_in_solid(pypt, occsolid):
    """
    This function checks if a point is inside an OCCsolid.
 
    Parameters
    ----------
    pypt : tuple of floats
        Check if this point is inside the OCCsolid. A pypt is a tuple that documents the xyz coordinates of a pt e.g. (x,y,z)
        
    occsolid : OCCsolid
        Check if the point is inside this OCCsolid.

    Returns
    -------
    True, False, None : True, False, None
        If True means the point is in the solid, if False the point is not in the solid, if None means the point is on the solid.
    """
    gp_pnt = gp_Pnt(pypt[0], pypt[1], pypt[2] )
    if Common.point_in_solid(occsolid, gp_pnt)[0]:
        return True 
    elif Common.point_in_solid(occsolid, gp_pnt)[0] == None:
        return None #means its on the solid
    else: 
        return False
コード例 #3
0
ファイル: calculate.py プロジェクト: CES-MDE/py4design
def point_in_solid(pypt, occsolid):
    """
    This function checks if a point is inside an OCCsolid.
 
    Parameters
    ----------
    pypt : tuple of floats
        Check if this point is inside the OCCsolid. A pypt is a tuple that documents the xyz coordinates of a pt e.g. (x,y,z)
        
    occsolid : OCCsolid
        Check if the point is inside this OCCsolid.

    Returns
    -------
    True, False, None : True, False, None
        If True means the point is in the solid, if False the point is not in the solid, if None means the point is on the solid.
    """
    gp_pnt = gp_Pnt(pypt[0], pypt[1], pypt[2])
    if Common.point_in_solid(occsolid, gp_pnt)[0]:
        return True
    elif Common.point_in_solid(occsolid, gp_pnt)[0] == None:
        return None  #means its on the solid
    else:
        return False