Beispiel #1
0
def commandCreateDual():
	figures=objFigure.fromGfFigure(gf.figureGet())
	for f in figures:
		if not check.isFigureConvex(f):
			raise RuntimeError("The figure is not convex")
	if figureInfo:
		name, desc = figureInfo.getNameDesc()
	figures=[createDual(f) for f in figures]
	gf.figureOpen(objFigure.toGfFigure(figures), True)
	if figureInfo:
		figureInfo.setNameDescPath("Dual of " + name, None)
def commandCreateDual():
	figures=objFigure.fromGfFigure(gf.figureGet())
	for f in figures:
		if not check.isFigureConvex(f):
			raise RuntimeError("The figure is not convex")
	if figureInfo:
		name, desc = figureInfo.getNameDesc()
	figures=[createDual(f) for f in figures]
	gf.figureOpen(objFigure.toGfFigure(figures), True)
	if figureInfo:
		figureInfo.setNameDescPath("Dual of " + name, None)
Beispiel #3
0
def commandCutFaces(dim=2, ratio=0.1):
	if ratio>=1 or ratio<=0:
		raise RuntimeError("Wrong ratio")
	figures=objFigure.fromGfFigure(gf.figureGet())
	for f in figures:
		if not check.isFigureConvex(f):
			raise RuntimeError("The figure is not convex")
	if figureInfo:
		name, desc = figureInfo.getNameDesc()
	figures2=[]
	for f in figures:
		figures2.extend(cutOffFacesDim(f, ratio, dim))
	gf.figureOpen(objFigure.toGfFigure(figures2), True)
	gf.clear()
	if dim==0:
		name = name + " with vertices cut off"
	elif dim==1:
		name = name + " with edges cut off"
	else:
		name = name + " with " + str(dim) + "-faces cut off"

	if figureInfo:
		figureInfo.setNameDescPath(name, None)