I've been working on an upgrade project for a customer and we found a strange issue when running some of their test data through Deep Server (DS).  Most of their data is cylindrical about the origin.  However, some of the engineers need to put "test" objects into the assembly so that the manuracturers know where to pace tools during testing.  In general, this is not a problem.  We load the test objects correctly and they're positioned correctly.  However, the issue came about when we quarter cut the models.

A long time, this customer worked with us on our quarter cutting technique and said they just needed us to quarter cut based on the bounding box of the model.  At that time, test objects were not used very much and the customer didn't know these objects would create an issue.  Well, they do.  Here's a mockup model I created using Deep Exploration (DE) which I made have some strangely positioned tubes sticking out of it which would distort the scene bounding box calculation.

protrusion.png

So, here what DS would have made the quarter cut look like:

protrusion_default_quarter.png

That's not right.  I need to quarter cut through the center of the main cylinder.

So, here's what I figured out.  First, make a small RH file that just has a basic Plane in it:

  1. File -> New
  2. Create -> Create Primitive -> Plane
  3. I also renamed the Plane object to have the name "QuarterCutOffset"

Set the size to whatever you want, I made mine 10 units in the width and height.  Then, zero out the transform so it's sitting at 0,0,0.

Now, in DS, create the following DS process:

  1. filetrigger
  2. go_open (open file passed to filetrigger)
  3. go_metadata
  4. go_mergetransformfile_XMin
    1. Here's where the magic starts.  You import the plane RH file and transform it to the (go_metadata/XMax * -1)
    2. ex: concat('0 0 -1 0 1 0 1 0 0 ', string(number(//go_metadata/metadataobject/XMax) * -1), ' 0 0')
  5. Then, do this for the XMax value which uses XMin * -1
  6. Then, do this for the YMin and YMax values
    1. You will also want to figure out the tranformation matrix part to rotate it 90 degress in the X-Axis
    2. ex: concat('0 0 -1 0 1 0 1 0 0 ', string(number(//go_metadata/metadataobject/XMax) * -1), ' 0 0')
  7. Then, do this for the ZMax and ZMin values
    1. You will also want to figure out the tranformation matrix part to rotate it 90 degress in the Y-Axis
    2. ex: concat('1 0 0 0 1 0 0 0 1 0 0 ', string(number(//go_metadata/metadataobject/ZMax) * -1))
  8. Now, you need to perform a ct_polygon_cut.  I set the settings to top and firstquarter.
  9. Now's another tricky part.  We need to remove all of the planes we put into the scene so they don't show up.  To do this, use a cm_removeunwantednodes
    1. You point this at an XML file that contains the following info:

      1.  
  10. Now do a go_save to save the new RH file and you should be good to go.

Here's what my final output has with the cm_removeunwantednodes skipped

protrusion_w_squares.png

Here's what I have as the normal output:

protrusion_clean.png

I'm thinking about converting much of this to a Python script but I'll post about that later...