當前位置: 首頁>>代碼示例>>Python>>正文


Python Polygon.setTolerance方法代碼示例

本文整理匯總了Python中Polygon.setTolerance方法的典型用法代碼示例。如果您正苦於以下問題:Python Polygon.setTolerance方法的具體用法?Python Polygon.setTolerance怎麽用?Python Polygon.setTolerance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Polygon的用法示例。


在下文中一共展示了Polygon.setTolerance方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: line2pointIntersection

# 需要導入模塊: import Polygon [as 別名]
# 或者: from Polygon import setTolerance [as 別名]
from mrpolygons import mrpolygon, scalePolygon, polarPolygon2cartesian, transportPolygonGeometry, transportPolygon
import Polygon
Polygon.setTolerance(1e-3)
from Polygon import Polygon
from Polygon.Utils import fillHoles, prunePoints, reducePoints
import numpy
import os
import sys
import imp
from contiguity import weightsFromAreas

def line2pointIntersection(line,point,tol):
    if line.distance(point) < tol:
        return point
    else:
        return None

def line2mpointsIntersection(line,mpoints,tol):
    result = []
    for point in mpoints:
        if line2pointIntersection(line,point,tol) != None:
            result.append(point)
    if len(result) >= 2:
        intersection = result.sort(key=lambda x: Point(line.coords[0]).distance(Point(x)))
    return result

class rimap():
    def __init__(self,n=3600,N=30,alpha=[0.1,0.5],sigma=[1.1,1.4],dt=0.1,pg=0.01,pu=0.05,su=0.315,boundary=""):
        """Creates an irregular maps

        :param n: number of areas 
開發者ID:1990q828j,項目名稱:clusterpy,代碼行數:33,代碼來源:rimaps.py

示例2: __init__

# 需要導入模塊: import Polygon [as 別名]
# 或者: from Polygon import setTolerance [as 別名]
#!/usr/bin/env python

import math,re, os, random
import Polygon, Polygon.IO, Polygon.Utils
import project
from regions import *
import itertools
import decomposition

Polygon.setTolerance(0.1)

class parseLP:
    """
    A parser to parse the locative prepositions in specification
    """
    def __init__(self):
        
        pass

    def main(self,argv):
        """ Main function; run automatically when called from command-line """

        spec_file = argv
        self.regionNear = []
        self.regionBetween = []
        defaultNearDistance = 50

        # load data
        self.proj = project.Project()
        self.proj.setSilent(True)
        self.proj.loadProject(spec_file)
開發者ID:RobertVillalba,項目名稱:LTLMoP,代碼行數:33,代碼來源:parseLP.py

示例3: __init__

# 需要導入模塊: import Polygon [as 別名]
# 或者: from Polygon import setTolerance [as 別名]
	def __init__(self, poly=None, color=(1,1,1,0.9), keepsimple = False, minlinelen=2):
		self.color = color
		self.poly = poly
		self.keepsimple = keepsimple
		po.setTolerance(0.1)
		self.minlinelen = minlinelen
開發者ID:chozabu,項目名稱:KivEntEd,代碼行數:8,代碼來源:PolyGen.py


注:本文中的Polygon.setTolerance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。