• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSBezierCurve and Line Width
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBezierCurve and Line Width


  • Subject: Re: NSBezierCurve and Line Width
  • From: Nicko van Someren <email@hidden>
  • Date: Fri, 3 Dec 2004 18:23:45 +0000

On 3 Dec 2004, at 16:22, Henry McGilton wrote:

Is there an easy way to do this? The code to create this using polygons is a little daunting, so I don't want to tackle it unless absolutely necessary.

A possible starting point is with the bezierPathByFlatteningPath method. Create a one-unit width path, then flatten it, and then draw lines either side of the flattened path, using a parameter to control the distance from the centre-line.

I'd be inclined to look into using this route. I'm not sure if it's the case in Quartz but in old PostScript rendering systems the stroking of a path was done by flattening the path and then constructing a new path of parallel line pairs and corner caps which was in turn filled. If you want to take a Bezier path and stroke it with a tapering brush stroke you would want to do the same save for not having the path segments each side of the flattened parts parallel.


The definitive work on doing fancy strokes on Bezier paths is a paper called "Skeletal Strokes" from SIGGRAPH '94 (I think) by Sui Chi (Alex) Hsu and the technology went on to be the foundation of the program Expression sold by Creature House (now owned by Microsoft). While the functionality of Expression is rather more than what you are looking for tracking down the old SIGGRAPH paper would be instructive. It's available on line if you are an ACM member.

	Cheers,
		Nicko

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSBezierCurve and Line Width (From: Jeff LaMarche <email@hidden>)
 >Re: NSBezierCurve and Line Width (From: Henry McGilton <email@hidden>)

  • Prev by Date: Re: Different versions of framework?
  • Next by Date: Re: compositing views into one window
  • Previous by thread: Re: NSBezierCurve and Line Width
  • Next by thread: Is this technically Feasible? - Drop location to be determined programmatically?
  • Index(es):
    • Date
    • Thread