teknomatika Posted December 14, 2012 Share Posted December 14, 2012 What is the reason why the divisions are not always accurate? For example, 28 divisions? But with other dividers. I appreciate the explanation. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun DTR (A) (* PI (/ A 180.0)) ) (defun c:STA (/ nr len ang ang1 pc1 pc2 ) (setq nr (getint "\n Nr. Divisions? ")) (setq len (getdist "\n Segments Length? ")) (setq ang (/ 360 nr)) (setq ang1 (dtr 0)) (setq pc1 (getpoint "\n Central Point: ")) (setq pc2 (polar pc1 ang1 len)) (command "_.line" "_non" pc1 "_non" pc2 "") (repeat nr (setq ang1 (+ ang1 ang)) (setq pc2 (polar pc1 (dtr ang1) len)) (command "_.line" "_non" pc1 "_non" pc2 "") ) (princ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 14, 2012 Share Posted December 14, 2012 Could it have anything to do with the setting of units > precision? Quote Link to comment Share on other sites More sharing options...
MSasu Posted December 14, 2012 Share Posted December 14, 2012 Please pay atention that by dividing two integers the result will be rounded. This will fix your code: (setq ang (/ 360[color=red].0[/color] nr)) Quote Link to comment Share on other sites More sharing options...
teknomatika Posted December 14, 2012 Author Share Posted December 14, 2012 In fact, it seems solved. ReMark and MSasu Thanks for the help. Quote Link to comment Share on other sites More sharing options...
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.