Created
January 24, 2019 11:34
-
-
Save jstults/3e6e1ac5958ad50f213f3dddff2c3ac1 to your computer and use it in GitHub Desktop.
python script to run InverseCSG on an example part from OpenLSTO based on the run_tests script that ships with InverseCSG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for a post on combining OpenLSTO and InverseCSG for topology optimization interpretation:
http://www.variousconsequences.com/2019/01/openlsto-plus-inversecsg.html