From: Pedro T. <pt...@te...> - 2003-12-18 10:06:15
|
El Jueves, 18 de Diciembre de 2003 02:07, a Paul Kienzle se le ocurri=F3 d= ecir=20 lo siguiente: > > Instead of doing that, we might return a cell array instead of a > > matrix when > > non simplicial facets are found. For instance, the following result: > >. . . . . . . . . . . . > > would be represented in Octave like this: > > > > A =3D {[3 4 2 1], > > [7 4 3], > > [5 7 3 1], > > [4 6 2], > > [6 7 5], > > [7 6 4], > > [6 5 1 2]} > > > > > > (Notice that vertex indices in Octave start at 1 instead of zero.) > > > > I do not know how backward incompatible would be such a change. > > I think the most convenient would be to return a cell-array of > matrices, one > for each dimension of returned facet. I don't understand this. Each of these matrices would contain an unique num= ber=20 referecing a vertex?. > > I think it would also be convenient if the default were to arbitrarily > split > those facets that are non-simplicial so that those who just want > triangles > don't have to deal with the occasional square. I'm guessing that this > is > > what matlab does --- convhulln returns this for the cube: > >> convhulln(cube) > > ans =3D > > 3 4 1 > 4 2 1 > 2 4 6 > 2 5 1 > 5 2 6 > 7 5 6 > 4 7 6 > 7 4 3 > 7 3 1 > 5 7 1 > This is what Qt is supposed to do. QJ also does it although using some othe= r=20 method (joggling vertices until only simplicial facets are found). Anyway Q= t=20 option is not working under octave. Is it just my case? > > So long as the default all-simplicial case is returned as a matrix, > backward > compatibility doesn't matter. The user will need special code to > handle the > non-simplicial facets anyway. Ok on that. > Are these two cases different enough that we need different functions? > > I think you are going to need an interface layer above the QHull options > so that users can ask for them nicely: > > [X,Y,Z] =3D convhulln(cube,'output',{'simplicial','ideal','geomview'}) > > This says that X will contain the simplicial output (as a full matrix), > Y will contain a cell array of facet sizes, and Z will contain a string > used to control geomview. The default for output must be 'simplicial' > for compatibility. > > That means you will need other options for controlling the QHull > algorithm, > such as 'qhull','QJ' to feed a raw option string, or if you are feeling > creative, meaningful names for all the options. I think so.=20 In fact. Maybe we should use convhulln for matlab compatibility if this is = an=20 issue. Some of the important info that I think should be accesible from=20 octave is stored in qh struct in qhull. What I mean is: - A polyhedron is just an ordered list of facets. - A facet should contain: - id number - normals and offset (hyperplane supporting the facet) - area - set of vertices (n if simplicial, >n if non-simplicial) - set of neighbours (again n if simplicial...). Here's the need for the = id. - set of ridges. (?) I don't know how difficult this is but it looks like in the same=20 =46ORALLfacets{} loop the above can be retrieved and written to octave. Regards, Pedro |