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.

Applying a texture changes the size of the mesh

See original GitHub issue

Describe the bug, what’s wrong, and what you expected.

When applying a texture (image of a seismic line), the cross section/mesh the image is supposed to be put on has shrunk. I would expect the image to be stretched across the entire mesh.

Steps to reproduce the bug.

import pyvista as pv

p = pv.Plotter(notebook=False)

tex = pv.read_texture('1.png')

# Adding or removing the texture is the only thing that is changed
p.add_mesh(mesh, texture=tex,cmap=odt_petrel)

p.show_grid(color='black')
p.set_background(color='white')
p.set_scale(1,1,1)
p.show()

System Information

--------------------------------------------------------------------------------
  Date: Sun Nov 20 20:19:23 2022 Mitteleuropäische Zeit

                OS : Windows
            CPU(s) : 16
           Machine : AMD64
      Architecture : 64bit
               RAM : 15.2 GiB
       Environment : Jupyter
        GPU Vendor : ATI Technologies Inc.
      GPU Renderer : AMD Radeon(TM) Graphics
       GPU Version : 4.5.14761 Core Profile Context 21.30.40.09 30.0.13040.9001

  Python 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)]

           pyvista : 0.33.3
               vtk : 9.0.1
             numpy : 1.19.2
           imageio : 2.13.1
           appdirs : 1.4.4
            scooby : 0.5.12
        matplotlib : 3.3.2
             PyQt5 : 5.12.3
           IPython : 7.22.0
          colorcet : 3.0.0
             scipy : 1.6.2
              tqdm : 4.50.2
            meshio : 4.4.6

  Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for
  Intel(R) 64 architecture applications
--------------------------------------------------------------------------------
​

Screenshots

Mesh without texture image

Mesh with texture image

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexanderJuestelcommented, Dec 2, 2022

So, after adjusting the z_spacing and the z position, it is also possible to like change the clims of the mesh.

That is amazing 😃 image

image

1reaction
adeakcommented, Nov 29, 2022

Here’s what the image looks like in my image viewer:

screenshot of image viewer software, showing a checkerboard "transparency" pattern at the top and bottom of the texture image

Note the checkerboard strips at the top and bottom. Isn’t it just that your image has transparent parts, and those don’t get rendered on your mesh?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Change Material Size in Blender the EASY WAY!
In this video, learn to use nodes in Blender to quickly change the ... 0:13 - Example Texture Location 1:04 - Adding Mapping...
Read more >
How to keep texture size whatever the size of the object?
To change the scale of the textures, add Mapping and a Texture Coordinate node in the Shader Editor. Connect the UV output (or...
Read more >
Texture Size/Resolution vs Mesh Size/Blender Units
Hi I am currently trying to texture an image on a flat plane in blender by uvmapping the texture to the plane and...
Read more >
How do you move and resize textures in Blender?
Move and resize a texture using the shader editor · Press Shift+A and go to Input->Texture coordinate, place it to the left of...
Read more >
Applying Textures — Blender Manual - UV
Applying Textures to UVs​​ The UV Editor allows you to map textures directly to the mesh faces. The 3D Viewport shows you the...
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