def _create_mesh(self):
log.debug('Creating mesh for box primitive')
box = self._unit_box
vertices, faces, normals = box.vertices, box.faces, box.face_normals
vertices = points.transform_points(vertices * self.box_extents,
self.box_transform)
normals = np.dot(self.box_transform[0:3,0:3],
normals.T).T
aligned = windings_aligned(vertices[faces[:1]], normals[:1])[0]
if not aligned:
faces = np.fliplr(faces)
# for a primitive the vertices and faces are derived from other information
# so it goes in the cache, instead of the datastore
self._cache['vertices'] = vertices
self._cache['faces'] = faces
self._cache['face_normals'] = normals
评论列表
文章目录