Thank you, that was exactly what I was looking for.

On Friday, January 13, 2023 at 8:42:26 AM UTC-8 Radu Serban wrote:

> Wei – this is not what the original poster asked for.
>
>  
>
> Whop42 – we do not have a function for exporting the deformed state of an 
> SCM terrain patch as a heightmap. I’d be curious to know why you would want 
> that in the first place.  Nonetheless, you can generate a heightmap image 
> yourself (e.g., with STB which is what we use to initialize an SCM patch 
> from a heightmap). To do that, you can extract the current height of the 
> SCM terrain at the locations you are interested in 
> (SCMDeformableTerrain::GetHeight) or else grab the current visualization 
> mesh ( SCMDeformableTerrain::GetMesh) and then convert these heights to 
> grayscale and load an image pixel-by-pixel, effectively doing the reverse 
> of what we do in SCMDeformableSoil::Initialize 
> <https://github.com/projectchrono/chrono/blob/9ba226bf4866ef13b6c3dce3ae9f16d3ab55acea/src/chrono_vehicle/terrain/SCMDeformableTerrain.cpp#L389>
> .
>
>  
>
> --Radu
>
>  
>
> *From:* [email protected] <[email protected]> *On 
> Behalf Of *[email protected]
> *Sent:* Friday, 13 January 2023 16:21
> *To:* ProjectChrono <[email protected]>
> *Subject:* [chrono] Re: Outputting the heightmap of a 
> SCMDeformableTerrain?
>
>  
>
> Take a look at this demo at line327 
> <https://github.com/projectchrono/chrono/blob/main/src/demos/vehicle/wheeled_models/demo_VEH_HMMWV_DefSoil.cpp#L327>,
>  
> I think that might be what you would like to find.
>
>  
>
> Thank you,
>
> Wei
>
> On Wednesday, January 11, 2023 at 7:17:47 PM UTC-6 [email protected] 
> wrote:
>
> Hi,
>
>  
>
> I'm simulating an object deforming soil, and would like to have the data 
> in the form of a heightmap. I have a simulation rendering properly with a 
> SCMDeformableTerrain instance, but how do I get the information out of that 
> into a .png or something similar?
>
>  
>
> Thanks,
>
> whop42
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "ProjectChrono" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/projectchrono/76724687-dbbb-48b0-a730-87b088f21cf6n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/projectchrono/76724687-dbbb-48b0-a730-87b088f21cf6n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/projectchrono/1112eedf-97ac-44ee-912a-c901a5dbd6f4n%40googlegroups.com.

Reply via email to