[SOLVED] STL Mesh model Lines doesn't work

Hello,

I’am creating a mesh from a stl file. But if I’am switching the mode (Mesh.setMode()) from Triangles to Lines I get a very strange picture.

In the mode Triangles the mesh looks fine but in Lines mode the lines are crisscross.
I expected that all triangles just displayed as lines.

Unfortunately, I can not upload any images, due to an error in the forum.
If the image upload functionality works again then I will upload some images.

The forum upload feature will never work again because we’ve turned it off. There are approximately 900 gazillion image hosting sites online. imgur.com is the best one.

Anyway, switching the mesh mode probably won’t do what you want but it’s hard to say just based on what you’ve provided.

Is the original file lines or triangles? Do you want to just see a wireframe version of the triangles or something?

Thanks for your fast reply. I uploaded it at your suggested service.

The following image is shown in Mode.LTriangles

If I switched to Mode.Lines then it looks like:

But I expected this:

Here you can see only lines or edges of the triangles are showing.

A line mesh is not at all the same as a triangle mesh. A line is two points. A triangle is three points.

What you want is wire frame… which is something you can set on the material. Look through the javadoc for the additional render state and/or check the material related tutorials.

1 Like

Thank you very much my friend. This line solved my problem.

meshModel.getMaterial().getAdditionalRenderState().setWireframe(true);

1 Like