Skip to content
Snippets Groups Projects
Commit e829e0e2 authored by Markus FRANK's avatar Markus FRANK Committed by MarkusFrankATcernch
Browse files

Support export to CAD - improve CAD imports to support vis-attrs and materials

parent 45add6af
No related branches found
No related tags found
No related merge requests found
...@@ -41,13 +41,9 @@ static void* read_CAD_Volume(Detector& dsc, int argc, char** argv) { ...@@ -41,13 +41,9 @@ static void* read_CAD_Volume(Detector& dsc, int argc, char** argv) {
if ( fname.empty() || help ) { if ( fname.empty() || help ) {
cout << cout <<
"Usage: -plugin DD4hep_CAD_export -arg [-arg] \n\n" "Usage: -plugin DD4hep_CAD_export -arg [-arg] \n\n"
" -output <string> Output file name. \n" " -input <string> Input file name. \n"
" -type <string> Output file type. \n" " -scale <float> Scale factor when importing shapes. \n"
" -recursive Export volume/detector element and all daughters.\n"
" -volume <string> Path to the volume to be exported. \n"
" -detector <string> Path to the detector element to be exported. \n"
" -help Print this help output. \n" " -help Print this help output. \n"
" -scale <number> Unit scale before writing output data. \n"
" Arguments given: " << arguments(argc,argv) << endl << flush; " Arguments given: " << arguments(argc,argv) << endl << flush;
::exit(EINVAL); ::exit(EINVAL);
} }
......
...@@ -44,7 +44,10 @@ include(CTest) ...@@ -44,7 +44,10 @@ include(CTest)
# #
# Test basic shapes by comparing mesh vertices with reference file # Test basic shapes by comparing mesh vertices with reference file
set(DDCAD_Tests) set(DDCAD_Tests)
## Multi-shapes: BLEND_HUMAN COB_dwarf set(ClientTestsEx_INSTALL ${CMAKE_INSTALL_PREFIX}/examples/ClientTests)
set(DDCADTests_INSTALL ${CMAKE_INSTALL_PREFIX}/examples/DDCAD)
#
# Multi-shapes: BLEND_HUMAN COB_dwarf
list(APPEND DDCAD_Tests BHV_Boxing_Toes Collada_duck PLY_Wuson ) list(APPEND DDCAD_Tests BHV_Boxing_Toes Collada_duck PLY_Wuson )
foreach (test ${DDCAD_Tests}) foreach (test ${DDCAD_Tests})
dd4hep_add_test_reg( DDCAD_Check_Shape_${test} dd4hep_add_test_reg( DDCAD_Check_Shape_${test}
...@@ -53,3 +56,27 @@ foreach (test ${DDCAD_Tests}) ...@@ -53,3 +56,27 @@ foreach (test ${DDCAD_Tests})
REGEX_PASS "Shape verification SUCCESSFUL." REGEX_PASS "Shape verification SUCCESSFUL."
REGEX_FAIL "ERROR;FAILED" ) REGEX_FAIL "ERROR;FAILED" )
endforeach() endforeach()
#
# Test CAD export from a simplyfied model
dd4hep_add_test_reg( DDCAD_export_cal_endcaps
COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDCAD.sh"
EXEC_ARGS geoPluginRun -input ${ClientTestsEx_INSTALL}/compact/CaloEndcapReflection.xml
-plugin DD4hep_CAD_export -output endcap_reflection.collada
-type collada -recursive -detector /world -recursive -scale 1.0
REGEX_PASS "Analysed 96 of 96 meshes"
REGEX_FAIL "Exception"
REGEX_FAIL "FAILED"
)
#
# Test CAD import from the exported simplyfied model
dd4hep_add_test_reg( DDCAD_import_cal_endcaps
COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDCAD.sh"
EXEC_ARGS geoDisplay -input ${DDCADTests_INSTALL}/compact/Import_CaloEndcap.xml -load -destroy
DEPENDS Persist_Conditions_Save
REGEX_PASS "Read 96 meshes"
REGEX_FAIL "Exception"
)
#
#
#
<lccdd>
<!--
#==========================================================================
# AIDA Detector description implementation
#==========================================================================
# Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
# All rights reserved.
#
# For the licensing terms see $DD4hepINSTALL/LICENSE.
# For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
#
#==========================================================================
-->
<includes>
<gdmlFile ref="../../ClientTests/compact/CheckShape.xml"/>
</includes>
<detectors>
<detector id="1" name="Shape_Collada" type="DD4hep_TestShape_Creator">
<check>
<shape type="CAD_MultiVolume" ref="./endcap_reflection.collada" unit="cm"/>
</check>
</detector>
</detectors>
</lccdd>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment