def test_mate(): problem = GeometricProblem(dimension=3) # create and mate two blocks add_block(problem, "A", 4.0, 2.0, 6.0) add_block(problem, "B", 4.0, 2.0, 6.0) mate_blocks(problem, "A", 'right-bot-front', 'right-bot-back', 'right-top-front', "B", 'left-bot-front', 'left-bot-back', 'left-top-front', 0.5, 0.0) # add global coordinate system problem.add_point("origin", vector([0.0, 0.0, 0.0])) problem.add_point("x-axis", vector([1.0, 0.0, 0.0])) problem.add_point("y-axis", vector([0.0, 1.0, 0.0])) problem.add_constraint(FixConstraint("origin", vector([0.0, 0.0, 0.0]))) problem.add_constraint(FixConstraint("x-axis", vector([1.0, 0.0, 0.0]))) problem.add_constraint(FixConstraint("y-axis", vector([0.0, 1.0, 0.0]))) # fix block1 to cs problem.add_constraint( MateConstraint("origin", "x-axis", "y-axis", block_var("A", "left-bot-front"), block_var("A", "right-bot-front"), block_var("A", "left-top-front"), id_transform_3D())) test(problem)
def test_non_triangular(n): problem = random_problem_2D(n) print "before:" print problem randomize_angles(problem) print "after:" print problem test(problem)
def test_line(): diag_select("(GeometricSolver)|(CoincidenceConstraint)") #test(line_problem_2d_0()) #test(line_problem_2d_1()) #test(line_problem_2d_2()) #test(line_problem_2d_3a()) #test(line_problem_2d_3b()) #test(line_problem_2d_4()) #test(line_problem_3d_0()) #test(line_problem_3d_1()) test(line_problem_3d_2())
def test_mate(): problem = GeometricProblem(dimension=3) # create and mate two blocks add_block(problem, "A", 4.0, 2.0, 6.0) add_block(problem, "B", 4.0, 2.0, 6.0) mate_blocks(problem, "A", 'right-bot-front','right-bot-back','right-top-front', "B", 'left-bot-front','left-bot-back','left-top-front', 0.5, 0.0) # add global coordinate system problem.add_point("origin",vector([0.0,0.0,0.0])) problem.add_point("x-axis",vector([1.0,0.0,0.0])) problem.add_point("y-axis",vector([0.0,1.0,0.0])) problem.add_constraint(FixConstraint("origin",vector([0.0,0.0,0.0]))) problem.add_constraint(FixConstraint("x-axis",vector([1.0,0.0,0.0]))) problem.add_constraint(FixConstraint("y-axis",vector([0.0,1.0,0.0]))) # fix block1 to cs problem.add_constraint(MateConstraint("origin","x-axis","y-axis", block_var("A", "left-bot-front"),block_var("A", "right-bot-front"),block_var("A", "left-top-front"), id_transform_3D())) test(problem)
def test3d(): #diag_select("clsolver") #test(double_tetrahedron_problem()) #test(ada_tetrahedron_problem()) #test(double_banana_problem()) #test(double_banana_plus_one_problem()) #test(random_triangular_problem_3D(10,10.0,0.0,0.5)) #test(random_distance_problem_3D(10,1.0,0.0)) test(fix1_problem_3d()) test(fix2_problem_3d()) test(fix3_problem_3d())
def test2d(): #diag_select("clsolver") test(ddd_problem()) test(double_triangle()) test(triple_double_triangle()) test(dad_problem()) test(add_problem()) test(ada_problem()) test(aad_problem())