Diskuzní fórum a databáze tipů a utilit pro AutoCAD, Inventor, Revit a další produkty Autodesk - od firmy Arkance Systems [www.cadforum.cz]
CZ | SK | EN | DE
Přihlášení
či registrace
   právě nás čte: 5067 
RSS kanál - CAD tipy RSS tipy
RSS diskuze

Diskuze Diskuzní fórum, poradna

 

NápovědaCAD diskuze, rady, výměna zkušeností

 
CAD Fórum - Homepage Veřejné diskuzní fórum k CAD aplikacím - ptejte se na libovolné otázky týkající se oboru CAx, podělte se o vaše znalosti a zkušenosti s programy AutoCAD, Inventor, Revit, Fusion 360, 3ds Max a s dalšími CAD aplikacemi. Zaregistrujte se nebo se přihlašte a zašlete váš příspěvek do odpovídajícího fóra. Viz další informace o CAD Fóru. Nechcete se registrovat? Zeptejte se v naší Facebook poradně.
Fórum nenahrazuje technický support firmy Arkance Systems (CAD Studio) - přímá podpora pro zákazníky funguje na helpdesk.cadstudio.cz
  FAQ FAQ  Prohledat fórum   Události   Registrovat Registrovat  Přihlásit Přihlásit

Téma uzavřenoepicykloida

 Odpovědět Odpovědět Stránka  <12 archiv
Autor
Honzicek Zobrazit panel
Diskutér
Diskutér

Přihlášen: 27.úno.2006
Stav: Offline
Bodů: 32
Přímý odkaz na tuto zprávu Zasláno: 09.bře.2006 v 16:47
možná bych to měl trochu zkrátit...prostě potřebuju,aby po tom co udělám křivku program  dal uživateli na výběr \Konec\změnit parametry\další\

Zpět nahoru
Honzicek Zobrazit panel
Diskutér
Diskutér

