当前位置: 首页>>代码示例>>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;未经允许,请勿转载。