Differentiated projected plane origin and global origin for creating workplanes
Added ProjectedGlobalOrigin as centerOption for worplane constructor to differentiate between projecting the global origin and the current plane origin when creating new workplanes. Also updated projectToPlane method of Vector to only accept plane objects and it no longer does in inplace modification. Updated test converage for ProjectedOrigin and ProjectedGlobalOrigin options.
This commit is contained in:
@ -161,24 +161,11 @@ class TestCadObjects(BaseTest):
|
||||
base = Vector(5, 7, 9)
|
||||
x_dir = Vector(1, 0, 0)
|
||||
|
||||
# test passing plane defined by base and normal
|
||||
point = Vector(10, 11, 12).projectToPlane(base, normal)
|
||||
self.assertTupleAlmostEquals(point.toTuple(), (59/7, 55/7, 51/7),
|
||||
decimal_places)
|
||||
|
||||
point = Vector(10, 11, 12).projectToPlane(base, normal.normalized())
|
||||
self.assertTupleAlmostEquals(point.toTuple(), (59/7, 55/7, 51/7),
|
||||
decimal_places)
|
||||
|
||||
# test passing Plane object
|
||||
point = Vector(10, 11, 12).projectToPlane(Plane(base, x_dir, normal))
|
||||
self.assertTupleAlmostEquals(point.toTuple(), (59/7, 55/7, 51/7),
|
||||
decimal_places)
|
||||
|
||||
# test wrong number of input arguments
|
||||
with self.assertRaises(TypeError):
|
||||
Vector(10,11.12).projectToPlane(1,1,1)
|
||||
|
||||
def testMatrixCreationAndAccess(self):
|
||||
def matrix_vals(m):
|
||||
return [[m[r,c] for c in range(4)] for r in range(4)]
|
||||
|
Reference in New Issue
Block a user