Jump to content

Recommended Posts

Posted

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. ^.^

Posted

Look into (grvecs) for graphics display only. -David

Posted

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?

Posted

Use a center point with polar, and increment the angle....I have a function for this if you want me to post it.

Posted

I agree with Ron, I would normally use a (repeat 300), with an increment of (/ pi 150), which makes a pretty good circle.

Posted

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.

Posted

Check this:

http://www.cadtutor.net/forum/showpost.php?p=243926&postcount=25

Posted
Check this:

http://www.cadtutor.net/forum/showpost.php?p=243926&postcount=25

 

Lee do you watch Family Guy?

Posted

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

Posted
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! :oops:

Posted
On occassion... why?

 

 

Cause your last post that i quoted reminded me of the british drive by... lol

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...