question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DATA(rename txt to zip): mesh_tex.txt

CODE:

from vedo import *

path_pfx = "/home/lab0/Pictures/mesh_tex"
path_obj = path_pfx + "/pro_img_ds_HR_00000_0.obj"
path_ply = path_pfx + "/cv_img_du_00000_0_mesh_inC.ply"
path_opt = path_pfx + "/pro_img_ds_HR_00000_0_opt.ply"
path_tex = path_pfx + "/img_c_ortho_HR_00000_0.png"

plt = Plotter(shape=(1, 3), size=(800, 600))
M1 = Mesh(path_obj).texture(path_tex)
M2 = Mesh(path_ply).c((200, 200, 200))
M3 = Mesh(path_opt).c((200, 200, 200))
plt.show(M1, at=0)
plt.show(M2, at=1)
plt.show(M3, at=2)
plt.show(interactive=True, zoom=1.0)

RESULT:

screenshot

QUESTIONS:

  1. how to fix the texture mapping
  2. how to remove the two vertical lines (borderless mode)
  3. how to set zoom to fit the height like the following (I adjust it manually)

screenshot

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
marcomusycommented, May 4, 2022

I would write it this way:

from vedo import *

path_pfx = "."
path_obj = path_pfx + "/pro_img_ds_HR_00000_0.obj"
path_ply = path_pfx + "/cv_img_du_00000_0_mesh_inC.ply"
path_opt = path_pfx + "/pro_img_ds_HR_00000_0_opt.ply"
path_tex = path_pfx + "/img_c_ortho_HR_00000_0.png"

settings.rendererFrameAlpha = 0

plt = Plotter(shape=(1, 3), size=(800, 600))

M1 = Mesh(path_obj)
tcoords = M1.pointdata["Material"]
M1.texture(path_tex, tcoords=tcoords)

M2 = Mesh(path_ply).c((200, 200, 200))
M3 = Mesh(path_opt).c((200, 200, 200))
cam = dict(  # press shift-C in the scene to dump these numbers
    pos=(6.743e-3, -0.09617, 1.069),
    focalPoint=(6.743e-3, -0.09617, -2.190),
    viewup=(0, 1.000, 0),
)
plt.at(0).show(M1)
plt.at(1).show(M2)
plt.at(2).show(M3, camera=cam)
plt.interactive().close()
Screenshot 2022-05-04 at 11 41 28

It would be nice to have tcoords accept a string - so I will add this as enhancement feature so that the above can become M1.texture(path_tex, tcoords="Material")

1reaction
marcomusycommented, May 4, 2022

@ttsesm The same code works for you as well!

from vedo import *

M1 = Mesh("RPf_00204.obj").print()
tcoords = M1.pointdata["material_0"]
M1.texture("RPf_00204.png", tcoords=tcoords)

show(M1).interactive().close()
Screenshot 2022-05-04 at 12 06 49
Read more comments on GitHub >

github_iconTop Results From Across the Web

mesh | 3D TEXTURES
Posts about mesh written by Katsukagi. ... Free seamless PBR textures with Diffuse, Normal, Displacement, Occlusion, ... metal mesh metallic wire ...
Read more >
Mesh texture Images | Free Vectors, Stock Photos & PSD
Find & Download Free Graphic Resources for Mesh Texture. 42000+ Vectors, Stock Photos & PSD files. ✓ Free for commercial use ✓ High...
Read more >
Mesh Texture Vector Art - Vecteezy
Browse 22465 incredible Mesh Texture vectors, icons, clipart graphics, and backgrounds for royalty-free download from the creative contributors at Vecteezy!
Read more >
Mesh Texture Vector Images (over 150,000)
The best selection of Royalty Free Mesh Texture Vector Art, Graphics and Stock Illustrations. Download 150000+ Royalty Free Mesh Texture Vector Images.
Read more >
Mesh - KeyShot 10 Manual
Here the mesh texture have been used as an opacity map to add holes in the surface, without having to model them. Depth...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found