Instantly share code, notes, and snippets.

Embed
What would you like to do?
python script to run InverseCSG on an example part from OpenLSTO based on the run_tests script that ships with InverseCSG
import os
import sys
# Usage: python3 topopt2CSG.py <build_dir> <test_name>
# Example:
# python3 topopt2CSG.py ../build openlsto
#
if len(sys.argv) < 3:
print('Error: please specify the test case name.')
sys.exit(-1)
build_dir = sys.argv[1]
test_name = sys.argv[2]
if test_name == 'openlsto':
os.system('python3 ../inverse_csg/main.py --builddir %s --outdir ../openlsto --mesh ../openlsto/mystlfile-openscad-import.off --eps 0.1 --surfacedensity 100 --volumedensity 10' % build_dir)
else:
print('Unknown test case: %s' % test_name)
sys.exit(-1)
@jstults

This comment has been minimized.

Copy link
Owner Author

jstults commented Jan 24, 2019

for a post on combining OpenLSTO and InverseCSG for topology optimization interpretation:
http://www.variousconsequences.com/2019/01/openlsto-plus-inversecsg.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment