I am trying to make a porous structure using a macro script. With the help of the forum I have an approach, now my issue the size of my model. I can do about 100 holes a pass in a loop but i run into problems as I approach 10,000 pores. Am I at just a hard limit for the program. I know there are a lot of surfaces to handle but I am planning on just converting to an STL file for a CFD run.
What is the most intensive step of a binary cut? Should I go to a 1 sphere per pass after a certain point? Ideally I need to get about 1 million pores. The CFD is going on a cluster but I have to do geometry on a desktop, (i5 wtih 32GB of memory). Is this just not feasible?
My code
Code: Select all
import Part,numpy
doc = App.newDocument()
mu, sigma = 0, 0.1 # mean and standard deviation
solid = Part.makeBox(500,500,200)
message = "#Entering Loop"
spheres = []
file = open('myfile1.dat', 'w+')
s1 = solid
for y in range(0,100):
spheres = []
s2 = None
for x in range(0,10 ):
radius = numpy.random.normal(loc=20.0, scale=1.0, size=None)
pos_x = numpy.random.randint(1,500)
pos_y = numpy.random.randint(1,500)
pos_z = numpy.random.randint(1,500)
pos_vec = FreeCAD.Vector(pos_x,pos_y,pos_z)
spheres.append(Part.makeSphere(radius, pos_vec))
s2 = spheres.pop()
fused = s2.multiFuse(spheres)
result = s1.cut(fused)
s1 = result
Part.show(result)