Questions tagged [mesh]

Do NOT use for questions about mesh-networks. Use [mesh-network] instead. A mesh is a collection of vertices, edges, and faces that defines the shape of a polyhedral object in 3D computer graphics and solid modeling.

From Wikipedia:
A polygon mesh is a collection of vertices, edges and faces that defines the shape of a polyhedral object in 3D computer graphics and solid modeling. The faces usually consist of triangles, quadrilaterals or other simple convex polygons, since this simplifies rendering, but may also be composed of more general concave polygons, or polygons with holes. Check for more Mesh Detail

2641 questions
18
votes
3 answers

Three.js - How can I calculate the distance between two 3D positions?

I've already tried searching several different things on Google. Doesn't seem like I'm able to find anything. Thought I might as well upload a question to Stack Overflow. Thanks!
user3490600
  • 255
  • 1
  • 3
  • 8
17
votes
3 answers

Decomposing a 3d mesh into a 2d net

Suppose you have a 3 dimensional object, represented as a 3d mesh in some common file format. How would you devise an algorithm to decompose the mesh into one or more 2d 'nets' - that is, a 2-dimensional representation that can be cut out and folded…
Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
15
votes
2 answers

Algorithm for labeling edges of a triangular mesh

Introduction As part of a larger program (related to rendering of volumetric graphics), I have a small but tricky subproblem where an arbitrary (but finite) triangular 2D mesh needs to be labeled in a specific way. Already a while ago I wrote a…
Reunanen
  • 7,921
  • 2
  • 35
  • 57
15
votes
1 answer

Can I hide faces of a mesh in three.js?

I want to make parts of a mesh invisible at runtime. Can I set these parts invisible/transparent, e.g. by changing attributes of single faces? The mesh itself uses only one material. Exemplary illustration as the editor understands this question:…
user1455053
  • 151
  • 1
  • 3
14
votes
6 answers

Mesh to mesh intersections

I'm looking for a library or a paper that describes how to determine if one triangular mesh intersects another. Interestingly I am coming up empty. If there is some way to do it in CGAL, it is eluding me. It seems like it clearly should be possible,…
Doug McClean
  • 14,265
  • 6
  • 48
  • 70
14
votes
3 answers

Change the colors of a cube's faces

I actually found this question, but it says material.color doesn't exist. I need to know how to change the colors of the various faces of a cube I'm drawing: var newCube = new THREE.Mesh(new three.CubeGeometry(size, size, size), new…
David Gomes
  • 5,644
  • 16
  • 60
  • 103
13
votes
2 answers

Coloring mesh edges in meshlab

I have been working on an algorithm that takes a mesh, does some fancy things with it, and produces some output. To visualize the result I decided to produce a copy of the mesh, colour it in a smart way that is somehow related to the produced…
John C
  • 233
  • 2
  • 7
12
votes
1 answer

Calculating normals between 2 meshes ending up in seams

My Task I currently creating a terrain for Unity3D which is specialized for mobile-devices with low memory for a running app. Allowing a terrain with a size of 15.000 x 15.000 kilometers and a height from -1.000 meters to 10.000 meters and it's only…
Felix K.
  • 6,201
  • 2
  • 38
  • 71
12
votes
2 answers

Secondary y-axis in matlab 3D plot (surf, mesh, surfc)

I am trying to add a secondary y-axis with different units to a 3D plot. [m2_array, ~ , ~] = F_readBin('amb.bin'); amb = m2_array(:,:,lat); surfc(light,'LineWidth',0.001); ylim([1 24]); xlim([1 size(light,2)]); title(['@…
Larusson
  • 267
  • 3
  • 21
12
votes
1 answer

How to convert arrays of x,y,z coordinates to 3D path in numpy

Given three 1D arrays of X, Y and Z coordinates, how to convert into a 3D mesh path using numpy? I managed to do this for 2D using numpy (ie no for loops): import numpy def path_2d_numpy(x, y): m1, m2 = numpy.meshgrid(x, y) m1[1::2] =…
Tiago Coutinho
  • 1,618
  • 15
  • 17
12
votes
1 answer

How to create multiple Box and only change the texture on one side?

I'm trying to apply a texture to only one side of a Box Object. Basic code: BoxGeo = new THREE.BoxGeometry(50, 50, 125); BoxMat = new THREE.MeshLambertMaterial({ color: 0xF0F0F0 }); BoxObj = new THREE.Mesh(GeoBox, GeoMat); I tried using an array…
Jeremy Dicaire
  • 4,615
  • 8
  • 38
  • 62
12
votes
4 answers

In Python, how do I voxelize a 3D mesh

I need help on getting started in Python (which I almost know nothing of) to voxelize a 3D mesh generated from Rhino. The data input will be a .OBJ file and so will the output. The ultimate purpose for this usage is to find the shortest distance…
FongYu
  • 767
  • 4
  • 15
  • 24
11
votes
2 answers

Reading and plotting VTK file data structure with python

I have a VTK file (unstructured grid) with points and cells. I can import the file and read it into using the meshio python package. If I type the command mesh.cells I see a dictionary called 'hexahedron' with an array made up of lists inside like…
NaN
  • 643
  • 1
  • 8
  • 21
11
votes
2 answers

Intersection 3D meshes python

I just started to work with 3D meshes, oriented to be used for finite element analysis. I would like to model inclusions for materials (any shape, but mainly interested in spheres and ellipsoids) in a cube-like matrix. These inclusions shouldn't be…
Ger
  • 349
  • 2
  • 16
11
votes
4 answers

How to smooth mesh triangles in STL loaded BufferGeometry

I´m trying to load some STL files using Three.js. The models are loaded correctly, but there are too many triangles that I would like to merge/smooth. I had successfully applied smooth loading terrains in other 3D formats, but I can´t do it with…
spacorum
  • 495
  • 6
  • 16