Load Session from RV2

Load Pattern from RV2 Session

Here, we will load the pattern that is created from the RV2 session, so that you can also work partially in RV2 user interface and continue your design procedure with Python. As an alternative, you can also find the .json file of the pattern in the data folder, and load it the same way as the former tutorial example.


# ==============================================================================
# File
# ==============================================================================
HERE = os.path.dirname(__file__)
FILE = os.path.join(HERE, 'data', 'armadillo_pattern_initial.rv2')
with open(FILE, 'r') as f:
    session = json.load(f, cls=DataDecoder)

pattern = Pattern.from_data(session['data']['pattern'])

# ==============================================================================
#  Visualization
# ==============================================================================
artist = MeshArtist(pattern, layer="CSD2::pattern")
artist.clear_layer()
artist.draw()

Last updated