def _create_polygons(solid, face, color, polygons): vertices = [] for i in face.indices[:-1]: v = solid.vertices[i] vertices.append(CSG.Vector(v)) polygon = CSG.Polygon(vertices, False) polygon.shared = color polygons.append(polygon)
def _create_tri_polygon(solid, i0, i1, i2): # CSG.js (WebGL) では時計回りが表 p0 = solid.vertices[i0] p1 = solid.vertices[i1] p2 = solid.vertices[i2] vertices = [] vertices.append(CSG.Vector(p0)) vertices.append(CSG.Vector(p1)) vertices.append(CSG.Vector(p2)) return CSG.Polygon(vertices, False)