Ejemplo n.º 1
0
    def _formed_object_default(self):
        return CreasePattern(X=[0, 0, 0])

    traits_view = View(
        VGroup(
            HGroup(
                Item('node', springy=True)
            ),
            UItem('formed_object@'),
        ),
        resizable=True,
        title='Custom Factory'
    )

if __name__ == '__main__':

    from oricreate.api import CreasePatternState

    cp = CreasePatternState(X=[[0, 0, 0],
                               [1, 1, 0]],
                            L=[[0, 1]])

    yf = CustomCPFactory(formed_object=cp)

    cp = yf.formed_object
    yf.configure_traits()

    import pylab as p
    cp.plot_mpl(p.axes())
    p.show()
Ejemplo n.º 2
0
'''
Created on 13.04.2016

@author: jvanderwoerd
'''
from oricreate.api import CreasePatternState, CustomCPFactory
import matplotlib.pyplot as plt

cp = CreasePatternState(X=[[0, 0, 0],
                           [1, 0, 0],
                           [1, 1, 0],
                           [0, 1, 0],
                           [0.5, 0.5, 0]
                          ],
                        L=[[0, 1], [1, 2], [2, 3], [3, 0],
                           [0, 4], [1, 4], [2, 4], [3, 4]],
                        F=[[0, 1, 4], [1, 2, 4], [4, 3, 2], [4, 3, 0]]
                        )

cp_factory = CustomCPFactory(formed_object=cp)

fig, ax = plt.subplots()
cp.plot_mpl(ax, facets=True, lines=True, linewidth=2, fontsize=30)

plt.show()