Sampling SSM using API

Hello,

Firstly, I’ve enjoyed exploring Shapeworks. It’s a very powerful piece of software, and I particularly found the correspondence particle approach to shape modeling effective in improving the efficiency of the modeling workflow. Great work!

I’ve gone through the workflow in the software GUI. At the end of the workflow, I can modulate a single PC-mode between -2 < Z < +2 to effect the shape of the mean mesh. Then I see in File->Export I can export the current mesh.

I am trying to reproduce this workflow programmatically using the API:

  1. Load a previously built SSM (created using GUI)
  2. Provide an array of z-scores for each PC mode, calculate the loadings, and apply to mean model
  3. Export this updated mesh geometry

Is this possible? The python API seems to only allow for basic analysis outputs such as sensitivity. I’ve looked at a few of the Python examples, but haven’t identified a solution. Any advice would be greatly appreciated.

Thanks,
Don

Hi,

There isn’t really an API to do this right now. If I wanted to accomplish this, I would export the eigen vectors from Studio and write some code to multiply the mean shape positions by the eigenvectors times the Z score for each mode. Then they can be visualized in Studio by providing them as old style particle-only shapes. The old XML looks like:

<point_files>
shape1.particles
shape2.particles

</point_files>

It will be a basic reconstruction. It may take some more thinking and effort to construct an input that will have valid backing shape to use for surface reconstruction.

Hi Alan, thank you for your feedback. I have the code written to apply loadings to mean SSM shape as described, but my concern (as you said) was the uncertainty introduced by morphing a convex hull onto the correspondence particle map. I will see if I can’t come up with a good solution, thanks!