commit
9ce84fb5d6
|
@ -375,7 +375,7 @@ class CQ(object):
|
||||||
normal = normal.multiply(-1.0)
|
normal = normal.multiply(-1.0)
|
||||||
|
|
||||||
#offset origin if desired
|
#offset origin if desired
|
||||||
offsetVector = normal.normalize().multiply(offset)
|
offsetVector = normal.normalized().multiply(offset)
|
||||||
offsetCenter = center.add(offsetVector)
|
offsetCenter = center.add(offsetVector)
|
||||||
|
|
||||||
#make the new workplane
|
#make the new workplane
|
||||||
|
|
|
@ -125,7 +125,7 @@ class Vector(object):
|
||||||
tmp_fc_vector = FreeCAD.Base.Vector(self.wrapped)
|
tmp_fc_vector = FreeCAD.Base.Vector(self.wrapped)
|
||||||
return Vector(tmp_fc_vector.multiply(scale))
|
return Vector(tmp_fc_vector.multiply(scale))
|
||||||
|
|
||||||
def normalize(self):
|
def normalized(self):
|
||||||
"""Return a normalized version of this vector"""
|
"""Return a normalized version of this vector"""
|
||||||
tmp_fc_vector = FreeCAD.Base.Vector(self.wrapped)
|
tmp_fc_vector = FreeCAD.Base.Vector(self.wrapped)
|
||||||
tmp_fc_vector.normalize()
|
tmp_fc_vector.normalize()
|
||||||
|
@ -343,7 +343,7 @@ class Plane(object):
|
||||||
normal = Vector(normal)
|
normal = Vector(normal)
|
||||||
if (normal.Length == 0.0):
|
if (normal.Length == 0.0):
|
||||||
raise ValueError('normal should be non null')
|
raise ValueError('normal should be non null')
|
||||||
self.zDir = normal.normalize()
|
self.zDir = normal.normalized()
|
||||||
xDir = Vector(xDir)
|
xDir = Vector(xDir)
|
||||||
if (xDir.Length == 0.0):
|
if (xDir.Length == 0.0):
|
||||||
raise ValueError('xDir should be non null')
|
raise ValueError('xDir should be non null')
|
||||||
|
@ -539,8 +539,8 @@ class Plane(object):
|
||||||
if (self.zDir.dot(xDir) > 1e-5):
|
if (self.zDir.dot(xDir) > 1e-5):
|
||||||
raise ValueError('xDir must be parralel to the plane')
|
raise ValueError('xDir must be parralel to the plane')
|
||||||
xDir = Vector(xDir)
|
xDir = Vector(xDir)
|
||||||
self.xDir = xDir.normalize()
|
self.xDir = xDir.normalized()
|
||||||
self.yDir = self.zDir.cross(self.xDir).normalize()
|
self.yDir = self.zDir.cross(self.xDir).normalized()
|
||||||
|
|
||||||
def _calcTransforms(self):
|
def _calcTransforms(self):
|
||||||
"""Computes transformation matrices to convert between coordinates
|
"""Computes transformation matrices to convert between coordinates
|
||||||
|
|
|
@ -62,6 +62,9 @@ class Shape(object):
|
||||||
self.wrapped = obj
|
self.wrapped = obj
|
||||||
self.forConstruction = False
|
self.forConstruction = False
|
||||||
|
|
||||||
|
# Helps identify this solid through the use of an ID
|
||||||
|
self.label = ""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def cast(cls, obj, forConstruction=False):
|
def cast(cls, obj, forConstruction=False):
|
||||||
"Returns the right type of wrapper, given a FreeCAD object"
|
"Returns the right type of wrapper, given a FreeCAD object"
|
||||||
|
@ -356,6 +359,9 @@ class Vertex(Shape):
|
||||||
self.Y = obj.Y
|
self.Y = obj.Y
|
||||||
self.Z = obj.Z
|
self.Z = obj.Z
|
||||||
|
|
||||||
|
# Helps identify this solid through the use of an ID
|
||||||
|
self.label = ""
|
||||||
|
|
||||||
def toTuple(self):
|
def toTuple(self):
|
||||||
return (self.X, self.Y, self.Z)
|
return (self.X, self.Y, self.Z)
|
||||||
|
|
||||||
|
@ -381,6 +387,9 @@ class Edge(Shape):
|
||||||
FreeCADPart.Circle: 'CIRCLE'
|
FreeCADPart.Circle: 'CIRCLE'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Helps identify this solid through the use of an ID
|
||||||
|
self.label = ""
|
||||||
|
|
||||||
def geomType(self):
|
def geomType(self):
|
||||||
t = type(self.wrapped.Curve)
|
t = type(self.wrapped.Curve)
|
||||||
if self.edgetypes.has_key(t):
|
if self.edgetypes.has_key(t):
|
||||||
|
@ -476,6 +485,9 @@ class Wire(Shape):
|
||||||
"""
|
"""
|
||||||
self.wrapped = obj
|
self.wrapped = obj
|
||||||
|
|
||||||
|
# Helps identify this solid through the use of an ID
|
||||||
|
self.label = ""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def combine(cls, listOfWires):
|
def combine(cls, listOfWires):
|
||||||
"""
|
"""
|
||||||
|
@ -546,6 +558,9 @@ class Face(Shape):
|
||||||
FreeCADPart.Cone: 'CONE'
|
FreeCADPart.Cone: 'CONE'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Helps identify this solid through the use of an ID
|
||||||
|
self.label = ""
|
||||||
|
|
||||||
def geomType(self):
|
def geomType(self):
|
||||||
t = type(self.wrapped.Surface)
|
t = type(self.wrapped.Surface)
|
||||||
if self.facetypes.has_key(t):
|
if self.facetypes.has_key(t):
|
||||||
|
@ -602,6 +617,9 @@ class Shell(Shape):
|
||||||
"""
|
"""
|
||||||
self.wrapped = wrapped
|
self.wrapped = wrapped
|
||||||
|
|
||||||
|
# Helps identify this solid through the use of an ID
|
||||||
|
self.label = ""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def makeShell(cls, listOfFaces):
|
def makeShell(cls, listOfFaces):
|
||||||
return Shell(FreeCADPart.makeShell([i.obj for i in listOfFaces]))
|
return Shell(FreeCADPart.makeShell([i.obj for i in listOfFaces]))
|
||||||
|
@ -614,6 +632,9 @@ class Solid(Shape):
|
||||||
"""
|
"""
|
||||||
self.wrapped = obj
|
self.wrapped = obj
|
||||||
|
|
||||||
|
# Helps identify this solid through the use of an ID
|
||||||
|
self.label = ""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def isSolid(cls, obj):
|
def isSolid(cls, obj):
|
||||||
"""
|
"""
|
||||||
|
@ -915,6 +936,9 @@ class Compound(Shape):
|
||||||
"""
|
"""
|
||||||
self.wrapped = obj
|
self.wrapped = obj
|
||||||
|
|
||||||
|
# Helps identify this solid through the use of an ID
|
||||||
|
self.label = ""
|
||||||
|
|
||||||
def Center(self):
|
def Center(self):
|
||||||
return self.Center()
|
return self.Center()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user