Rhinoceros with Pythhon으로 Lattice Hige를 쓰는 프로그램

5143 단어 Pythonrhinoceros

사용법

  • drawlatticehinge.pydownload
  • drawlatticehinge.py를 같은 주 프로그램과 같은 디렉터리에 저장
  • 주 프로그램drawlatticehinge.import
  • 매개 변수 설정 및 draw 설정lattice_follow_크로스포인트로 그리기
  • 샘플 프로그램


    SampleProgram.py
    
    import rhinoscriptsyntax as rs
    import drawlatticehinge as lh
    import math
    
    def clear_all():
        all_obs = rs.ObjectsByType(0)
        rs.DeleteObjects(all_obs)
    
    clear_all()
    
    parameter = [37.5,0.2,0.4,1.5,10]
    lattice = lh.LatticeHinge(parameter)
    
    startPoint = (0,0,0)
    endPoint = (200,200,0)
    
    lattice.draw_lattice_follow_crosspoint(startPoint,endPoint)
    

    매개 변수


    parameter = [37.5,0.2,0.4,1.5,10]
    
    LINE_LENGTH = parameter[0] #37.5#
    LINE_WIDTH = parameter[1] #0.2#
    OVERLAP_RATE = parameter[2] #0.4#
    LINE_INTERVAL = parameter[3] #1.5#
    INTERVAL_LIMIT = parameter[4] #10#
    cutAngle = (math.radians(90),math.radians(90),math.radians(90),math.radians(90))
    
    ※ 주석
    LINE_LENGTH = 선 길이
    LINE_WIDTH = 선 1개의 너비(레이저 컷의 너비로 0.2mm)
    OVERLAP_RATE= 선의 길이 중첩도
    LINE_선과 선 사이의 간격
    INTERVAL_LIMIT = Lattice의 반복 횟수

    실행 결과



    startPoint = (0,0)에서 endPoint = (200200,0) 사이의 Lattice Hinge

    좋은 웹페이지 즐겨찾기