From 11d0ab1e17e88ed393b83263db88b2e8f558f9f4 Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Wed, 3 May 2023 14:31:36 -0500
Subject: [PATCH] fix: respect rotation/position transformation in
 CAD_MultiVolume

This respects the specified rotation/position in xml such as:
```xml
  <detectors>
    <detector id="1" name="Shape_PLY_Wuson" type="DD4hep_TestShape_Creator">
      <check vis="Shape1_vis">
        <shape type="CAD_Shape" ref="${DD4hepExamplesINSTALL}/examples/DDCAD/models/PLY/Wuson.ply"/>
        <position x="30 * cm" y="30 * cm" z="30 * cm"/>
        <rotation x="0"  y="0"  z="0"/>
      </check>
      <test type="DD4hep_Mesh_Verifier" ref="${DD4hepExamplesINSTALL}/examples/DDCAD/ref/Ref_PLY_Wuson.txt" create="CheckShape_create"/>
    </detector>
  </detectors>
```
---
 DDCAD/src/plugins/CADPlugins.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DDCAD/src/plugins/CADPlugins.cpp b/DDCAD/src/plugins/CADPlugins.cpp
index 231dc6fb5..8a646ebe9 100644
--- a/DDCAD/src/plugins/CADPlugins.cpp
+++ b/DDCAD/src/plugins/CADPlugins.cpp
@@ -253,7 +253,7 @@ static Handle<TObject> create_CAD_Volume(Detector& dsc, xml_h e)   {
       if ( vol.isValid() )   {
         if ( (vol.material() == dsc.air()) && default_material.isValid() )
           vol.setMaterial(default_material);
-        envelope.placeVolume(vol);
+        envelope.placeVolume(vol,env_trafo);
       }
     }
   }
-- 
GitLab