MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Drawing and Filling closed objects of arbitrary shape?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38175] RE: [mg38114] Drawing and Filling closed objects of arbitrary shape?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Wed, 4 Dec 2002 03:25:22 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

AES,

You do have to make complex, so to speak, polygons but is is easy to do. You
can't use the Circle or Disk primitives because you can't split them where a
Line might intersect. You have to set up a parametrized circle. You have to
find the intersection points with the line to determine the arc you want to
draw. If you have the arc, Polygon will fill it, and by duplicating the
first point at the end, you can outline the area with a Line.

My DrawGraphics package has a StitchLineSegments routine for connecting
together line segments drawn by various plot routines. There is an example
in the DrawGraphics Help under StitchLineSegments that show how to make a
filled area bounded by several curves. There is also a DrawingTransform
routine that could be used to move "standard" lens patterns into a more
general position. You could easily write your own routines that perform
these function.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/



From: AES/newspost [mailto:siegman at stanford.edu]
To: mathgroup at smc.vnet.net

I'm drawing various closed objects of arbitrary shape (thick lenses, for
example) using sequences of Lines and segments of Circles (arcs), and
then would like to Fill them with a specified color.  How to do the Fill?

(I suppose I could do this as a very complex polygon, replacing the arcs
by many short line segments and building up the whole object as a
lengthy list of points; but that seems like a pain.)


"Power tends to corrupt.  Absolute power corrupts absolutely."
    Lord Acton (1834-1902)
"Dependence on advertising tends to corrupt.  Total dependence
    on advertising  corrupts totally." (today's equivalent)



  • Prev by Date: Re: solve
  • Next by Date: Re: Re: copying cells in Mathematica 4.2
  • Previous by thread: Re: function composition
  • Next by thread: Levemberg