Can you specify the interval of a mesh when sweeping from a surface that has been meshed?

I’d like to be able to control the # of layers my sweep mesh makes when I’m sweeping a meshed surface into a volume. The doco at Creating Volumes says

include_mesh : This option will sweep the source surface and existing mesh into a meshed 3D solid. The mesh size is automatically computed using the Default auto interval specification.

I know I can adjust the Set Auto Size Default <value> but that isn’t the same as the interval, which I can’t seem to find a way to change. Is there some var I can set to control the interval?

Something like getting half as many mesh layers when doing

cubit.cmd('create surface circle radius 0.1 zplane ')
cubit.cmd('undo group begin')
cubit.cmd('surface 1  interval  ')
cubit.cmd('mesh surface 1 ')
cubit.cmd('undo group end')
cubit.cmd('sweep surface 1  perpendicular distance 0.5  include_mesh  keep ')

To my knowledge there isn’t a way to do this when using the described approach for creating the 3D volume. There is, however, a different approach that does allow you to do this: create the BREP first, then mesh with a sweep, specifying the number of intervals on the linking curves.

For example:

reset

create surface circle radius 0.1 zplane
sweep surface 1 perpendicular distance 0.5

surface 1 size 0.025
surface 1 scheme circle
mesh surface 1

curve 3  interval 5
curve 3  scheme equal

mesh volume 1

You could even automate this using the Cubit-Python API, automatically identifying a linking curve:

def find_sweep_link_curve( volume_id, source_surface_id, try_split_periodic ):
  surfs_in_volume = cubit.parse_cubit_list( "surface", f"in volume {volume_id}" )
  curves_in_source_surface = cubit.parse_cubit_list( "curve", f"in surface {source_surface_id}" )
  verts_in_source_surface = cubit.parse_cubit_list( "vertex", f"in surface {source_surface_id}" )
  for vid in verts_in_source_surface:
    curves_in_vert = cubit.parse_cubit_list( "curve", f"in vertex {vid}" )
    for cid in curves_in_vert:
      if cid not in curves_in_source_surface:
        return cid
  if try_split_periodic:
    cubit.cmd( f"split periodic volume {volume_id}" )
    cid = find_sweep_link_curve( volume_id, source_surface_id, False )
    return cid
  return ()

Demonstrate on a “complex” surface

cubit.cmd( "reset" )
cubit.cmd( "create surface circle radius 1 zplane" )
cubit.cmd( "create surface circle radius 1 zplane" )
cubit.cmd( "create surface circle radius 1 zplane" )
cubit.cmd( "move vol 2 x 1.4" )
cubit.cmd( "move vol 3 x -.5 y 1.4" )
cubit.cmd( "subtract vol 2 3 from vol 1" )
cubit.cmd( "sweep surface 4  perpendicular distance 1" )

cubit.cmd( "surface 9 size 0.05" )
cubit.cmd( "surface 9 scheme polyhedron" )
cubit.cmd( "mesh surface 9" )

link_curve = find_sweep_link_curve( 1, 9, False )
cubit.cmd( f"curve {link_curve} interval 5" )

cubit.cmd( "mesh volume 1" )

A volume with no linking curve:

cubit.cmd( "reset" )
cubit.cmd( "create Cylinder height 1 radius .25" )

link_curve = find_sweep_link_curve( 1, 3, True )
cubit.cmd( f"curve {link_curve} interval 5" )

cubit.cmd( "surface 2 size 0.05" )
cubit.cmd( "surface 2 scheme circle" )
cubit.cmd( "mesh surface 2" )

cubit.cmd( "mesh volume 1" )

Let me know if this is helpful / suits your needs!

Hi, thanks for the reply! This didn’t quite work for me on my geometry (the linking curve part) but it did inspire a solution that works well: instead of just sweeping the surface into a volume I created a curve to sweep around and I could set the interval of the curve then mesh a surface then the volume. Thanks again!