Freerefill Posted June 15, 2009 Posted June 15, 2009 Another odd request. I have a need to draw a circle (or any part of one, that is to say, a circular arc), but one not of an object. I'd like to draw it using vectors so that I can redraw and update the math which created it, so if I, for example, zoom or pan, the circle will update to the new location (suppose I wanted a circle in the center of the screen at a certain size to stay there, as it appears, regardless of how much I pan or zoom). The math I can do. What I'm stuck on is a circle comprised of vectors. My initial idea was to write a function with various inputs, specifically the precision of the circle, and draw it much like a polygon. It would not be a circle, but it would be "close enough." Since that method doesn't particularly sit well with me, I was hoping someone else might have an idea. Is it possible? Or do I have to create an entity and modify it? Also, I'm very interested in figuring out the meat of this by myself, so rather than code, I'd prefer hints or suggestions. Thank you all very much for anything you can do to help. ^.^ Quote
David Bethel Posted June 15, 2009 Posted June 15, 2009 Look into (grvecs) for graphics display only. -David Quote
Freerefill Posted June 15, 2009 Author Posted June 15, 2009 Ok, so I've spent the last hour googling for information on (grvecs) and "graphics display only" and I've gotten zip ^^' Everyone seems to think that just copying and pasting what's already in the Help file seems to be enough.. I gave it some thought. Would it involve a transform matrix, somehow? I'm thinking I could probably write something (ugh, it's been way too long since I did this sort of math) to transform the list of points from a Cartesian coordinate system into a Polar one. Or am I barking up the proverbial wrong tree? Quote
ronjonp Posted June 15, 2009 Posted June 15, 2009 Use a center point with polar, and increment the angle....I have a function for this if you want me to post it. Quote
Lee Mac Posted June 15, 2009 Posted June 15, 2009 I agree with Ron, I would normally use a (repeat 300), with an increment of (/ pi 150), which makes a pretty good circle. Quote
Freerefill Posted June 15, 2009 Author Posted June 15, 2009 Ah, so it does have to be broken up into individual vectors.. Here's what I came up with. Not terribly clean, I'm sure.. but it works: (defun grcircle( / ); ; Create a circle using grvecs and input (setq cenPt (getpoint "\nSelect point: ") radius (* 0.05 (getvar "viewsize")) strAng 0.0 endAng 135.0 percis 1.0 polLst nil ) (repeat (fix (/ (- endAng strAng) perCis)) (setq polLst (append polLst (list 7 (polar cenPt (* strAng (/ pi 180)) radius) (polar cenPt (* (+ strAng percis) (/ pi 180)) radius)))) (setq strAng (+ strAng percis)) ) (grvecs polLst) ) Obviously, most of the stuff in the (setq) is going to be tossed in as a passed variable.. this is just to get it started. Quote
Lee Mac Posted June 15, 2009 Posted June 15, 2009 Check this: http://www.cadtutor.net/forum/showpost.php?p=243926&postcount=25 Quote
Commandobill Posted June 16, 2009 Posted June 16, 2009 Check this: http://www.cadtutor.net/forum/showpost.php?p=243926&postcount=25 Lee do you watch Family Guy? Quote
David Bethel Posted June 16, 2009 Posted June 16, 2009 Also, I'm very interested in figuring out the meat of this by myself, so rather than code, I'd prefer hints or suggestions. ^.^ Everyone seems to think that just copying and pasting what's already in the Help file seems to be enough.. ..................... -David Quote
Lee Mac Posted June 16, 2009 Posted June 16, 2009 Lee do you watch Family Guy? On occassion... why? Quote
Lee Mac Posted June 16, 2009 Posted June 16, 2009 Also, I'm very interested in figuring out the meat of this by myself, so rather than code, I'd prefer hints or suggestions. Oops! Quote
Commandobill Posted June 16, 2009 Posted June 16, 2009 On occassion... why? Cause your last post that i quoted reminded me of the british drive by... lol 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.