Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 4125

Texture Mapping out Geometry

$
0
0

hi i created script c# for set XYZ Size of Texture Material(and we can bake that object with Material in Rhino by siz) but output for bake only== Mesh ! and i need bake it for example Brep Surface ,…(According to the input geometry)
Any suggestions or any C# Api? Because I didn’t find any Api for Brep or Surface Like Mesh

mesh.TextureCoordinates(textureMapping);

https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.collections.meshtexturecoordinatelist/settexturecoordinates

@mahdiyar


 private void RunScript(Mesh mesh, Box box, string path, double tr, ref object MeshMap, ref object Material)
  {
    Component.Name = "Texture Maping,Matrial";
    if(Component.Params.Input[1].VolatileDataCount != 0 && mesh != null){
      var textu = TextureMapping.CreateBoxMapping(box.Plane, box.X, box.Y, box.Z, true);
      mesh.TextureCoordinates.SetTextureCoordinates(textu);
      MeshMap = mesh;}
    Material mat = new Material();
    if (path != null)
    {
      mat.SetBitmapTexture(path);
      mat.Transparency = tr;
    }
    var m = RenderMaterial.CreateBasicMaterial(mat, RhinoDoc.ActiveDoc);
    Material = new GH_Material(m);
  }

texture mapping.zip (205.0 KB)

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4125

Trending Articles