コード例 #1
0
 def getProjection(self, fromPoint):
     """
         get Projection of the point x,y in the line
     """
     p1 = self.p1
     p2 = self.p2
     v = Vector(p1, p2)
     v1 = Vector(p1, fromPoint)
     pjPoint = v.map(v1.point).point
     return p1 + pjPoint
コード例 #2
0
ファイル: segment.py プロジェクト: chiamingyen/PythonCAD_py3
 def getProjection(self,fromPoint):
     """
         get Projection of the point x,y in the line
     """
     p1=self.p1
     p2=self.p2
     v=Vector(p1,p2)
     v1=Vector(p1,fromPoint)
     pjPoint=v.map(v1.point).point
     return p1+pjPoint
コード例 #3
0
 def getDimensioLines(self):
     """
         compute all the segment needed for the dimension
     """
     p1p2v = Vector(self.firstPoint, self.secondPoint)
     v = Vector(self.firstPoint, self.thirdPoint)
     pp = self.firstPoint + p1p2v.map(v.point).point
     p3ppv = Vector(pp, self.thirdPoint)
     #
     fp = self.firstPoint + p3ppv.point
     fp = QtCore.QPointF(fp.x, fp.y * -1.0)
     sp = self.secondPoint + p3ppv.point
     sp = QtCore.QPointF(sp.x, sp.y * -1.0)
     #
     fp1 = QtCore.QPointF(self.firstPoint.x, self.firstPoint.y * -1.0)
     sp1 = QtCore.QPointF(self.secondPoint.x, self.secondPoint.y * -1.0)
     #
     return [(fp, sp), (fp, fp1), (sp, sp1)]
コード例 #4
0
ファイル: dimension.py プロジェクト: chen7/pythoncad
 def getDimensioLines(self):
     """
         compute all the segment needed for the dimension
     """
     p1p2v=Vector(self.firstPoint, self.secondPoint)
     v=Vector(self.firstPoint,self.thirdPoint)
     pp=self.firstPoint+p1p2v.map(v.point).point
     p3ppv=Vector(pp, self.thirdPoint)
     #
     fp=self.firstPoint+p3ppv.point
     fp=QtCore.QPointF(fp.x, fp.y*-1.0)
     sp=self.secondPoint+p3ppv.point
     sp=QtCore.QPointF(sp.x, sp.y*-1.0)
     #
     fp1=QtCore.QPointF(self.firstPoint.x, self.firstPoint.y*-1.0)
     sp1=QtCore.QPointF(self.secondPoint.x, self.secondPoint.y*-1.0)
     #
     return [(fp, sp), (fp, fp1), (sp, sp1)]