Example #1
0
                            [0, 3],
                            [1, 3],
                            [1, 4],
                            [2, 3],
                            [2, 5],
                            [3, 4],
                            [3, 5],
                            [3, 6],
                            [4, 6],
                            [5, 6]],
                       F=[[0, 1, 3],
                            [0, 3, 2],
                            [1, 4, 3],
                            [2, 3, 5],
                            [3, 6, 5],
                            [3, 4, 6]])

    caf = CnstrTargetFace(F=[r_, s_, 4 * 0.4 * t_ * r_ * (1 - r_ / 3)])

    ff = FormFinding(cp=cp, n_steps=1)

    ff.tf_lst = [(caf, [0, 1, 2, 3, 4, 5, 6])]

    # Unfolding
    uf = Folding(cp=ff.cp, tf_lst=ff.tf_lst, n_steps=10)
    uf.unfold = True
    print 'x_t', uf.x_t[-1]



fold = FormFinding(
    source=init,
    n_steps=10,
    tf_lst=[
        (face_z_t_2, triangle.N)
        # , (face_y_0,n_y_0) ,
        ,
        (tf_y_plus, n_tf_y_plus),
        (tf_y_minus, n_tf_y_minus)
        # ],
        # dof_constraints= [
        #   ([(0,0,-1.0),(2,0,2.0),(4,0,-1.0)],0.0), ([(2,0,-1.0),(4,0,2.0),(6,0,-1.0)],0.0), ([(6,0,-1.0),(8,0,2.0),(10,0,-1.0)],0.0),
        # ([(8,0,-1.0),(10,0,1.0),(11,0,1.0),(12,0,-1.0)],0.0),
        #  ([(11,0,-1.0),(12,0,2.0),(13,0,-1.0)],0.0), ([(12,0,-1.0),(13,0,2.0),(14,0,-1.0)],0.0), ([(13,0,-1.0),(14,0,2.0),(15,0,-1.0)],0.0),
        # ([(14,0,-1.0),(15,0,1.0),(16,0,1.0),(17,0,-1.0)],0.0),
        #  ([(16,0,-1.0),(17,0,2.0),(18,0,-1.0)],0.0), ([(17,0,-1.0),(18,0,2.0),(19,0,-1.0)],0.0),
        # ([(18,0,-1.0),(19,0,1.0),(20,0,1.0),(21,0,-1.0)],0.0),
        # ([(20,0,-1.0),(21,0,2.0),(22,0,-1.0)],0.0),
        # ([(21,0,-1.0),(22,0,1.0),(23,0,1.0),(24,0,-1.0)],0.0),
        # Try with only cinematic constaints
        # ([(5,2,1.0)],0.0), ([(5,1,1.0)],0.0), ([(5,0,1.0)],0.0),
        # ([(25,2,1.0),(5,2,-1.0)],0.3)
        # ([(25,1,1.0)],0.0), ([(25,0,1.0)],0.0)
        # Formfinding : Cinematic constraints to have a constant length of the side lines
        # Right side of the pattern :
        #  ([(25,0,1.0)*(25,0,1.0),(24,0,1.0)*(25,0,-2.0),(24,0,1.0)*(24,0,1.0), (25,1,1.0)*(25,1,1.0),(24,1,1.0)*(25,1,-2.0),(24,1,1.0)*(24,1,1.0), (25,2,1.0)*(25,2,1.0),(24,2,1.0)*(25,2,-2.0),(24,2,1.0)*(24,2,1.0),
        # (24,0,-1.0)*(24,0,1.0),(22,0,1.0)*(24,0,2.0),(22,0,-1.0)*(22,0,1.0), (24,1,-1.0)*(24,1,1.0),(22,1,1.0)*(24,1,2.0),(22,1,-1.0)*(22,1,1.0), (24,2,-1.0)*(24,2,1.0),(22,2,1.0)*(24,2,2.0),(22,2,-1.0)*(22,2,1.0)],0.0),
        # ([(24,0,1.0)*(24,0,1.0),(22,0,1.0)*(24,0,-2.0),(22,0,1.0)*(22,0,1.0), (24,1,1.0)*(24,1,1.0),(22,1,1.0)*(24,1,-2.0),(22,1,1.0)*(22,1,1.0), (24,2,1.0)*(24,2,1.0),(22,2,1.0)*(24,2,-2.0),(22,2,1.0)*(22,2,1.0),
        # (22,0,-1.0)*(22,0,1.0),(19,0,1.0)*(22,0,2.0),(19,0,-1.0)*(19,0,1.0), (22,1,-1.0)*(22,1,1.0),(19,1,1.0)*(22,1,2.0),(19,1,-1.0)*(19,1,1.0), (22,2,-1.0)*(22,2,1.0),(19,2,1.0)*(22,2,2.0),(19,2,-1.0)*(19,2,1.0)],0.0),
        # ([(22,0,1.0)*(22,0,1.0),(19,0,1.0)*(22,0,-2.0),(19,0,1.0)*(19,0,1.0), (22,1,1.0)*(22,1,1.0),(19,1,1.0)*(22,1,-2.0),(19,1,1.0)*(19,1,1.0), (22,2,1.0)*(22,2,1.0),(19,2,1.0)*(22,2,-2.0),(19,2,1.0)*(19,2,1.0),
        # (19,0,-1.0)*(19,0,1.0),(15,0,1.0)*(19,0,2.0),(15,0,-1.0)*(15,0,1.0), (19,1,-1.0)*(19,1,1.0),(15,1,1.0)*(19,1,2.0),(15,1,-1.0)*(15,1,1.0), (19,2,-1.0)*(19,2,1.0),(15,2,1.0)*(19,2,2.0),(15,2,-1.0)*(15,2,1.0)],0.0),
        # ([(19,0,1.0)*(19,0,1.0),(15,0,1.0)*(19,0,-2.0),(15,0,1.0)*(15,0,1.0), (19,1,1.0)*(19,1,1.0),(15,1,1.0)*(19,1,-2.0),(15,1,1.0)*(15,1,1.0), (19,2,1.0)*(19,2,1.0),(15,2,1.0)*(19,2,-2.0),(15,2,1.0)*(15,2,1.0),
        # (15,0,-1.0)*(15,0,1.0),(10,0,1.0)*(15,0,2.0),(10,0,-1.0)*(10,0,1.0), (15,1,-1.0)*(15,1,1.0),(10,1,1.0)*(15,1,2.0),(10,1,-1.0)*(10,1,1.0), (15,2,-1.0)*(15,2,1.0),(10,2,1.0)*(15,2,2.0),(10,2,-1.0)*(10,2,1.0)],0.0),
        # Left side of the pattern :
        # ([(25,0,1.0)*(25,0,1.0),(23,0,1.0)*(25,0,-2.0),(23,0,1.0)*(23,0,1.0), (25,1,1.0)*(25,1,1.0),(23,1,1.0)(25,1,-2.0),(23,1,1.0)*(23,1,1.0), (25,2,1.0)*(25,2,1.0),(23,2,1.0)*(25,2,-2.0),(23,2,1.0)*(23,2,1.0),
        # (23,0,-1.0)*(23,0,1.0),(20,0,1.0)*(23,0,2.0),(20,0,-1.0)*(20,0,1.0), (23,1,-1.0)*(23,1,1.0),(20,1,1.0)(23,1,2.0),(20,1,-1.0)*(20,1,1.0), (23,2,-1.0)*(23,2,1.0),(20,2,1.0)*(23,2,2.0),(20,2,-1.0)*(20,2,1.0)],0.0)
        # ([(24,0,1.0)*(24,0,1.0),(22,0,1.0)*(24,0,-2.0),(22,0,1.0)*(22,0,1.0), (24,1,1.0)*(24,1,1.0),(22,1,1.0)(24,1,-2.0),(22,1,1.0)*(22,1,1.0), (24,2,1.0)*(24,2,1.0),(22,2,1.0)(24,2,-2.0),(22,2,1.0)*(22,2,1.0),
        # (22,0,-1.0)*(22,0,1.0),(19,0,1.0)*(22,0,2.0),(19,0,-1.0)*(19,0,1.0), (22,1,-1.0)*(22,1,1.0),(19,1,1.0)(22,1,2.0),(19,1,-1.0)*(19,1,1.0), (22,2,-1.0)*(22,2,1.0),(19,2,1.0)(22,2,2.0),(19,2,-1.0)*(19,2,1.0)],0.0),
        # ([(22,0,1.0)*(22,0,1.0),(19,0,1.0)*(22,0,-2.0),(19,0,1.0)*(19,0,1.0), (22,1,1.0)*(22,1,1.0),(19,1,1.0)(22,1,-2.0),(19,1,1.0)*(19,1,1.0), (22,2,1.0)*(22,2,1.0),(19,2,1.0)(22,2,-2.0),(19,2,1.0)*(19,2,1.0),
        # (19,0,-1.0)*(19,0,1.0),(15,0,1.0)*(19,0,2.0),(15,0,-1.0)*(15,0,1.0), (19,1,-1.0)*(19,1,1.0),(15,1,1.0)(19,1,2.0),(15,1,-1.0)*(15,1,1.0), (19,2,-1.0)*(19,2,1.0),(15,2,1.0)(19,2,2.0),(15,2,-1.0)*(15,2,1.0)],0.0),
        # ([(19,0,1.0)*(19,0,1.0),(15,0,1.0)*(19,0,-2.0),(15,0,1.0)*(15,0,1.0), (19,1,1.0)*(19,1,1.0),(15,1,1.0)(19,1,-2.0),(15,1,1.0)*(15,1,1.0), (19,2,1.0)*(19,2,1.0),(15,2,1.0)(19,2,-2.0),(15,2,1.0)*(15,2,1.0),
        # (15,0,-1.0)*(15,0,1.0),(10,0,1.0)*(15,0,2.0),(10,0,-1.0)*(10,0,1.0), (15,1,-1.0)*(15,1,1.0),(10,1,1.0)(15,1,2.0),(10,1,-1.0)*(10,1,1.0), (15,2,-1.0)*(15,2,1.0),(10,2,1.0)(15,2,2.0),(10,2,-1.0)*(10,2,1.0)],0.0),
    ],
    MAX_ITER=500,
)
        + t_ * (H - dH)
    )


# face du dome a suivre
tf_z_t = CnstrTargetFace(F=[get_dome_x_t(R_o, 0, H, 0), s_, get_dome_z_t(R_o, 0, H, 0)])


# Surface limits of the folding

# tf_x_R_i = CnstrTargetFace(F=[R_i, r_, s_])
# tf_x_R_o = CnstrTargetFace(F=[R_o, r_, s_])
tf_z_0 = CnstrTargetFace(F=[r_, s_, 0])

# ===============================================================================
# Initialization object
# ===============================================================================

# init = Initialization(cp=triangle, tf_lst=[(tf_z_t, triangle.N)])


# ===============================================================================
# Form-finding object
# ===============================================================================
form = FormFinding(source=init, tf_lst=[(tf_z_t, triangle.N)], n_steps=10, MAX_ITER=500)


v = CreasePatternView(root=form.source)
v.configure_traits()
form.show()