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]<mailto:[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]<mailto:[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/PH0PR06MB82378E2FE7D318259C04483AA7C29%40PH0PR06MB8237.namprd06.prod.outlook.com.

Reply via email to