• 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: How to trim a bezier path?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to trim a bezier path?


  • Subject: Re: How to trim a bezier path?
  • From: Scott Thompson <email@hidden>
  • Date: Wed, 7 Dec 2005 10:10:37 -0600


On Dec 7, 2005, at 8:50 AM, Jim Marschke wrote:

But that means every time I want to draw the path I have to recreate it. That can take a while when I have thousands of points -- and multiple paths. The path itself seems to be a great storage area, and when I resize I just do a transform rather than rebuilding. There are easy ways to append data to a path, I was hoping someone knew of a way to remove data.

Jim

More likely than not, it is a much better idea to recreate the path from the data every time.

Let's say you have 10,000 data points. It is the case that creating a path from those 10,000 points will take some time. However, since a wide monitor is only on the order of 1000 pixels wide, it is very unlikely that even if you were to display the path of 10,000 points that the user would be able to glean 10,000 points worth of useful information from seeing it drawn on the screen.

A much better strategy would be to filter the 10,000 points depending on how you plan to display them. In the example above, you could choose every 10th point, or average 10 points, or any of a number of other strategies to generate a path of only 1000 points.

For a path of 10,000 points, there are other considerations. When you draw a path, the drawing model guarantees that each pixel affected by the path will be drawn exactly once. This requires the computer to check the path for self intersections and such. In drawing a path of 10,000 points in a window that is 1000 pixels wide these calculations can yield very poor performance.

Reasons like these should help you to understand that the bezier path classes are not intended to be repositories for model data. In the long run, you will probably do yourself a favor by using the bezier classes for drawing, and managing your data yourself.

Scott

_______________________________________________
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
  • Follow-Ups:
    • Re: How to trim a bezier path?
      • From: Alastair Houghton <email@hidden>
References: 
 >How to trim a bezier path? (From: Jim Marschke <email@hidden>)
 >Re: How to trim a bezier path? (From: Scott Thompson <email@hidden>)
 >Re: How to trim a bezier path? (From: Jim Marschke <email@hidden>)

  • Prev by Date: Re: NSTableHeaderCell Woes...
  • Next by Date: Clearing Recent Items programmatically
  • Previous by thread: Re: How to trim a bezier path?
  • Next by thread: Re: How to trim a bezier path?
  • Index(es):
    • Date
    • Thread