def drawLine(self,p1x,p1y,p2x,p2y, layer,color='#000000'): ''' draw the white line in order to separate the sensors ''' path = Path() path.addNodeAtEnd(p1x,p1y) path.addNodeAtEnd(p2x,p2y) style = {'stroke' : str(color), 'stroke-width': self.gap, 'fill': 'none'} svgPath = inkex.etree.SubElement(layer, inkex.addNS('path','svg'), {'style': simplestyle.formatStyle(style)}) path.toSVG(svgPath)
def _polygonToPath(self, polygon): """ Internal convertion of a Shapely Polygon into a Path object. """ coords = polygon.exterior.coords.xy coordsX = coords[0] coordsY = coords[1] path = Path() for i in range(len(coordsX)): path.addNodeAtEnd(coordsX[i], coordsY[i]) return path