Hello, thanks for the answer. I honestly missed the exporting .obj feature.
However, when I try to use it in PyChrono, it comes up with a type error.
Here's an example:
mesh: chrono.ChTriangleMeshConnected = terrain.GetMesh().GetMesh()
mesh.WriteWavefront("terrain.obj", mesh)
...
TypeError: in method 'ChTriangleMeshConnected_WriteWavefront', argument 2
of type 'std::vector<
chrono::geometry::ChTriangleMeshConnected,std::allocator<
chrono::geometry::ChTriangleMeshConnected > > const &'
It seems that the c++ class std::vector isn't implemented in PyChrono (at
least from what I can tell with experimenting with tuples, lists, etc. and
the PyChrono reference). Is there a workaround for this, or should I just
go another route?
Thanks,
whop42
On Monday, January 23, 2023 at 2:29:49 PM UTC-8 Radu Serban wrote:
> I didn’t respond because I’m not sure what to tell you. As you indicated,
> this doesn’t seem to be a Chrono problem but rather an issue with your
> code. All I can suggest is export the terrain mesh from Chrono to an OBJ
> and use an external viewer to make sure it is what you also see in the
> Irrlicht rendering. If that is the case, you must have some bug in how you
> postprocess the mesh to generate your heightmap image.
>
> You may want to use a third-party tool to generate the heightmap from an
> OBJ. A web search shows this: https://github.com/ryobg/obj2hmap
>
>
>
> --Radu
>
>
>
> *From:* [email protected] <[email protected]> *On
> Behalf Of *Whop42 Whop42
> *Sent:* Sunday, 22 January 2023 23:51
> *To:* ProjectChrono <[email protected]>
> *Subject:* [chrono] Heightmap of SCMDeformableTerrain Issues
>
>
>
> I previously posted it in another conversation, however it got no
> attention due to the original question being resolved.)
>
>
>
> I have run into a problem with this approach (although i suspect it's just
> my code.) I used the SCMDeformableTerrain's mesh's ChTriangleMeshConnected
> to gather a list of all the vertices in the mesh. I then added the heights
> to a 2D list (and normalized them), then dumped them into a grayscale
> image. However, the image turns out unintelligible (example attached.) It's
> supposed to be a shoeprint, imprinted from a (3D-scanned) .obj of a shoe.
>
>
>
> Here's the code:
> https://gist.github.com/Whop42/43d496e42d8c8f227b53ada1d3da7502
>
> Print in Irrlicht:
>
> How do I rectify this problem and make the print show up, like it is in
> Irrlicht?
>
>
>
> --
> 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/3d5ccf3d-6f49-4291-8a19-0bb0dda3815dn%40googlegroups.com
>
> <https://groups.google.com/d/msgid/projectchrono/3d5ccf3d-6f49-4291-8a19-0bb0dda3815dn%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/85509675-3368-4fa7-96ab-73a5946d343dn%40googlegroups.com.