Start a new topic

How to access HeightField in earthwork system?

In the excavator scene with Vortex Studio EditorI would like to know real-time shape of soil in the earthwork zone.

To achieve this objective, I have tried to access HeightField in earthwork system by scripting python, but I cannot do that.

So, I would like to know whether it is possible to access HeightField in earthwork system.

And if it is possible, how can I do that? 

1 Comment


This question was responded in a private conversation but i'll post it here for other people to see.

To access the heightfield, the following can be done:
1.  Isolate the Soil Zone's dynamics extension in your code. If in the  Editor you can create a script extension with a parameter of type  Extension Pointer and assign it the Soil Zone's Dynamics extension.
2. The soil zone's height field can be accessed with the following code:
my_dynamics_extension.getOutputContainer()['HeightField']['Height Array'].toVectorDouble()

Then the heightfield's data is available as an array of numbers that represent the columns of the heightfield.

I hope this answers your question. Please let us know if you need any further assistance.

Login to post a comment