From: mgsloan <mg...@gm...> - 2007-04-14 23:14:36
|
> > > Sounds good! Yeah, one thing that might be nice would be an algorithm > to > > find combinable, adjacent segments, and do combine them. Hopefully it > can > > be written in such a way that it works for both 1d and 2d (eg, write 1d > > accuracy and combination algos, then do a 1d and 2d optimizer). > > Compute the all the left and right derivative on the edge and if they are > sufficiently equal, the curves are sufficiently equal. That's what I thought at first, however, I'm not sure how that interacts with combining sbasis. This would mean that any C0, C1 pw could be a single sbasis. This may indeed be possible, however, we will need to do some cost weighing in the function - a combination isn't valuable if it produces a large coefficient count while reducing precision. > Sounds like most of that is yours/jfs domain. As for the compose with > > periodics, first off, we'd need a periodics class which stores offset, > > period, and a pw or an sb for the period. Given a portion operation > which > > returns a pw of an interval of the periodic, composing (periodic . pw) > would > > become (pw . pw). Composing (pw . periodic) would result in a periodic, > and > > would essentially be the inner sb/pw composed with the first pw. So, I > > think periodic stuff can be managed fairly quickly. They allow fairly > easy > > segment count explosion, though, if you go high-frequency and compose > with a > > pw. > > Right, the main value is for things like wiggles, which are periodic. The > other discus-ed idea was lazy sbs such as pseudo-random, perlin, most > higher functions (sqrt, e.g.) etc. Lazy pw<sb>s are hard. Maybe for 2geom scala. The nice thing about having a periodic class like this is that you can control what can be done with periodics - you can't perform an operation on two periodics (might have nearly irrational period ratios), you can't cast periodics to anything else. All it can do is render itself useful to something finite. There are still problems though. Lets say, pw + periodic. Outside the pw's intended domain, the periodicity will dissapear. Anyway, progress report: Completed - define a plotter function for d2<pw<sb>> and pw<d2<sb>> (for toys/tests) I've also done half of some of the other ones, like d2pw bridges and pw/d2pw bounds. I've modified Pw's concat to hopefully deal with emptys gracefully, however, it is untested. Oh, and now interval's functions look like this: Interval::unionWith(Interval) unify(Interval, Interval) intersect(Interval, Interval) Hopefully at some point rect will mostly be replaced by D2<Interval> -mgsloan |