本文整理汇总了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];
示例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))
示例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