Draft: Fixes bugs from last commit
This commit is contained in:
parent
b3f79881c5
commit
c6858f69fd
|
@ -26,6 +26,7 @@ __author__ = "Yorik van Havre"
|
||||||
__url__ = "http://free-cad.sourceforge.net"
|
__url__ = "http://free-cad.sourceforge.net"
|
||||||
|
|
||||||
import FreeCAD,FreeCADGui,Draft
|
import FreeCAD,FreeCADGui,Draft
|
||||||
|
from FreeCAD import Vector
|
||||||
from PyQt4 import QtGui,QtCore
|
from PyQt4 import QtGui,QtCore
|
||||||
from DraftTools import translate
|
from DraftTools import translate
|
||||||
|
|
||||||
|
@ -309,7 +310,7 @@ class Component:
|
||||||
v1 = DraftVecUtils.scaleTo(n,width*1.1) # we extrude a little more to avoid face-on-face
|
v1 = DraftVecUtils.scaleTo(n,width*1.1) # we extrude a little more to avoid face-on-face
|
||||||
f.translate(v1)
|
f.translate(v1)
|
||||||
v2 = v1.negative()
|
v2 = v1.negative()
|
||||||
v2 = v1.multiply(-2)
|
v2 = Vector(v1).multiply(-2)
|
||||||
f = f.extrude(v2)
|
f = f.extrude(v2)
|
||||||
if plac:
|
if plac:
|
||||||
f.Placement = plac
|
f.Placement = plac
|
||||||
|
|
|
@ -411,18 +411,18 @@ class _Wall(ArchComponent.Component):
|
||||||
if not DraftVecUtils.isNull(dvec):
|
if not DraftVecUtils.isNull(dvec):
|
||||||
dvec.normalize()
|
dvec.normalize()
|
||||||
if obj.Align == "Left":
|
if obj.Align == "Left":
|
||||||
dvec = dvec.multiply(width)
|
dvec.multiply(width)
|
||||||
w2 = DraftGeomUtils.offsetWire(wire,dvec)
|
w2 = DraftGeomUtils.offsetWire(wire,dvec)
|
||||||
w1 = Part.Wire(DraftGeomUtils.sortEdges(wire.Edges))
|
w1 = Part.Wire(DraftGeomUtils.sortEdges(wire.Edges))
|
||||||
sh = DraftGeomUtils.bind(w1,w2)
|
sh = DraftGeomUtils.bind(w1,w2)
|
||||||
elif obj.Align == "Right":
|
elif obj.Align == "Right":
|
||||||
dvec = dvec.multiply(width)
|
dvec.multiply(width)
|
||||||
dvec = dvec.negative()
|
dvec = dvec.negative()
|
||||||
w2 = DraftGeomUtils.offsetWire(wire,dvec)
|
w2 = DraftGeomUtils.offsetWire(wire,dvec)
|
||||||
w1 = Part.Wire(DraftGeomUtils.sortEdges(wire.Edges))
|
w1 = Part.Wire(DraftGeomUtils.sortEdges(wire.Edges))
|
||||||
sh = DraftGeomUtils.bind(w1,w2)
|
sh = DraftGeomUtils.bind(w1,w2)
|
||||||
elif obj.Align == "Center":
|
elif obj.Align == "Center":
|
||||||
dvec = dvec.multiply(width/2)
|
dvec.multiply(width/2)
|
||||||
w1 = DraftGeomUtils.offsetWire(wire,dvec)
|
w1 = DraftGeomUtils.offsetWire(wire,dvec)
|
||||||
dvec = dvec.negative()
|
dvec = dvec.negative()
|
||||||
w2 = DraftGeomUtils.offsetWire(wire,dvec)
|
w2 = DraftGeomUtils.offsetWire(wire,dvec)
|
||||||
|
@ -459,8 +459,8 @@ class _Wall(ArchComponent.Component):
|
||||||
pass
|
pass
|
||||||
elif (len(base.Faces) == 1) and (not obj.ForceWire):
|
elif (len(base.Faces) == 1) and (not obj.ForceWire):
|
||||||
if height:
|
if height:
|
||||||
norm = normal.multiply(height)
|
normal.multiply(height)
|
||||||
base = base.extrude(norm)
|
base = base.extrude(normal)
|
||||||
elif len(base.Wires) >= 1:
|
elif len(base.Wires) >= 1:
|
||||||
temp = None
|
temp = None
|
||||||
for wire in obj.Base.Shape.Wires:
|
for wire in obj.Base.Shape.Wires:
|
||||||
|
|
|
@ -1018,12 +1018,12 @@ def array(objectslist,arg1,arg2,arg3,arg4=None):
|
||||||
typecheck([(xvector,Vector), (yvector,Vector), (xnum,int), (ynum,int)], "rectArray")
|
typecheck([(xvector,Vector), (yvector,Vector), (xnum,int), (ynum,int)], "rectArray")
|
||||||
if not isinstance(objectslist,list): objectslist = [objectslist]
|
if not isinstance(objectslist,list): objectslist = [objectslist]
|
||||||
for xcount in range(xnum):
|
for xcount in range(xnum):
|
||||||
currentxvector=xvector.multiply(xcount)
|
currentxvector=Vector(xvector).multiply(xcount)
|
||||||
if not xcount==0:
|
if not xcount==0:
|
||||||
move(objectslist,currentxvector,True)
|
move(objectslist,currentxvector,True)
|
||||||
for ycount in range(ynum):
|
for ycount in range(ynum):
|
||||||
currentxvector=FreeCAD.Base.Vector(currentxvector)
|
currentxvector=FreeCAD.Base.Vector(currentxvector)
|
||||||
currentyvector=currentxvector.add(yvector.multiply(ycount))
|
currentyvector=currentxvector.add(Vector(yvector).multiply(ycount))
|
||||||
if not ycount==0:
|
if not ycount==0:
|
||||||
move(objectslist,currentyvector,True)
|
move(objectslist,currentyvector,True)
|
||||||
def polarArray(objectslist,center,angle,num):
|
def polarArray(objectslist,center,angle,num):
|
||||||
|
@ -1212,7 +1212,7 @@ def offset(obj,delta,copy=False,bind=False,sym=False,occ=False):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if sym:
|
if sym:
|
||||||
d1 = delta.multiply(0.5)
|
d1 = Vector(delta).multiply(0.5)
|
||||||
d2 = d1.negative()
|
d2 = d1.negative()
|
||||||
n1 = DraftGeomUtils.offsetWire(obj.Shape,d1)
|
n1 = DraftGeomUtils.offsetWire(obj.Shape,d1)
|
||||||
n2 = DraftGeomUtils.offsetWire(obj.Shape,d2)
|
n2 = DraftGeomUtils.offsetWire(obj.Shape,d2)
|
||||||
|
@ -3695,21 +3695,21 @@ class _Array(_DraftObject):
|
||||||
import Part
|
import Part
|
||||||
base = [shape.copy()]
|
base = [shape.copy()]
|
||||||
for xcount in range(xnum):
|
for xcount in range(xnum):
|
||||||
currentxvector=xvector.multiply(xcount)
|
currentxvector=Vector(xvector).multiply(xcount)
|
||||||
if not xcount==0:
|
if not xcount==0:
|
||||||
nshape = shape.copy()
|
nshape = shape.copy()
|
||||||
nshape.translate(currentxvector)
|
nshape.translate(currentxvector)
|
||||||
base.append(nshape)
|
base.append(nshape)
|
||||||
for ycount in range(ynum):
|
for ycount in range(ynum):
|
||||||
currentyvector=FreeCAD.Vector(currentxvector)
|
currentyvector=FreeCAD.Vector(currentxvector)
|
||||||
currentyvector=currentyvector.add(yvector.multiply(ycount))
|
currentyvector=currentyvector.add(Vector(yvector).multiply(ycount))
|
||||||
if not ycount==0:
|
if not ycount==0:
|
||||||
nshape = shape.copy()
|
nshape = shape.copy()
|
||||||
nshape.translate(currentyvector)
|
nshape.translate(currentyvector)
|
||||||
base.append(nshape)
|
base.append(nshape)
|
||||||
for zcount in range(znum):
|
for zcount in range(znum):
|
||||||
currentzvector=FreeCAD.Vector(currentyvector)
|
currentzvector=FreeCAD.Vector(currentyvector)
|
||||||
currentzvector=currentzvector.add(zvector.multiply(zcount))
|
currentzvector=currentzvector.add(Vector(zvector).multiply(zcount))
|
||||||
if not zcount==0:
|
if not zcount==0:
|
||||||
nshape = shape.copy()
|
nshape = shape.copy()
|
||||||
nshape.translate(currentzvector)
|
nshape.translate(currentzvector)
|
||||||
|
|
|
@ -1871,8 +1871,8 @@ def circlefrom1Line2Points(edge, p1, p2):
|
||||||
v2 = p2.sub(s)
|
v2 = p2.sub(s)
|
||||||
projectedDist = math.sqrt(abs(v1.dot(v2)))
|
projectedDist = math.sqrt(abs(v1.dot(v2)))
|
||||||
edgeDir = vec(edge); edgeDir.normalize()
|
edgeDir = vec(edge); edgeDir.normalize()
|
||||||
projectedCen1 = Vector.add(s, edgeDir.multiply(projectedDist))
|
projectedCen1 = Vector.add(s, Vector(edgeDir).multiply(projectedDist))
|
||||||
projectedCen2 = Vector.add(s, edgeDir.multiply(-projectedDist))
|
projectedCen2 = Vector.add(s, Vector(edgeDir).multiply(-projectedDist))
|
||||||
perpEdgeDir = edgeDir.cross(Vector(0,0,1))
|
perpEdgeDir = edgeDir.cross(Vector(0,0,1))
|
||||||
perpCen1 = Vector.add(projectedCen1, perpEdgeDir)
|
perpCen1 = Vector.add(projectedCen1, perpEdgeDir)
|
||||||
perpCen2 = Vector.add(projectedCen2, perpEdgeDir)
|
perpCen2 = Vector.add(projectedCen2, perpEdgeDir)
|
||||||
|
@ -1968,8 +1968,8 @@ def circleFromPointLineRadius (point, edge, radius):
|
||||||
if dist.Length == 0:
|
if dist.Length == 0:
|
||||||
segment = vec(edge)
|
segment = vec(edge)
|
||||||
perpVec = DraftVecUtils.crossproduct(segment); perpVec.normalize()
|
perpVec = DraftVecUtils.crossproduct(segment); perpVec.normalize()
|
||||||
normPoint_c1 = perpVec.multiply(radius)
|
normPoint_c1 = Vector(perpVec).multiply(radius)
|
||||||
normPoint_c2 = perpVec.multiply(-radius)
|
normPoint_c2 = Vector(perpVec).multiply(-radius)
|
||||||
center1 = point.add(normPoint_c1)
|
center1 = point.add(normPoint_c1)
|
||||||
center2 = point.add(normPoint_c2)
|
center2 = point.add(normPoint_c2)
|
||||||
elif dist.Length > 2 * radius:
|
elif dist.Length > 2 * radius:
|
||||||
|
@ -1989,8 +1989,8 @@ def circleFromPointLineRadius (point, edge, radius):
|
||||||
dist = math.sqrt(radius**2 - (radius - normDist)**2)
|
dist = math.sqrt(radius**2 - (radius - normDist)**2)
|
||||||
centerNormVec = DraftVecUtils.scaleTo(point.sub(normPoint), radius)
|
centerNormVec = DraftVecUtils.scaleTo(point.sub(normPoint), radius)
|
||||||
edgeDir = edge.Vertexes[0].Point.sub(normPoint); edgeDir.normalize()
|
edgeDir = edge.Vertexes[0].Point.sub(normPoint); edgeDir.normalize()
|
||||||
center1 = centerNormVec.add(normPoint.add(edgeDir.multiply(dist)))
|
center1 = centerNormVec.add(normPoint.add(Vector(edgeDir).multiply(dist)))
|
||||||
center2 = centerNormVec.add(normPoint.add(edgeDir.multiply(-dist)))
|
center2 = centerNormVec.add(normPoint.add(Vector(edgeDir).multiply(-dist)))
|
||||||
circles = []
|
circles = []
|
||||||
if center1:
|
if center1:
|
||||||
circ = Part.Circle(center1, NORM, radius)
|
circ = Part.Circle(center1, NORM, radius)
|
||||||
|
@ -2020,8 +2020,8 @@ def circleFrom2PointsRadius(p1, p2, radius):
|
||||||
dir = vec(p1_p2); dir.normalize()
|
dir = vec(p1_p2); dir.normalize()
|
||||||
perpDir = dir.cross(Vector(0,0,1)); perpDir.normailze()
|
perpDir = dir.cross(Vector(0,0,1)); perpDir.normailze()
|
||||||
dist = math.sqrt(radius**2 - (dist_p1p2 / 2.0)**2)
|
dist = math.sqrt(radius**2 - (dist_p1p2 / 2.0)**2)
|
||||||
cen1 = Vector.add(mid, perpDir.multiply(dist))
|
cen1 = Vector.add(mid, Vector(perpDir).multiply(dist))
|
||||||
cen2 = Vector.add(mid, perpDir.multiply(-dist))
|
cen2 = Vector.add(mid, Vector(perpDir).multiply(-dist))
|
||||||
circles = []
|
circles = []
|
||||||
if cen1: circles.append(Part.Circle(cen1, norm, radius))
|
if cen1: circles.append(Part.Circle(cen1, norm, radius))
|
||||||
if cen2: circles.append(Part.Circle(cen2, norm, radius))
|
if cen2: circles.append(Part.Circle(cen2, norm, radius))
|
||||||
|
@ -2266,12 +2266,12 @@ def findHomotheticCenterOfCircles(circle1, circle2):
|
||||||
perpCenDir = cenDir.cross(Vector(0,0,1)); perpCenDir.normalize()
|
perpCenDir = cenDir.cross(Vector(0,0,1)); perpCenDir.normalize()
|
||||||
|
|
||||||
# Get point on first circle
|
# Get point on first circle
|
||||||
p1 = Vector.add(circle1.Curve.Center, perpCenDir.multiply(circle1.Curve.Radius))
|
p1 = Vector.add(circle1.Curve.Center, Vector(perpCenDir).multiply(circle1.Curve.Radius))
|
||||||
|
|
||||||
centers = []
|
centers = []
|
||||||
# Calculate inner homothetic center
|
# Calculate inner homothetic center
|
||||||
# Get point on second circle
|
# Get point on second circle
|
||||||
p2_inner = Vector.add(circle1.Curve.Center, perpCenDir.multiply(-circle1.Curve.Radius))
|
p2_inner = Vector.add(circle1.Curve.Center, Vector(perpCenDir).multiply(-circle1.Curve.Radius))
|
||||||
hCenterInner = DraftVecUtils.intersect(circle1.Curve.Center, circle2.Curve.Center, p1, p2_inner, True, True)
|
hCenterInner = DraftVecUtils.intersect(circle1.Curve.Center, circle2.Curve.Center, p1, p2_inner, True, True)
|
||||||
if hCenterInner:
|
if hCenterInner:
|
||||||
centers.append(hCenterInner)
|
centers.append(hCenterInner)
|
||||||
|
@ -2279,7 +2279,7 @@ def findHomotheticCenterOfCircles(circle1, circle2):
|
||||||
# Calculate outer homothetic center (only exists of the circles have different radii)
|
# Calculate outer homothetic center (only exists of the circles have different radii)
|
||||||
if circle1.Curve.Radius != circle2.Curve.Radius:
|
if circle1.Curve.Radius != circle2.Curve.Radius:
|
||||||
# Get point on second circle
|
# Get point on second circle
|
||||||
p2_outer = Vector.add(circle1.Curve.Center, perpCenDir.multiply(circle1.Curve.Radius))
|
p2_outer = Vector.add(circle1.Curve.Center, Vector(perpCenDir).multiply(circle1.Curve.Radius))
|
||||||
hCenterOuter = DraftVecUtils.intersect(circle1.Curve.Center, circle2.Curve.Center, p1, p2_outer, True, True)
|
hCenterOuter = DraftVecUtils.intersect(circle1.Curve.Center, circle2.Curve.Center, p1, p2_outer, True, True)
|
||||||
if hCenterOuter:
|
if hCenterOuter:
|
||||||
centers.append(hCenterOuter)
|
centers.append(hCenterOuter)
|
||||||
|
|
|
@ -1351,7 +1351,7 @@ class Ellipse(Creator):
|
||||||
p1 = self.node[0]
|
p1 = self.node[0]
|
||||||
p3 = self.node[-1]
|
p3 = self.node[-1]
|
||||||
diagonal = p3.sub(p1)
|
diagonal = p3.sub(p1)
|
||||||
halfdiag = diagonal.multiply(0.5)
|
halfdiag = Vector(diagonal).multiply(0.5)
|
||||||
center = p1.add(halfdiag)
|
center = p1.add(halfdiag)
|
||||||
p2 = p1.add(DraftVecUtils.project(diagonal, plane.v))
|
p2 = p1.add(DraftVecUtils.project(diagonal, plane.v))
|
||||||
p4 = p1.add(DraftVecUtils.project(diagonal, plane.u))
|
p4 = p1.add(DraftVecUtils.project(diagonal, plane.u))
|
||||||
|
@ -1761,7 +1761,7 @@ class Dimension(Creator):
|
||||||
# for unlinked arc mode:
|
# for unlinked arc mode:
|
||||||
# if self.arcmode:
|
# if self.arcmode:
|
||||||
# v = self.node[1].sub(self.node[0])
|
# v = self.node[1].sub(self.node[0])
|
||||||
# v = v.multiply(0.5)
|
# v.multiply(0.5)
|
||||||
# cen = self.node[0].add(v)
|
# cen = self.node[0].add(v)
|
||||||
# self.node = [self.node[0],self.node[1],cen]
|
# self.node = [self.node[0],self.node[1],cen]
|
||||||
self.createObject()
|
self.createObject()
|
||||||
|
@ -2656,7 +2656,7 @@ class Trimex(Modifier):
|
||||||
if real:
|
if real:
|
||||||
if self.force:
|
if self.force:
|
||||||
ray = self.newpoint.sub(v1)
|
ray = self.newpoint.sub(v1)
|
||||||
ray = ray.multiply(self.force/ray.Length)
|
ray.multiply(self.force/ray.Length)
|
||||||
self.newpoint = Vector.add(v1,ray)
|
self.newpoint = Vector.add(v1,ray)
|
||||||
newedges.append(Part.Line(self.newpoint,v2).toShape())
|
newedges.append(Part.Line(self.newpoint,v2).toShape())
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -261,9 +261,9 @@ class plane:
|
||||||
|
|
||||||
def getGlobalCoords(self,point):
|
def getGlobalCoords(self,point):
|
||||||
"returns the global coordinates of the given point, taken relatively to this working plane"
|
"returns the global coordinates of the given point, taken relatively to this working plane"
|
||||||
vx = self.u.multiply(point.x)
|
vx = Vector(self.u).multiply(point.x)
|
||||||
vy = self.v.multiply(point.y)
|
vy = Vector(self.v).multiply(point.y)
|
||||||
vz = self.axis.multiply(point.z)
|
vz = Vector(self.axis).multiply(point.z)
|
||||||
pt = (vx.add(vy)).add(vz)
|
pt = (vx.add(vy)).add(vz)
|
||||||
return pt.add(self.position)
|
return pt.add(self.position)
|
||||||
|
|
||||||
|
@ -285,9 +285,9 @@ class plane:
|
||||||
|
|
||||||
def getGlobalRot(self,point):
|
def getGlobalRot(self,point):
|
||||||
"Same as getGlobalCoords, but discards the WP position"
|
"Same as getGlobalCoords, but discards the WP position"
|
||||||
vx = self.u.multiply(point.x)
|
vx = Vector(self.u).multiply(point.x)
|
||||||
vy = self.v.multiply(point.y)
|
vy = Vector(self.v).multiply(point.y)
|
||||||
vz = self.axis.multiply(point.z)
|
vz = Vector(self.axis).multiply(point.z)
|
||||||
pt = (vx.add(vy)).add(vz)
|
pt = (vx.add(vy)).add(vz)
|
||||||
return pt
|
return pt
|
||||||
|
|
||||||
|
|
|
@ -145,8 +145,8 @@ def calcBulge(v1,bulge,v2):
|
||||||
'''
|
'''
|
||||||
chord = v2.sub(v1)
|
chord = v2.sub(v1)
|
||||||
sagitta = (bulge * chord.Length)/2
|
sagitta = (bulge * chord.Length)/2
|
||||||
startpoint = v1.add(chord.multiply(0.5))
|
|
||||||
perp = chord.cross(Vector(0,0,1))
|
perp = chord.cross(Vector(0,0,1))
|
||||||
|
startpoint = v1.add(chord.multiply(0.5))
|
||||||
if not DraftVecUtils.isNull(perp): perp.normalize()
|
if not DraftVecUtils.isNull(perp): perp.normalize()
|
||||||
endpoint = perp.multiply(sagitta)
|
endpoint = perp.multiply(sagitta)
|
||||||
return startpoint.add(endpoint)
|
return startpoint.add(endpoint)
|
||||||
|
@ -231,7 +231,7 @@ class fcformat:
|
||||||
v1 = FreeCAD.Vector(r1,g1,b1)
|
v1 = FreeCAD.Vector(r1,g1,b1)
|
||||||
v2 = FreeCAD.Vector(r2,g2,b2)
|
v2 = FreeCAD.Vector(r2,g2,b2)
|
||||||
v = v2.sub(v1)
|
v = v2.sub(v1)
|
||||||
v = v.multiply(0.5)
|
v.multiply(0.5)
|
||||||
cv = v1.add(v)
|
cv = v1.add(v)
|
||||||
else:
|
else:
|
||||||
c1 = bparams.GetUnsigned("BackgroundColor")
|
c1 = bparams.GetUnsigned("BackgroundColor")
|
||||||
|
|
|
@ -320,7 +320,7 @@ def arcend2center(lastvec,currentvec,rx,ry,xrotation=0.0,correction=False):
|
||||||
rx = float(rx)
|
rx = float(rx)
|
||||||
ry = float(ry)
|
ry = float(ry)
|
||||||
v0 = lastvec.sub(currentvec)
|
v0 = lastvec.sub(currentvec)
|
||||||
v0 = v0.multiply(0.5)
|
v0.multiply(0.5)
|
||||||
m1=FreeCAD.Matrix()
|
m1=FreeCAD.Matrix()
|
||||||
m1.rotateZ(-xrotation) #Formular 6.5.1
|
m1.rotateZ(-xrotation) #Formular 6.5.1
|
||||||
v1=m1.multiply(v0)
|
v1=m1.multiply(v0)
|
||||||
|
@ -347,7 +347,7 @@ def arcend2center(lastvec,currentvec,rx,ry,xrotation=0.0,correction=False):
|
||||||
m2=FreeCAD.Matrix()
|
m2=FreeCAD.Matrix()
|
||||||
m2.rotateZ(xrotation)
|
m2.rotateZ(xrotation)
|
||||||
centeroff = currentvec.add(lastvec)
|
centeroff = currentvec.add(lastvec)
|
||||||
centeroff = centeroff.multiply(.5)
|
centeroff.multiply(.5)
|
||||||
vcenter = m2.multiply(vcx1).add(centeroff) # Step3 F.6.5.3
|
vcenter = m2.multiply(vcx1).add(centeroff) # Step3 F.6.5.3
|
||||||
#angle1 = Vector(1,0,0).getAngle(Vector((v1.x-vcx1.x)/rx,(v1.y-vcx1.y)/ry,0)) # F.6.5.5
|
#angle1 = Vector(1,0,0).getAngle(Vector((v1.x-vcx1.x)/rx,(v1.y-vcx1.y)/ry,0)) # F.6.5.5
|
||||||
#angledelta = Vector((v1.x-vcx1.x)/rx,(v1.y-vcx1.y)/ry,0).getAngle(Vector((-v1.x-vcx1.x)/rx,(-v1.y-vcx1.y)/ry,0)) # F.6.5.6
|
#angledelta = Vector((v1.x-vcx1.x)/rx,(v1.y-vcx1.y)/ry,0).getAngle(Vector((-v1.x-vcx1.x)/rx,(-v1.y-vcx1.y)/ry,0)) # F.6.5.6
|
||||||
|
@ -616,11 +616,11 @@ class svgHandler(xml.sax.ContentHandler):
|
||||||
else:
|
else:
|
||||||
# anticlockwise
|
# anticlockwise
|
||||||
perp = DraftVecUtils.rotate2D(chord,math.pi/2)
|
perp = DraftVecUtils.rotate2D(chord,math.pi/2)
|
||||||
chord = chord.multiply(.5)
|
chord.multiply(.5)
|
||||||
if chord.Length > rx: a = 0
|
if chord.Length > rx: a = 0
|
||||||
else: a = math.sqrt(rx**2-chord.Length**2)
|
else: a = math.sqrt(rx**2-chord.Length**2)
|
||||||
s = rx - a
|
s = rx - a
|
||||||
perp = perp.multiply(s/perp.Length)
|
perp.multiply(s/perp.Length)
|
||||||
midpoint = lastvec.add(chord.add(perp))
|
midpoint = lastvec.add(chord.add(perp))
|
||||||
seg = Part.Arc(lastvec,midpoint,currentvec).toShape()
|
seg = Part.Arc(lastvec,midpoint,currentvec).toShape()
|
||||||
else:# big arc or elliptical arc
|
else:# big arc or elliptical arc
|
||||||
|
|
Loading…
Reference in New Issue
Block a user