Ejemplo n.º 1
0
	def centerRotate( self, xmlElement ):
		"Add a wedge center and rotate."
		wedgeCenter = evaluate.getVector3ByKey( 'wedgecenter', None, xmlElement )
		if wedgeCenter != None:
			self.loop.append( wedgeCenter )
		rotation = math.radians( evaluate.getEvaluatedFloatZero( 'rotation', xmlElement ) )
		rotation += evaluate.getEvaluatedFloatZero( 'rotationoverside', xmlElement ) * self.sideAngle
		if rotation != 0.0:
			planeRotation = euclidean.getWiddershinsUnitPolar( rotation )
			for vertex in self.loop:
				rotatedComplex = vertex.dropAxis() * planeRotation
				vertex.x = rotatedComplex.real
				vertex.y = rotatedComplex.imag
		if 'clockwise' in xmlElement.attributeDictionary:
			isClockwise = euclidean.getBooleanFromValue( evaluate.getEvaluatedValueObliviously( 'clockwise', xmlElement ) )
			if isClockwise == euclidean.getIsWiddershinsByVector3( self.loop ):
				self.loop.reverse()
Ejemplo n.º 2
0
def getSegmentLoop( close, loop, xmlElement ):
	"Get segment loop."
	path = evaluate.getPathByPrefix( getSegmentPathDefault(), 'segment', xmlElement )
	if path == getSegmentPathDefault():
		return loop
	path = getXNormalizedVector3Path( path )
	segmentCenter = evaluate.getVector3ByKey( 'segmentcenter', None, xmlElement )
	if euclidean.getIsWiddershinsByVector3( loop ):
		path = path[ : : - 1 ]
		for point in path:
			point.x = 1.0 - point.x
			if segmentCenter == None:
				point.y = - point.y
	segmentLoop = []
	for pointIndex in xrange( len( loop ) ):
		segmentLoop += getSegmentPath( loop, path, pointIndex, segmentCenter )
	return euclidean.getLoopWithoutCloseSequentialPoints( close, segmentLoop )