public bool LoadMesh(string filename) { filename = String.Format("Assets/Models/Saved/{0}", filename); _extrudableMesh._manifold = new Manifold(); var manifold = new Manifold(); bool loaded = manifold.LoadFromOBJ(filename); Text TextUI = GetComponentInChildren <Text>(); if (loaded) { string otherText = TextUI.text; TextUI.text = String.Format("{0}\n>> 3D Model loaded", otherText); manifold.StitchMesh(1e-10); _extrudableMesh.LoadMesh(manifold); } else { string otherText = TextUI.text; TextUI.text = String.Format("{0}\n>> 3D Model FAILED to load", otherText); } TextUI.fontSize = 75; return(loaded); }
public bool LoadMesh(string filename) { Debug.Log("worktableController here... trying to load..." + " " + filename); #if UNITY_STANDALONE && !UNITY_EDITOR filename = String.Format("Saved/{0}.obj", filename); #else filename = String.Format("Assets/Models/Saved/{0}.obj", filename); #endif _extrudableMesh._manifold = new Manifold(); var manifold = new Manifold(); bool loaded = manifold.LoadFromOBJ(filename); if (loaded) { manifold.StitchMesh(1e-10); _extrudableMesh.LoadMesh(manifold); } return(loaded); }