本文整理汇总了Python中line.Line.length方法的典型用法代码示例。如果您正苦于以下问题:Python Line.length方法的具体用法?Python Line.length怎么用?Python Line.length使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类line.Line
的用法示例。
在下文中一共展示了Line.length方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeVCurveR
# 需要导入模块: from line import Line [as 别名]
# 或者: from line.Line import length [as 别名]
def makeVCurveR(self):
parts = []
vCurvesHeight = self.vCurvesHeight
vCurvesWidth = self.vCurvesWidth
vCurvesDepth = self.vCurvesDepth
v21 = Base.Vector(self.stopsWidth+self.botCurveWidth,0,self.botCurveHeight+self.stopsHeight);
v22 = v21+Base.Vector(-vCurvesWidth,0,vCurvesHeight);
l2 = Line().fromPoints((v21.x, v21.z), (v22.x, v22.z))
p23 = l2.pointAtDist(l2.length() - self.stopsHeight)
v23 = Base.Vector(p23[0], 0, p23[1])
l3 = Line().fromPoints((v21.x, v21.z), (v23.x, v23.z))
p21 = l3.bissection().pointAtDist(vCurvesDepth)
c21 = Base.Vector(p21[0],0,p21[1])
l4 = Line().fromPoints((v23.x, v23.z), (v22.x, v22.z))
p31 = l4.bissection().pointAtDist(self.stopsWidth/2)
c31 = Base.Vector(p31[0],0,p31[1])
parts.append(Part.Arc(v21,c21,v23).toShape())
parts.append(Part.Arc(v23,c31,v22).toShape())
s1 = Part.Shape(parts)
return parts
示例2: str
# 需要导入模块: from line import Line [as 别名]
# 或者: from line.Line import length [as 别名]
from polyline import Polyline
from circle import Circle
from arc import Arc
from block import Block
from fileformats.render2dxf import Render2DXF
from twod_operations import *
#from toacadscript import element2Script, elements2Script, toFile
if __name__ == "__main__":
p1=Point(1,2,3)
p2=Point(4,5,6)
l1=Line(p1,p2)
print "p1 = " + str(p1)
print "p2 = " + str(p2)
print "l1 = " + str(l1)
print "l1.length() = %f" % l1.length()
pl1=Polyline([Point(0,0),Point(1,1),Point(1,0),Point(0,0)],closed=True)
print "pl1 = " + str(pl1)
print "pl1.length() = %f" % pl1.length()
print "pl1.area() = %f" % pl1.area()
v1 = Vector(1,2,3)
print "v1 = " + str(v1)
v2 = Vector(1,0,0)
print "v2 = " + str(v2)
v3 = Vector(0,1,0)
print "v3 = " + str(v3)
print "v1 dot v2 = " + str(v1.dot(v2))
print "v2 cross v3= " + str(v2.cross(v3))
print "v1 * 3 = " + str(v1 * 3)
print "2 * v1 = " + str(2.0 * v1) #this doesn;t work becuse of the ordering of the arguments to __mul__, that sucks!
print "v1 / 3 = " + str(v1/3)