Přihlášen: 27.úno.2006
Stav: Offline
Bodů: 32
Přímý odkaz na tuto zprávu Zasláno: 09.bře.2006 v 17:00
(defun c:tk ()
  (initget "CY EP HYP EV ARCH  ")
  (setq word (getkword "Zadejte druh krivky:(CYkloida EPicykloida HYPocykloida EVolventa

ARCHimedova-spirála)"))
  (cond ((= word "CY")   (setq r(getreal"poloměr tvořící kružnice:"))
         &nbs p;         &nbs p;     (setq d(getreal"vzdálenost bodu:"))
         &nbs p;         &nbs p;     (setq pocet (getreal"Zadejte pocet cyklu:"))
         &nbs p;         &nbs p;     (setq t1 0)
         &nbs p;         &nbs p;     (setq t2 (* (pocet) 2. Pi))
         &nbs p;         &nbs p;     (setq int (/ (- t2 t1) 100.0))
         &nbs p;         &nbs p;     (setq bod(getpoint"Zadejte počáteční bod odvalovací úsečky:"))
         &nbs p;         &nbs p;     (setq a t1)
         &nbs p;         &nbs p;     (setq x (-(* r a)(* d (sin a))))
         &nbs p;         &nbs p;     (setq y (- r (* d (cos a))))        & nbsp;        
         &nbs p;         &nbs p;     (setq x (+ x (car bod)))
         &nbs p;         &nbs p;     (setq y (+ y (cadr bod)))
         &nbs p;         &nbs p;     (command "bod" (list x y))
         &nbs p;         &nbs p;         (repeat 100
         &nbs p;         &nbs p;         &nbs p;   (setq a (+ int a))
         &nbs p;         &nbs p;         &nbs p;   (setq x (-(* r a)(* d (sin a))))
         &nbs p;         &nbs p;         &nbs p;   (setq y (- r(* d(cos a))))
         &nbs p;         &nbs p;         &nbs p;   (setq x (+ x (car bod)))
         &nbs p;         &nbs p;         &nbs p;   (setq y (+ y (cadr bod)))
         &nbs p;         &nbs p;         &nbs p;   (command "úsečka" "@" (list x y) "")
         &nbs p;         &nbs p;         &nbs p;         &nbs p;  )
         &nbs p;         &nbs p;     (command "regen")
          &n bsp;          (setq part 1))

         ((= word "EP")  (setq a(getreal"Zadejte poloměr pevné kružnice:"))
         &nbs p;         &nbs p;     (setq b(getreal"Zadejte poloměr kutálející se kružnice:"))
         &nbs p;         &nbs p;     (setq pocet (getreal"Zadejte pocet cyklu:"))
         &nbs p;         &nbs p;     (setq bod (getpoint"Zadejte bod"))
         &nbs p;         &nbs p;     (setq t1 0)       
         &nbs p;         &nbs p;     (setq t2 (* (pocet) 2. Pi))
         &nbs p;         &nbs p;     (setq int (/ (- t2 t1) 100.0))
         &nbs p;         &nbs p;     (setq c t1)
         &nbs p;         &nbs p;     (setq x (-(* (+ a b) (cos c))(* b( cos (* (/ (+ a b) b) c)))))
         &nbs p;         &nbs p;     (setq y (-(* (+ a b) (sin c))(* b( sin (* (/ (+ a b) b) c)))))
         &nbs p;         &nbs p;     (setq x (+ x (car bod)))
         &nbs p;         &nbs p;     (setq y (+ y (cadr bod)))
         &nbs p;         &nbs p;     (command "_POINT" (list x y))
         &nbs p;         &nbs p;       (repeat 100  
         &nbs p;         &nbs p;         (setq c (+ int c))
         &nbs p;         &nbs p;         (setq x (-(* (+ a b) (cos c))(* b( cos (* (/ (+ a b) b) c)))))
         &nbs p;         &nbs p;         (setq y (-(* (+ a b) (sin c))(* b( sin (* (/ (+ a b) b) c)))))
         &nbs p;         &nbs p;         (setq x (+ x (car bod)))
         &nbs p;         &nbs p;          (s etq y (+ y (cadr bod)))
         &nbs p;         &nbs p;         (command "úsečka" "@" (list x y) "")
         &nbs p;         &nbs p;         &nbs p;        )
         &nbs p;         &nbs p;      (command "_CIRCLE" (list (car bod) (cadr bod)) a)
         &nbs p;         &nbs p;      (command "regen")
          &n bsp;         &n bsp; (setq part 2))

    ((= word "HYP")  (setq a(getreal"Zadejte poloměr pevné kružnice:"))
         &nbs p;         &nbs p;     (setq b(getreal"Zadejte poloměr kutálející se kružnice:"))
         &nbs p;         &nbs p;     (setq pocet (getreal"Zadejte pocet cyklu:"))
         &nbs p;         &nbs p;     (setq bod (getpoint"Zadejte bod:"))
         &nbs p;         &nbs p;     (setq t1 0)       
         &nbs p;         &nbs p;     (setq t2 (* (pocet) 2. PI))
         &nbs p;         &nbs p;     (setq int (/ (- t2 t1) 100.0))
         &nbs p;         &nbs p;     (setq c t1)
         &nbs p;         &nbs p;     (setq x (+(* (- a b) (cos c))(* b( cos (* (/ (- a b) b) c)))))
         &nbs p;         &nbs p;     (setq y (-(* (- a b) (sin c))(* b( sin (* (/ (- a b) b) c)))))
         &nbs p;         &nbs p;     (setq x (+ x (car bod)))
         &nbs p;         &nbs p;     (setq y (+ y (cadr bod)))
         &nbs p;         &nbs p;     (command "_POINT" (list x y))
         &nbs p;         &nbs p;       (repeat 100  
         &nbs p;         &nbs p;         (setq c (+ int c))
         &nbs p;         &nbs p;         (setq x (+(* (- a b) (cos c))(* b( cos (* (/ (- a b) b) c)))))
         &nbs p;         &nbs p;         (setq y (-(* (- a b) (sin c))(* b( sin (* (/ (- a b) b) c)))))
         &nbs p;         &nbs p;         (setq x (+ x (car bod)))
         &nbs p;         &nbs p;         (setq y (+ y (cadr bod)))
         &nbs p;         &nbs p;      (command "úsečka" "@" (list x y) "")
         &nbs p;         &nbs p;         &nbs p;      )
         &nbs p;         &nbs p;      (command "_CIRCLE" (list (car bod) (cadr bod)) a)
         &nbs p;         &nbs p;      (command "regen")
          &n bsp;         &n bsp; (setq part 3))

       ((= word "EV")     (setq r (getreal"Zadejte poloměr:"))
         &nbs p;         &nbs p;      (setq d (getreal"Zadejte průměr:"))
         &nbs p;         &nbs p;      (setq pocet (getreal"Zadejte pocet cyklu:"))
         &nbs p;         &nbs p;      (setq bod (getpoint"Zadejte bod:"))
         &nbs p;         &nbs p;      (setq t1 0)
         &nbs p;         &nbs p;      (setq t2 (* (pocet) 2. PI))
         &nbs p;         &nbs p;      (setq int (/(- t2 t1) 100.0))
         &nbs p;         &nbs p;      (setq c t1)
         &nbs p;         &nbs p;      (setq x  (+(*(+ r d) (cos c)) (* (* r c) (sin c))))
         &nbs p;         &nbs p;      (setq y  (-(*(+ r d) (sin c)) (* (* r c) (cos c))))
         &nbs p;         &nbs p;      (setq x (+ x (car bod)))
         &nbs p;         &nbs p;      (setq y (+ y (cadr bod)))
         &nbs p;         &nbs p;      (command "_POINT" (list x y))
         &nbs p;         &nbs p;        (repeat 100
         &nbs p;         &nbs p;          (s etq c (+ int c))
         &nbs p;         &nbs p;          (s etq x  (+(*(+ r d) (cos c)) (* (* r c) (sin c))))
         &nbs p;         &nbs p;          (s etq y  (-(*(+ r d) (sin c)) (* (* r c) (cos c))))
         &nbs p;         &nbs p;          (s etq x (+ x (car bod)))
         &nbs p;         &nbs p;          (s etq y (+ y (cadr bod)))
         &nbs p;         &nbs p;          (c ommand "úsečka" "@" (list x y) "")
         &nbs p;         &nbs p;         &nbs p;          )
         &nbs p;         &nbs p;      (command "regen")
          &n bsp;         &n bsp; (setq part 4))
    
    ((= word "ARCH")   (setq r(getreal"Zadejte poloměr Archimedovy spirály:"))
         &nbs p;         &nbs p;       (setq pocet (getreal"Zadejte pocet cyklu:"))
         &nbs p;         &nbs p;       (setq bod (getpoint"Zadejte bod:"))
         &nbs p;         &nbs p;       (setq t1 0)
         &nbs p;         &nbs p;       (setq t2 (* (pocet) 2. PI))
         &nbs p;         &nbs p;       (setq int (/(- t2 t1) 100.0))
         &nbs p;         &nbs p;       (setq c t1)
         &nbs p;         &nbs p;       (setq x (* (* r c) (sin c)))
         &nbs p;         &nbs p;       (setq y (* (* r c) (cos c)))
         &nbs p;         &nbs p;       (setq x (+ x (car bod)))
         &nbs p;         &nbs p;       (setq y (+ y (cadr bod)))
         &nbs p;         &nbs p;       (command "_POINT" (list x y) )
         &nbs p;         &nbs p;         (repeat 100
         &nbs p;         &nbs p;         &nbs p; (setq c (+ int c))
         &nbs p;         &nbs p;         &nbs p; (setq x (* (* r c) (sin c)))
         &nbs p;         &nbs p;         &nbs p; (setq y (* (* r c) (cos c)))
         &nbs p;         &nbs p;         &nbs p; (setq x (+ x (car bod)))
         &nbs p;         &nbs p;         &nbs p; (setq y (+ y (cadr bod)))
         &nbs p;         &nbs p;         &nbs p; (command "úsečka" "@" (list x y) "")
         &nbs p;         &nbs p;         &nbs p;         &nbs p; )
         &nbs p;         &nbs p;       (command "regen")
          &n bsp;         &n bsp;  (setq part 5))


   
    (T (prompt "Chyba:nevybral jste žádnou křivku!!!"))
    )
)

 



zatim mám tohle...tedak nevim jestli je to správně protože jsem to  upravoval  v textáku ...
Zpět nahoru
Honzicek Zobrazit panel
Diskutér
Diskutér

Přihlášen: 27.úno.2006
Stav: Offline
Bodů: 32
Přímý odkaz na tuto zprávu Zasláno: 10.bře.2006 v 09:59

oprava:

(defun c:tk ()
  (initget "CY EP HYP EV ARCH  ")
  (setq word (getkword "Zadejte druh krivky:(CYkloida EPicykloida HYPocykloida EVolventa ARCHimedova-spirála)"))
  (cond ((= word "CY")   (setq r(getreal"poloměr tvořící kružnice:"))
                           (setq d(getreal"vzdálenost bodu:"))
                           (setq pocet (getreal"Zadejte pocet cyklu:"))
                   (setq bod(getpoint"Zadejte počáteční bod odvalovací úsečky:"))
                   (command "úsečka" (list (car bod) (cadr bod)) (list (* (car bod) 1.2) (cadr bod)) "")         &nb sp; 
                           (setq t1 0)
                           (setq t2 (* pocet Pi))
                           (setq int (/ (- t2 t1) 100.0))
                           (setq a t1)
                           (setq x (-(* r a)(* d (sin a))))
                           (setq y (- r (* d (cos a))))         & nbsp;      
                           (setq x (+ x (car bod)))
                           (setq y (+ y (cadr bod)))
                           (command "bod" (list x y))
                               (repeat 100
                                   (setq a (+ int a))
                                   (setq x (-(* r a)(* d (sin a))))
                                   (setq y (- r(* d(cos a))))
                                   (setq x (+ x (car bod)))
                                   (setq y (+ y (cadr bod)))
                                   (command "úsečka" "@" (list x y) "")
                                              )
                           (command "regen")
                   (setq part 1))

         ((= word "EP")  (setq a(getreal"Zadejte poloměr pevné kružnice:"))
                           (setq b(getreal"Zadejte poloměr kutálející se kružnice:"))
                           (setq pocet (getreal"Zadejte pocet cyklu:"))
                           (setq bod (getpoint"Zadejte bod"))
                           (setq t1 0)      
                           (setq t2 (* pocet Pi))
                           (setq int (/ (- t2 t1) 100.0))
                           (setq c t1)
                           (setq x (-(* (+ a b) (cos c))(* b( cos (* (/ (+ a b) b) c)))))
                           (setq y (-(* (+ a b) (sin c))(* b( sin (* (/ (+ a b) b) c)))))
                           (setq x (+ x (car bod)))
                           (setq y (+ y (cadr bod)))
                           (command "_POINT" (list x y))
                             (repeat 100 
                               (setq c (+ int c))
                               (setq x (-(* (+ a b) (cos c))(* b( cos (* (/ (+ a b) b) c)))))
                               (setq y (-(* (+ a b) (sin c))(* b( sin (* (/ (+ a b) b) c)))))
                               (setq x (+ x (car bod)))
                                (setq y (+ y (cadr bod)))
                               (command "úsečka" "@" (list x y) "")
                                         )
                            (command "_CIRCLE" (list (car bod) (cadr bod)) a)
                            (command "regen")
                     (setq part 2))

 ((= word "HYP")  (setq a(getreal"Zadejte poloměr pevné kružnice:"))
                           (setq b(getreal"Zadejte poloměr kutálející se kružnice:"))
                           (setq pocet (getreal"Zadejte pocet cyklu:"))
                           (setq bod (getpoint"Zadejte bod:"))
                           (setq t1 0)      
                           (setq t2 (* pocet PI))
                           (setq int (/ (- t2 t1) 100.0))
                           (setq c t1)
                           (setq x (+(* (- a b) (cos c))(* b( cos (* (/ (- a b) b) c)))))
                           (setq y (-(* (- a b) (sin c))(* b( sin (* (/ (- a b) b) c)))))
                           (setq x (+ x (car bod)))
                           (setq y (+ y (cadr bod)))
                           (command "_POINT" (list x y))
                             (repeat 100 
                               (setq c (+ int c))
                               (setq x (+(* (- a b) (cos c))(* b( cos (* (/ (- a b) b) c)))))
                               (setq y (-(* (- a b) (sin c))(* b( sin (* (/ (- a b) b) c)))))
                               (setq x (+ x (car bod)))
                               (setq y (+ y (cadr bod)))
                            (command "úsečka" "@" (list x y) "")
                                      )
                            (command "_CIRCLE" (list (car bod) (cadr bod)) a)
                            (command "regen")
                     (setq part 3))

       ((= word "EV")     (setq r (getreal"Zadejte poloměr:"))
                            (setq d (getreal"Zadejte průměr:"))
                            (setq pocet (getreal"Zadejte pocet cyklu:"))
                            (setq bod (getpoint"Zadejte bod:"))
                            (setq t1 0)
                            (setq t2 (* pocet PI))
                            (setq int (/(- t2 t1) 100.0))
                            (setq c t1)
                            (setq x  (+(*(+ r d) (cos c)) (* (* r c) (sin c))))
                            (setq y  (-(*(+ r d) (sin c)) (* (* r c) (cos c))))
                            (setq x (+ x (car bod)))
                            (setq y (+ y (cadr bod)))
                            (command "_POINT" (list x y))
                              (repeat 100
                                (setq c (+ int c))
                                (setq x  (+(*(+ r d) (cos c)) (* (* r c) (sin c))))
                                (setq y  (-(*(+ r d) (sin c)) (* (* r c) (cos c))))
                                (setq x (+ x (car bod)))
                                (setq y (+ y (cadr bod)))
                                (command "úsečka" "@" (list x y) "")
                                            )
                            (command "regen")
                     (setq part 4))
 
 ((= word "ARCH")   (setq r(getreal"Zadejte poloměr Archimedovy spirály:"))
                             (setq pocet (getreal"Zadejte pocet cyklu:"))
                             (setq bod (getpoint"Zadejte bod:"))
                             (setq t1 0)
                             (setq t2 (* pocet PI))
                             (setq int (/(- t2 t1) 100.0))
                             (setq c t1)
                             (setq x (* (* r c) (sin c)))
                             (setq y (* (* r c) (cos c)))
                             (setq x (+ x (car bod)))
                             (setq y (+ y (cadr bod)))
                             (command "_POINT" (list x y) )
                               (repeat 100
                                 (setq c (+ int c))
                                 (setq x (* (* r c) (sin c)))
                                 (setq y (* (* r c) (cos c)))
                                 (setq x (+ x (car bod)))
                                 (setq y (+ y (cadr bod)))
                                 (command "úsečka" "@" (list x y) "")
                                             )
                             (command "regen")
                      (setq part 5))


 
 (T (prompt "Chyba:nevybral jste žádnou křivku!!!"))
 )
)

 

 

 

Zpět nahoru

Pro technickou podporu CAD
kontaktujte Helpdesk

Příbuzné CAD tipy:
Tip 2412:Jak v Inventoru nakreslit evolventu, cykloidu, řetězovku či jinou křivku?


 Odpovědět Odpovědět Stránka  <12 archiv

Přejít na fórum Oprávnění fóra Zobrazit panel



Stránka byla vygenerována za 1,265 sekund.