I have a complex surface generated by 161523 vertexes. The attached file ‘make_surface_big.jou’ is how this surface was created, which took ~ 3 days to read all the vertexes. The trelis file for the surface can be downloaded from the following link. make_surface_big.jou (7.1 MB) trelis file
I was trying to use one part of this surface to make a volume and chop another volume. The journal file is attached. However, it took ~4 days to run and finally gave an error message (attached). I tried to use ‘webcut’ and got similar error message (also attached).
I’m confused because when I tried with a smaller surface it worked. Any help on how to create this geometry will be much appreciated. Also, any suggestions on making these operations faster? I’m using Coreform Cubit 2021.5 on a 2020 iMac (3.8 GHz 8-Core Intel Core i7 and 128 GB memory).
Set the graphics tolerance to 15 degrees or larger.
graphics tolerance angle 15
Note that 15 degrees is the “optimal” render tolerance for accuracy and speed. Rendering times increase dramatically as you decrease from 15 degrees to 1 degree… see plot (time in seconds)
VERY IMPORTANT Don’t run “very large” journal files that consist of the same command applied over-and-over to unique values of a dataset. Instead use Cubit-Python to apply instructions via various flow control and modern programming paradigms. For instance, instead of running a 160K line journal file, that consists primarily of commands similar to:
Write those vertex locations to a CSV file and use Cubit-Python to process them. For instance:
def create_vertex_from_file(filename):
f = open(filename)
fLines = f.readlines()
fLines = [line.strip() for line in fLines]
f.close()
for line in fLines:
line = line.split(",")
cubit.cmd(f"create vertex x {line[0]} y {line[1]} z {line[2]}")
Combining these three things together, here’s what I’d do to replace your make_surface_big.jou file:
def main(vertex_file, curve_file, offset):
prepare_cubit()
create_vertex_from_file(vertex_file)
create_curve_from_file(curve_file)
create_surface(offset)
def prepare_cubit():
cubit.cmd("reset")
cubit.cmd("echo off")
cubit.cmd("journal off")
cubit.cmd("info off")
cubit.cmd("graphics tolerance 15")
def create_vertex_from_file(filename):
print(f"Creating vertices from {filename}...")
f = open(filename)
fLines = f.readlines()
fLines = [line.strip() for line in fLines]
f.close()
counter = 0
line_count = 0
for line in fLines:
counter+=1
line_count+=1
line = line.split(",")
cubit.cmd(f"create vertex x {line[0]} y {line[1]} z {line[2]}")
if counter == 1000:
counter = 0
cubit.cmd("info on")
print(f"Processed line {line_count} of {len(fLines)}")
cubit.cmd("info off")
cubit.cmd("info on")
print("Done!")
cubit.cmd("info off")
def create_curve_from_file(filename):
cubit.cmd("info on")
print(f"Creating curves using vertices from {filename}...")
cubit.cmd("info off")
f = open(filename)
fLines = f.readlines()
fLines = [line.strip() for line in fLines]
f.close()
for line in fLines:
line = line.split(",")
cubit.cmd(f"create curve spline location vertex {line[0]} to {line[1]} delete")
cubit.cmd("info on")
print("Done!")
cubit.cmd("info off")
def create_surface(offset):
cubit.cmd("info on")
cubit.cmd("Creating shoreline surface model...")
cubit.cmd("create surface skin curve all")
cubit.cmd(f"webcut volume 1 with plane zplane offset {offset}")
cubit.cmd("merge all")
cubit.cmd("delete vertex all")
cubit.cmd("delete curve all")
print("Done!")
cubit.cmd("info off")
if __name__=="__main__":
vertex_file = r"C:\Users\Owner\Downloads\vertex_locations.csv"
curve_file = r"C:\Users\Owner\Downloads\spline_vertices.csv"
offset = -0.2
main(vertex_file, curve_file, offset)
Notice how I’ve balanced the cost of printing to the terminal with progress reporting, via intentional use of print statements and info on / info off. Then I run this using my (Windows 10) terminal:
## POWERSHELL COMMAND
PS C:\Users\Owner> & 'C:\Program Files\Coreform Cubit 2021.5\bin\coreform_cubit.com' -nographics
## WAIT FOR CUBIT TO LOAD... THEN WHEN PROMPT APPEARS DO THE FOLLOWING:
### Add the path to the Python file I made above
import sys
sys.path.append(r"C:\Users\Owner\Downloads")
### Import the file
import make_surface_big
### Set variables
vertex_file = r"C:\Users\Owner\Downloads\vertex_locations.csv"
curve_file = r"C:\Users\Owner\Downloads\spline_vertices.csv"
offset = -0.2
### Execute
make_surface_big.main(vertex_file, curve_file, offset)
I attempted to to use a webcut tool on this model. It for three days without completing. I didn’t wait for an error at that point.
Working with splines is very expensive compared to analytic CAD. 160k spline vertices is astronomical. There’s very little that we can do to improve that performance - much of that is on the commercial solid modeling engine that we use, ACIS. We would suggest resampling the vertices to reduce the number of vertices to improve the performance.
The volume overlap of the webcut you are attempting is very small in comparison to the overall model size. Couple that with 160k spline vertices and there are any number of reasons why it might fail.
Are you trying to create three volumes? It might be faster to project the shoreline curve on to the surfaces and create the volumes via bounding box or lofting.