Exemple #1
0
def slide_03_DaoSecPrincipe(r, offset, k, h):

    drawCircle(r + offset,  'stInfo')
    pntsBase = getPntsBase(r)
    wireDaoClassic = getWireDaoClassic(pntsBase)
    wireDao0 = getShapeOffset(wireDaoClassic, -offset)
    ScShape(wireDao0, 'stMain')

    # for oure goal we need divide Dao on Head and Tail
    # Head sections is parallell
    # Tail sections is focused on focus point
    pntsDao0 = getPntsOfShape(wireDao0)
    pntDownLimit, pntDaoStart, pntUpLimit, pntDaoEnd  = pntsDao0

    # we need focus to determine tail sections
    pntFocus = getPntDaoFocus(r)
    ScPoint(pntFocus, 'stMain')
    ScLabel(pntFocus, 'f0', 'stMain')

    # we need two points to determine section
    pnt1, pnt2 = getPntsForDaoSec(pntDaoStart, pntUpLimit, pntDaoEnd, pntDownLimit, pntFocus, k)
    ScLine(pnt1, pnt2, 'stFocus')

    # !!! we need use plane to detect intercsect (not line) becouse 3D
    planeSec = getFacePlane(pnt1, pnt2, h)
    ScShape(planeSec, 'stFocus')

    pntsSec =  getPntsEdgesFacesIntersect(wireDao0, planeSec)
    drawPoints(pntsSec, 'stFocus')
Exemple #2
0
def slide_07_DaoWithCase (r, offset, caseH, delta):

    pntsBase = getPntsBase(r)
    wireDaoClassic = getWireDaoClassic(pntsBase)
    wireDao0 = getShapeOffset(wireDaoClassic, -offset)

    pntsDao0 = getPntsOfShape(wireDao0)
    pntDownLimit, pntDaoStart, pntUpLimit, pntDaoEnd  = pntsDao0

    pntFocus = getPntDaoFocus(r)

    ks = [ 3, 9 , 16, 24, 35, 50, 70, 85]
    wiresSec = []

    for k in  ks:
       wireSec = getWireDaoSec(wireDao0, pntFocus, k/100)
       wiresSec += [wireSec]

    solidDao0 = getShapeSkin(pntDaoStart, wiresSec, pntDaoEnd)
    solidDao0 = getShapeZScale(solidDao0, 0.7)
    # !!! Boolean not work if not small rotate (its a bus)
    solidDao0  = getShapeOZRotate(solidDao0, pi*0.2)
    ScShape(solidDao0, stDao0)
    solidDao1  = getShapeOZRotate(solidDao0, pi)
    ScShape(solidDao1, stDao1)

    case = getDaoCase(r, offset, caseH)
    case = BRepAlgoAPI_Cut(case, solidDao0).Shape()
    case = BRepAlgoAPI_Cut(case, solidDao1).Shape()

    case = getShapeTranslate(case, 0,0, -caseH)
    ScShape(case, stCase)
Exemple #3
0
def slide_07_DaoWithCase(r, offset, caseH, caseZMove, gap):

    solidDao0 = getSolidDao(r, offset + gap)
    ScShape(solidDao0, stDao0)
    solidDao1 = getShapeOZRotate(solidDao0, pi)
    ScShape(solidDao1, stDao1)

    case = getDaoCase(r, offset, caseH)

    case = getShapeTranslate(case, 0, 0, caseZMove)
    ScShape(case, stCase)
Exemple #4
0
def slide_02_DaoConcept(r, offset):

    drawCircle(r + offset, 'stInfo')
    pntsBase = getPntsBase(r)
    wireDaoClassic = getWireDaoClassic(pntsBase)
    wireDao0 = getShapeOffset(wireDaoClassic, -offset)
    ScShape(wireDao0, 'stMain')

    pntsDao0 = getPntsOfShape(wireDao0)
    drawPoints(pntsDao0, 'stFocus', 'd')

    wireDao1 = getShapeOZRotate(wireDao0, pi)
    ScShape(wireDao1, 'stInfo')
