Mike55 Posted June 25, 2020 Posted June 25, 2020 If you have some time I could use some help. I'm make an auger. I can't get past this see attachments. Looking at A. Is drawn with Lisp. B. Is a block made form A and laid down flat by hand not using lisp for a reference. C. Is what I would like to make to mach B but only using A for reference. D. The 0.1729 and the 0.5358 are out of reach? I can find the information to make the bottom triangle, but can not find the information for the top triangle? I know I can swing arcs but I do not want to pause the program to get outside help, I would like to just use lisp if I can. Thank's (defun c:18 (/) (setvar "osmode" 0) (setq odima 6.0) (setq idimb 1.0) (setq dro 6.0) (setq nos 12) (setq sp (list 25 25)) (setq hig (/ dro nos)) (setq nhig (- hig(* hig 2))) (setq stside (/(- odima idimb)2)) (setq nos (+ nos 0.0)) (setq nosang (/ 360 nos)) (setq angfs (- 360 nosang)) (setq nosangr (*(/ pi 180) nosang)) (command ".circle" sp (/ idimb 2)) (command "_.zoom" "all") (command "_.zoom" ".5x") (command ".line" (setq p1(polar sp 0 (/ idimb 2)))(setq p2(polar p1 0 stside))"") (command ".line" (setq p3(polar sp nosangr(/ idimb 2)))(setq p4(polar p3 nosangr stside))"") (command "_.move" "L" "" '(0 0 0)(list 0 0 hig)) (setq 3li (entlast)) (setq 3li (entget 3li)) (setq 3li10 (assoc 10 3li)) (setq 3li10 (cdr 3li10)) (setq 3li11 (assoc 11 3li)) (setq 3li11 (cdr 3li11)) (setq p11 (list p1 0.0)) (setq p22 (list p2 0.0)) (command "_.line" p2 3li11 p1 3li10 "") (setq p13 (distance p1 p3) p310 (sqrt(+(* p13 p13)(* hig hig)))) (setq p14 (distance p1 p4) p411 (sqrt(+(* p14 p14)(* hig hig)))) (setq p24d (distance p2 p4) p211 (sqrt(+(* p24d p24d)(* hig hig)))) (setq trl (-(car p2)(car p4))) (setq rsl (-(cadr p4)(cadr p2))) (setq sid1 (sqrt(+(* rsl rsl)(* hig hig)))) (setq p24l (sqrt(+(* trl trl)(* sid1 sid1)))) ;(command "_.rotate" "w" (polar sp (* pi 1.25)(+ idimb 16))(polar p4 (/ pi 6)(+ idimb 16)) "" sp angfs) ;(command "_move" "w" (polar sp (* pi 1.25)(+ idimb 16))(polar p4 (/ pi 6)(+ idimb 16))"" sp (list 50.0 50.0 nhig)) ;(command "_.line" p2 3li11 p1 3li10 "") ;(command "_.line" 3li10 3li11 "") (setq sp2 (polar sp 0 (* odima 2))) (setq cr24 (-(car p2)(car p4))) (setq cd42 (-(cadr p4)(cadr p2))) (setq sid1 (sqrt(+(* cd42 cd42)(* hig hig)))) (setq p24l (sqrt(+(* cr24 cr24)(* sid1 sid1)))) (setq cr13 (-(car p1)(car p3))) (setq cd31 (-(cadr p3)(cadr p1))) (setq sid2 (sqrt(+(* cr13 cr13)(* cd31 cd31)))) (setq p13l (sqrt(+(* sid2 sid2)(* hig hig)))) (command ".line" (setq a1(list 5 5))(setq a2 (polar a1 (* pi 1.5)cd31))(setq a3 (polar a2 0 cr13))"") (command ".erase" "l" "" ".erase" "l" "") (setq cr1 (car a1)) (setq cd1 (cadr a1)) (setq cr3 (car a3)) (setq cd3 (cadr a3)) (setq pa31 (angle (list cr3 cd3)(list cr1 cd1))) (command ".zoom" "w" (polar(polar sp2 (* pi 1.5)(+(/ odima 2)6))pi (+(/ odima 2)6)) (polar(polar sp2 (/ pi 2)(+(/ odima 2)6))0 (+(/ odima 2)6))) (command ".line" (setq p21(polar sp2 0 (/ idimb 2)))(setq p22 (polar p21 0 (/(- odima idimb) 2)))"") (command ".line" p22 (setq p24(polar(polar p22 pi cr24)(/ pi 2)sid1))p21"") ;(command ".line" p21 (setq p23(polar p21 pa31 p13l))p24 "") ;(command ".line" p21 (setq p23(polar(polar p21 pi cr13) p24 "") (setq p21(polar sp2 0 (/ idimb 2))) (setq p22 (polar p21 0 (/(- odima idimb) 2))) (setq crp1 (car p1)) (setq cdp1 (cadr p1)) (setq crp2 (car p2)) (setq cdp2 (cadr p2)) (setq crp4 (car p4)) (setq cdp4 (cadr p4)) (setq p4 (list crp4 cdp4 hig)) (command ".ucs" "3" p1 p2 p4) (setq angrs (angle(list crp2 cdp2)(list crp4 cdp4))) (setq angts (angle(list crp1 cdp1)(list crp4 cdp4))) (command ".ucs" "world") ;(command ".line" p22 (setq p24(polar p22 angrs p211))p21 "") ;(command ".zoom" "W" (polar sp (* pi 1.25) (+ idimb 2))(polar p2 (/ pi 2)(+ idimb 2))) (command ".zoom" "all" ) (princ) );end_defu Math1.dwg Quote
Stefan BMR Posted June 26, 2020 Posted June 26, 2020 You can use some math and lisp features to get rid of a lot of lines in your code. For example, instead of drawing a line at 0.0 elevation and then move it to hig, you can just calculate p3 as (setq p3 (polar (list (car sp) (cadr sp) hig) nosangr (/ idimb 2))) Next, p4 will follow the same elevation. Back to your problem, I guess the easiest way for you to calculate p23 is using UCS. At the beginning, set sp as 3Dpoint, otherwise everything is calculated in xOy plan (distances, angles) and you need 3d points for your 3d problem. (setq sp (list 25.0 25.0 0.0)) Add the next code in the end of your routine, exactly between ".ucs" and ".zoom" (command ".ucs" "world") (setq p3 (list (car p3) (cadr p3) hig) p4 (list (car p4) (cadr p4) hig) ) (command ".ucs" "3p" p1 p4 p3) (setq a (angle '(0 0 0) (trans p3 0 1))) (command ".ucs" "world") (setq p23 (polar p21 (+ (angle p21 p24) a) (distance p1 p3))) (command ".line" p21 p23 p24 "") (command ".zoom" "all" ) 1 Quote
BIGAL Posted June 26, 2020 Posted June 26, 2020 Is the answer in the formula for a helix ? The 3 points would be a 1-2 1st helix plus 1 2nd helix, then opposite 1-2 2nd helix plus 1 1st helix, 3d lines or can be pface as triangles are a face. "Helix" is a solids inbuilt command or are you fabricating from lots of pieces. used divide on a helix so can get "point"'. 1 Quote
Mike55 Posted June 26, 2020 Author Posted June 26, 2020 Stefan BMR: Thanks you are all over it! I just made one change from this (setq p23 (polar p21 (+ (angle p21 p24) a) (distance p1 p3))) to this (setq p23 (polar p21 (+ (angle p21 p24) a) p13l)) works grate. I would have had to use arcs and paused the program to get outside help to pick the intersection of the arcs. This is what I was looking for. Thanks BIGAL: Never used the "Helix" command I will have to look in to it. Thanks for your input. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.