Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
e829e0e2
Commit
e829e0e2
authored
3 years ago
by
Markus FRANK
Committed by
MarkusFrankATcernch
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
DDCAD/src/plugins/CADPlugins.cpp
+2
-6
2 additions, 6 deletions
DDCAD/src/plugins/CADPlugins.cpp
examples/DDCAD/CMakeLists.txt
+28
-1
28 additions, 1 deletion
examples/DDCAD/CMakeLists.txt
examples/DDCAD/compact/Import_CaloEndcap.xml
+26
-0
26 additions, 0 deletions
examples/DDCAD/compact/Import_CaloEndcap.xml
with
56 additions
and
7 deletions
DDCAD/src/plugins/CADPlugins.cpp
+
2
−
6
View file @
e829e0e2
...
@@ -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
);
}
}
...
...
This diff is collapsed.
Click to expand it.
examples/DDCAD/CMakeLists.txt
+
28
−
1
View file @
e829e0e2
...
@@ -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"
)
#
#
#
This diff is collapsed.
Click to expand it.
examples/DDCAD/compact/Import_CaloEndcap.xml
0 → 100644
+
26
−
0
View file @
e829e0e2
<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>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment