Our torque and drag model generates a list of calculated values at a regular interval of depth. These values are then mapped to the work-string inside the well-bore. There are two interesting issues here.
The work-string is confined by the well profile in real-life, and similarly when modeling this issue our work-string path will follow the path of our well. To code the new requirements, the base class created in the first post will be extended, and the reliance on the well profile path, will introduce temporal coupling in code.
The other interesting thing to note is that we don't have a one to one relationship with values coming from the torque and drag model being mapped to 3D points. It might take 100 or 200 points to represent the 3D center-line of the well-bore, while the torque and drag model can return several thousand data points. To get around this issue, the data needs to be interpolated by depth at each 3D point along the profile.
Overview of Mapping Values as Texture Coordinates in Helix Toolkit
Helix toolkit uses the concept of texture mapping to apply a skin over the 3D objects. The concepts are explained in detail on Wikipedia. For what we are doing the concepts can be simplified to this, the texture coordinate will determine which value from a linear brush will be applied to the geometry. Values on a linear gradient brush range from 0 to 1, so the values being mapped will also need to be normalized into this range. Once we have a list of texture coordinates, one for each 3D point, we can simply bind to them from our pipe in Xaml.
Here is the code.
It was requested that I provide a working example, I've placed somewhat simplified project in OneDrive that will help you get up and running.