Sample Import Conversion Scripts

 
 
 

Adaptive Tesselation Script Sample

This sample script autostitches and then creates two levels of detail (named adaptDEFAULT and adapt2DEFAULT) with adaptive sampling.

For a definition of the sampling methods, see What are adaptive vs. non-adaptive sampling?.

# journal Custom-Example-High.j
#
# AUTOSTITCH
#
# Use this setting to create a shell of adjacent surfaces
# This creates fewer scene graph nodes.
edit autostitch createnewmodel true
#
# Stitch the geometry and then separate by material assignment
# (creates separate shells when createnewmodel true).
edit autostitch preservestyleassignments true
#
# Separate stitched objects by layer.
edit autostitch separatelayers true
#
# Choose a specific stitch tolerance in cm.
edit autostitch tolerance 0.1
#
create autostitch
#
#
# TESSELLATE
#
#
create unloadfile
# create the first LOD, named adaptDEFAULT
create tessellationsettings adaptDEFAULT
edit tessellationsettings adaptDEFAULT chorddeviation 0.02
edit tessellationsettings adaptDEFAULT maxchordlength 0
edit tessellationsettings adaptDEFAULT normaltolerance 0
create levelofdetail adaptDEFAULT
#
# create the second LOD, named adapt2DEFAULT
create tessellationsettings adapt2DEFAULT
edit tessellationsettings adapt2DEFAULT chorddeviation 0.01
edit tessellationsettings adapt2DEFAULT maxchordlength 0
edit tessellationsettings adapt2DEFAULT normaltolerance 0
create levelofdetail adapt2DEFAULT
#
# Now output the file
output "%s"
#
# Delete the NURBS model.
#(If you delete the NURBS model you cannot calculate ambient shadows.)
#delete splinefit

Non-Adaptive Script Example

This sample script autostitches and then applies non-adaptive tessellation with very high surface quality.

For a definition of the sampling methods, see What are adaptive vs. non-adaptive sampling?.

# journal NonAdaptive-VeryHigh.j
#
# AUTOSTITCH
#
# Use this setting to create a shell of adjacent surfaces
# This creates fewer scene graph nodes.
edit autostitch createnewmodel true
#
# Stitch the geometry and then separate by material assignment
# (creates separate shells when createnewmodel true)
edit autostitch preservestyleassignments true
#
# Separate stitched objects by layer.
edit autostitch separatelayers true
#
# Choose a specific stitch tolerance in cm.
edit autostitch tolerance 0.1
#
create autostitch
#
#
# TESSELLATE
#
#
create unload
#
# create an LOD named veryhighNA
create tessellationsettings veryhighNA
edit tessellationsettings veryhighNA tessellate true
# set the sampling method to non-adaptive (it’s adaptive by default)
edit tessellationsettings veryhighNA adaptive false
edit tessellationsettings veryhighNA sampletype entiredomain
edit tessellationsettings veryhighNA numsamples 16
create level veryhighNA
output "%s"