|
From: Michael S. <m-s...@us...> - 2005-09-28 11:19:21
|
On 28.09.05, Andre Wobst wrote: > Hi, > > On 28.09.05, André Wobst wrote: > > allow pathitem append on empty normpath > > ... > > ! if self.normsubpaths: > > ! context = path.context(*(self.normsubpaths[-1].atend_pt() + > > ! self.normsubpaths[-1].atbegin_pt())) > > ! item.updatenormpath(self, context) > > ! else: > > ! self.normsubpaths = item.createnormpath(self).normsubpaths > > There is an interesting misfeature in the normpath: We can descripe a > path without a currentpoint, which is not empty. This is done by an > empty normsubpath (neither having any normsubpathitems nor a > skippedline) used as the last normsubpath in a normpath. In PostScript > you can't describe such a path. Only a completely empty path doesn't > have a currentpoint. > > There are several options here: > > 1) We can ignore that. (But the code fragment shown above will fail > when adding a pathitem to such a normpath (=self).) > > 2) We can forbid to have an empty normsubpath as the last normpath > except when we have only a single normsubpath, i.e. the path is > still completely empty. > > 3) Any normsubpath should have a currentpoint (or a movetopoint or a > staringpoint or whatever you name it). We would not need the trick > with the zero-length skippedline for descriping a moveto anymore. > I'm +1 for option 3. Note that this implies, that an empty path cannot > contain any normsubpath anymore. Not even an empty one, since there > are no real "empty" normsubpaths anymore, since they at least have > a movetopoint. A clear -1 from me for option 3. Just because of what you say: > This also makes it impossible to build a normsubpath by > first creating an empty one and then filling it with normsubpathitems. > This might be unhandy. Especially for deformers, ... where new normpaths are built. It is a very convenient feature of the normpaths that the can be built in a loop without always testing if it has been created already. This is what made the smoother e.g. unreadable. On the level of normsubpaths, which are used internally I would like to keep the creation procedure with an emtpy normsubpath. On the level of normpaths, this could be different. What about forbidding to _add_ an empty normsubpath to a normpath? Then, the question if self.normsubpaths: really does what you expect it to do. The creation of a normpath reads then: 1. create an empty normpath 2. create the normsubpaths in a loop 2a add them if they are not empty Alltoghether, this is a little weaker than your option 2 which gets a +1 from me. 4) Another possiblity would be a self.good() which tests each normsubpath for filling (-1 from me because it will be sloooooow) > Last but not least we should take into account, > that the epsilon is a feature of a normsubpath. In order to set the > epsilon we would also need to set the starting point either by passing > some normsubpathitems or by setting it explicitly (as a moveto would > do it instead of using the skippedline-trick). Michael. -- "A mathematician is a device for turning coffee into theorems" Paul Erdös. |