def openConvexFromVertList(vertices, name=None, description=None, path=None): if vertices: gfFigure = [vertices] + [[]] * len(vertices[0]) gfFigure = gf.figureConvexHullUpdate(gfFigure) gf.figureOpen(gfFigure) else: gf.close() if figureInfo: figureInfo.setNameDescPath(name, description, path)
def openConvexFromVertList(vertices, name=None, description=None, path=None): if vertices: gfFigure=[vertices]+[[]]*len(vertices[0]) gfFigure=gf.figureConvexHullUpdate(gfFigure) gf.figureOpen(gfFigure) else: gf.close() if figureInfo: figureInfo.setNameDescPath(name, description, path)
def createConvexObjFigure(vertices): import objFigure if vertices: gfFigure=[vertices]+[[]]*len(vertices[0]) gfFigure=gf.figureConvexHullUpdate(gfFigure) figures=objFigure.fromGfFigure(gfFigure) if len(figures)>1: figures=[f for f in figures if f.dim>0] if len(figures)!=1: raise RuntimeError("Unspecified error occurred") return figures.pop() else: return None
def createConvexObjFigure(vertices): import objFigure if vertices: gfFigure=[vertices]+[[]]*len(vertices[0]) gfFigure=gf.figureConvexHullUpdate(gfFigure) gfFigure[0]=vertices; # to avoid rounding, tuples will have the same hash as original figures=objFigure.fromGfFigure(gfFigure) if len(figures)>1: figures=[f for f in figures if f.dim>0] if len(figures)!=1: raise RuntimeError("Unspecified error occurred") return figures.pop() else: return None
def createConvexObjFigure(vertices): import objFigure if vertices: gfFigure = [vertices] + [[]] * len(vertices[0]) gfFigure = gf.figureConvexHullUpdate(gfFigure) gfFigure[0] = vertices # to avoid rounding, tuples will have the same hash as original figures = objFigure.fromGfFigure(gfFigure) if len(figures) > 1: figures = [f for f in figures if f.dim > 0] if len(figures) != 1: raise RuntimeError("Unspecified error occurred") return figures.pop() else: return None