On Aug 28, 8:45 am, "William Stein" <[EMAIL PROTECTED]> wrote:
> > 1) Better triangulations for many-vertex faces.  You either have to
> > work around the current behavior of indexed_face_set or change it.  I
> > have been trying to do the former in polyhedra.py, since then it only
> > impacts things in that module, but my current efforts are kind of
> > sad.  That's why .render_solid() is commented out in groebner_fan
> > right now.  My current effort tries to get a triangulation from random
> > lifting but I must be doing something stupid since it fails sometimes
> > on pretty small faces.
>
> Could you explain what "random lifting" is?

If you have a 2-D face with lots of vertices, you randomly add a third
coordinate to each vertex.  This 'lifted' 3D polytope should have
simplicial faces.  By choosing either the upper or lower faces of the
3D polytope, you should get a triangulation of the original 2D face
after projecting out the third coordinate.  My weak effort at this is
in the function triangulated_facial_incidences in sage/geometry/
polyhedra.py.

> > 1b) A 3D polygon command.  This could easily be built off of the
> > polyhedra code if the triangulation there was fixed.
> Could you clarify what is broken?  I didn't know that triangulation is
> broken.

If you look in plot/plot3d/index_face_set.pyx, I think the relevant
problem is in this code:

cdef inline format_pmesh_face(face_c face):
    cdef char ss[100]
    cdef Py_ssize_t r, i
    if face.n == 3:
        r = sprintf_5i(ss, "%d\n%d\n%d\n%d\n%d", face.n+1,
                                                 face.vertices[0],
                                                 face.vertices[1],
                                                 face.vertices[2],
                                                 face.vertices[0])
    elif face.n == 4:
        r = sprintf_6i(ss, "%d\n%d\n%d\n%d\n%d\n%d", face.n+1,
 
face.vertices[0],
 
face.vertices[1],
 
face.vertices[2],
 
face.vertices[3],
                                                     face.vertices[0])
    else:
        # Naive triangulation
        all = []
        for i from 1 <= i < face.n-1:
            r = sprintf_4i(ss, "4\n%d\n%d\n%d\n%d", face.vertices[0],
                                                    face.vertices[i],
                                                    face.vertices[i
+1],
                                                    face.vertices[0])
            PyList_Append(all, PyString_FromStringAndSize(ss, r))
        return "\n".join(all)
    # PyString_FromFormat is almost twice as slow
    return PyString_FromStringAndSize(ss, r)

...in which you see that for more than 4 vertices this routine assumes
that triangulation has already been done and the vertices have been
put in a certain order.  I'm not sure its 'broken' since it really
isn't triangulating at all, it assumes that has been done.

> I definitely don't want to maintain such an spkg, especially since if
> blender is any good as a project (and it is!) then one should be
> able to easily install it on ones computer independent of Sage.
> Making an spkg should only be needed if we need to binary link
> Sage to a program, hence build it with special options, or the program
> has a relatively small user base and is hard to install (e.g., polymake,
> etc.).   For this application, can't one just write some data to a
> file and run blender as a subprocess.

What would be nice is if sage could use the python interface to
Blender.  Blender installs its own version of python, and I'm not sure
what the best way to deal with that is.

>
> Another way to make animation for a web browser would be
> to use javascript, though the timing might look jerky.  Another
> possibility is flash.

I am very ignorant about flash and would like to learn more.  Is there
a fully open-source option with flash?  What are good places/texts to
learn about that?

Cheers,
M. Hampton
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to