コード例 #1
0
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)
コード例 #2
0
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)
コード例 #3
0
ファイル: gfUtils.py プロジェクト: Zereges/geometric-figures
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
コード例 #4
0
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
コード例 #5
0
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