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


Python Wrappers.pointAtParameter方法代碼示例

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


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

示例1: divideEdge

# 需要導入模塊: import Wrappers [as 別名]
# 或者: from Wrappers import pointAtParameter [as 別名]
	def divideEdge(self,edge,param):
		"""
			split the edge at the provided parameter,
			creating two new edge nodes.
			update internal structures accordingly.
		"""
		original = self.findEdge(edge,param);
		
		if original == None:
			raise ValueError,"Could not find edge having parameter %0.3f" % (param);
			
		#param must be between the bounds on the original edge
		assert param >= original.p1 and param <= original.p2;
		
		#compute nodes on either end.
		n1 = tP(original.firstPoint);
		n2 = tP(original.lastPoint);
		
		#add new node and edges
		n3 = tP( Wrappers.pointAtParameter(edge,param));
		newNode1 = EdgeSegment(edge,original.p1,param,original.type);
		newNode2 = EdgeSegment(edge,param,original.p2, original.type );

		
		self.addEdgeSegment(newNode1);
		self.addEdgeSegment(newNode2);
		
		#delete the original
		self.removeEdge(original);
				
		return [newNode1,newNode2];
開發者ID:adam-urbanczyk,項目名稱:emcfab,代碼行數:33,代碼來源:edgegraph3__old.py

示例2: addEdgeListAsSingleEdge

# 需要導入模塊: import Wrappers [as 別名]
# 或者: from Wrappers import pointAtParameter [as 別名]
    def addEdgeListAsSingleEdge(self, edgeList, etype):
        """
			adds a list of edges in the graph as a single edge.
			The list of edges becomes a 'pseudo-edge' with a single start and endpoint.
			The edge cannot be divided, and its vertices are not stored in the edge graph
		"""

        # TODO: adding this method has broken the EdgeSegment intervace.
        # what is needed is an object that exposes first and last point, and a container for the underlying object
        # an edgesegment ( a portion of an edge between two parameters ), a full edge ( requring no trimming ),
        # and a gropu of edges combined are all special subcases.

        firstEdge = edgeList[0]
        lastEdge = edgeList[-1]
        (f, l) = brepTool.Range(firstEdge)
        (n, m) = brepTool.Range(lastEdge)

        # todo, this can be optimized, the underlying curve is computed twice here.
        # something very odd is happening here. whey does using the last parameter and first paraterm
        # work ? initially i had them backewards, which should have worked, but opposites worked.
        # wierd. do i need to account for the sense?
        # maybe i should just use wrappers.edge here
        if firstEdge.Orientation() == TopAbs.TopAbs_FORWARD:
            p1 = tP(Wrappers.pointAtParameter(firstEdge, f))
        else:
            p1 = tP(Wrappers.pointAtParameter(firstEdge, l))

        if lastEdge.Orientation() == TopAbs.TopAbs_FORWARD:
            p2 = tP(Wrappers.pointAtParameter(lastEdge, m))
        else:
            p2 = tP(Wrappers.pointAtParameter(lastEdge, n))

            # todo, i dont think we care about this key do we, as long as it is unique?
        self.g.add_edge(p1, p2, {"edgeList": edgeList, "type": etype})
        if etype == "FILL":
            self.fillEdges.append((p1, p2))
開發者ID:adam-urbanczyk,項目名稱:emcfab,代碼行數:38,代碼來源:edgegraph3.py

示例3: addFillEdges

# 需要導入模塊: import Wrappers [as 別名]
# 或者: from Wrappers import pointAtParameter [as 別名]
	def addFillEdges(self,edgeList):

		if len(edgeList) == 1:
			(f,l) = brepTool.Range(edgeList[0]);
			p1 = tP( Wrappers.pointAtParameter( edgeList[0],f));
			p2 = tP( Wrappers.pointAtParameter( edgeList[0],l));
		else:
			firstEdge = edgeList[0];
			lastEdge = edgeList[-1];
			(f,l) = brepTool.Range(firstEdge);
			(n,m) = brepTool.Range(lastEdge);
			
			if firstEdge.Orientation() == TopAbs.TopAbs_FORWARD:
				p1 = tP( Wrappers.pointAtParameter( firstEdge,f));
			else:
				p1 = tP( Wrappers.pointAtParameter ( firstEdge,l));
			
			if lastEdge.Orientation() == TopAbs.TopAbs_FORWARD:	
				p2 = tP(Wrappers.pointAtParameter(lastEdge,m ));
			else:
				p2 = tP(Wrappers.pointAtParameter(lastEdge,n ));
		
		self.fillEdges.append( (p1,p2,edgeList )); #would be nice if edge lists and edges looked the same
開發者ID:adam-urbanczyk,項目名稱:emcfab,代碼行數:25,代碼來源:edgegraph4.py


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