Resize the grid.

I have a 3D model that has been uploaded as an obj file in Three.js . The model itself is furniture.

enter image description here

The problem is that the furniture material is dynamic and differs in size (thickness). I need to be able to make the material thicker, but the overall size of the model cannot be changed. Therefore, scaling is not an option.

Is there a way to resize parts of the model (several specific grids) and not jeopardize the structure of the grid itself? I need to change the thickness of the structure, but the internal parts of the model should not change.

The only solution I can think of is to change the scale of some grids, and then change the global position of other grids based on this. Is it correct?

object.traverse(function(child) { if (child instanceof THREE.Mesh) { // resize and reposition some of the meshes } }); 

Possible ways to solve it:

+5
source share
2 answers

You can use Clara.io, it is built on top of three JSs and allows you to run the geometry operators that you configure in Clara.io scripts. Clara.io has a thickness operator that you can use.

Documentation here: http://clara.io/learn/sdk/interactive-experiences

Everything you can do in the Clara.io editor you can do in interactive embedding.

+3
source

Well, if all the cells are separate primitives, then you can simply zoom in on each part that you want to change along one axis, and just adjust the anchor points to be constrained from the outside. Therefore, for the parts on the border, you scale the empty object to which they are attached to support the outer shell.

EG:

  OOOOOO OMMMMMMO OMmmmmMO OMmmmmMO OMMMMMMO OOOOOO 

where O is a 3D object carrying an adjacent Mesh-M, and m represents grids that scale themselves. Thus, if you adjust the scale of all β€œm” and β€œO”, the outer shell will remain in place,

But you are on the right track with a detour. You just have to do it. For an easy transition to a crawl, I would give everything you want to change as an attribute in a .userData object. Because in some cases you need to scale empty objects (O) (so that you can move the anchor point efficiently), while in others you need to scale the grids in place (m). Thus, this is not a pure mesh-based operation (since the grids want to scale from their center). Running some tags makes it easier to bypass:

 object.traverse(function(child){ if(child instanceof THREE.Mesh){ if(child.userData.isScalable){ //do the scaling. } } }); 

and if you configured the heirarchy and .userData tags correctly, then you just scale things and save the outer shell.

Is that what you are asking? because the question is unclear.

+2
source

All Articles