Exemple #5
0
def slide_01_DaoClassic(r):

    drawCircle(r, 'stInfo')
    pntsBase = getPntsBase(r)
    drawPoints(pntsBase, 'stFocus', 'b')
    shapeDaoClassic = getWireDaoClassic(pntsBase)
    ScShape(shapeDaoClassic, 'stMain')
Exemple #6
0
def slide_04_DaoManySec(r, offset, kStart, kEnd, cnt):

    drawCircle(r + offset, 'stInfo')
    pntsBase = getPntsBase(r)
    wireDaoClassic = getWireDaoClassic(pntsBase)
    wireDao0 = getShapeOffset(wireDaoClassic, -offset)
    ScShape(wireDao0, 'stMain')

    pntsDao0 = getPntsOfShape(wireDao0)
    pntDownLimit, pntDaoStart, pntUpLimit, pntDaoEnd  = pntsDao0

    pntFocus = getPntDaoFocus(r)
    drawPoints(pntFocus,  'stFocus', 'f0')

    for i in range(cnt+1):
        k = i/cnt
        kkScale = kEnd - kStart
        kk = kStart + k* kkScale
        p0,p1 = getPntsForDaoSec(pntDaoStart, pntUpLimit, pntDaoEnd, pntDownLimit, pntFocus, kk)
        ScLine(p0, p1, 'stFocus')
        wireSec = getWireDaoSec(wireDao0, pntFocus, kk)
        ScShape(wireSec, 'stMain')
Exemple #7
0
def slide_06_DaoComplete (r, offset):

    drawCircle(r + offset, 'stInfo')
    pntsBase = getPntsBase(r)
    wireDaoClassic = getWireDaoClassic(pntsBase)
    wireDao0 = getShapeOffset(wireDaoClassic, -offset)

    pntsDao0 = getPntsOfShape(wireDao0)
    pntDownLimit, pntDaoStart, pntUpLimit, pntDaoEnd  = pntsDao0

    pntFocus = getPntDaoFocus(r)

    ks = [ 3, 9 , 16, 24, 35, 50, 70, 85]
    wiresSec = []

    for k in  ks:
       wireSec = getWireDaoSec(wireDao0, pntFocus, k/100)
       wiresSec += [wireSec]

    solidDao0 = getShapeSkin(pntDaoStart, wiresSec, pntDaoEnd)
    solidDao0 = getShapeZScale(solidDao0, 0.7)
    ScShape(solidDao0, stDao0)
    solidDao1  = getShapeOZRotate(solidDao0, pi)
    ScShape(solidDao1, stDao1)
Exemple #8
0
def slide_05_DaoSkinning (r, offset):

    drawCircle(r + offset,  'stInfo')
    pntsBase = getPntsBase(r)
    wireDaoClassic = getWireDaoClassic(pntsBase)
    wireDao0 = getShapeOffset(wireDaoClassic, -offset)
    ScShape(wireDao0, 'stMain')

    pntsDao0 = getPntsOfShape(wireDao0)
    pntDownLimit, pntDaoStart, pntUpLimit, pntDaoEnd  = pntsDao0

    pntFocus = getPntDaoFocus(r)
    drawPoints(pntFocus, 'stMain' ,'f')

    ks = [ 3, 9 , 16, 24, 35, 50, 70, 85]
    wiresSec = []

    for k in  ks:
       wireSec = getWireDaoSec(wireDao0, pntFocus, k/100)
       ScShape(wireSec, 'stMain')
       wiresSec += [wireSec]

    solidDao0 = getShapeSkin(pntDaoStart, wiresSec, pntDaoEnd)
    ScShape(solidDao0, 'stFocus')
Exemple #9
0
def slide_06_DaoComplete(r, offset):

    solidDao0 = getSolidDao(r, offset)
    ScShape(solidDao0, stDao0)
    solidDao1 = getShapeOZRotate(solidDao0, pi)
    ScShape(solidDao1, stDao1)