Example #1
0
import matplotlib.pyplot as plt
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import cuboct
import pfea
import frame3dd
import subprocess
import json
from math import *
import DM23dd
import pickle

mat_matrix = DM23dd.mat_matrix_from_json('data/bridge.json')

subdiv = 1
#Subdivide the material matrix
dims = np.shape(mat_matrix)
new_mat_matrix = np.zeros(
    ((dims[0] - 2) * subdiv + 2, (dims[1] - 2) * subdiv + 2,
     (dims[2] - 2) * subdiv + 2))

for i in range(1, dims[0] - 1):
    for j in range(1, dims[1] - 1):
        for k in range(1, dims[2] - 1):
            if mat_matrix[i][j][k] == 1:
                dex = ((i - 1) * subdiv + 1, (j - 1) * subdiv + 1,
                       (k - 1) * subdiv + 1)
                for l in range(0, subdiv):
                    for m in range(0, subdiv):
                        for n in range(0, subdiv):
Example #2
0
import matplotlib.pyplot as plt
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import cuboct
import pfea
import frame3dd
import subprocess
import json
from math import *
import DM23dd 
import pickle

mat_matrix = DM23dd.mat_matrix_from_json('data/hut.json')

subdiv = 1
#Subdivide the material matrix
dims = np.shape(mat_matrix)
new_mat_matrix = np.zeros(((dims[0]-2)*subdiv+2,(dims[1]-2)*subdiv+2,(dims[2]-2)*subdiv+2))

for i in range(1,dims[0]-1):
	for j in range(1,dims[1]-1):
		for k in range(1,dims[2]-1):
			if mat_matrix[i][j][k] == 1:
				dex = ((i-1)*subdiv+1,(j-1)*subdiv+1,(k-1)*subdiv+1)
				for l in range(0,subdiv):
					for m in range(0,subdiv):
						for n in range(0,subdiv):
							new_mat_matrix[l+dex[0]][m+dex[1]][n+dex[2]] = 1

#print(new_mat_matrix)
Example #3
0
import matplotlib.pyplot as plt
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import cuboct
import pfea
import frame3dd
import subprocess
import json
from math import *
import DM23dd 
import pickle

mat_matrix = DM23dd.mat_matrix_from_json('data/bridge.json')

subdiv = 1
#Subdivide the material matrix
dims = np.shape(mat_matrix)
new_mat_matrix = np.zeros(((dims[0]-2)*subdiv+2,(dims[1]-2)*subdiv+2,(dims[2]-2)*subdiv+2))

for i in range(1,dims[0]-1):
	for j in range(1,dims[1]-1):
		for k in range(1,dims[2]-1):
			if mat_matrix[i][j][k] == 1:
				dex = ((i-1)*subdiv+1,(j-1)*subdiv+1,(k-1)*subdiv+1)
				for l in range(0,subdiv):
					for m in range(0,subdiv):
						for n in range(0,subdiv):
							new_mat_matrix[l+dex[0]][m+dex[1]][n+dex[2]] = 1

#print(new_mat_matrix)