Changeset 7780:2a1ae37eaaae
- Timestamp:
- 12/14/07 17:11:47 (5 years ago)
- Branch:
- default
- Children:
- 7781:81debe531ffd, 7855:0fed8c25284d
- File:
-
- 1 edited
-
sage/plot/plot3d/index_face_set.pyx (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sage/plot/plot3d/index_face_set.pyx
r7779 r7780 128 128 face.vertices[0]) 129 129 else: 130 raise NotImplementedError, "pmesh doesn't support larger than quadrilaterals" # return join([str(face.vertices[i] + off) for i from 0 <= i < face.n] + []) 130 # Naive triangulation 131 all = [] 132 for i from 1 <= i < face.n-1: 133 r = sprintf_4i(ss, "4\n%d\n%d\n%d\n%d", face.vertices[0], 134 face.vertices[i], 135 face.vertices[i+1], 136 face.vertices[0]) 137 PyList_Append(all, PyString_FromStringAndSize(ss, r)) 138 return "\n".join(all) 131 139 # PyString_FromFormat is almost twice as slow 132 140 return PyString_FromStringAndSize(ss, r) … … 504 512 505 513 faces = [format_pmesh_face(self._faces[i]) for i from 0 <= i < self.fcount] 514 515 # If a face has more than 4 vertices, it gets chopped up in format_pmesh_face 516 cdef Py_ssize_t extra_faces = 0 517 for i from 0 <= i < self.fcount: 518 if self._faces[i].n >= 5: 519 extra_faces += self._faces[i].n-3 520 506 521 _sig_off 507 522 508 523 all = [str(self.vcount), 509 524 points, 510 str(self.fcount ),525 str(self.fcount + extra_faces), 511 526 faces] 512 527
Note: See TracChangeset
for help on using the changeset viewer.
